cancel
Showing results for 
Search instead for 
Did you mean: 

How to increment only minor version after Document.RestoreVersion

_______________
Champ in-the-making
Champ in-the-making

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?

3 REPLIES 3

Rodri_
Star Contributor
Star Contributor

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!

Hello Rodri. Thank you, but i mean some different things.

Rodri_
Star Contributor
Star Contributor

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.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.