Class RestDocumentClient
java.lang.Object
com.logicaldoc.webservice.rest.client.AbstractRestClient<DocumentService>
com.logicaldoc.webservice.rest.client.RestDocumentClient
-
Constructor Summary
ConstructorDescriptionRestDocumentClient
(String endpoint, String apiKey) RestDocumentClient
(String endpoint, String apiKey, int timeout) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
checkout
(long docId) create
(WSDocument document, File packageFile) create
(WSDocument document, javax.activation.DataHandler dataHandler) void
void
createThumbnail
(long docId, String fileVersion, String type) 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) getDocument
(long docId) getNotes
(long docId) Gets the notes for the given documentgetRatings
(long docId) Gets all the ratings of the given documentjavax.activation.DataHandler
getVersionContent
(long docId, String version) list
(long folderId) listDocuments
(long folderId, String fileName) listPaginated
(long folderId, String fileName, String sort, Integer page, Integer max) rateDocument
(long docId, int vote) Puts a new rating on the given documentvoid
update
(WSDocument document)
-
Constructor Details
-
RestDocumentClient
-
RestDocumentClient
-
-
Method Details
-
create
- Throws:
FileNotFoundException
-
create
-
list
public List<WSDocument> list(long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
listPaginated
public List<WSDocument> listPaginated(long folderId, String fileName, String sort, Integer page, Integer max) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
listDocuments
public List<WSDocument> listDocuments(long folderId, String fileName) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
getDocument
public WSDocument getDocument(long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
delete
public void delete(long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
getContent
public javax.activation.DataHandler getContent(long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException -
getVersionContent
public javax.activation.DataHandler getVersionContent(long docId, String version) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException -
checkout
public void checkout(long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException -
update
public void update(WSDocument document) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException -
checkin
public void checkin(long docId, String comment, Boolean release, File packageFile) throws FileNotFoundException - Throws:
FileNotFoundException
-
addNote
public WSNote addNote(long docId, String note) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException -
deleteNote
public void deleteNote(long noteId) throws AuthenticationException, WebserviceException, PersistenceException Adds a new note for the given document- Parameters:
noteId
- identifier of the note- Throws:
PersistenceException
- Error in the data layerWebserviceException
- Error in the Webservice layerAuthenticationException
- Authentication issue
-
deleteVersion
public void deleteVersion(long docId, String version) throws AuthenticationException, WebserviceException, PersistenceException Adds a new note for the given document- Parameters:
docId
- identifier of the documentversion
- document's version- Throws:
PersistenceException
- Error in the data layerWebserviceException
- Error in the Webservice layerAuthenticationException
- Authentication issue
-
getNotes
public List<WSNote> getNotes(long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Gets the notes for the given document- Parameters:
docId
- identifier of the document- Returns:
- list of ratings
- Throws:
PersistenceException
- Error in the data layerWebserviceException
- Error in the Webservice layerAuthenticationException
- Authentication issuePermissionException
- Not enough permissionsUnexistingResourceException
- The specified document does not exist
-
rateDocument
public WSRating rateDocument(long docId, int vote) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Puts a new rating on the given document- Parameters:
docId
- identifier of the documentvote
- the vote- Returns:
- the rating
- Throws:
PersistenceException
- Error in the data layerWebserviceException
- Error in the Webservice layerAuthenticationException
- Authentication issuePermissionException
- Not enough permissionsUnexistingResourceException
- The specified document does not exist
-
getRatings
public List<WSRating> getRatings(long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Gets all the ratings of the given document- Parameters:
docId
- identifier of the document- Returns:
- array of ratings
- Throws:
PersistenceException
- Error in the data layerWebserviceException
- Error in the Webservice layerAuthenticationException
- Authentication issuePermissionException
- Not enough permissionsUnexistingResourceException
- The specified document does not exist
-
createPdf
public void createPdf(long docId, String fileVersion) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException -
createThumbnail
public void createThumbnail(long docId, String fileVersion, String type) throws AuthenticationException, WebserviceException, PersistenceException, IOException
-