Document version numeration configuration
We support different numeration schemas. By default OpenKM uses com.openkm.vernum.MajorMinorVersionNumerationAdapter which is similar to 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 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 to "%02d" to create versions like "01", "02", etc.
Restarting application is needed after changing the value of version.numeration.adapter.
Also note that if already there are documents in the repository, changing the Numeration Adapter may cause problems because they are not compatible between them.
Version numeration schemas
Numeration adapter | First version | Next versions |
---|---|---|
com.openkm.vernum.PlainVersionNumerationAdapter | 1 | 2, 3, 4, etc. |
com.openkm.vernum.MajorMinorVersionNumerationAdapter | 1.0 | 1.1, 1.2, 1.3, etc. |
com.openkm.vernum.BranchVersionNumerationAdapter | 1 | 2, 3, 2.1, 2.2, etc. |
com.openkm.vernum.LetterVersionAdapter | A | A,B,C, etc. |
com.openkm.vernum.MajorMinorReleaseVersionNumerationAdapter | 1.0.0 | 1.1.0, 1.2.0, 1.2.1, etc. |
Migration between versions
We recommend you set the correct numeration at the beginning of using the application. Otherwise will be needed a migration of existing numeration 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 already there are documents in the repository, changing the Numeration Adapter may cause problems when they are not compatible between them.
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';