Skip to content

Vince-Cercury/nuxeo-platform-importer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Multi threaded document importer from server filesystem

The file importer comes as a Java library (with nuxeo runtime service) and a sample JAX-RS interface to launch, monitor and abort import jobs.

Build with::

$ mvn install -Dmaven.test.skip=true

And deploy the two jars from the target subfolder into the nuxeo.ear/plugins or nxserver/bundles folder of your nuxeo server (and restart).

To import the folder '/home/ogrisel/Documents' into the workspace '/default-domain/workspaces/my-workspace' while monitoring the import logs from a REST client use the following HTTP GET queries::

GET http://localhost:8080/nuxeo/site/fileImporter/logActivate

GET http://localhost:8080/nuxeo/site/fileImporter/run?targetPath=/default-domain/workspaces/my-workspace&inputPath=/home/ogrisel/Documents&batchSize=10&interactive=false&nbThreads=4

GET http://localhost:8080/nuxeo/site/fileImporter/log

To execute those HTTP queries you can either use a browser with an active Nuxeo session (JSESSIONID cookie) or use a third party stateless HTTP client with HTTP Basic Authentication, eg: with the curl commandline client::

$ curl --basic -u 'Administrator:Administrator' "http://localhost:8080/nuxeo/site/fileImporter/log"

Don't forget to quote the URL if it includes special shell characters such as '&'.

You can also the generic HTTP GUI client from the rest-client java project::

http://code.google.com/p/rest-client/

Don't forget to fill in the 'Auth' tab with your user credentials.

API call for Scan Importer

Update Nuxeo Studio package from your local instance. Make sure your studio specifies a scan importer config.

make sure the import folders exists on the filesystem of the Nuxeo node. Something like (defined in the scanner config above): /mnt/tmp/nuxeo/images/import/input /mnt/tmp/nuxeo/images/import/imported

Copy some xml files in the input folder

Launch logging (does not work yet): curl --basic -u 'Administrator:Administrator' "http://localhost:8080/nuxeo/site/scanner/logActivate"

Trigger the ingestion: curl --basic -u 'Administrator:Administrator' "http://localhost:8080/nuxeo/site/scanner/runWithConfigLoad" Check in the console if files are getting processed.

About

Nuxeo Importer sample addon

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 100.0%