• Make Version start from 0 ?

  • OpenKM has many interesting features, but requires some configuration process to show its full potential.
OpenKM has many interesting features, but requires some configuration process to show its full potential.
Forum rules: Please, before asking something see the documentation wiki or use the search feature of the forum. And remember we don't have a crystal ball or mental readers, so if you post about an issue tell us which OpenKM are you using and also the browser and operating system version. For more info read How to Report Bugs Effectively.
 #47636  by mamad
 
Hi guys,
I'm using openkm6.3.7-DEV community edition
I want to know is it possible to make versions of a document starting from 0 not 1?
It means when i upload a document the first version become 0.0
I have the openkm development environment and there is no problem to change source code if it need any change.
Thanks in advance
 #47647  by jllort
 
You should build your own Version Number Adapter, take a look at:
https://docs.openkm.com/kcenter/view/ok ... apter.html
https://github.com/openkm/document-mana ... apter.java

My suggestion is clone the class MajorMinorReleaseVersionNumerationAdapter and apply into the modifications
Finally should change the value of the configuration parameter named version.numeration.adapter ( Administration > Configuration parameters )
https://docs.openkm.com/kcenter/view/ok ... ation.html
And restart OpenKM to take effect.

Remember you have our Personal OpenKM development environment ( VM based ) what you can download to get a rapid development scenario, ready to be used https://www.openkm.com/en/download.html ( there's a video what explains how to configure ).
 #47682  by mamad
 
Thanks for your hint.
I simply change the starting version from 1.0 to 0.0 by changing getInitialVersionNumber() method inside MajorMinorReleaseVersionNumerationAdapter class :
Code: Select all
@Override
public String getInitialVersionNumber() {
        return "0.0";
	}
}
it was easy right ?:D
 #47688  by jllort
 
Yes, should not be difficult a change. I suggest you create a new class either modifying existing one.

About Us

OpenKM is part of the management software. A management software is a program that facilitates the accomplishment of administrative tasks. OpenKM is a document management system that allows you to manage business content and workflow in a more efficient way. Document managers guarantee data protection by establishing information security for business content.