Page 1 of 1

Changing the initial Document Version number.

PostPosted:Tue Oct 21, 2014 12:48 am
by JOS123
Hi, we have just started using OKM and I would like to know if it is possible to commence the version numbering from 0.1, instead of 1.0? That is, when you do the initial upload of a document, can the system assign 0.1 instead of 1.0? The versions would then go to 0.1, 0.2 etc until we do a major release to 1.0. If this is possible, how can we do this?
Many thanks

Re: Changing the initial Document Version number.

PostPosted:Wed Oct 22, 2014 9:13 am
by jllort
Document version number is based on java class plugin. You can change the logic implementing your own class for it.
Code: Select all
/**
 * @author pavila
 * @see PlainVersionNumerationAdapter
 * @see BranchVersionNumerationAdapter
 * @see MajorMinorVersionNumerationAdapter
 * @see MajorMinorReleaseVersionNumerationAdapter
 */
public interface VersionNumerationAdapter {
	final String qs = "from NodeVersion nv where nv.parent=:parent and nv.name=:name";

	/**
	 * Obtain the initial version number to be set when creating a new document
	 *
	 * @return This first version number.
	 */
	public String getInitialVersionNumber();

	/**
	 * Calculate the next version number from a given one.
	 *
	 * @param session Hibernate session.
	 * @param nVer    Current document version node.
	 * @return The new calculated version numbering.
	 */
	public String getNextVersionNumber(Session session, NodeVersion nVer, int increment);
}
Here you can take a look about some implementations
http://sourceforge.net/p/openkm/code/HE ... km/vernum/

To change it must go to Administration / Configuration parameters and change default class by your own
Code: Select all
version.numeration.adapter=com.openkm.vernum.MajorMinorVersionNumerationAdapter 

Re: Changing the initial Document Version number.

PostPosted:Mon Oct 27, 2014 12:34 am
by JOS123
Many thanks for the response. We will give it a try.