Desktop and Mobile

How to Customize Nuxeo Drive Versioning Policy

Updated: March 18, 2024

How to Configure the Versioning Delay or Version Increment

You can configure two parameters of Nuxeo Drive versioning policy thanks to the extension point fileSystemItemFactory: 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.drive.adapters</require>

  <extension target="org.nuxeo.drive.service.FileSystemItemAdapterService"
    point="fileSystemItemFactory">

    <fileSystemItemFactory class="org.nuxeo.drive.service.impl.DefaultFileSystemItemFactory" name="defaultFileSystemItemFactory" order="40">
      <parameters>
        <parameter name="versioningDelay">1800</parameter>
        <parameter name="versioningOption">MAJOR</parameter>
      </parameters>
    </fileSystemItemFactory>

  </extension>

How to Change Nuxeo Drive Versioning Policy

If you need to make more changes on the versioning mechanism in Nuxeo Drive:

  1. Write your own implementation of VersioningFileSystemItemFactory interface, and in particular write the expected behavior in the needsVersioning method.
  2. Contribute to the fileSystemItemFactory extension point to use your new class:
  <extension target="org.nuxeo.drive.service.FileSystemItemAdapterService"
    point="fileSystemItemFactory">

    <fileSystemItemFactory class="com.sample.drive.CustomFileSystemItemFactory" name="customFileSystemItemFactory" order="20"/>

  </extension>