Bulk import tool for alfresco - 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.

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.

Related

Is there a way to import or load libraries in service worker?

I am writing a service worker for my app which, in 'activate' state reads and writes to IndexedDB. For reading or writing in IndexedDB, I use a library called 'idb'(https://unpkg.com/idb?module). Is there ant possible way to import libraries in service workers. Also, the library use ES6 imports and exports, will that be a problem?
To import scripts/libraries in service workers I had to use importScripts() rather than fetch() and that did the trick. Also, the imported library gets added to the ServiceWorkerGlobalScope, meaning I had to use this.<library-name> to access the library.
Also, the ServiceWorkerGlobalScope doesn't have support for ES6 import/export, that's why I needed to build the package with npm build and then use it.
importScripts('index-min.js');
this.idb();

Alfresco data export and import

we have to export alfresco data and import into another repository, and not necessarily backup/restore process. we are aiming for script which can be run and extract data on some conditions, set of files, with all its metedata.
i have got below link, which talks about same, but it is old , and things cant be done like versions of the file, condition based extract.
https://www.ibm.com/developerworks/cn/xml/x-cmis2/index.html
i would like to know any approaches available for extract and import of the alfresco data into other repositories..
There is nothing out-of-the-box that will do this. The replication sub-system is not suitable for frequent replication of more than a small handful of nodes.
So, you will have to write a custom solution or look at third-party solutions that can do this. Simflofy is one example. Another example is the Parashift Alfstream module.
If you would like to develop this yourself, I suggest you do something like:
Write code to export one or more files to the file system. This should be storage that is shared between the source and all target repositories.
Alongside each file, write a "manifest" file that descries the file's metadata, including custom properties and property values. You should use the same format that the Bulk File System Import Tool expects when doing an import.
Add a message to a queue that describes where the exported data is sitting and where it needs to be imported.
In the target repository, write a listener that is subscribe to the queue.
When the listener gets a message it can initiate a Bulk File System Import in the target system. The BFSIT will import the files and set the metadata as described in the manifest file you generated in Step 2.
Optionally, the target system can place another message on the queue acknowledging that the import has been performed, which the source repo can then pick up to complete the task.
Some people have been successful using Apache Camel for this, but it is not strictly necessary.

How to integrate jsreport to meteor application

Can anyone help me how to integrate jsreport to meteor application and how to use it to generate pdfs using data from database?
You can use the node package for that.
Link:: here
Don't forget to import the package before use.
You can also check the following example also which is using jsreport-client.
Link:: Here

Using Express.js modules in Sails.js

Sails.js does not yet have official Sqlite adapter. There are some attempts, but having read the comments, they are buggy and not reliable.
Since Sails.js uses Express.js, and Express has decent sqlite modules, I was thinking how to use it in Sails?
Any idea is appreciated.
I managed to do it. Very easy. First Install the sql3lite package
Lets Assume I have UserController. At the start of the controller, use this:
sqlite3 = require('sqlite3').verbose(),
db = new sqlite3.Database('myDbName');
db object has all that is needed. You can check the link for detailed CRUD reference :)

ldap queries in Qt

Thinking of implementing a LDAP-viewer in QML. The first step is obviously to make a Qt back-end that can handle ldap-queries. I've read the rfc1823 (ldap tutorial of sorts), but still can't understand where to begin really.
I would be interested in some Qt code that would get me started on some sample LDAP functions, for instance :
connect to a ldap server
do some simple query of any type
close the connection
Edit: code is not required if you can point me to any tutorials/guides as to how one does this in C++ / Qt
I suggest using libldap. Writing a client from scratch is a lot of work. Take a look here for some examples as a kick-off. You can easily integrate that code with Qt.
The OpenLDAP library also has some c++ example included.

Resources