Document version numeration configuration

We support different numeration schemas. By default, OpenKM uses com.openkm.vernum.MajorMinorVersionNumerationAdapter, which is similar to the Jackrabbit implementation.

More information about how to create your own Version Number Adapter.

Field / PropertyTypeDescription
version.numeration.adapter String

Numeration schema.

Available schemas:

      • com.openkm.plugin.vernum.PlainVersionNumerationAdapter
      • com.openkm.plugin.vernum.PlainZeroVersionNumerationAdapter
      • com.openkm.plugin.vernum.MajorMinorVersionNumerationAdapter
      • com.openkm.plugin.vernum.BranchVersionNumerationAdapter
      • com.openkm.plugin.vernum.MajorMinorReleaseVersionNumerationAdapter
      • com.openkm.plugin.vernum.VersionLetterAdapter

com.openkm.vernum.MajorMinorVersionNumerationAdapter

version.numeration.format String

Number format for numeration. Used in PlainVersionNumerationAdapter.

%d

Some Numeration Adapters, like PlainVersionNumerationAdapter, may have additional configuration parameters like version.numeration.format, which is used to define the numeration number format. By default, this is "%d", but you can change it to "%02d" to create versions like "01", "02", etc.

Restarting the application is required after changing the value of version.numeration.adapter.

Also note that if there are already documents in the repository, changing the Numeration Adapter may cause problems because they are not compatible with each other.

Version numeration schemas

Numeration adapterFirst versionNext versions
com.openkm.plugin.vernum.PlainVersionNumerationAdapter 1 2, 3, 4, etc.
com.openkm.plugin.vernum.PlainZeroVersionNumerationAdapter 0 1, 2, 3, etc.
com.openkm.plugin.vernum.MajorMinorVersionNumerationAdapter 1.0 1.1, 1.2, 1.3, etc.
com.openkm.plugin.vernum.BranchVersionNumerationAdapter 1 2, 3, 2.1, 2.2, etc.
com.openkm.plugin.vernum.MajorMinorReleaseVersionNumerationAdapter 0.0.0 0.0.1, 0.0.2, 0.1.0, 0.1.1, 1.0.0
com.openkm.plugin.vernum.VersionLetterAdapter A B, C

Migration between versions

We recommend that you set the correct numeration before you start using the application. Otherwise, a migration of existing numeration will be needed, and this operation is not always easy.

You can change the default Numeration Adapter using the "version.numeration.adapter" configuration parameter. You need to restart OpenKM every time you change this parameter. Also note that if there are already documents in the repository, changing the Numeration Adapter may cause problems when they are not compatible with each other.

If you change the version numeration adapter, you also need to update the existing numeration; for example, migrating from PlainVersionNumerationAdapter to MajorMinorVersionNumerationAdapter.

-- HQL queries
UPDATE NodeDocumentVersion ndv SET ndv.name = '01' WHERE ndv.name='1.0'; UPDATE NodeDocumentVersion ndv SET ndv.name = '02' WHERE ndv.name='1.1'; UPDATE NodeDocumentVersion ndv SET ndv.name = '03' WHERE ndv.name='1.2';