You have created your own document types and defined forms and view that show properties specific to your business and users. Your users leverage Nuxeo Drive to work on Nuxeo documents from their desktop and you want them to be able to enjoy the metadata edit feature of Nuxeo Drive.
Obviously you want them to be displayed the same properties as in the Nuxeo Platform web UI.
To do so:
- In Nuxeo Studio, create a new Form layout called
myDriveLayout
for instance. - Fill in the View Layout and Edit Layout with relevant widgets. You will probably end up with similar information as on your custom document type layouts.
- Create a new XML Extension called
DriveMetadataEdit
for instance. Use the following content and adapt it to your needs:
<extension target="org.nuxeo.ecm.platform.types.TypeService" point="types"> <type id="mydocumenttype"> <layouts mode="drive"> <layout>#{layoutMode == 'edit'? 'myDriveLayout@edit' : 'myDriveLayout@view'}</layout> </layouts> </type> </extension>
- Replace
<type id="mydocumenttype">
with your document type id.
- Replace
- If you want to enable a custom metadata edit view for additional document types:
- Repeat steps 1 and 2 to create additional layouts.
- Edit the
DriveMetadataEdit
extension and add new<type> ... </type>
sections filled in with the appropriate document types ids and layouts names.
- Save and deploy.
Notes
- Why not use the default View and Edit layouts of your custom document types?
There are chances that the View and Edit layouts defined for your document types use the
file:content
widget, that enables to view and upload a file to the document. It wouldn't make much sense to display this field to users from the file itself. That's why you need to create a new layout for this Metadata edit view.
Other Nuxeo Drive Documentation