Versions

Do you want to create a native client or integrate with third party applications: webservices are the solution.

Moderator: car031

Rabbit80
Posts: 29
Joined: Mon Oct 04, 2010 3:18 pm

Versions

Tue Apr 10, 2012 4:55 pm

When I try do download a previous version of a document, I get a "Fault occurred whilst processing" error.

I can use the getVersions command fine to retrieve the metadata, it is the getContent command that throws the exception when I provide it with the Id for a previous version of a document.

The logs in LD record the following: org.apache.cxf.phase.PhaseInterceptorChain Application
{http://document.webservice.logicaldoc.c ... getContent has thrown exception, unwinding now: java.lang.NullPointerException: null

Is what I am trying to achieve possible - ie retrieving a specific version of a document?

Cheers

Shane
mmeschieri
Posts: 242
Joined: Mon Apr 19, 2010 3:40 pm

Re: Versions

Tue Apr 10, 2012 5:10 pm

The getContent is able to retrieve just the actual document's file. So you must use the ID of an existing document (not version ID)
Rabbit80
Posts: 29
Joined: Mon Oct 04, 2010 3:18 pm

Re: Versions

Wed Apr 11, 2012 8:44 am

So - is it not possible to recover the previous versions of a document via webservices then?
agaspa
Posts: 714
Joined: Tue Apr 20, 2010 8:24 am

Re: Versions

Wed Apr 11, 2012 9:02 am

Yes, correct.
Actually (LD version 6.4) using web-services you can get the information about the versions of a document but you can't get the content of an old version.
This is indeed a lack, but so far we still had not received requests regarding this aspect...
However this thing is not particularly complicated, so I think that we will put in the development stack very soon.
If you want you can also use our issue tracker to report the feature request.
Rabbit80
Posts: 29
Joined: Mon Oct 04, 2010 3:18 pm

Re: Versions

Wed Apr 11, 2012 11:09 am

I guess whilst it is desirable, there is a fairly straightforward workaround..

I can simply generate a link in the form "http://<servername:port>/logicaldoc/download?sid=<sessionId>&docId=<customID>&versionID=<ID>&open=true" and download the doc from there.
agaspa
Posts: 714
Joined: Tue Apr 20, 2010 8:24 am

Re: Versions

Wed Apr 11, 2012 11:51 am

Actually I had not thought of this possibility.
Congratulations !
The URL address you suggested is the one of the download servlet that is always available and can be used to get the content of an old version of a document.
This is a really stable servlet as it's used primarily by the GUI of the software to download document content and also content of old versions.
agaspa
Posts: 714
Joined: Tue Apr 20, 2010 8:24 am

Re: Versions

Wed Apr 11, 2012 12:06 pm

Be aware only that the address composition is a little different:
you should use the documentID and not the customID cause they may be different and have different purposes.
Also you must use the proper versionId
"http://<servername:port>/logicaldoc/download?sid=<sessionId>&docId=<documentID>&versionId=<versionID>&open=true"

(You can get the version of a document from webservices using documentClient getVersions(String sid, long docId) method
http://wiki.logicaldoc.com/wiki/Documen ... g_docId.29
Rabbit80
Posts: 29
Joined: Mon Oct 04, 2010 3:18 pm

Re: Versions

Thu Apr 12, 2012 10:41 am

OK - I'll correct my code.

Thanks for that!

Return to “Web Services”

Who is online

Users browsing this forum: No registered users and 19 guests