Customize BulkImporter

Hi all, I've customized our Bulk import form but I'm facing to issues with some fields.

If I upload a PDF or ODT file, there is no problem but when I try to upload a txt file, there is an exception caused by fileds which.

All fields which use a custom vocabulary or the ldap username autocomplete are not accepted.

For exemple, I'have a single vocabulary called “ulr:meeting_type” When I import a PDF file, there is no problem, but when I import a txt file, nuxeo throws this exception :

Do you know why ?

chain Name: FileManager.ImportWithMetaDataInSeam Exception: OperationException Caught error: Failed to invoke operation Document.Update Caused by: org.nuxeo.ecm.core.api.model.PropertyNotFoundException: ulr:meeting_type Hierarchy calls

org.nuxeo.ecm.automation.core.operations.services.FileManagerImport
    org.nuxeo.ecm.automation.core.operations.document.UpdateDocument

at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:232)
at org.nuxeo.ecm.automation.core.impl.OperationServiceImpl.run(OperationServiceImpl.java:115)
at org.nuxeo.ecm.automation.server.jaxrs.batch.BatchManagerComponent.execute(BatchManagerComponent.java:283)
at org.nuxeo.ecm.automation.server.jaxrs.batch.BatchManagerComponent.execute(BatchManagerComponent.java:249)
at org.nuxeo.ecm.webapp.action.ImportActions.importDocumentsThroughBatchManager(ImportActions.java:293)
at org.nuxeo.ecm.webapp.action.ImportActions.importDocuments(ImportActions.java:245)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
0 votes

0 answers

860 views

ANSWER

The txt file could be mapped to another doctype (Note) hence the error.

Maybe you could have a look at http://explorer.nuxeo.com/nuxeo/site/distribution/cap-8.2/viewExtensionPoint/org.nuxeo.ecm.platform.filemanager.service.FileManagerService--plugins

06/10/2016

Mohamed,

Does the schema used by the doctype in question include the desired meta-data field?

-Yousuf

06/13/2016

Hi Yousuf Nejati

Yes, all fields are display with their metadata (for select etc…)

I have added a screenshot :)

06/14/2016

Hi pibou Bouvret

To be precise, this is what I'm trying to do. I have created a document type called "Document ULR".

When I wish to deposit a document ULR in Nuxeo, I click on the button "new document", the form is properly displayed and I can complete all fields and save without problem. And that, whatever the extension of the document (doc, docx, pptx, pdf, txt, xml, sql, …)

After having found that we could use the "import" button, I wanted to ensure that the displayed form is exactly the same as "Document ULR". So I have created the "bulkImport" form in Form Layouts (Nuxeo studio). I have set

Feature ID : bulkImport
Initialization : From Document
    File (Document ULR)

So when I click on "Import" button, the Bulk Form displayed is exactely the same than "Document ULR" doctype form

That's why I don't understand why it causes troubles, and why it want to map it to another doctype (Note). Do you think I have to create the form by hand ? It could take a long time…

06/14/2016

In the contribution I mentionned, the "NoteImporter" plugin tries to create a Note document when a file whose MIME type is "text/plain" is imported.

Maybe you could try and change the local configuration of the workspace you re working in and only allow your custom doctype (choose it also for automatic doctype).

06/14/2016