Reputation: 437
Hi and thanks in advance for the help
I have aproblem that when i change a property in Alfresco, the document is versioned to a minor version on Alfresco 4.2.3.3
So if i upload a document to Alfresco via CMIS (create document 1.0) and after taht modifiy a property i get the version 1.1 i would like to keep the 1.0 version with the modified property. Only want to version if the content is changed.
What i have done so far
Set the value of the property cm:autoVersionOnUpdateProps in a just created document. I have done this diferent options:
This errors are when calling to Session.getTypeDefinition sending P:cm:versionable and false. or P:cmis:versionable and false to the method.
I have a custom Type that i can modifiy, but i dont know how to change it so it overrides the value of that property. Is it possible?
Not an option
I cannot change the contentModel.xml to set by default the property cm:autoVersionOnUpdateProps to false inside the aspect cm:versionable because other documents that use the aspect need to work with that property true.
Questions
Is there a way to override a value of a property only for some types?
Can i via CMIS 1.1 set the value of the property cm:autoVersionOnUpdateProps someway?
Any other option to avoid the behavior?
Enviroment:
Upvotes: 0
Views: 1123
Reputation: 6643
No CMIS doesn't see the cm:versionable aspect or it's properties. I'm not sure if that's a bug or not, but we solved it by a Site Rule which sets the cm:autoVersionOnUpdateProps to false (uncheck the checkbox).
You can also write a JavaScript which triggers on the rule of write a behaviour. But our CMIS application only writes to 1 site, so it was easier to create a rule for it.
Upvotes: 3
Reputation: 2037
You can override propery using override tag in your custom content model.
<type name="custom:contenttype">
<parent>cm:content</parent>
<properties>
</properties>
<overrides>
<property name="cm:autoVersionOnUpdateProps">
<default>(Put your value here)</default>
</property>
</overrides>
</type>
Upvotes: 2