How to increment only minor version after Document.RestoreVersion
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2019 01:07 AM
Hello. After invoke operation Document.RestoreVersion e.g. major version 2 -> major version 1, i need to update document with major version 1 and increment minor version of major version 1, but nuxeo java client return major version 2 after update major version 1. How can i fix this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2019 02:54 AM
Hello, if you are using Java Client, did you try to update the version of the document by using the following?
document = nuxeoClient.operation("Document.CreateVersion").param("increment", "MINOR").input(document).execute();
In this case, with "MINOR", the version 1.0 will generate the version 1.1. You can also change "MINOR" to "MAYOR" in order to increment from 1.0 to 2.0.
Info about the Document.CreateVersion operation: http://explorer.nuxeo.com/nuxeo/site/distribution/Nuxeo%20DM-8.2/viewOperation/Document.CreateVersio...
Hope it helps!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2019 04:17 AM
Hello Rodri. Thank you, but i mean some different things.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2019 10:05 AM
Well. You can play with "checkout" and "createVersion" parameters of "Document.RestoreVersion" operation. However, I think that the behavior you are expecting is not possible only with those operations. If you want to restore a document from a version, then you can generate a new version with the restored version. For example, if the document has the version 2.4, you can restore the 1.1 version but creating a new version (2.5). So 2.5 = 1.1. In other case, you might have two 1.2 versions and this is not possible.
