Platform Explorer / Nuxeo Platform LTS 2015 7.10

Extension point versioningRules

Extension point defining default versioning rules or versioning rules by document type. Contributions to this XP are available for VersioningService implementing ExtendableVersioningService interface.

Example:

    <defaultVersioningRule>
        <initialState major="1" minor="0"/>
        <options lifeCycleState="*">
            <none default="true"/>
            <minor/>
            <major/>
        </options>
        <options lifeCycleState="approved">
            <none default="true"/>
            <minor/>
        </options>
    </defaultVersioningRule>
    <versioningRule enabled="true" typeName="File">
        <initialState major="1" minor="1"/>
        <options lifeCycleState="project">
            <none/>
            <minor default="true"/>
        </options>
        <options lifeCycleState="approved"/>
    </versioningRule>

The defaultVersioningRule will be used for all the document types if no specific versioningRule is contributed.

typeName attribute is only available for versioningRule tag and should be the name of a document type.

Initial state is the initial version number of the document. Default is 0.0 .

Options tag contains the different increment option available when saving a document. Only none, minor and major tags are used. If the default attribute isn't set, the first tag will be used as default. Options tag should always have the lifeCycleState attribute. The life cycle state name "*" can be used to match any state: it'll be used by default if no other option with a matching state exists.

Following option gives no increment saving option when the current lifeCycle of the document is approved.

    <options lifeCycleState="approved"/>

Following options removes major increment option and set the minor increment option as default choice.

    <options lifeCycleState="project">
        <none/>
        <minor default="true"/>
    </options>

If no option is specified, the defaultVersioningRule is used. If there is no defaultVersioningRule, we fall back on the service implementation.

@Since 5.4.2

Contribution Descriptor

Existing Contributions

  • nuxeo-easyshare-7.10-HF02.jar /OSGI-INF/extensions.xml
    <extension point="versioningRules" target="org.nuxeo.ecm.core.versioning.VersioningService">
        <versioningRule typeName="EasyShareFolder">
          <initialState major="0" minor="0"/>
          <options lifeCycleState="*">
            <none default="true"/>
            <minor/>
            <major/>
          </options>
        </versioningRule>
      </extension>