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 Creating your own Version Number Adapter.
| Field / Property | Type | Description |
|---|---|---|
| version.numeration.adapter | String |
Numeration schema. Available schemas:
com.openkm.vernum.MajorMinorVersionNumerationAdapter |
| version.numeration.format | String |
Numeration number format. Used in the 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 documents already exist in the repository, changing the Numeration Adapter may cause problems because they are not compatible with each other.
Version numeration schemas
| Numeration adapter | First version | Next 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 at the beginning of 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 documents already exist 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, the migration 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';