Search in sources :

Example 31 with WorkspaceNode

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode in project muikku by otavanopisto.

the class MaterialUnEmbedder method unembedHtmlMaterial.

private void unembedHtmlMaterial(WorkspaceNode parent, WorkspaceMaterial workspaceMaterial, HtmlMaterial htmlMaterial) throws DeusNexInternalException, IOException {
    String html = htmlMaterial.getHtml();
    if (StringUtils.isNotBlank(html)) {
        InputStream is = null;
        logger.info("Unembedding html material " + htmlMaterial.getId());
        try {
            is = new ByteArrayInputStream(html.getBytes("UTF-8"));
            DocumentBuilder builder = DeusNexXmlUtils.createDocumentBuilder();
            Document document = builder.parse(is);
            if (document != null) {
                NodeList iframes = DeusNexXmlUtils.findNodesByXPath(document.getDocumentElement(), "//iframe[@data-type='embedded-document']");
                if (iframes.getLength() > 0) {
                    List<Document> splittedHtmlDocument = splitHtmlDocument(document);
                    for (int i = 0; i < splittedHtmlDocument.size(); i++) {
                        List<Long> pieceList = new ArrayList<Long>();
                        htmlMaterialPieces.put(htmlMaterial.getId(), pieceList);
                        HashMap<Long, WorkspaceMaterialAssignmentType> assignmentTypes = new HashMap<Long, WorkspaceMaterialAssignmentType>();
                        Document documentPiece = splittedHtmlDocument.get(i);
                        List<HtmlMaterial> pieceHtmlMaterials;
                        if (isEmbedPiece(documentPiece)) {
                            WorkspaceMaterialAssignmentType assignmentType = embeddedHtmlMaterialAssignmentType(documentPiece);
                            pieceHtmlMaterials = new ArrayList<HtmlMaterial>();
                            long embeddedHtmlMaterialId = embeddedHtmlMaterialId(documentPiece);
                            if (htmlMaterialPieces.containsKey(embeddedHtmlMaterialId)) {
                                for (Long htmlMaterialId : htmlMaterialPieces.get(embeddedHtmlMaterialId)) {
                                    logger.info("Existing html material " + htmlMaterialId + " embedded in " + htmlMaterial.getId());
                                    HtmlMaterial pieceHtmlMaterial = htmlMaterialController.findHtmlMaterialById(htmlMaterialId);
                                    pieceHtmlMaterials.add(pieceHtmlMaterial);
                                    pieceList.add(pieceHtmlMaterial.getId());
                                    assignmentTypes.put(pieceHtmlMaterial.getId(), assignmentType);
                                }
                            } else {
                                HtmlMaterial pieceHtmlMaterial = htmlMaterialController.findHtmlMaterialById(embeddedHtmlMaterialId);
                                logger.info("Existing html material " + embeddedHtmlMaterialId + " embedded in " + htmlMaterial.getId());
                                pieceHtmlMaterials.add(pieceHtmlMaterial);
                                pieceList.add(pieceHtmlMaterial.getId());
                                assignmentTypes.put(pieceHtmlMaterial.getId(), assignmentType);
                            }
                        } else {
                            String license = null;
                            HtmlMaterial pieceHtmlMaterial = htmlMaterialController.createHtmlMaterial(htmlMaterial.getTitle() + " (" + i + ")", DeusNexXmlUtils.serializeElement(documentPiece.getDocumentElement(), true, false, "xml"), "text/html; editor=CKEditor", 0l, license);
                            logger.info("New html material piece " + pieceHtmlMaterial.getId() + " split from " + htmlMaterial.getId());
                            pieceHtmlMaterials = new ArrayList<HtmlMaterial>();
                            pieceHtmlMaterials.add(pieceHtmlMaterial);
                            pieceList.add(pieceHtmlMaterial.getId());
                        }
                        for (HtmlMaterial pieceHtmlMaterial : pieceHtmlMaterials) {
                            WorkspaceNode newNode = workspaceMaterialController.createWorkspaceMaterial(parent, pieceHtmlMaterial, assignmentTypes.get(pieceHtmlMaterial.getId()), WorkspaceMaterialCorrectAnswersDisplay.ALWAYS);
                            workspaceMaterialController.moveAbove(newNode, workspaceMaterial);
                        }
                    }
                    workspaceMaterialController.deleteWorkspaceMaterial(workspaceMaterial, true);
                    htmlMaterialController.deleteHtmlMaterial(htmlMaterial);
                } else {
                    logger.info("Html material " + htmlMaterial.getId() + " has no embeds");
                }
            }
        } catch (Exception e) {
            logger.log(Level.SEVERE, "Html material " + htmlMaterial.getId() + " unembed fail", e);
            throw new DeusNexInternalException("MaterialUnEmbedder:unembedHtmlMaterial", e);
        } finally {
            if (is != null) {
                is.close();
            }
        }
    }
}
Also used : HashMap(java.util.HashMap) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) NodeList(org.w3c.dom.NodeList) DeusNexInternalException(fi.otavanopisto.muikku.plugins.dnm.parser.DeusNexInternalException) ArrayList(java.util.ArrayList) WorkspaceMaterialAssignmentType(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialAssignmentType) Document(org.w3c.dom.Document) WorkspaceNode(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode) XPathExpressionException(javax.xml.xpath.XPathExpressionException) TransformerException(javax.xml.transform.TransformerException) JsonMappingException(org.codehaus.jackson.map.JsonMappingException) IOException(java.io.IOException) JsonGenerationException(org.codehaus.jackson.JsonGenerationException) DeusNexInternalException(fi.otavanopisto.muikku.plugins.dnm.parser.DeusNexInternalException) JsonParseException(org.codehaus.jackson.JsonParseException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException) ByteArrayInputStream(java.io.ByteArrayInputStream) DocumentBuilder(javax.xml.parsers.DocumentBuilder) HtmlMaterial(fi.otavanopisto.muikku.plugins.material.model.HtmlMaterial)

Example 32 with WorkspaceNode

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode in project muikku by otavanopisto.

the class DeusNexServiceDownloadUpdater method downloadNext.

@Schedule(hour = "*", minute = "*", second = "*/20", persistent = false)
public void downloadNext() {
    if (contextInitialized) {
        if (!running) {
            running = true;
            try {
                Long pendingDownload = deusNexImportQueueController.getNextPendingDownload();
                if (pendingDownload != null) {
                    logger.info(String.format("Processing dnm document #%d", pendingDownload));
                    try {
                        Document document = client.getDocument(pendingDownload);
                        if (document != null) {
                            logger.info(String.format("Downloading dnm document #%d (%s)", document.getId(), document.getPath()));
                            String documentData = client.getDocumentData(pendingDownload);
                            if (documentData != null) {
                                String path = document.getPath();
                                int slashIndex = path.indexOf('/');
                                String workspacePath = slashIndex > -1 ? path.substring(slashIndex + 1) : null;
                                String dnmId = slashIndex > -1 ? path.substring(0, slashIndex) : path;
                                Long workspaceEntityId = deusNexMachinaController.getWorkspaceEntityIdDnmId(dnmId);
                                WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceEntityId);
                                if (workspaceEntity != null) {
                                    if ("[_FPF_]".equals(workspacePath)) {
                                        logger.info(String.format("Importing front-page document #%d into workspace %s", document.getId(), workspaceEntity.getUrlName()));
                                        InputStream documentStream = new ByteArrayInputStream(documentData.getBytes("UTF-8"));
                                        try {
                                            deusNexMachinaController.importFrontPageDocument(workspaceEntity, documentStream);
                                        } finally {
                                            documentStream.close();
                                        }
                                    } else if ("[_HELP_PAGE_]".equals(workspacePath)) {
                                        logger.info(String.format("Importing help-page document #%d into workspace %s", document.getId(), workspaceEntity.getUrlName()));
                                        InputStream documentStream = new ByteArrayInputStream(documentData.getBytes("UTF-8"));
                                        try {
                                            deusNexMachinaController.importHelpPageDocument(workspaceEntity, documentStream);
                                        } finally {
                                            documentStream.close();
                                        }
                                    } else {
                                        WorkspaceNode parentNode = null;
                                        if (StringUtils.isBlank(workspacePath)) {
                                            parentNode = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceEntity(workspaceEntity);
                                        } else {
                                            String[] pathElements = workspacePath.split("/");
                                            parentNode = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceEntity(workspaceEntity);
                                            WorkspaceNode parent = parentNode;
                                            for (int i = 0, l = pathElements.length; i < l; i++) {
                                                String pathElement = pathElements[i];
                                                parentNode = workspaceMaterialController.findWorkspaceNodeByParentAndUrlName(parent, pathElement);
                                                if (parentNode == null) {
                                                    parentNode = workspaceMaterialController.createWorkspaceFolder(parent, pathElement, pathElement);
                                                }
                                                parent = parentNode;
                                            }
                                        }
                                        logger.info(String.format("Importing dnm document #%d into workspace %s", document.getId(), workspaceEntity.getUrlName()));
                                        InputStream documentStream = new ByteArrayInputStream(documentData.getBytes("UTF-8"));
                                        try {
                                            deusNexMachinaController.importDeusNexDocument(parentNode, documentStream);
                                        } finally {
                                            documentStream.close();
                                        }
                                    }
                                    deusNexImportQueueController.removePendingDownload(pendingDownload);
                                    deusNexImportQueueController.addDownloaded(document.getId());
                                    logger.info(String.format("Processed dnm document #%d (%s)", document.getId(), document.getPath()));
                                } else {
                                    logger.log(Level.WARNING, String.format("Ignoring import for document %s because maching workspace could not be found", document.getPath()));
                                }
                            } else {
                                logger.severe(String.format("Pending dnm document %d did not contain any data", pendingDownload));
                            }
                        } else {
                            logger.severe(String.format("Pending dnm document %d could not be found", pendingDownload));
                        }
                    } catch (Exception e) {
                        logger.warning(String.format("Dnm document %d processing failed, added it back to queue: " + e.getMessage(), pendingDownload));
                    }
                }
            } finally {
                running = false;
            }
        }
    }
}
Also used : WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) ByteArrayInputStream(java.io.ByteArrayInputStream) ByteArrayInputStream(java.io.ByteArrayInputStream) InputStream(java.io.InputStream) WorkspaceNode(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode) Schedule(javax.ejb.Schedule)

Example 33 with WorkspaceNode

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode in project muikku by otavanopisto.

the class AcceptanceTestsRESTService method createWorkspaceMaterial.

@POST
@Path("/workspaces/{WORKSPACEENTITYID}/folders")
@RESTPermit(handling = Handling.UNSECURED)
public Response createWorkspaceMaterial(@PathParam("WORKSPACEENTITYID") Long workspaceEntityId, fi.otavanopisto.muikku.atests.WorkspaceFolder payload) {
    WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceEntityId);
    if (workspaceEntity == null) {
        return Response.status(Status.NOT_FOUND).entity("Workspace entity not found").build();
    }
    WorkspaceNode parentNode = null;
    if (payload.getParentId() != null) {
        parentNode = workspaceMaterialController.findWorkspaceNodeById(payload.getParentId());
        if (parentNode == null) {
            return Response.status(Status.BAD_REQUEST).entity("Invalid parentId").build();
        }
    } else {
        parentNode = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceEntity(workspaceEntity);
        if (parentNode == null) {
            return Response.status(Status.INTERNAL_SERVER_ERROR).entity("Could not find workspace root entity").build();
        }
    }
    WorkspaceFolder workspaceFolder = workspaceMaterialController.createWorkspaceFolder(parentNode, payload.getTitle());
    if (workspaceFolder == null) {
        return Response.status(Status.INTERNAL_SERVER_ERROR).entity("Could not create workspace folder").build();
    }
    return Response.ok(createRestEntity(workspaceFolder)).build();
}
Also used : WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) WorkspaceNode(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode) WorkspaceFolder(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceFolder) Path(javax.ws.rs.Path) RESTPermit(fi.otavanopisto.security.rest.RESTPermit) POST(javax.ws.rs.POST)

Example 34 with WorkspaceNode

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode in project muikku by otavanopisto.

the class WorkspaceRESTService method createWorkspaceMaterial.

@POST
@Path("/workspaces/{ID}/materials/")
@RESTPermitUnimplemented
public Response createWorkspaceMaterial(@PathParam("ID") Long workspaceEntityId, @QueryParam("sourceNodeId") Long sourceNodeId, @QueryParam("targetNodeId") Long targetNodeId, @QueryParam("sourceWorkspaceEntityId") Long sourceWorkspaceEntityId, @QueryParam("targetWorkspaceEntityId") Long targetWorkspaceEntityId, @QueryParam("copyOnlyChildren") Boolean copyOnlyChildren, @QueryParam("cloneMaterials") @DefaultValue("false") Boolean cloneMaterials, @QueryParam("updateLinkedMaterials") @DefaultValue("false") Boolean updateLinkedMaterials, fi.otavanopisto.muikku.plugins.workspace.rest.model.WorkspaceMaterial entity) {
    WorkspaceEntity workspaceEntity = workspaceController.findWorkspaceEntityById(workspaceEntityId);
    if (workspaceEntity == null) {
        return Response.status(Status.NOT_FOUND).build();
    }
    if ((sourceNodeId != null) || (sourceWorkspaceEntityId != null)) {
        if (sourceNodeId == null) {
            WorkspaceEntity sourceWorkspaceEntity = workspaceController.findWorkspaceEntityById(sourceWorkspaceEntityId);
            if (sourceWorkspaceEntity == null) {
                return Response.status(Status.BAD_REQUEST).entity(String.format("Invalid sourceWorkspaceEntity %d", sourceWorkspaceEntityId)).build();
            }
            WorkspaceRootFolder sourceRootFolder = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceEntity(sourceWorkspaceEntity);
            if (sourceRootFolder == null) {
                return Response.status(Status.BAD_REQUEST).entity(String.format("Invalid sourceWorkspaceEntity %d", sourceWorkspaceEntityId)).build();
            }
            sourceNodeId = sourceRootFolder.getId();
        }
        if (targetNodeId == null) {
            if (targetWorkspaceEntityId != null) {
                WorkspaceEntity targetWorkspaceEntity = workspaceController.findWorkspaceEntityById(targetWorkspaceEntityId);
                if (targetWorkspaceEntity == null) {
                    return Response.status(Status.BAD_REQUEST).entity(String.format("Invalid targetWorkspaceEntity %d", sourceWorkspaceEntityId)).build();
                }
                WorkspaceRootFolder targetRootFolder = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceEntity(targetWorkspaceEntity);
                if (targetRootFolder == null) {
                    return Response.status(Status.BAD_REQUEST).entity(String.format("Invalid targetWorkspaceEntity %d", sourceWorkspaceEntityId)).build();
                }
                targetNodeId = targetRootFolder.getId();
            }
        }
        if (targetNodeId == null) {
            return Response.status(Status.BAD_REQUEST).entity("targetNodeId is required when sourceNodeId is specified").build();
        }
        if (!sessionController.hasEnvironmentPermission(MuikkuPermissions.COPY_WORKSPACE)) {
            return Response.status(Status.FORBIDDEN).build();
        }
        // Source
        WorkspaceNode sourceNode = workspaceMaterialController.findWorkspaceNodeById(sourceNodeId);
        if (sourceNode == null) {
            return Response.status(Status.BAD_REQUEST).entity("null source").build();
        }
        // Target
        WorkspaceNode targetNode = workspaceMaterialController.findWorkspaceNodeById(targetNodeId);
        if (targetNode == null) {
            return Response.status(Status.BAD_REQUEST).entity("null target").build();
        }
        WorkspaceRootFolder targetRootFolder = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceNode(targetNode);
        if (!targetRootFolder.getWorkspaceEntityId().equals(workspaceEntity.getId())) {
            return Response.status(Status.BAD_REQUEST).entity(String.format("targetNode does not belong to workspace entity %d", workspaceEntity.getId())).build();
        }
        // Circular reference check
        WorkspaceNode node = targetNode;
        while (node != null) {
            if (node.getId().equals(sourceNode.getId())) {
                return Response.status(Status.BAD_REQUEST).entity("Circular copy reference").build();
            }
            node = node.getParent();
        }
        // Copy
        WorkspaceNode createdNode = null;
        WorkspaceMaterial createdMaterial = null;
        if (copyOnlyChildren) {
            List<WorkspaceNode> sourceChildren = workspaceMaterialController.listWorkspaceNodesByParent(sourceNode);
            for (WorkspaceNode sourceChild : sourceChildren) {
                workspaceMaterialController.cloneWorkspaceNode(sourceChild, targetNode, cloneMaterials);
            }
        } else {
            createdNode = workspaceMaterialController.cloneWorkspaceNode(sourceNode, targetNode, cloneMaterials);
            if (createdNode.getType() == WorkspaceNodeType.MATERIAL) {
                createdMaterial = workspaceMaterialController.findWorkspaceMaterialById(createdNode.getId());
                if (entity != null && entity.getNextSiblingId() != null) {
                    WorkspaceNode nextSibling = workspaceMaterialController.findWorkspaceNodeById(entity.getNextSiblingId());
                    if (nextSibling == null) {
                        return Response.status(Status.BAD_REQUEST).entity("Specified next sibling does not exist").build();
                    }
                    workspaceMaterialController.moveAbove(createdNode, nextSibling);
                }
            }
        }
        return createdMaterial == null ? Response.noContent().build() : Response.ok(createRestModel(createdMaterial)).build();
    } else {
        if (!sessionController.hasWorkspacePermission(MuikkuPermissions.MANAGE_WORKSPACE_MATERIALS, workspaceEntity)) {
            return Response.status(Status.FORBIDDEN).build();
        }
        if (entity.getMaterialId() == null) {
            return Response.status(Status.BAD_REQUEST).entity("material_id is required when creating new WorkspaceMaterial").build();
        }
        WorkspaceNode parent = null;
        if (entity.getParentId() != null) {
            parent = workspaceMaterialController.findWorkspaceNodeById(entity.getParentId());
            if (parent == null) {
                return Response.status(Status.NOT_FOUND).entity("parent not found").build();
            }
        } else {
            parent = workspaceMaterialController.findWorkspaceRootFolderByWorkspaceEntity(workspaceEntity);
        }
        Material material = materialController.findMaterialById(entity.getMaterialId());
        if (material == null) {
            return Response.status(Status.NOT_FOUND).entity("material not found").build();
        }
        WorkspaceMaterial workspaceMaterial = workspaceMaterialController.createWorkspaceMaterial(parent, material, entity.getAssignmentType(), entity.getCorrectAnswers());
        if (entity.getNextSiblingId() != null) {
            WorkspaceNode nextSibling = workspaceMaterialController.findWorkspaceNodeById(entity.getNextSiblingId());
            if (nextSibling == null) {
                return Response.status(Status.BAD_REQUEST).entity("Specified next sibling does not exist").build();
            }
            if (!nextSibling.getParent().getId().equals(parent.getId())) {
                return Response.status(Status.BAD_REQUEST).entity("Specified next sibling does not share parent with created workspace material").build();
            }
            workspaceMaterialController.moveAbove(workspaceMaterial, nextSibling);
        }
        // #1261: HtmlMaterial attachments should be added to all workspace materials sharing the same HtmlMaterial
        if (updateLinkedMaterials && parent instanceof WorkspaceMaterial) {
            Long parentMaterialId = ((WorkspaceMaterial) parent).getMaterialId();
            if (parentMaterialId != null) {
                Material parentMaterial = materialController.findMaterialById(parentMaterialId);
                if (parentMaterial instanceof HtmlMaterial) {
                    List<WorkspaceMaterial> sharedWorkspaceMaterials = workspaceMaterialController.listWorkspaceMaterialsByMaterial(parentMaterial);
                    for (WorkspaceMaterial sharedWorkspaceMaterial : sharedWorkspaceMaterials) {
                        if (sharedWorkspaceMaterial.getId().equals(workspaceMaterial.getId())) {
                            // skip the one we created above
                            continue;
                        }
                        WorkspaceMaterial sharedAttachment = workspaceMaterialController.findWorkspaceMaterialByParentAndUrlName(sharedWorkspaceMaterial, workspaceMaterial.getUrlName());
                        if (sharedAttachment == null) {
                            workspaceMaterialController.createWorkspaceMaterial(sharedWorkspaceMaterial, material, workspaceMaterial.getUrlName(), workspaceMaterial.getAssignmentType(), workspaceMaterial.getCorrectAnswers());
                        }
                    }
                }
            }
        }
        return Response.ok(createRestModel(workspaceMaterial)).build();
    }
}
Also used : WorkspaceEntity(fi.otavanopisto.muikku.model.workspace.WorkspaceEntity) Material(fi.otavanopisto.muikku.plugins.material.model.Material) HtmlMaterial(fi.otavanopisto.muikku.plugins.material.model.HtmlMaterial) WorkspaceMaterial(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial) HtmlMaterial(fi.otavanopisto.muikku.plugins.material.model.HtmlMaterial) WorkspaceNode(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode) WorkspaceMaterial(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial) WorkspaceRootFolder(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder) Path(javax.ws.rs.Path) POST(javax.ws.rs.POST) RESTPermitUnimplemented(fi.otavanopisto.muikku.rest.RESTPermitUnimplemented)

Example 35 with WorkspaceNode

use of fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode in project muikku by otavanopisto.

the class WorkspaceRESTService method createRestModel.

private fi.otavanopisto.muikku.plugins.workspace.rest.model.WorkspaceMaterial createRestModel(WorkspaceMaterial workspaceMaterial) {
    WorkspaceNode workspaceNode = workspaceMaterialController.findWorkspaceNodeNextSibling(workspaceMaterial);
    Long nextSiblingId = workspaceNode != null ? workspaceNode.getId() : null;
    return new fi.otavanopisto.muikku.plugins.workspace.rest.model.WorkspaceMaterial(workspaceMaterial.getId(), workspaceMaterial.getMaterialId(), workspaceMaterial.getParent() != null ? workspaceMaterial.getParent().getId() : null, nextSiblingId, workspaceMaterial.getHidden(), workspaceMaterial.getAssignmentType(), workspaceMaterial.getCorrectAnswers(), workspaceMaterial.getPath(), workspaceMaterial.getTitle());
}
Also used : WorkspaceNode(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode) WorkspaceMaterial(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial)

Aggregations

WorkspaceNode (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceNode)41 WorkspaceMaterial (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterial)14 WorkspaceEntity (fi.otavanopisto.muikku.model.workspace.WorkspaceEntity)11 WorkspaceFolder (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceFolder)11 HtmlMaterial (fi.otavanopisto.muikku.plugins.material.model.HtmlMaterial)9 IOException (java.io.IOException)9 Path (javax.ws.rs.Path)9 ArrayList (java.util.ArrayList)8 EntityManager (javax.persistence.EntityManager)8 CriteriaBuilder (javax.persistence.criteria.CriteriaBuilder)8 DeusNexInternalException (fi.otavanopisto.muikku.plugins.dnm.parser.DeusNexInternalException)6 Material (fi.otavanopisto.muikku.plugins.material.model.Material)6 RESTPermitUnimplemented (fi.otavanopisto.muikku.rest.RESTPermitUnimplemented)6 TransformerException (javax.xml.transform.TransformerException)6 XPathExpressionException (javax.xml.xpath.XPathExpressionException)6 SAXException (org.xml.sax.SAXException)6 WorkspaceRootFolder (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceRootFolder)5 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)5 Resource (fi.otavanopisto.muikku.plugins.dnm.parser.structure.model.Resource)4 WorkspaceMaterialAssignmentType (fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialAssignmentType)4