I am using the ContentImporter API to import JSON files from the FS and turn 
them into node-trees in the JCR.  

For testing i've created a "root" nt:folder node at: /apps/test

When importing i call:

node => /apps/test
jsonFile => new File(/tmp/demo.json).getName()
stream = new FileInputStream(jsonFile)
options = new CustomImportOptions(false, false, true, true)
// ischecking => false, isignoredimportprovider => false, isoverwrite => true, 
ispropertyoverwrite => true


contentImporterService.importContent(node, jsonFile, stream, options, null);

Try to execute the import results in a RepositoryException: 

REP ERROR: Unable to perform operation. Node is protected.

I've tried deleting /apps/test and re-creating it to clear any left over 
versioning, etc. that might have been inadvertently added, but to no avail.

When I inspect /apps/test in CRX/CRXDE it states "Protected: false" so I'm not 
entirely sure why during the import it thinks it (or at least i think thats the 
node its talking about) is protected.

Using the content import via maven-sling-plugin declarations works fine.

-- 
David Gonzalez
Sent with Sparrow (http://www.sparrowmailapp.com/?sig)

Reply via email to