Package com.logicaldoc.webservice.rest
Interface DocumentService
- All Known Implementing Classes:
RestDocumentService
,RestDocumentSwagger
@Consumes({"application/xml","application/json"})
@Produces("application/json")
public interface DocumentService
-
Method Summary
Modifier and TypeMethodDescriptionAdds a new note for the given documentvoid
checkin
(String docId, String comment, String release, String filename, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Check-in an existing document Performs a check-in (commit) operation of new content over an existing document.void
checkout
(long docId) Executed the checkoutcopy
(long docId, long folderId, boolean links, boolean notes, boolean security) Copies a document into another foldercreate
(WSDocument document, org.apache.cxf.jaxrs.ext.multipart.Attachment contentDetail) Creates a new documentcreateAlias
(long docId, long folderId, String type) Creates a new document alias for the given document inside a specified foldercreateDownloadTicket
(long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads) Creates a new download ticketvoid
Creates the PDF conversion of the given document; if the PDF conversion was already created, nothing will happenvoid
createThumbnail
(long docId, String fileVersion, String type) Creates the thumbail of the given document; if the thumbnail was already created, nothing will happencreateViewTicket
(long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads, Integer maxViews) Creates a new download ticketvoid
delete
(long docId) Deletes a documentvoid
deleteLink
(long id) Removes an existing linkvoid
deleteNote
(long noteId) Deletes a new note by note identifierdeleteVersion
(long docId, String version) Deletes a version by document identifier and version ID.getAccessControlList
(long docId) Retrieves the access control listgetAliases
(long docId) Gets the aliases of the given documentjavax.activation.DataHandler
getContent
(long docId) Retrieves the file content of a document.getDocument
(long docId) Retrieves a document from the databasegetDocumentByCustomId
(String customId) Gets document metadata of an existing document with the given custom identifiergetDocuments
(List<Long> docIds) Gets document metadata of a collection of existing documents with the given identifiersgetExtractedText
(long docId) Gets the document's text stored in the full-text indexgetLinks
(long docId) Gets all the links of a specific documentgetNotes
(long docId) Gets the notes for the given documentgetRatings
(long docId) Gets all the ratings of the given documentgetRecentDocuments
(Integer maxHits) Lists of last modified documents of the current sessionjavax.activation.DataHandler
getResource
(long docId, String fileVersion, String suffix) Gets the content of a resource associated to the given document.javax.activation.DataHandler
getThumbnail
(String type, String docPath, List<javax.ws.rs.core.PathSegment> docPathList) Retrieves the thumbnail imagejavax.activation.DataHandler
getVersionContent
(long docId, String version) Retrieves the file content of a version.getVersions
(long docId) Gets the version history of an existing document with the given identifierboolean
isDownload
(long docId) Tests if a document is downloadable.boolean
Tests if the current user has a specific permission on a documentboolean
isRead
(long docId) Tests if a document is readable.boolean
isWrite
(long docId) Tests if a document is writableCreates a new link between two documents.list
(long folderId) Lists the documents in a folderlistDocuments
(long folderId, String fileName) Lists the documents in a folderlistPaginated
(long folderId, String fileName, String sort, Integer page, Integer max) Gets the documents in a specific foldervoid
lock
(long docId) Locks an existing document with the given identifier.void
move
(long docId, long folderId) Moves an existing document with the given identifiervoid
promoteVersion
(long docId, String version) Promotes an old version to the current default one.rateDocument
(long docId, int vote) Puts a new rating on the given documentvoid
Re-indexes(or indexes from scratch) a documentvoid
Renames the title of an existing document with the given identifier.void
replaceFile
(Integer docId, String fileVersion, String comment, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Replace the file of a version.void
restore
(long docId, long folderId) Restores a deleted documentAdds a new note for the given documentvoid
Sends a set of documents as mail attachmentsvoid
setAccessControlList
(long docId, List<WSAccessControlEntry> acl) Sets the Access Control Listvoid
setPassword
(long docId, String password) Puts a password protection to the documentvoid
unlock
(long docId) Unlocks an existing document with the given identifier.boolean
Unprotects a document that is password protected.void
unsetPassword
(long docId, String currentPassword) Removes the password protection from the documentvoid
update
(WSDocument document) Updates an existing document with the value object containing the document's metadata.upload
(String docId, String folderId, String release, String filename, String language, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Uploads a document Creates or updates an existing document, if used in update mode docId must be provided, when used in create mode folderId is required.void
uploadResource
(Integer docId, String fileVersion, String suffix, org.apache.cxf.jaxrs.ext.multipart.Attachment contentDetail) Uploads a new resource of the document Uploads a new resource attached to the given document.
-
Method Details
-
create
@POST @Path("/create") @Consumes("multipart/form-data") @Produces("application/json") WSDocument create(WSDocument document, org.apache.cxf.jaxrs.ext.multipart.Attachment contentDetail) Creates a new document- Parameters:
document
- the document's metadatacontentDetail
- the file binaries- Returns:
- data structure representing the created document
-
getDocument
@GET @Path("/getDocument") @Produces({"application/json","application/xml"}) WSDocument getDocument(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Retrieves a document from the database- Parameters:
docId
- identifier of the document- Returns:
- the document object representation
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
checkout
@POST @Path("/checkout") @Consumes("application/x-www-form-urlencoded") void checkout(@FormParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Executed the checkout- Parameters:
docId
- identifier of the document- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
checkin
@POST @Path("/checkin") @Consumes("multipart/form-data") void checkin(String docId, String comment, String release, String filename, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Check-in an existing document Performs a check-in (commit) operation of new content over an existing document. The document must be in checked-out status- Parameters:
docId
- identifier of the documentcomment
- version commentrelease
- it this is a major version or notfilename
- filename of the documentfiledataDetail
- binary content of the file
-
replaceFile
@POST @Path("/replaceFile") @Consumes("multipart/form-data") void replaceFile(Integer docId, String fileVersion, String comment, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Replace the file of a version. Replaces the file associated to a given version.- Parameters:
docId
- identifier of the documentcomment
- version commentfileVersion
- the file versionfiledataDetail
- binary content of the file
-
upload
@POST @Path("/upload") @Consumes("multipart/form-data") Long upload(String docId, String folderId, String release, String filename, String language, org.apache.cxf.jaxrs.ext.multipart.Attachment filedataDetail) Uploads a document Creates or updates an existing document, if used in update mode docId must be provided, when used in create mode folderId is required. Returns the ID of the created/updated document. <br/>Example: curl -u admin:admin -H ''Accept: application/json'' -X POST -F folderId=4 -F filename=newDoc.txt -F filedata=@newDoc.txt http://localhost:8080/services/rest/document/upload- Parameters:
docId
- identifier of the document (string format)folderId
- identifier of the folderrelease
- if the upload must produce a major release or nowfilename
- name of the filelanguage
- the document's languagefiledataDetail
- the binary content- Returns:
- identifier of the updated document
-
delete
@DELETE @Path("/delete") void delete(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Deletes a document- Parameters:
docId
- identifier of the document to delete- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
list
@GET @Path("/list") @Produces("application/json") List<WSDocument> list(@QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Lists the documents in a folder- Parameters:
folderId
- identifier of the folder- Returns:
- array of documents contained in the folder
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
listPaginated
@GET @Path("/listPaginated") @Produces("application/json") List<WSDocument> listPaginated(@QueryParam("folderId") long folderId, @QueryParam("fileName") String fileName, @QueryParam("sort") String sort, @QueryParam("page") Integer page, @QueryParam("max") Integer max) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Gets the documents in a specific folder- Parameters:
folderId
- The folder idfileName
- Optional file name filtersort
- Optional sort criteriapage
- Optional page numbermax
- Optional maximum number of elements per page- Returns:
- Collection of documents
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- Error in the webserviceAuthenticationException
- Invalid sessionPermissionException
- The user does not have the required permission
-
listDocuments
@GET @Path("/listDocuments") List<WSDocument> listDocuments(@QueryParam("folderId") long folderId, @QueryParam("fileName") String fileName) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Lists the documents in a folder- Parameters:
folderId
- identifier of the folderfileName
- a file name to use as filter- Returns:
- array of documents contained in the folder
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
update
@PUT @Path("/update") void update(WSDocument document) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Updates an existing document with the value object containing the document's metadata.- Parameters:
document
- the document to update- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
getContent
@GET @Path("/getContent") @Produces("application/octet-stream") javax.activation.DataHandler getContent(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Retrieves the file content of a document.- Parameters:
docId
- identifier of the document- Returns:
- the contents
- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
getVersionContent
@GET @Path("/getVersionContent") @Produces("application/octet-stream") javax.activation.DataHandler getVersionContent(@QueryParam("docId") long docId, @QueryParam("version") String version) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Retrieves the file content of a version.- Parameters:
docId
- identifier of the documentversion
- version specification- Returns:
- the contents
- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
addNote
@POST @Path("/addNote") @Consumes("application/x-www-form-urlencoded") WSNote addNote(@FormParam("docId") long docId, @FormParam("note") String note) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Adds a new note for the given document- Parameters:
docId
- identifier of the documentnote
- the note to add- Returns:
- the added note
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
deleteNote
@DELETE @Path("/deleteNote") void deleteNote(@QueryParam("noteId") long noteId) throws AuthenticationException, WebserviceException, PersistenceException Deletes a new note by note identifier- Parameters:
noteId
- identifier of the note- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
getNotes
@GET @Path("/getNotes") List<WSNote> getNotes(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Gets the notes for the given document- Parameters:
docId
- identifier of the document- Returns:
- List of notes
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
rateDocument
@PUT @Path("/rateDocument") WSRating rateDocument(@QueryParam("docId") long docId, @QueryParam("vote") 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 voted document
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
getRatings
@GET @Path("/getRatings") List<WSRating> getRatings(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Gets all the ratings of the given document- Parameters:
docId
- identifier of the document- Returns:
- the ratings
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
deleteVersion
@DELETE @Path("/deleteVersion") String deleteVersion(@QueryParam("docId") long docId, @QueryParam("version") String version) throws AuthenticationException, WebserviceException, PersistenceException Deletes a version by document identifier and version ID. You can not delete the latest version of a document- Parameters:
docId
- identifier of the documentversion
- the document's version- Returns:
- the latest version of the document
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
move
@PUT @Path("/move") void move(@QueryParam("docId") long docId, @QueryParam("folderId") long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Moves an existing document with the given identifier- Parameters:
docId
- The document idfolderId
- Identifier of the new document's folder- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The requested document does not exist
-
copy
@PUT @Path("/copy") @Produces("application/json") WSDocument copy(@QueryParam("docId") long docId, @QueryParam("folderId") long folderId, @QueryParam("links") boolean links, @QueryParam("notes") boolean notes, @QueryParam("security") boolean security) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Copies a document into another folder- Parameters:
docId
- The document idfolderId
- Identifier of the new document's folderlinks
- If links must be copied toonotes
- If notes and annotations must be copied too- Returns:
- The new copy
- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
createThumbnail
@PUT @Path("/createThumbnail") void createThumbnail(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion, @QueryParam("type") String type) throws AuthenticationException, WebserviceException, PersistenceException, IOException Creates the thumbail of the given document; if the thumbnail was already created, nothing will happen- Parameters:
docId
- The document idfileVersion
- The specific file version(it can be empty)type
- The thumbnail type(eg: thumbnail, tile, mobile)- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
getThumbnail
@GET @Path("/thumbnail/{type}/{docpath:.*}") @Produces("image/jpeg") javax.activation.DataHandler getThumbnail(@PathParam("type") String type, @PathParam("docpath") String docPath, @PathParam("docpath") List<javax.ws.rs.core.PathSegment> docPathList) throws AuthenticationException, WebserviceException, PersistenceException, IOException, PermissionException Retrieves the thumbnail image- Parameters:
type
- type of the thumbnaildocPath
- path of the documentdocPathList
- path of the document- Returns:
- image content
- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
createPdf
@PUT @Path("/createPdf") void createPdf(@QueryParam("docId") long docId, @QueryParam("fileVersion") String fileVersion) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Creates the PDF conversion of the given document; if the PDF conversion was already created, nothing will happen- Parameters:
docId
- The document idfileVersion
- The specific file version(it can be empty)- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
promoteVersion
@PUT @Path("/promoteVersion") void promoteVersion(@QueryParam("docId") long docId, @QueryParam("version") String version) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException, UnexistingResourceException Promotes an old version to the current default one. If you promote a prior version, what it does is make it the default version again. (regardless of there being many versions).- Parameters:
docId
- the document to be updatedversion
- the version- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
rename
@PUT @Path("/rename") void rename(@QueryParam("docId") long docId, @QueryParam("name") String name) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Renames the title of an existing document with the given identifier.- Parameters:
docId
- The document idname
- The new document filename- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
getVersions
@GET @Path("/getVersions") List<WSDocument> getVersions(@QueryParam("docId") long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Gets the version history of an existing document with the given identifier- Parameters:
docId
- The document id- Returns:
- Array of versions
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
createAlias
@POST @Path("/createAlias") WSDocument createAlias(long docId, long folderId, String type) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Creates a new document alias for the given document inside a specified folder- Parameters:
docId
- The original document idfolderId
- Identifier of the folder in which will be stored the alias.type
- Type of the alias- Returns:
- The value object containing the document's metadata
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
createDownloadTicket
@POST @Path("/createDownloadTicket") @Consumes("application/x-www-form-urlencoded") String createDownloadTicket(long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Creates a new download ticket- Parameters:
docId
- identifier of the documentsuffix
- can be null or 'conversion.pdf'expireHours
- expiration time expressed in hoursexpireDate
- exact expiration date expressed in the format yyyy-MM-ddmaxDownloads
- maximum number of admitted downloads- Returns:
- the download ticket
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentialsPermissionException
- The user does not have the download permission
-
createViewTicket
@POST @Path("/createViewTicket") @Consumes("application/x-www-form-urlencoded") String createViewTicket(long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads, Integer maxViews) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Creates a new download ticket- Parameters:
docId
- identifier of the documentsuffix
- can be null or 'conversion.pdf'expireHours
- expiration time expressed in hoursexpireDate
- exact expiration date expressed in the format yyyy-MM-ddmaxDownloads
- maximum number of admitted downloadsmaxViews
- maximum number of admitted views- Returns:
- the download ticket
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentialsPermissionException
- The user does not have the download permission
-
deleteLink
@DELETE @Path("/deleteLink") void deleteLink(long id) throws AuthenticationException, WebserviceException, PersistenceException Removes an existing link- Parameters:
id
- ID of the link- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
getAliases
@GET @Path("/getAliases") List<WSDocument> getAliases(long docId) throws AuthenticationException, WebserviceException, PersistenceException Gets the aliases of the given document- Parameters:
docId
- The master document ID- Returns:
- List of aliases
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
getDocumentByCustomId
@GET @Path("/getDocumentByCustomId") WSDocument getDocumentByCustomId(String customId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Gets document metadata of an existing document with the given custom identifier- Parameters:
customId
- The custom id- Returns:
- A value object containing the document's metadata
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
getDocuments
@GET @Path("/getDocuments") List<WSDocument> getDocuments(List<Long> docIds) throws AuthenticationException, WebserviceException, PersistenceException Gets document metadata of a collection of existing documents with the given identifiers- Parameters:
docIds
- identifiers of the documents- Returns:
- the list of documents
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
getExtractedText
@GET @Path("/getExtractedText") @Produces("text/plain") String getExtractedText(long docId) throws AuthenticationException, WebserviceException, PersistenceException Gets the document's text stored in the full-text index- Parameters:
docId
- The document id- Returns:
- The requested document's text
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
getRecentDocuments
@GET @Path("/getRecentDocuments") List<WSDocument> getRecentDocuments(Integer maxHits) throws AuthenticationException, WebserviceException, PersistenceException Lists of last modified documents of the current session- Parameters:
maxHits
- Maximum number of returned records- Returns:
- List of documents
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
getLinks
@GET @Path("/getLinks") List<WSLink> getLinks(long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException Gets all the links of a specific document- Parameters:
docId
- ID of the document- Returns:
- The new links of the document
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
getResource
@GET @Path("/getResource") @Produces("application/octet-stream") javax.activation.DataHandler getResource(long docId, String fileVersion, String suffix) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Gets the content of a resource associated to the given document.- Parameters:
docId
- The document idfileVersion
- The specific file version(it can be empty)suffix
- Suffix specification(it can be empty, conversion.pdf to get the PDF conversion)- Returns:
- The requested resource's binary
- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
link
WSLink link(long doc1, long doc2, String type) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Creates a new link between two documents.- Parameters:
doc1
- ID of document 1doc2
- ID of document 2type
- The link type(it can be empty)- Returns:
- the new link
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
lock
void lock(long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Locks an existing document with the given identifier.- Parameters:
docId
- The document id- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
reindex
void reindex(long docId, String content) throws AuthenticationException, ParsingException, WebserviceException, PersistenceException Re-indexes(or indexes from scratch) a document- Parameters:
docId
- The document idcontent
- The content to be used (if null the file is parsed)- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceParsingException
- Error parsing the contentAuthenticationException
- Invalid credentials
-
uploadResource
@POST @Path("/uploadResource") @Consumes("multipart/form-data") void uploadResource(Integer docId, String fileVersion, String suffix, org.apache.cxf.jaxrs.ext.multipart.Attachment contentDetail) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException Uploads a new resource of the document Uploads a new resource attached to the given document. If the resource already exists it is overwritten- Parameters:
docId
- identifier of the documentfileVersion
- version of the filesuffix
- suffix specificationcontentDetail
- file content- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentials
-
restore
void restore(long docId, long folderId) throws AuthenticationException, WebserviceException, PersistenceException Restores a deleted document- Parameters:
docId
- The document idfolderId
- Id of the folder in which the document must be restored- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
saveNote
WSNote saveNote(long docId, WSNote note) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Adds a new note for the given document- Parameters:
docId
- identifier of the documentnote
- the note to add- Returns:
- the added note
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
sendEmail
void sendEmail(List<Long> docIds, String recipients, String subject, String message) throws AuthenticationException, WebserviceException, PersistenceException, IOException, javax.mail.MessagingException Sends a set of documents as mail attachments- Parameters:
docIds
- Set of document identifiersrecipients
- Set of recipients(comma separated)subject
- The email subjectmessage
- The email message body- Throws:
IOException
- I/O errorPersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentialsjavax.mail.MessagingException
- Error in the communication with the mail server
-
setPassword
void setPassword(long docId, String password) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Puts a password protection to the document- Parameters:
docId
- identifier of the documentpassword
- the new password- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
unlock
void unlock(long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Unlocks an existing document with the given identifier.- Parameters:
docId
- identifier of the document- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
unprotect
boolean unprotect(long docId, String password) throws PersistenceException, AuthenticationException, WebserviceException Unprotects a document that is password protected. If the given password is right, the document remains unprotected for the duration of the session- Parameters:
docId
- identifier of the documentpassword
- the password- Returns:
- was it uprotected?
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid session
-
unsetPassword
void unsetPassword(long docId, String currentPassword) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Removes the password protection from the document- Parameters:
docId
- identifier of the documentcurrentPassword
- the password- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServicePermissionException
- The current user does not have enough permissionsAuthenticationException
- Invalid credentialsUnexistingResourceException
- The specified document does not exist
-
setAccessControlList
@PUT @Path("/setAccessControlList") void setAccessControlList(@QueryParam("docId") long docId, List<WSAccessControlEntry> acl) throws PersistenceException, PermissionException, AuthenticationException, WebserviceException Sets the Access Control List- Parameters:
docId
- Document idacl
- the complete Access Control List- Throws:
PersistenceException
- Error in the databaseWebserviceException
- Error in the webserviceAuthenticationException
- Invalid sessionPermissionException
- The user does not have the required permission
-
getAccessControlList
@GET @Path("/getAccessControlList") List<WSAccessControlEntry> getAccessControlList(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Retrieves the access control list- Parameters:
docId
- Document id- Returns:
- 'error' if error occurred, the right objects collection
- Throws:
PermissionException
- The permission has not been grantedPersistenceException
- Error in the databaseWebserviceException
- Error in the webserviceAuthenticationException
- Invalid session
-
isRead
@GET @Path("/isRead") boolean isRead(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException Tests if a document is readable.- Parameters:
docId
- The document id- Returns:
- True if the identifier denotes a readable document, otherwise false.
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
isDownload
@GET @Path("/isDownload") boolean isDownload(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException Tests if a document is downloadable.- Parameters:
docId
- The document id- Returns:
- True if the identifier denotes a downloadable document, otherwise false.
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
isWrite
@GET @Path("/isWrite") boolean isWrite(@QueryParam("docId") long docId) throws AuthenticationException, WebserviceException, PersistenceException Tests if a document is writable- Parameters:
docId
- The document id- Returns:
- True if the identifier denotes a writable document, otherwise false
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-
isGranted
@GET @Path("/isGranted") boolean isGranted(@QueryParam("docId") long docId, @QueryParam("permission") String permission) throws AuthenticationException, WebserviceException, PersistenceException Tests if the current user has a specific permission on a document- Parameters:
docId
- The document idpermission
- The permission to check (eg: 'read', 'write', ...)- Returns:
- True if the identifier denotes a granted permission, otherwise false
- Throws:
PersistenceException
- Error in the databaseWebserviceException
- A generic error in the WebServiceAuthenticationException
- Invalid credentials
-