Alfresco share versioning different than 1.0

cancel
Showing results for 
Search instead for 
Did you mean: 
thomas59000
Member II

Alfresco share versioning different than 1.0

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

3 Replies
krutik_jayswal
Senior Member II

Re: Alfresco share versioning different than 1.0

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) {
String
versionNumber = "1.0";
      //Logic to calculate veersion
      return versionNumber;
   }
}
douglascrp
Advanced II

Re: Alfresco share versioning different than 1.0

Some more ideas on how to customize the versioning behaviour.

Technical Tips & Tricks: How to Change the Alfresco Version Label Format 

thomas59000
Member II

Re: Alfresco share versioning different than 1.0

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