Web UI Framework

How to Customize the Bulk Import Form

The bulk import screen offers a form that allows to edit several documents at the same time. You can customize it with Studio by creating a form layout named bulkImport. The "Create" layout will be used on the bulk import popup.

Note that the Where and Files fields are obviously not customizable and will always be displayed on this form. The layout is actually below these two fields.

Creating a Form Layout in Studio

  1. In Studio, go to Listings & Views > Form Layouts and click on New,
  2. Fill in the Feature ID: bulkImport and click on Next,

    Make sure that your form layout is named bulkImport to override the default one.

  3. Go to the Creation Layout tab,
  4. Drag and drop the widgets you need,
  5. Click on Save.

Deploying Changes on Your Nuxeo Platform Instance

  1. Go to your Nuxeo Platform instance.
  2. Connect as Administrator with Administrator password.
  3. Click on Admin Center > Update Center > Nuxeo Studio.
  4. Click on the Update button.
  5. Go in a workspace and edit your documents.

Specific Cases

When you want to create a bulk edit form with the possibility to edit the collections and the tags, you need a particular configuration.

Tags

When you configure a widget to select tags, the field that needs to be referenced is contextData['request/bulk_tags']

  1. Drag and drop a generic widget from the right to the grid,
  2. Fill in the creation form, 
  3. In the Edit Properties, select Yes for the Can Select New Tag field,
  4. Click on Save and deploy your changes on your instance.

Collections

When configuring a widget to select collections, the field that needs to be referenced is contextData['request/bulk_collections'].

  1. Drag and drop a generic widget from the right to the grid,
  2. Fill in the creation form, 
  3. Fill in the Edit Properties:

    Document page provider name

    default_document_suggestion
    Selection FormatterformatSelectedCollection
    Suggestion FormatterformatSuggestedCollection

  4. In the Custom Properties fill in the following fields:

    restoreSeamCtxfalse
    operationIdCollection.Suggestion
  5. Click on Save and deploy your changes on your instance.

You should end up with something like this:

Adding New Import Options

The bulk import popup can display more than one import layout. When more than one is contributed, you can select which one you want to use to import the uploaded documents through the "Import Options" field. 

An import option is contributed through an action in the IMPORT_DOCUMENTS category.  The action must reference the chainId and the layout to use for this import option.  The action label is used in the "Import Options" select. 

The contribution of the default bulk import is:

<extension target="org.nuxeo.ecm.platform.actions.ActionService"
  point="actions">

  <action id="dndBulkImportDocuments" link=""
    order="10" label="label.smart.import"
    help="desc.smart.import.file">
    <category>IMPORT_DOCUMENTS</category>
    <properties>
      <property name="chainId">FileManager.ImportWithMetaDataInSeam</property>
      <property name="layout">[email protected]</property>
    </properties>
  </action> 
</extension>

The layout displayed will be [email protected] and documents will be imported through the FileManager.ImportWithMetaDataInSeam chain. 

To add a new one, you can just add a new action referencing your own layout (or the default one) and your own chain id (or the default one).

In this example we create an import option that puts the status of your document “obsolete” if you type in the term "legacy" in the source metadata.

  1. In Studio, create this automation chain,

    - FileManager.Import:
        overwite: "true"
    - Document.Update:
        properties: {}
        save: "true"
    - Document.SetLifeCycle:
        value: "@{Document[\"dc:source\"] == \"legacy\" ? \"obsolete\" : \"approve\"}"
    - Seam.Refresh
    
  2. You can now create an xml extension to add an import option that call our chain,

    <extension target="org.nuxeo.ecm.platform.actions.ActionService"
      point="actions">
    
      <action id="customBulkImportDocuments"
        order="20" label="My Custom Import">
        <category>IMPORT_DOCUMENTS</category>
        <properties>
          <property name="chainId">ImportChain</property>
          <property name="layout">[email protected]</property>
        </properties>
      </action>
    </extension>
    
  3. Click on Save. You can now deploy your changes on your platform. 

Disabling the Default Import Option

If you want to disable the default import option (after having contributed a new one for instance), you can do it with the following contribution:

<extension target="org.nuxeo.ecm.platform.actions.ActionService"
  point="actions">

  <action id="dndBulkImportDocuments" enabled="false" />
</extension>

After deploying your changes, you can only see your custom import option when you click on Import

3 months ago manonlumeau Relocated assets to fit new URL structure for 60 - fix
4 years ago Solen Guitter 27 | ix typ
4 years ago Solen Guitter 26 | Add note about Where and Files fields
4 years ago Manon Lumeau 25
4 years ago Manon Lumeau 24
5 years ago Manon Lumeau 23
5 years ago Manon Lumeau 22
5 years ago Manon Lumeau 21
5 years ago Manon Lumeau 20
5 years ago Manon Lumeau 19
5 years ago Manon Lumeau 18
5 years ago Manon Lumeau 17
5 years ago Manon Lumeau 15
5 years ago Manon Lumeau 16
5 years ago Manon Lumeau 14
5 years ago Manon Lumeau 13
5 years ago Manon Lumeau 12
5 years ago Manon Lumeau 11
5 years ago Manon Lumeau 10
5 years ago Manon Lumeau 9
5 years ago Manon Lumeau 8
5 years ago Manon Lumeau 7
5 years ago Manon Lumeau 6
5 years ago Manon Lumeau 5
5 years ago Manon Lumeau 4
5 years ago Manon Lumeau 3
5 years ago Manon Lumeau 2
5 years ago Manon Lumeau 1
History: Created by Manon Lumeau

We'd love to hear your thoughts!

All fields required