Search in sources :

Example 6 with ACPImportPackageHandler

use of org.alfresco.repo.importer.ACPImportPackageHandler in project alfresco-repository by Alfresco.

the class DynamicCreateRepositoryLocation method onCreateInTxn.

private void onCreateInTxn() {
    final File viewFile = ImporterBootstrap.getFile(contentViewLocation);
    ImportPackageHandler acpHandler = new ACPImportPackageHandler(viewFile, null);
    Location location = new Location(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
    location.setPath(getParentPath());
    final ImporterBinding binding = new ImporterBinding() {

        @Override
        public String getValue(String key) {
            return bundle.getString(key);
        }

        @Override
        public UUID_BINDING getUUIDBinding() {
            return UUID_BINDING.CREATE_NEW;
        }

        @Override
        public QName[] getExcludedClasses() {
            return null;
        }

        @Override
        public boolean allowReferenceWithinTransaction() {
            return false;
        }

        @Override
        public ImporterContentCache getImportConentCache() {
            return null;
        }
    };
    importerService.importView(acpHandler, location, binding, (ImporterProgress) null);
}
Also used : ImporterBinding(org.alfresco.service.cmr.view.ImporterBinding) ACPImportPackageHandler(org.alfresco.repo.importer.ACPImportPackageHandler) QName(org.alfresco.service.namespace.QName) ImportPackageHandler(org.alfresco.service.cmr.view.ImportPackageHandler) ACPImportPackageHandler(org.alfresco.repo.importer.ACPImportPackageHandler) File(java.io.File) Location(org.alfresco.service.cmr.view.Location)

Example 7 with ACPImportPackageHandler

use of org.alfresco.repo.importer.ACPImportPackageHandler in project alfresco-repository by Alfresco.

the class LoadTester method importTestData.

private void importTestData(String acpName, NodeRef space) throws IOException {
    ClassPathResource acpResource = new ClassPathResource(acpName);
    ACPImportPackageHandler acpHandler = new ACPImportPackageHandler(acpResource.getFile(), null);
    Location importLocation = new Location(space);
    importerService.importView(acpHandler, importLocation, null, null);
}
Also used : ACPImportPackageHandler(org.alfresco.repo.importer.ACPImportPackageHandler) ClassPathResource(org.springframework.core.io.ClassPathResource) Location(org.alfresco.service.cmr.view.Location)

Example 8 with ACPImportPackageHandler

use of org.alfresco.repo.importer.ACPImportPackageHandler in project alfresco-repository by Alfresco.

the class ImapServiceImplTest method importInternal.

private void importInternal(String acpName, NodeRef space) throws IOException {
    ClassPathResource acpResource = new ClassPathResource(acpName);
    ACPImportPackageHandler acpHandler = new ACPImportPackageHandler(acpResource.getFile(), null);
    Location importLocation = new Location(space);
    importerService.importView(acpHandler, importLocation, null, null);
}
Also used : ACPImportPackageHandler(org.alfresco.repo.importer.ACPImportPackageHandler) ClassPathResource(org.springframework.core.io.ClassPathResource) Location(org.alfresco.service.cmr.view.Location)

Aggregations

ACPImportPackageHandler (org.alfresco.repo.importer.ACPImportPackageHandler)8 Location (org.alfresco.service.cmr.view.Location)8 File (java.io.File)4 ClassPathResource (org.springframework.core.io.ClassPathResource)3 IOException (java.io.IOException)2 NodeRef (org.alfresco.service.cmr.repository.NodeRef)2 ImportPackageHandler (org.alfresco.service.cmr.view.ImportPackageHandler)2 FileNotFoundException (java.io.FileNotFoundException)1 FileOutputStream (java.io.FileOutputStream)1 HashMap (java.util.HashMap)1 AlfrescoRuntimeException (org.alfresco.error.AlfrescoRuntimeException)1 FileInfo (org.alfresco.service.cmr.model.FileInfo)1 ContentReader (org.alfresco.service.cmr.repository.ContentReader)1 ImporterBinding (org.alfresco.service.cmr.view.ImporterBinding)1 QName (org.alfresco.service.namespace.QName)1 ZipFile (org.apache.commons.compress.archivers.zip.ZipFile)1 WebScriptException (org.springframework.extensions.webscripts.WebScriptException)1 WebScriptRequest (org.springframework.extensions.webscripts.WebScriptRequest)1 WrappingWebScriptRequest (org.springframework.extensions.webscripts.WrappingWebScriptRequest)1 FormField (org.springframework.extensions.webscripts.servlet.FormData.FormField)1