cancel
Showing results for 
Search instead for 
Did you mean: 

Automation Client - retrieve document versions

debbbole_
Champ in-the-making
Champ in-the-making

Hi@all 🙂

I'm creating/updating documents remotely on a Nuxeo repository using Automation Client (I'm using Nuxeo 5.6). How can i find the versions of a document using Automation Client? And how can i retrieve the content of a specific version of a document?

1 REPLY 1

Fred_Vadon
Star Contributor
Star Contributor

Hi!

There is no automation operation that get versions of one document (maybe it should). Anyway, you can get away with a run script operation

Here is an example of script that get all published versions of a document (proxies) and remove them :

proxies = Session.getProxies(new org.nuxeo.ecm.core.api.IdRef(Document.id),null);
for(proxy : proxies)
{ Session.removeDocument(proxy.getRef()); }

In your case, you are not looking for proxies but versions, so it should be something like : version = Session.GetVersions(....

For more informations of what methods are available with the object Session, you can take a look at: CoreSession You will see that they are several methods to get the versions of a document depending on what you plan to do with it (just need the refs or all document models).

Fred

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.