I want Versioning done or Updated on Documents with Aspect cm:versionable
I want to disable Versioning for all the documents without cm:versionable aspect that is to disable upload new Version button etc. Only documents with cm:versionable aspect can only be versioned as of my requirement.
Please anyone can provide guidelines or steps if possible.
It by default sets following properties on the uploaded node:
cm:autoVersion => true - Tells that when the cm:versionable aspect is applied and initial snap shot of the node was taken.cm:initialVersion => true - Tells that when ever a change is made to the "content of a node" that has the versionable aspect applied a new version will be created.cm:autoVersionOnUpdateProps => false - Tells that version won't be incremented when properties are updated on a node.
Removing this aspect is not a good idea. I would suggest you to categorize the document (by content type) and set the above properties when nodes are created.
For example, you have content types "demo:myCustomContent" and "demo:myCustomSupportContent". You want "demo:myCustomContent" to allow display upload new version action and allow versioning on content/property updates. but for "demo:myCustomSupportContent" you don't want "upload new version" action to show and don't want version change on properties update.
if [ node has "cm:versionable" aspect and type is "demo:myCustomContent"] then
set the following properties (
cm:autoVersionOnUpdateProps => true )
else if [ node has "cm:versionable" aspect and type is "demo:myCustomSupportContent"] then
set the following properties ( cm:autoVersion => false cm:autoVersionOnUpdateProps => false )
Add an evaluator for Upload new version action, to check if "cm:autoVersion" and "cm:autoVersionOnUpdateProps" values are true, then show action else hide. This ootb evaluator can be used to test the condition "evaluator.doclib.action.metadataValue"
Sorry if I couldnt explain my reuirement properly before. What I need is that intially is that I want to unable global versioning for all as my project is migration type and after all documents are migrated I need to disable the versioning accordingly by removing Cm: versionable to the document or folder that is no one could upload new version or change document version.
Thanks for making me understand correctly how things work with versioning. After disabling cm:autoVersion, cm:autoVersionOnUpdateProps will no user be able to upload new version because i tried it and i can able to upload new version through upload new version button and thus my requirement of disabling versioning after migration is not fulfilled.