Client Applications

HOWTO: Customize Nuxeo Drive Versioning Policy

Updated: March 27, 2019 Page Information Edit on GitHub

How to Configure the Versioning Delay or Version Increment

You can contribute a new versioning policy and filter thanks to the extension points policies and filters to configure the last edit delay until a new version is created and which version increment will occur (minor or major).

For example, to create a major version if the document is modified 30 minutes after the last change, use this contribution:

<require>org.nuxeo.ecm.core.versioning.default-policies</require>

<extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="policies">
    <policy id="versioning-delay" increment="MAJOR" order="40">
        <filter-id>versioning-delay</filter-id>
        <filter-id>drive-filter</filter-id>
    </policy>
</extension>

<extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="filters">
    <filter id="versioning-delay">
        <condition>#{currentDocument.dc.modified.time - previousDocument.dc.modified.time >= 1800000}</condition>
    </filter>
    <filter id="drive-filter">
        <condition>#{currentDocument.contextData.source == "drive"}</condition>
    </filter>
</extension>

How to Change Nuxeo Drive Versioning Policy

If you need to make more changes on the versioning mechanism in Nuxeo Drive, you can write your own implementation of the VersioningPolicyFilter interface, and contribute it to the filters extension point.

<extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="policies">
    <policy id="custom-versioning-policy" increment="MAJOR" order="40">
        <filter-id>custom-versioning-filter</filter-id>
    </policy>
</extension>

<extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="filters">
    <filter id="custom-versioning-filter" class="foo.bar.CustomVersioningFilter">
</extension>


a month ago manonlumeau NXDRIVE-1581: Update Nuxeo Drive documentation
a month ago manonlumeau Final review
2 months ago manonlumeau NXDOC-1871: update Nuxeo sources retrieval
3 years ago Solen Guitter 8
3 years ago Manon Lumeau 7 | javadoc links updated
3 years ago Manon Lumeau 6
4 years ago Manon Lumeau 5
4 years ago Solen Guitter 4
4 years ago Solen Guitter 3 | fix link
4 years ago Solen Guitter 2
4 years ago Solen Guitter 1
History: Created by Solen Guitter

We'd love to hear your thoughts!

All fields required