Client Applications

How to Customize the Drive Metadata Edit Layouts

Updated: October 22, 2018 Page Information Edit on GitHub

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:

  1. In Nuxeo Studio, create a new Form layout called myDriveLayout for instance.
  2. 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.
  3. Create a new XML Extension called DriveMetadataEdit for instance.
  4. 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'? '[email protected]' : '[email protected]'}</layout>
        </layouts>
      </type>
    </extension>
    
    • Replace <type id="mydocumenttype"> with your document type id.
  5. If you want to enable a custom metadata edit view for additional document types:
    1. Repeat steps 1 and 2 to create additional layouts.
    2. Edit the DriveMetadataEdit extension and add new <type> ... </type> sections filled in with the appropriate document types ids and layouts names.
  6. 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.

2 months ago manonlumeau NXDOC-1650 fix about integrating changes, add mention on multiple attempts
3 years ago Manon Lumeau 8
3 years ago Manon Lumeau 7
3 years ago Solen Guitter 6
3 years ago Solen Guitter 5 | Add screenshot of how-to result
3 years ago Solen Guitter 4 | Add link
3 years ago Solen Guitter 3 | fix typo
3 years ago Solen Guitter 2 | Add related pages
3 years ago Solen Guitter 1
History: Created by Solen Guitter

We'd love to hear your thoughts!

All fields required