alfrescobulkcmisopencmis

Bulk import tool for alfresco


I want to integrate the functionnality of Bulk import tool into my Java code Client CMIS using openCMIS library, is there any way to do so ? The goal is to do an import to alfresco automatically and without using the bulk import tool UI I found this code :

Streaming

UserTransaction txn = transactionService.getUserTransaction();

txn.begin();

AuthenticationUtil.setRunAsUser('admin');

StreamingNodeImporterFactory streamingNodeImporterFactory = (StreamingNodeImporterFactory)ctx.getBean('streamingNodeImporterFactory');
NodeImporter nodeImporter = streamingNodeImporterFactory.getNodeImporter(new File('importdirectory'));
BulkImportParameters bulkImportParameters = new BulkImportParameters();

bulkImportParameters.setTarget(folderNode);
bulkImportParameters.setReplaceExisting(true);
bulkImportParameters.setBatchSize(40);

bulkImportParameters.setNumThreads(4);
bulkImporter.bulkImport(bulkImportParameters, nodeImporter);


txn.commit();

But I didn't found any library that provides classes implemented in this code, so I can use them in my code.

If someone please can help me. Thanks a lot.


Solution

  • The code you are showing that invokes the Bulk File System Import Tool is running in the same process as Alfresco. It leverages the foundational Java API to make all of the calls.

    You are asking about a client based on OpenCMIS. CMIS is a standard for working with all kinds of repositories. There is nothing in the spec or in the OpenCMIS implementation that knows anything about the Alfresco-specific Bulk File System Import Tool. Therefore, you cannot initiate a BFSIT import via CMIS.

    To do imports, you can use the BFSIT or you can use CMIS, but combining the two does not make much sense.