I am a bit confused, as to how I would go about updating the version of a document by using REST in Java.
I am using LogicalDOC Community Edition, and through Eclipse, I am able to CRUD folders, create, read, update (just the metadata), and delete documents.
But how do I actually upload a new version of a document? I have found check in, checkout etc. methods in a DocumentService class, but is this what I am supposed to be using?
I have access to:
RestDocumentClient.create: Creates a new document
RestDocumentClient.getDocument: Gets a document
RestDocumentClient.delete: Deletes a document
RestDocumentClient.update: Updates ONLY the metadata of a document? I am confused.
Thank you
Java REST upload new version of document?
Moderator: car031
Post
Re: Java REST upload new version of document?
Hi,
RestDocumentClient currently allows to update the document metadata, but doesn't have a method to update the content of a document.
Though the DocumentService interface (com.logicaldoc.webservice.rest.DocumentService) exposes some of methods that allows to update the content (file) of a document in 2 ways:
1) via versioning checkout/checking methods
2) using the method upload
That methods are implemented by the class RestDocumentService (com.logicaldoc.webservice.rest.endpoint.RestDocumentService)
So using Apache HttpClient 4.5.2 you can invoke directly the methods in RestDocumentService https://hc.apache.org/httpcomponents-cl ... index.html
See also the attached class (from logicaldoc-webservice package)
RestDocumentClient currently allows to update the document metadata, but doesn't have a method to update the content of a document.
Though the DocumentService interface (com.logicaldoc.webservice.rest.DocumentService) exposes some of methods that allows to update the content (file) of a document in 2 ways:
1) via versioning checkout/checking methods
2) using the method upload
That methods are implemented by the class RestDocumentService (com.logicaldoc.webservice.rest.endpoint.RestDocumentService)
So using Apache HttpClient 4.5.2 you can invoke directly the methods in RestDocumentService https://hc.apache.org/httpcomponents-cl ... index.html
See also the attached class (from logicaldoc-webservice package)
- Attachments
-
- HttpRestWb.zip
- (2.98 KiB) Downloaded 217 times
Post
Re: Java REST upload new version of document?
Thank you for the response, shatzing
It took me a minute to understand how all this stuff fits together, but I figured it out now, and I think I would be able to use this HttpClient to run all the REST methods from now on!
Have a nice day
It took me a minute to understand how all this stuff fits together, but I figured it out now, and I think I would be able to use this HttpClient to run all the REST methods from now on!
Have a nice day
Who is online
Users browsing this forum: No registered users and 82 guests