How can i disable the option: Skip Version Increment?
I am trying to make it impossible to skip the version update. So that every time when a document has been modified, it wil create atleast a minor of major version increment…?
Hi,
Here's a typical definition of a contribution to the versioning service that controls available options:
<extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="versioningRules">
<versioningRule typeName="MyDoc">
<initialState major="0" minor="0"/>
<options lifeCycleState="*">
<none default="true"/>
<minor/>
<major/>
</options>
</versioningRule>
</extension>
You can define your own for your document type, and remove the “none” option if you'd like to force version increment.
This cannot be used in an XML extension in Studio waiting for https://jira.nuxeo.com/browse/NXS-1259 issue to be fixed, but as a workaround, you can put this contribution in a another jar and make it require the Studio bundle (to make sure it's deployed afterwards).
Regards
First, i would like to thank u for the answer, it looked pretty simple. But when i try it on nuxeo Studio on the document type: File. I dont seem to get it to work. Im a missing something?
I have added to following extension:
<extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="versioningRules">
<versioningRule enabled="true" typeName="File">
<initialState major="0" minor="0"/>
<options lifeCycleState="*">
<major default="true"/>
</options>
</versioningRule>
</extension>
in an xml file in the templates/custom directory
in the xml extensions of studio
I ve also tried to define a defaultVersioningRule : it seems to work for all default types, but not my overriden File Document type.
I have a extension via XML extensions:
<extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="versioningRules"> <versioningRule typeName="MyFile">
<initialState major="0" minor="0"/>
<options lifeCycleState="*">
<major/>
</options>
</versioningRule> </extension>
After installing the nuxeo package im still able to use all 3 options for versioning.
I hope u guys can help me. What im a doing wrong?
<component name="studio.extensions.XXXX" version="1.0.0">
In your component extending the Versioning Service :
<?xml version="1.0" encoding="UTF-8"?>
<component name="custom.versioningRules" version="1.0.0">
<require>studio.extensions.XXXX</require>
<extension target="org.nuxeo.ecm.core.versioning.VersioningService" point="versioningRules">
<versioningRule typeName="File" enabled="true">
<initialState major="2" minor="0"/>
<options lifeCycleState="*">
<none/>
<minor default="true" />
<major/>
</options>
</versioningRule>
</extension>
</component>
this extension creates the file in V2.0, and the default selected item in the versionning form is "minor version".
If you want to make the minor version compulsory, get rid of the "none" and "major" entry in the rule definition.
Do i put it all in Nuxeo Studio, Advanced Settings - XML Extensions?
I know that this is probably very stupid of me to ask, pls dont hate me :)
You can put your contribution in
templates/custom/config/
After the server restart, it will copied to
nxserver/config
= Component Loading Status: Pending: 1 / Unstarted: 0 / Total: 656
- service:custom.versioningRules requires
I dont know how to extract the component name in my nuxeo studio bundle?
If u can find it in your hart to take the a moment to help me out:
Pls give a step by step guide to configure this like u have pibou.
<component name="studio.extensions.my_studio_project" version="1.0.0">
In the component you wrote :
<component name="My.versioningRules" version="1.0.0">
<require>studio.extensions.my_studio_project</require>