Additional Services

How to Change the Default Document Type When Importing a File in the Nuxeo Platform?

In this how-to, importing a file can correspond to using the drag and drop, using the "Import a file" button, or adding a file from Nuxeo Drive or a WebDAV drive.

The mechanism to create a Nuxeo document with an import is tight to the extension point plugins from the FileManager service.

According to the mimetype of the file you try to import, a specific plugin will be called. And most of the time, it's the DefaultFileImporterplugin that will be used.

So, to create a document of your own type that, you have to set the docType attribute when overwriting the default contribution:

<require>org.nuxeo.ecm.platform.filemanager.service.FileManagerService.Plugins</require>

<extension target="org.nuxeo.ecm.platform.filemanager.service.FileManagerService" point="plugins">
    <plugin name="DefaultFileImporter" merge="true" docType="MyCustomFileType" />
</extension>

 


22 days ago Andrew Goodricke Syntax error fixed
3 years ago Manon Lumeau 11
3 years ago Solen Guitter 10
5 years ago Manon Lumeau 9
5 years ago Solen Guitter 8 | add links
5 years ago Solen Guitter 7
5 years ago Solen Guitter 6
5 years ago Solen Guitter 5
5 years ago Solen Guitter 4
5 years ago Thierry Martins 2 | Add related links
5 years ago Thierry Martins 3
5 years ago Thierry Martins 1
History: Created by Thierry Martins

We'd love to hear your thoughts!

All fields required