use of fi.otavanopisto.muikku.plugins.dnm.parser.DeusNexException in project muikku by otavanopisto.
the class DeusNexMachinaController method importDeusNexDocument.
public void importDeusNexDocument(WorkspaceNode parentNode, InputStream inputStream) throws DeusNexException {
DeusNexDocument desNexDocument = parseDeusNexDocument(inputStream);
List<WorkspaceNode> createdNodes = new ArrayList<>();
for (Resource resource : desNexDocument.getRootFolder().getResources()) {
importResource(parentNode, parentNode, resource, desNexDocument, createdNodes);
}
try {
postProcessResources(createdNodes);
} catch (Exception e) {
throw new DeusNexInternalException("PostProcesssing failed. ", e);
}
materialUnEmbedder.unembedWorkspaceMaterials(parentNode);
}
use of fi.otavanopisto.muikku.plugins.dnm.parser.DeusNexException in project muikku by otavanopisto.
the class DeusNexMachinaController method importHelpPageDocument.
public void importHelpPageDocument(WorkspaceEntity workspaceEntity, InputStream inputStream) throws DeusNexException {
DeusNexDocument deusNexDocument = parseDeusNexDocument(inputStream);
List<Resource> resources = deusNexDocument.getRootFolder().getResources();
if (!resources.isEmpty()) {
List<WorkspaceNode> createdNodes = new ArrayList<>();
WorkspaceFolder workspaceHelpPageFolder = workspaceMaterialController.createWorkspaceHelpPageFolder(workspaceEntity);
for (Resource resource : deusNexDocument.getRootFolder().getResources()) {
importResource(workspaceHelpPageFolder, workspaceHelpPageFolder, resource, deusNexDocument, createdNodes);
}
try {
postProcessResources(createdNodes);
} catch (Exception e) {
throw new DeusNexInternalException("PostProcesssing failed. ", e);
}
}
}
use of fi.otavanopisto.muikku.plugins.dnm.parser.DeusNexException in project muikku by otavanopisto.
the class DeusNexMachinaController method importFrontPageDocument.
public void importFrontPageDocument(WorkspaceEntity workspaceEntity, InputStream inputStream) throws DeusNexException {
DeusNexDocument deusNexDocument = parseDeusNexDocument(inputStream);
List<Resource> resources = deusNexDocument.getRootFolder().getResources();
if (!resources.isEmpty()) {
List<WorkspaceNode> createdNodes = new ArrayList<>();
WorkspaceFolder workspaceFrontPageFolder = workspaceMaterialController.createWorkspaceFrontPageFolder(workspaceEntity);
for (Resource resource : deusNexDocument.getRootFolder().getResources()) {
importResource(workspaceFrontPageFolder, workspaceFrontPageFolder, resource, deusNexDocument, createdNodes);
}
try {
postProcessResources(createdNodes);
} catch (Exception e) {
throw new DeusNexInternalException("PostProcesssing failed. ", e);
}
}
}
Aggregations