AnsweredAssumed Answered

Export ACP

Question asked by amitabhandari1 on Sep 8, 2010
Hi ,
I want to  export few spaces from the  parent space  . How is this possible .
With the below code I can export  a specific space including all  children. But I want to export only some of the children of a space.

            String TEMP_FILE_PREFIX = "alf";
            File zipFile = null;
            String packageName = "TestAcp";
            File dataFile = new File(packageName);
            File contentDir = new File(packageName);
            // create a temporary file to hold the zip
            zipFile = TempFileProvider
                    .createTempFile(TEMP_FILE_PREFIX, "." + ACPExportPackageHandler.ACP_EXTENSION);
            ACPExportPackageHandler zipHandler = new ACPExportPackageHandler(new FileOutputStream(zipFile),
                    dataFile, contentDir, AlfrescoServiceRegistry.getServiceRegistery().getMimetypeService());

            ExporterCrawlerParameters params = new ExporterCrawlerParameters();
            boolean includeChildren = true;
            boolean includeSelf = false;
            // provide the noderef of the space you want to import  
              params.setExportFrom(new Location(nodeRef));
               AlfrescoServiceRegistry.getServiceRegistery().getExporterService().exportView(zipHandler, params, null);
        } catch (FileNotFoundException fnfe)
            throw new ActionServiceException("export.package.error", fnfe);