Class SoapDocumentService
java.lang.Object
com.logicaldoc.webservice.AbstractService
com.logicaldoc.webservice.soap.endpoint.SoapDocumentService
- All Implemented Interfaces:
DocumentService
- Direct Known Subclasses:
RestDocumentService
Document Web Service Implementation (SOAP)
- Since:
- 5.2
- Author:
- Matteo Caruso - LogicalDOC
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionAdds a new note for the given documentvoid
checkin
(String sid, long docId, String comment, String filename, boolean release, WSDocument docVO, InputStream content) void
checkin
(String sid, long docId, String comment, String filename, boolean release, javax.activation.DataHandler content) Checks in an existing document with the given identifier to create a new version.void
checkinDocument
(String sid, long docId, String comment, String filename, boolean release, WSDocument docVO, InputStream content) void
checkinDocument
(String sid, long docId, String comment, String filename, boolean release, WSDocument docVO, javax.activation.DataHandler content) Checks in an existing document with the given identifier to create a new version.void
Checks out an existing document with the given identifier.Copies a document into another folder.create
(String sid, WSDocument document, InputStream content) create
(String sid, WSDocument document, javax.activation.DataHandler content) Create a new document.createAlias
(String sid, long docId, long folderId, String type) Creates a new document alias for the given document inside a specified foldercreateDownloadTicket
(String sid, long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads) Creates a new download ticketvoid
Creates the PDF conversion of the given document.void
createThumbnail
(String sid, long docId, String fileVersion, String type) Creates the thumbnail of the given document.createViewTicket
(String sid, long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads, Integer maxViews) Creates a new view ticketvoid
Deletes an existing document with the given identifier.void
deleteLink
(String sid, long id) Removes an existing linkvoid
deleteNote
(String sid, long noteId) Adds a new note for the given documentdeleteVersion
(String sid, long docId, String version) Deletes a version of a document with the given identifiers.getAccessControlList
(String sid, long docId) Retrieves the access control listgetAliases
(String sid, long docId) Gets the aliases of the given documentjavax.activation.DataHandler
getContent
(String sid, long docId) Gets the content of an existing document with the given identifiergetDocument
(String sid, long docId) Gets the metadata of an existing document with the given identifiergetDocumentByCustomId
(String sid, String customId) Gets document metadata of an existing document with the given custom identifiergetDocuments
(String sid, List<Long> docIds) Gets document metadata of a collection of existing documents with the given identifiersgetExtractedText
(String sid, long docId) Gets the document's text stored in the full-text indexGets all the links of a specific documentGets the notes for the given documentgetRatings
(String sid, long docId) Gets all the ratings of the given documentgetRecentDocuments
(String sid, Integer max) Lists of last modified documents of the current session.javax.activation.DataHandler
getResource
(String sid, long docId, String fileVersion, String suffix) Gets the content of a resource associated to the given document.getVersion
(String sid, long docId, String version) Gets a specific versionjavax.activation.DataHandler
getVersionContent
(String sid, long docId, String version) Gets the content of a specific version of a documentgetVersions
(String sid, long docId) Gets the version history of an existing document with the given identifierboolean
isDownload
(String sid, long docId) Tests if a document is downloadableboolean
Tests if the current user has a specific permission on a documentboolean
Tests if a document is readable.boolean
Tests if a document is writableCreates a new link between two documents.listDocuments
(String sid, long folderId, String fileName) Gets the documents in a specific foldervoid
Locks an existing document with the given identifier.void
Moves an existing document with the given identifier.void
promoteVersion
(String sid, long docId, String version) Promotes an old version to the current default one.rateDocument
(String sid, 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
(String sid, long docId, String fileVersion, String comment, javax.activation.DataHandler content) Replaces the file associated to a given version.void
Restores a deleted documentAdds a new note for the given documentvoid
Sends a set of documents as mail attachmentsvoid
setAccessControlList
(String sid, long docId, List<WSAccessControlEntry> acl) Sets the Access Control Listvoid
setPassword
(String sid, long docId, String password) Puts a password protection to the documentvoid
Unlocks an existing document with the given identifier.boolean
Unprotects a document that is password protected.void
unsetPassword
(String sid, long docId, String currentPassword) Removes the password protection from the documentvoid
update
(String sid, WSDocument document) Updates an existing document with the value object containing the document's metadatalong
upload
(String sid, Long docId, Long folderId, boolean release, String filename, String language, javax.activation.DataHandler content) Creates a new document or updates an existing one.void
uploadResource
(String sid, long docId, String fileVersion, String suffix, javax.activation.DataHandler content) Uploads a new resource attached to the given document.Methods inherited from class com.logicaldoc.webservice.AbstractService
convertDateToString, convertStringToDate, getCurrentMessage, isValidateSession, setCurrentMessage, setValidateSession
-
Constructor Details
-
SoapDocumentService
public SoapDocumentService()
-
-
Method Details
-
create
public WSDocument create(String sid, WSDocument document, javax.activation.DataHandler content) throws IOException, AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Create a new document. The user can completely customize the document through a value object containing the document's metadata- Specified by:
create
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocument
- Web service value object containing the document's metadatacontent
- The document's binary content- Returns:
- The value object containing the document's metadata
- Throws:
IOException
- I/O errorAuthenticationException
- Invalid sessionPermissionException
- The user does not have the required permissionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
create
public WSDocument create(String sid, WSDocument document, InputStream content) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException -
checkinDocument
public void checkinDocument(String sid, long docId, String comment, String filename, boolean release, WSDocument docVO, InputStream content) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException -
checkinDocument
public void checkinDocument(String sid, long docId, String comment, String filename, boolean release, WSDocument docVO, javax.activation.DataHandler content) throws IOException, AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Checks in an existing document with the given identifier to create a new version.- Specified by:
checkinDocument
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idcomment
- The check in operation commentfilename
- The document file namerelease
- True if this is a new release(e.g.: 2.0) rather than a subversion(e.g.: 1.1)docVO
- metadata for the documentcontent
- The document's binary content- Throws:
IOException
- I/O errorAuthenticationException
- Invalid sessionPermissionException
- The user does not have the required permissionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
checkin
public void checkin(String sid, long docId, String comment, String filename, boolean release, javax.activation.DataHandler content) throws IOException, AuthenticationException, PermissionException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Checks in an existing document with the given identifier to create a new version.- Specified by:
checkin
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idcomment
- The check in operation commentfilename
- The document file namerelease
- True if this is a new release(eg: 2.0) rather than a subversion(eg: 1.1)content
- The document's binary content- Throws:
IOException
- I/O errorAuthenticationException
- Invalid sessionPermissionException
- The user does not have the required permissionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
checkin
public void checkin(String sid, long docId, String comment, String filename, boolean release, WSDocument docVO, InputStream content) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException -
checkout
public void checkout(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentService
Checks out an existing document with the given identifier.- Specified by:
checkout
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document id- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
delete
public void delete(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentService
Deletes an existing document with the given identifier.- Specified by:
delete
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document id- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
getContent
public javax.activation.DataHandler getContent(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException Description copied from interface:DocumentService
Gets the content of an existing document with the given identifier- Specified by:
getContent
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document id- Returns:
- The requested document's binary
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionIOException
- I/O error
-
getVersionContent
public javax.activation.DataHandler getVersionContent(String sid, long docId, String version) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException Description copied from interface:DocumentService
Gets the content of a specific version of a document- Specified by:
getVersionContent
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idversion
- The specific version(it can be empty)- Returns:
- The requested version's binary
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionIOException
- I/O error
-
getResource
public javax.activation.DataHandler getResource(String sid, long docId, String fileVersion, String suffix) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException Description copied from interface:DocumentService
Gets the content of a resource associated to the given document.- Specified by:
getResource
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- 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:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionIOException
- I/O error
-
createPdf
public void createPdf(String sid, long docId, String fileVersion) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException Description copied from interface:DocumentService
Creates the PDF conversion of the given document. If the conversion was already created, nothing will happen.- Specified by:
createPdf
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idfileVersion
- The specific file version(it can be empty)- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionIOException
- I/O error
-
createThumbnail
public void createThumbnail(String sid, long docId, String fileVersion, String type) throws AuthenticationException, WebserviceException, PersistenceException, IOException Description copied from interface:DocumentService
Creates the thumbnail of the given document. If the thumbnail was already created, nothing will happen.- Specified by:
createThumbnail
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- The document idfileVersion
- The specific file version(it can be empty)type
- The thumbnail type(eg: thumb, tile, mobile, thumbXXX where XXX is a resolution in pixels)- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databaseIOException
- I/O error
-
uploadResource
public void uploadResource(String sid, long docId, String fileVersion, String suffix, javax.activation.DataHandler content) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException Description copied from interface:DocumentService
Uploads a new resource attached to the given document. If the resource already exists it is overwritten.- Specified by:
uploadResource
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- The document idfileVersion
- The specific file version(it can be empty)suffix
- Suffix specification(it cannot be empty, use 'conversion.pdf' to put the PDF conversion)content
- The resource's binary content- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionIOException
- I/O error
-
getDocument
public WSDocument getDocument(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Gets the metadata of an existing document with the given identifier- Specified by:
getDocument
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document id- Returns:
- A value object containing the document's metadata
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- the required document does not exist
-
getDocumentByCustomId
public WSDocument getDocumentByCustomId(String sid, String customId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentService
Gets document metadata of an existing document with the given custom identifier- Specified by:
getDocumentByCustomId
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessioncustomId
- The custom id- Returns:
- A value object containing the document's metadata
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
lock
public void lock(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Locks an existing document with the given identifier.- Specified by:
lock
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document id- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The requested document does not exist
-
move
public void move(String sid, long docId, long folderId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Moves an existing document with the given identifier.- Specified by:
move
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idfolderId
- Identifier of the new document's folder- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
copy
public WSDocument copy(String sid, long docId, long folderId, boolean links, boolean notes, boolean security) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException Description copied from interface:DocumentService
Copies a document into another folder.- Specified by:
copy
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- 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 created copy
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionIOException
- I/O error
-
rename
public void rename(String sid, long docId, String name) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Renames the title of an existing document with the given identifier.- Specified by:
rename
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idname
- The new document title- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
restore
public void restore(String sid, long docId, long folderId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Restores a deleted document- Specified by:
restore
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idfolderId
- Id of the folder in which the document must be restored- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
unlock
public void unlock(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Unlocks an existing document with the given identifier.- Specified by:
unlock
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- identifier of the document- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
update
public void update(String sid, WSDocument document) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, UnexistingResourceException Description copied from interface:DocumentService
Updates an existing document with the value object containing the document's metadata- Specified by:
update
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocument
- The value object containing the document's metadata- Throws:
AuthenticationException
- Invalid sessionPermissionException
- The user does not have the required permissionWebserviceException
- Error in the webservicePersistenceException
- Error in the databaseUnexistingResourceException
- The specified document does not exist
-
listDocuments
public List<WSDocument> listDocuments(String sid, long folderId, String fileName) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentService
Gets the documents in a specific folder- Specified by:
listDocuments
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessionfolderId
- The folder idfileName
- Optional file name filter- Returns:
- Collection of documents
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
getDocuments
public List<WSDocument> getDocuments(String sid, List<Long> docIds) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Gets document metadata of a collection of existing documents with the given identifiers- Specified by:
getDocuments
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocIds
- identifiers of the documents- Returns:
- the list of documents
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getRecentDocuments
public List<WSDocument> getRecentDocuments(String sid, Integer max) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Lists of last modified documents of the current session.- Specified by:
getRecentDocuments
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessionmax
- Maximum number of returned records- Returns:
- List of documents
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
sendEmail
public void sendEmail(String sid, List<Long> docIds, String recipients, String subject, String message) throws AuthenticationException, WebserviceException, PersistenceException, IOException, javax.mail.MessagingException Description copied from interface:DocumentService
Sends a set of documents as mail attachments- Specified by:
sendEmail
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocIds
- Set of document identifiersrecipients
- Set of recipients(comma separated)subject
- The email subjectmessage
- The email message body- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databaseIOException
- I/O errorjavax.mail.MessagingException
- error sending the email
-
createAlias
public WSDocument createAlias(String sid, long docId, long folderId, String type) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentService
Creates a new document alias for the given document inside a specified folder- Specified by:
createAlias
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- 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:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
reindex
public void reindex(String sid, long docId, String content) throws ParseException, AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Re-indexes(or indexes from scratch) a document- Specified by:
reindex
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- The document idcontent
- The content to be used (if null the file is parsed)- Throws:
ParseException
- Error in adding the entry into fulltext indexAuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error at data layer
-
getAliases
public List<WSDocument> getAliases(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Gets the aliases of the given document- Specified by:
getAliases
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The master document ID- Returns:
- List of aliases
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
upload
public long upload(String sid, Long docId, Long folderId, boolean release, String filename, String language, javax.activation.DataHandler content) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException Description copied from interface:DocumentService
Creates a new document or updates an existing one.- Specified by:
upload
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document id (optional)folderId
- The folder id (optional)release
- True if this is a major release(eg: 2.0) rather than a minor release(eg: 1.12)filename
- The document file namelanguage
- The language for the documentcontent
- The document's binary content- Returns:
- The created/updated document's ID
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionIOException
- I/O erro
-
link
public WSLink link(String sid, long doc1, long doc2, String type) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Creates a new link between two documents.- Specified by:
link
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondoc1
- ID of document 1doc2
- ID of document 2type
- The link type(it can be empty)- Returns:
- the new link
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
getLinks
public List<WSLink> getLinks(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentService
Gets all the links of a specific document- Specified by:
getLinks
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- ID of the document- Returns:
- The new links of the document
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permission
-
deleteLink
public void deleteLink(String sid, long id) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Removes an existing link- Specified by:
deleteLink
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessionid
- ID of the link- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error at data layer
-
getExtractedText
public String getExtractedText(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Gets the document's text stored in the full-text index- Specified by:
getExtractedText
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document id- Returns:
- The requested document's text
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
createDownloadTicket
public String createDownloadTicket(String sid, long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentService
Creates a new download ticket- Specified by:
createDownloadTicket
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- 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 downloads allowed- Returns:
- the download ticket
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the download permission
-
createViewTicket
public String createViewTicket(String sid, long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads, Integer maxViews) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException Description copied from interface:DocumentService
Creates a new view ticket- Specified by:
createViewTicket
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- 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 downloads allowedmaxViews
- maximum number of downloads allowed- Returns:
- the download ticket
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the download permission
-
setPassword
public void setPassword(String sid, long docId, String password) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Puts a password protection to the document- Specified by:
setPassword
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- identifier of the documentpassword
- the new password- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
unsetPassword
public void unsetPassword(String sid, long docId, String currentPassword) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Removes the password protection from the document- Specified by:
unsetPassword
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- identifier of the documentcurrentPassword
- the password- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
unprotect
public boolean unprotect(String sid, long docId, String password) throws PersistenceException, AuthenticationException, WebserviceException Description copied from interface:DocumentService
Unprotects a document that is password protected. If the given password is right, the document remains unprotected for the duration of the session- Specified by:
unprotect
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- identifier of the documentpassword
- the password- Returns:
- was it uprotected?
- Throws:
PersistenceException
- Error in the databaseAuthenticationException
- Invalid sessionWebserviceException
- Error in the webservice
-
addNote
public WSNote addNote(String sid, long docId, String note) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Adds a new note for the given document- Specified by:
addNote
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- identifier of the documentnote
- text of the note- Returns:
- the created note
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
saveNote
public WSNote saveNote(String sid, long docId, WSNote wsNote) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Adds a new note for the given document- Specified by:
saveNote
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- identifier of the documentwsNote
- the note to add- Returns:
- the added note
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
deleteNote
public void deleteNote(String sid, long noteId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Adds a new note for the given document- Specified by:
deleteNote
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessionnoteId
- identifier of the note- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
deleteVersion
public String deleteVersion(String sid, long docId, String version) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Deletes a version of a document with the given identifiers. You can not delete the latest version of a document- Specified by:
deleteVersion
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idversion
- The specific version- Returns:
- the latest version specification
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
getNotes
public List<WSNote> getNotes(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Gets the notes for the given document- Specified by:
getNotes
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- identifier of the document- Returns:
- list of notes
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
rateDocument
public WSRating rateDocument(String sid, long docId, int vote) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Puts a new rating on the given document- Specified by:
rateDocument
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- identifier of the documentvote
- the vote- Returns:
- the rating
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
getRatings
public List<WSRating> getRatings(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Gets all the ratings of the given document- Specified by:
getRatings
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- identifier of the document- Returns:
- List of ratings
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
replaceFile
public void replaceFile(String sid, long docId, String fileVersion, String comment, javax.activation.DataHandler content) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException, UnexistingResourceException Description copied from interface:DocumentService
Replaces the file associated to a given version.- Specified by:
replaceFile
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idfileVersion
- The file versioncomment
- The comment left for this actioncontent
- The file's binary content- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionIOException
- I/O errorUnexistingResourceException
- The specified document does not exist
-
promoteVersion
public void promoteVersion(String sid, long docId, String version) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, IOException, UnexistingResourceException Description copied from interface:DocumentService
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).- Specified by:
promoteVersion
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- the document to be updatedversion
- the version- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionIOException
- I/O errorUnexistingResourceException
- The specified document does not exist
-
getVersion
public WSDocument getVersion(String sid, long docId, String version) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Gets a specific version- Specified by:
getVersion
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document idversion
- The version number- Returns:
- The version
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
getVersions
public List<WSDocument> getVersions(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException, PermissionException, UnexistingResourceException Description copied from interface:DocumentService
Gets the version history of an existing document with the given identifier- Specified by:
getVersions
in interfaceDocumentService
- Parameters:
sid
- identifier of the sessiondocId
- The document id- Returns:
- Collection of versions
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionUnexistingResourceException
- The specified document does not exist
-
setAccessControlList
public void setAccessControlList(String sid, long docId, List<WSAccessControlEntry> acl) throws PersistenceException, PermissionException, AuthenticationException, WebserviceException Description copied from interface:DocumentService
Sets the Access Control List- Specified by:
setAccessControlList
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- Document idacl
- the complete Access Control List- Throws:
PersistenceException
- Error in the databasePermissionException
- The user does not have the required permissionAuthenticationException
- Invalid sessionWebserviceException
- Error in the webservice
-
getAccessControlList
public List<WSAccessControlEntry> getAccessControlList(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Retrieves the access control list- Specified by:
getAccessControlList
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- Document id- Returns:
- 'error' if error occurred, the right objects collection
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
isRead
public boolean isRead(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Tests if a document is readable.- Specified by:
isRead
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- The document id- Returns:
- True if the identifier denotes a readable document, otherwise false.
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
isWrite
public boolean isWrite(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Tests if a document is writable- Specified by:
isWrite
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- The document id- Returns:
- True if the identifier denotes a writable folder, otherwise false
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
isDownload
public boolean isDownload(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Tests if a document is downloadable- Specified by:
isDownload
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- The document id- Returns:
- True if the identifier denotes a writable folder, otherwise false
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-
isGranted
public boolean isGranted(String sid, long docId, String permission) throws AuthenticationException, WebserviceException, PersistenceException Description copied from interface:DocumentService
Tests if the current user has a specific permission on a document- Specified by:
isGranted
in interfaceDocumentService
- Parameters:
sid
- Session identifierdocId
- The document idpermission
- The permission to check (eg: 'read', 'write', ...)- Returns:
- True if the identifier denotes a granted permission, otherwise false
- Throws:
AuthenticationException
- Invalid sessionWebserviceException
- Error in the webservicePersistenceException
- Error in the database
-