Change the version manually of a Document in Alfre

2019-06-24 01:27发布

问题:

I want to know how can we change the Document Version Manually in Alfresco using OpenCmis? As of now when i update the document, every time alfresco change the version itself but I want to change version from user input like 1.0,2.0, 2.1 etc.

For Eg. document.txt 1.0, document.txt 1.1

Instead of document.txt 1.1 i want to place version 2.3

回答1:

There's no way to accomplish your goal under CMIS. The spec mandates all versioning properties on a cmis:document to be read only, and the only way to affect them in some ways is through the Versioning API, which only allow you to specify whether you're creating a minor or a major version, and an optional checkin comment.

You will need to write some more sophisticated server side extension to Alfresco if you want to do that, or extend your content model to provide a custom property to hold the information you currently want to store into the version label.



回答2:

You can do it through code example 1 example 2

or

You can do it through db update example

explore more options if above doesnt meet your requierement.