cancel
Showing results for 
Search instead for 
Did you mean: 

Access versioning information through Java API

__2
Champ in-the-making
Champ in-the-making

Hi!

I'm coding an application that stores documents in Nuxeo using Java API. I figured out how to create additional versions of a document through

doc.setPropertyValue("file:content", batchUpload.getBatchBlob());
doc = repository.updateDocument(doc);

and I can see using Web UI that it worked. Now, how can I access through the API the information in the screenshot below, like number of versions, timestamp, author,... And retrieve a particular version ?

Thanks in advance for your help 🙂

2 REPLIES 2

Gregory_Carlin
Elite Collaborator
Elite Collaborator

Hello,

You can:

  • Use the Document.Version automation operation.
  • Use the X-Versioning-Option HTTP header with major or minor value to version a document with the PUT method on the Document ID

Regards

Kevin_Leturc
Star Contributor
Star Contributor

Hello,

You can indeed use the automation operation or the header that Greg proposed to manually version a document. In your case, it seems that the automatic versioning is triggered.

Once you have a version, you can use the operation Document.GetVersions to get a list of versions for the given document, usage is such as below:

Documents versions = nuxeoClient.operation("Document.GetVersions").input("ID_OR_PATH").execute();

Regards.

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.