Additional Services

Collections

Functional Overview

Installation & Configuration

The collection module has no specific installation step as it is already included in the default Nuxeo Platform distribution.

Customization

How to Implement a New Type of Collection

If you'd like to implement a new collection (for instance to have new metadata) you can simply add the Collection facet to your specific document type. You'll therefore be able to use it as a regular collection.

  <require>org.nuxeo.ecm.collections.schemas</require>

  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="schema">
    <schema name="yourSchema" src="schemas/xxx.xsd" prefix="xxx" />
  </extension>
  <extension target="org.nuxeo.ecm.core.schema.TypeService" point="doctype">
    <facet name="YourFacet" >
      <schema name="yourSchema" />
    </facet>

    <doctype name="YourDocumentType" extends="Document">
      <facet name="YourFacet" />
      <facet name="Collection" />
    </doctype>

  </extension>

 

NotCollectionMember Facet

All documents can be added to a collection except:

  • Documents with the facet SystemDocument
  • Documents with the facet NotCollectionMember

By default, documents of type Collection, WorkspaceRoot, TemplateRoot, SectionRoot, Domain and Root have the facet NotCollectionMember. Please see collection-core-types-contrib.xml for more details.

Plugging Business Rules to Collection Specific Events

Several events related to collections are available:

  • beforeAddedToCollection
  • addedToCollection
  • beforeRemovedFromCollection
  • removedFromCollection

The collection reference is available in the event context map. For example, within an event listener which starts an automation chain, you can fetch the collection as described below:

- Document.Fetch:
    value: "@{Event.context.getProperty(\"collectionRef\").reference()}"

Synchronizing a Collection with Nuxeo Drive

To do so you need to add the following XML contribution with either Nuxeo Studio or a custom bundle:

<component name="org.nuxeo.drive.actions.collections">
  <require>org.nuxeo.drive.actions</require>
    <extension target="org.nuxeo.ecm.platform.actions.ActionService"
      point="filters">
      <filter id="can_sync_current_doc" append="true">
        <rule grant="true">
          <type>Collection</type>
        </rule>
      </filter>
    </extension>
</component>

Limitation

With this configuration you won't be able to unsynchronize a collection as usual using the icon as this icon will stay grey: .

Yet you can always unsynchronize the collection from the Nuxeo Drive tab in the user Home.

Notes:

  • Files or folders created in the locally synchronized collection folder will not be added to the collection server-side. For now we have no mechanism to choose their path in the hierarchy.
  • Please be aware that all the limitations applied to online editing with Nuxeo Drive apply to synchronized collections.

 

 

Core Implementation

A collection holds the list of references of the documents it contains. Conversely, a document holds the list of references of the collections it belongs to.

Collection operation are offered by the CollectionManager.java service.

Because a collection can potentially contain a large number of documents and, to a lesser extent, a document can belong to many collections, some tasks are performed asynchronously.

For instance, when deleting a collection, an asynchronous work will update the documents it contains to remove the reference of the deleted collection. In the same way, when a document is removed, an asynchronous work will update the collection it belonged to in order to remove the reference of the deleted document.

Finally, when copying a collection, an asynchronous work will also duplicate its content.

 


4 months ago manonlumeau Relocated assets to fit new URL structure for 710 - fix
3 years ago Solen Guitter 25 | dd missing <require> in Synchronizing a Collection with Nuxeo Drive contributio
4 years ago Solen Guitter 24
4 years ago Solen Guitter 23
4 years ago Manon Lumeau 22
4 years ago Manon Lumeau 21
4 years ago Solen Guitter 20
4 years ago Solen Guitter 19 | NXDOC-647 : use tabs to show Collections related docs
4 years ago Manon Lumeau 18
4 years ago Solen Guitter 17 | NXDOC-614: Add functional overview
5 years ago Solen Guitter 16 | format
5 years ago Michaƫl Vachette 15
5 years ago Antoine Taillefer 14
5 years ago Manon Lumeau 13
5 years ago Manon Lumeau 12
5 years ago Solen Guitter 11
5 years ago Solen Guitter 10
5 years ago Solen Guitter 9 | Add links
5 years ago Antoine Taillefer 8
5 years ago Solen Guitter 7
5 years ago Guillaume Renard 6
5 years ago Guillaume Renard 5
5 years ago Guillaume Renard 4
5 years ago Guillaume Renard 3
5 years ago Guillaume Renard 2
5 years ago Guillaume Renard 1
History: Created by Guillaume Renard

We'd love to hear your thoughts!

All fields required