Class RestDocumentClient
- java.lang.Object
-
- com.logicaldoc.webservice.rest.client.AbstractRestClient
-
- com.logicaldoc.webservice.rest.client.RestDocumentClient
-
public class RestDocumentClient extends AbstractRestClient
-
-
Constructor Summary
Constructors Constructor Description RestDocumentClient(String endpoint, String username, String password)
RestDocumentClient(String endpoint, String username, String password, int timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WSNote
addNote(long docId, String note)
String
checkin(long docId, String comment, Boolean release, File packageFile)
void
checkout(long docId)
WSDocument
create(WSDocument document, File packageFile)
WSDocument
create(WSDocument document, javax.activation.DataHandler dataHandler)
void
createPdf(long docId, String fileVersion)
void
createThumbnail(long docId, String fileVersion)
void
delete(long docId)
void
deleteNote(long noteId)
Adds a new note for the given documentvoid
deleteVersion(long docId, String version)
Adds a new note for the given documentjavax.activation.DataHandler
getContent(long docId)
WSDocument
getDocument(long docId)
WSNote[]
getNotes(long docId)
Gets the notes for the given documentWSRating[]
getRatings(long docId)
Gets all the ratings of the given documentjavax.activation.DataHandler
getVersionContent(long docId, String version)
WSDocument[]
list(long folderId)
WSDocument[]
listDocuments(long folderId, String fileName)
WSRating
rateDocument(long docId, int vote)
Puts a new rating on the given documentvoid
update(WSDocument document)
-
-
-
Method Detail
-
create
public WSDocument create(WSDocument document, File packageFile) throws Exception
- Throws:
Exception
-
create
public WSDocument create(WSDocument document, javax.activation.DataHandler dataHandler) throws Exception
- Throws:
Exception
-
list
public WSDocument[] list(long folderId) throws Exception
- Throws:
Exception
-
listDocuments
public WSDocument[] listDocuments(long folderId, String fileName) throws Exception
- Throws:
Exception
-
getDocument
public WSDocument getDocument(long docId) throws Exception
- Throws:
Exception
-
getContent
public javax.activation.DataHandler getContent(long docId) throws Exception
- Throws:
Exception
-
getVersionContent
public javax.activation.DataHandler getVersionContent(long docId, String version) throws Exception
- Throws:
Exception
-
update
public void update(WSDocument document) throws Exception
- Throws:
Exception
-
checkin
public String checkin(long docId, String comment, Boolean release, File packageFile) throws Exception
- Throws:
Exception
-
deleteNote
public void deleteNote(long noteId) throws Exception
Adds a new note for the given document- Parameters:
noteId
- identifier of the note- Throws:
Exception
- error in the server application
-
deleteVersion
public void deleteVersion(long docId, String version) throws Exception
Adds a new note for the given document- Parameters:
docId
- identifier of the documentversion
- document's version- Throws:
Exception
- error in the server application
-
getNotes
public WSNote[] getNotes(long docId) throws Exception
Gets the notes for the given document- Parameters:
docId
- identifier of the document- Returns:
- array of ratings
- Throws:
Exception
- error in the server application
-
rateDocument
public WSRating rateDocument(long docId, int vote) throws Exception
Puts a new rating on the given document- Parameters:
docId
- identifier of the documentvote
- the vote- Returns:
- the rating
- Throws:
Exception
- error in the server application
-
getRatings
public WSRating[] getRatings(long docId) throws Exception
Gets all the ratings of the given document- Parameters:
docId
- identifier of the document- Returns:
- array of ratings
- Throws:
Exception
- error in the server application
-
-