Search in sources :

Example 6 with ExporterCrawlerParameters

use of org.alfresco.service.cmr.view.ExporterCrawlerParameters in project alfresco-remote-api by Alfresco.

the class SiteExportGet method doPeopleACPExport.

protected void doPeopleACPExport(final List<NodeRef> peopleNodes, SiteInfo site, CloseIgnoringOutputStream writeTo) throws IOException {
    if (!peopleNodes.isEmpty()) {
        // Build the parameters
        ExporterCrawlerParameters parameters = new ExporterCrawlerParameters();
        parameters.setExportFrom(new Location(peopleNodes.toArray(new NodeRef[peopleNodes.size()])));
        parameters.setCrawlChildNodes(true);
        parameters.setCrawlSelf(true);
        parameters.setCrawlContent(true);
        // And the export handler
        ACPExportPackageHandler handler = new ACPExportPackageHandler(writeTo, new File(site.getShortName() + "-people.xml"), new File(site.getShortName() + "-people"), mimetypeService);
        // Do the export
        exporterService.exportView(handler, parameters, null);
    }
}
Also used : ACPExportPackageHandler(org.alfresco.repo.exporter.ACPExportPackageHandler) ExporterCrawlerParameters(org.alfresco.service.cmr.view.ExporterCrawlerParameters) File(java.io.File) Location(org.alfresco.service.cmr.view.Location)

Aggregations

File (java.io.File)6 ExporterCrawlerParameters (org.alfresco.service.cmr.view.ExporterCrawlerParameters)6 Location (org.alfresco.service.cmr.view.Location)6 ACPExportPackageHandler (org.alfresco.repo.exporter.ACPExportPackageHandler)3 NodeRef (org.alfresco.service.cmr.repository.NodeRef)3 IOException (java.io.IOException)2 QName (org.alfresco.service.namespace.QName)2 JSONException (org.json.JSONException)2 JSONObject (org.json.JSONObject)2 JSONTokener (org.json.JSONTokener)2 WebScriptException (org.springframework.extensions.webscripts.WebScriptException)2 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1