protected ContentTree newContentTree() { return new ContentTree(); }
private Document createDocument(Page page, LinkRenderingDetails linkDetails, DecorationPolicy decoration) { Document xhtml; ContentTree tree = new ContentTree(); tree.addRootNode(new ContentNode(page)); try { xhtml = intermediateHtmlBuilder.buildHtml(tree, page.getSpace(), linkDetails, decoration); } catch (ImportExportException e) { log.error("error build xml dom", e); throw new RuntimeException(e); } return xhtml; }
private File generatePdfExportFromImportExportManager() throws ImportExportException { final Page thisPage = getPage(); final DefaultExportContext context = new DefaultExportContext(); context.setExportScope(ExportScope.PAGE); context.setType(ImportExportManager.TYPE_PDF); context.addWorkingEntity(thisPage); context.setExportComments(false); context.setExportAttachments(false); context.setExportHierarchy(false); context.setUser(AuthenticatedUserThreadLocal.get()); final ContentTree contentTree = new ContentTree(); contentTree.addRootNode(new ContentNode(thisPage)); context.setContentTree(contentTree); return new File(importExportManager.exportAs(context, new ProgressMeter())); }