AnsweredAssumed Answered

Bulk import

Question asked by progm on Feb 9, 2018
Latest reply on Feb 9, 2018 by progm

Hello everyone,

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.

Outcomes