02-19-2018 07:53 AM
Hello,
I've installed alfresco community 5.2 in my company. the system is working perfectly.
Nevertheless, due to a large amount of document needed to be uploaded on alfresco, we have to use the versioning system.
However, we don't need to begin the version at 1.0.
For example, we need to upload a document which begins at version 26.0.
After a large amount of time passed seeking the web, I could not find the answer to my question.
Alfresco start the versioning at 1.0,
How to set a different variable than 1.0 ?
Thanks for all for your answer,
Best regards,
Thomas
02-19-2018 09:56 AM
You can achieve this using behaviours. Implement below CalculateVersionLabelPolicy.
VersionServicePolicies.CalculateVersionLabelPolicy
Below is some sample code for the same.
public class somcoVersionServicePolicies implements
VersionServicePolicies.CalculateVersionLabelPolicy {
@Override
public String calculateVersionLabel(QName classRef,
Version preceedingVersion, int versionNumber,
Map<String, Serializable> verisonProperties) {
StringversionNumber = "1.0";
//Logic to calculate veersion
return versionNumber;
}
}
02-20-2018 05:45 AM
Thanks a lot for your answer, however i'm a little rookie in alfresco using, how could I edit the code that you gave me ?
I've tried the other answer from Douglas C. R. Paes using a JS script. But if i change by this script, all versions will be at this number.
what could be awesome is : when i want to up a new version of a document, I can choose the up version.
Thanks a lot again for your support,
best regards,
Thomas
02-19-2018 04:06 PM
Some more ideas on how to customize the versioning behaviour.
Technical Tips & Tricks: How to Change the Alfresco Version Label Format
Explore our Alfresco products with the links below. Use labels to filter content by product module.