Class SoapDocumentClient
- java.lang.Object
-
- com.logicaldoc.webservice.soap.client.SoapClient<DocumentService>
-
- com.logicaldoc.webservice.soap.client.SoapDocumentClient
-
- All Implemented Interfaces:
DocumentService
public class SoapDocumentClient extends SoapClient<DocumentService> implements DocumentService
Document Web Service client.- Since:
- 7.5
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description SoapDocumentClient(String endpoint)SoapDocumentClient(String endpoint, int gzipThreshold, boolean log, int timeout)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WSNoteaddNote(String sid, long docId, String note)Adds a new note for the given documentvoidcheckin(String sid, long docId, String comment, String filename, boolean release, File content)voidcheckin(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.voidcheckinDocument(String sid, long docId, String comment, String filename, boolean release, WSDocument docVO, File content)voidcheckinDocument(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.voidcheckout(String sid, long docId)Checks out an existing document with the given identifier.WSDocumentcopy(String sid, long docId, long folderId)Copies a document into another folder.WSDocumentcreate(String sid, WSDocument document, File content)WSDocumentcreate(String sid, WSDocument document, javax.activation.DataHandler content)Create a new document.WSDocumentcreateAlias(String sid, long docId, long folderId, String type)Creates a new document alias for the given document inside a specified folderStringcreateDownloadTicket(String sid, long docId, String suffix, Integer expireHours, String expireDate, Integer maxDownloads)Creates a new download ticketvoidcreatePdf(String sid, long docId, String fileVersion)Creates the PDF conversion of the given document.voidcreateThumbnail(String sid, long docId, String fileVersion, String type)Creates the thumbnail of the given document.voiddelete(String sid, long docId)Deletes an existing document with the given identifier.voiddeleteLink(String sid, long id)Removes an existing linkvoiddeleteNote(String sid, long noteId)Adds a new note for the given documentStringdeleteVersion(String sid, long docId, String version)Deletes a version of a document with the given identifiers.voiddownloadContent(String sid, long docId, File out)voiddownloadResourceContent(String sid, long docId, String fileVersion, String suffix, File out)voiddownloadVersionContent(String sid, long docId, String version, File out)WSDocument[]getAliases(String sid, long docId)Gets the aliases of the given documentjavax.activation.DataHandlergetContent(String sid, long docId)Gets the content of an existing document with the given identifierWSDocumentgetDocument(String sid, long docId)Gets the metadata of an existing document with the given identifierWSDocumentgetDocumentByCustomId(String sid, String customId)Gets document metadata of an existing document with the given custom identifierWSDocument[]getDocuments(String sid, Long[] docIds)Gets document metadata of a collection of existing documents with the given identifiersStringgetExtractedText(String sid, long docId)Gets the document's text stored in the full-text indexWSLink[]getLinks(String sid, long docId)Gets all the links of a specific documentWSNote[]getNotes(String sid, long docId)Gets the notes for the given documentWSRating[]getRatings(String sid, long docId)Gets all the ratings of the given documentWSDocument[]getRecentDocuments(String sid, Integer max)Lists of last modified documents of the current session.javax.activation.DataHandlergetResource(String sid, long docId, String fileVersion, String suffix)Gets the content of a resource associated to the given document.WSDocumentgetVersion(String sid, long docId, String version)Gets a specific versionjavax.activation.DataHandlergetVersionContent(String sid, long docId, String version)Gets the content of a specific version of a documentWSDocument[]getVersions(String sid, long docId)Gets the version history of an existing document with the given identifierbooleanisReadable(String sid, long docId)Tests if a document is readableWSLinklink(String sid, long doc1, long doc2, String type)Creates a new link between two documents.WSDocument[]listDocuments(String sid, long folderId, String fileName)Gets a document in a specific foldervoidlock(String sid, long docId)Locks an existing document with the given identifier.voidmove(String sid, long docId, long folderId)Moves an existing document with the given identifier.voidpromoteVersion(String sid, long docId, String version)Promotes an old version to the current default one.WSRatingrateDocument(String sid, long docId, int vote)Puts a new rating on the given documentvoidreindex(String sid, long docId, String content)Re-indexes(or indexes from scratch) a documentvoidrename(String sid, long docId, String name)Renames the title of an existing document with the given identifier.voidreplaceFile(String sid, long docId, String fileVersion, String comment, javax.activation.DataHandler content)Replaces the file associated to a given version.voidrestore(String sid, long docId, long folderId)Restores a deleted documentWSNotesaveNote(String sid, long docId, WSNote note)Adds a new note for the given documentvoidsendEmail(String sid, Long[] docIds, String recipients, String subject, String message)Sends a set of documents as mail attachmentsvoidsetPassword(String sid, long docId, String password)Puts a password protection to the documentvoidunlock(String sid, long docId)Unlocks an existing document with the given identifier.booleanunprotect(String sid, long docId, String password)Unprotects a document that is password protected.voidunsetPassword(String sid, long docId, String currentPassword)Removes the password protection from the documentvoidupdate(String sid, WSDocument document)Updates an existing document with the value object containing the document's metadatalongupload(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.voiduploadResource(String sid, long docId, String fileVersion, String suffix, File content)voiduploadResource(String sid, long docId, String fileVersion, String suffix, javax.activation.DataHandler content)Uploads a new resource attached to the given document.
-
-
-
Constructor Detail
-
SoapDocumentClient
public SoapDocumentClient(String endpoint, int gzipThreshold, boolean log, int timeout) throws IOException
- Throws:
IOException
-
SoapDocumentClient
public SoapDocumentClient(String endpoint) throws IOException
- Throws:
IOException
-
-
Method Detail
-
create
public WSDocument create(String sid, WSDocument document, javax.activation.DataHandler content) throws AuthenticationException, PermissionException, IOException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceCreate a new document. The user can completely customize the document through a value object containing the document's metadata- Specified by:
createin 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:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionIOException- I/O errorWebserviceException- Error in the webservicePersistenceException- Error in the database
-
create
public WSDocument create(String sid, WSDocument document, File content) throws AuthenticationException, PermissionException, IOException, WebserviceException, PersistenceException
-
checkout
public void checkout(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceChecks out an existing document with the given identifier.- Specified by:
checkoutin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document id- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
delete
public void delete(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceDeletes an existing document with the given identifier.- Specified by:
deletein interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document id- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
getDocument
public WSDocument getDocument(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets the metadata of an existing document with the given identifier- Specified by:
getDocumentin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document id- Returns:
- A 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 database
-
getDocumentByCustomId
public WSDocument getDocumentByCustomId(String sid, String customId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets document metadata of an existing document with the given custom identifier- Specified by:
getDocumentByCustomIdin interfaceDocumentService- Parameters:
sid- identifier of the sessioncustomId- The custom id- Returns:
- A 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 database
-
isReadable
public boolean isReadable(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceTests if a document is readable- Specified by:
isReadablein interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document id- Returns:
- True if the identifier denotes a document, otherwise false
- Throws:
AuthenticationException- Invalid sessionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
lock
public void lock(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceLocks an existing document with the given identifier.- Specified by:
lockin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document id- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
move
public void move(String sid, long docId, long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceMoves an existing document with the given identifier.- Specified by:
movein interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document idfolderId- Identifier of the new document's folder- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
copy
public WSDocument copy(String sid, long docId, long folderId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServiceCopies a document into another folder.- Specified by:
copyin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document idfolderId- Identifier of the new document's folder- Returns:
- The created copy
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the databaseIOException- I/O error
-
unlock
public void unlock(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceUnlocks an existing document with the given identifier.- Specified by:
unlockin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- identifier of the document- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
update
public void update(String sid, WSDocument document) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceUpdates an existing document with the value object containing the document's metadata- Specified by:
updatein 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 database
-
checkin
public void checkin(String sid, long docId, String comment, String filename, boolean release, javax.activation.DataHandler content) throws AuthenticationException, PermissionException, IOException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceChecks in an existing document with the given identifier to create a new version.- Specified by:
checkinin 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:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionIOException- I/O errorWebserviceException- Error in the webservicePersistenceException- Error in the database
-
checkin
public void checkin(String sid, long docId, String comment, String filename, boolean release, File content) throws AuthenticationException, PermissionException, IOException, WebserviceException, PersistenceException
-
checkinDocument
public void checkinDocument(String sid, long docId, String comment, String filename, boolean release, WSDocument docVO, javax.activation.DataHandler content) throws AuthenticationException, PermissionException, IOException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceChecks in an existing document with the given identifier to create a new version.- Specified by:
checkinDocumentin 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:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionIOException- I/O errorWebserviceException- Error in the webservicePersistenceException- Error in the database
-
checkinDocument
public void checkinDocument(String sid, long docId, String comment, String filename, boolean release, WSDocument docVO, File content) throws AuthenticationException, PermissionException, IOException, WebserviceException, PersistenceException
-
getContent
public javax.activation.DataHandler getContent(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServiceGets the content of an existing document with the given identifier- Specified by:
getContentin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document id- Returns:
- The requested document's binary
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the databaseIOException- I/O error
-
getVersionContent
public javax.activation.DataHandler getVersionContent(String sid, long docId, String version) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServiceGets the content of a specific version of a document- Specified by:
getVersionContentin 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 sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the databaseIOException- I/O error
-
getResource
public javax.activation.DataHandler getResource(String sid, long docId, String fileVersion, String suffix) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServiceGets the content of a resource associated to the given document.- Specified by:
getResourcein 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 sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the databaseIOException- I/O error
-
downloadContent
public void downloadContent(String sid, long docId, File out) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
-
downloadVersionContent
public void downloadVersionContent(String sid, long docId, String version, File out) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
-
downloadResourceContent
public void downloadResourceContent(String sid, long docId, String fileVersion, String suffix, File out) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
-
restore
public void restore(String sid, long docId, long folderId) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceRestores a deleted document- Specified by:
restorein 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
-
rename
public void rename(String sid, long docId, String name) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceRenames the title of an existing document with the given identifier.- Specified by:
renamein interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document idname- The new document title- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
getDocuments
public WSDocument[] getDocuments(String sid, Long[] docIds) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets document metadata of a collection of existing documents with the given identifiers- Specified by:
getDocumentsin 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 WSDocument[] getRecentDocuments(String sid, Integer max) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceLists of last modified documents of the current session.- Specified by:
getRecentDocumentsin interfaceDocumentService- Parameters:
sid- identifier of the sessionmax- Maximum number of returned records- Returns:
- Array of documents
- Throws:
AuthenticationException- Invalid sessionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
sendEmail
public void sendEmail(String sid, Long[] docIds, String recipients, String subject, String message) throws AuthenticationException, WebserviceException, PersistenceException, IOException, javax.mail.MessagingException
Description copied from interface:DocumentServiceSends a set of documents as mail attachments- Specified by:
sendEmailin 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, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceCreates a new document alias for the given document inside a specified folder- Specified by:
createAliasin 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 sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
reindex
public void reindex(String sid, long docId, String content) throws AuthenticationException, WebserviceException, PersistenceException, ParseException
Description copied from interface:DocumentServiceRe-indexes(or indexes from scratch) a document- Specified by:
reindexin interfaceDocumentService- Parameters:
sid- Session identifierdocId- The document idcontent- The content to be used (if null the file is parsed)- Throws:
AuthenticationException- Invalid sessionWebserviceException- Error in the webservicePersistenceException- Error at data layerParseException- Error in adding the entry into fulltext index
-
listDocuments
public WSDocument[] listDocuments(String sid, long folderId, String fileName) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets a document in a specific folder- Specified by:
listDocumentsin interfaceDocumentService- Parameters:
sid- identifier of the sessionfolderId- The folder idfileName- Optional file name filter- Returns:
- A 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 database
-
getAliases
public WSDocument[] getAliases(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets the aliases of the given document- Specified by:
getAliasesin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The master document ID- Returns:
- Arrays of aliases
- Throws:
AuthenticationException- Invalid sessionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
link
public WSLink link(String sid, long doc1, long doc2, String type) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceCreates a new link between two documents.- Specified by:
linkin 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 sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
getLinks
public WSLink[] getLinks(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets all the links of a specific document- Specified by:
getLinksin interfaceDocumentService- Parameters:
sid- Session identifierdocId- ID of the document- Returns:
- The new links of the document
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
deleteLink
public void deleteLink(String sid, long id) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceRemoves an existing link- Specified by:
deleteLinkin interfaceDocumentService- Parameters:
sid- identifier of the sessionid- ID of the link- Throws:
AuthenticationException- Invalid sessionWebserviceException- Error in the webservicePersistenceException- Error at data layer
-
createPdf
public void createPdf(String sid, long docId, String fileVersion) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServiceCreates the PDF conversion of the given document. If the conversion was already created, nothing will happen.- Specified by:
createPdfin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document idfileVersion- The specific file version(it can be empty)- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the databaseIOException- I/O error
-
createThumbnail
public void createThumbnail(String sid, long docId, String fileVersion, String type) throws AuthenticationException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServiceCreates the thumbnail of the given document. If the thumbnail was already created, nothing will happen.- Specified by:
createThumbnailin 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, PermissionException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServiceUploads a new resource attached to the given document. If the resource already exists it is overwritten.- Specified by:
uploadResourcein 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 sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the databaseIOException- I/O error
-
uploadResource
public void uploadResource(String sid, long docId, String fileVersion, String suffix, File content) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
-
getExtractedText
public String getExtractedText(String sid, long docId) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets the document's text stored in the full-text index- Specified by:
getExtractedTextin 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:DocumentServiceCreates a new download ticket- Specified by:
createDownloadTicketin 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
-
setPassword
public void setPassword(String sid, long docId, String password) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServicePuts a password protection to the document- Specified by:
setPasswordin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- identifier of the documentpassword- the new password- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
unsetPassword
public void unsetPassword(String sid, long docId, String currentPassword) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceRemoves the password protection from the document- Specified by:
unsetPasswordin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- identifier of the documentcurrentPassword- the password- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
unprotect
public boolean unprotect(String sid, long docId, String password) throws PersistenceException
Description copied from interface:DocumentServiceUnprotects a document that is password protected. If the given password is right, the document remains unprotected for the duration of the session- Specified by:
unprotectin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- identifier of the documentpassword- the password- Returns:
- was it uprotected?
- Throws:
PersistenceException- Error in the database
-
addNote
public WSNote addNote(String sid, long docId, String note) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceAdds a new note for the given document- Specified by:
addNotein interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- identifier of the documentnote- text of the note- Returns:
- the created note
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
deleteNote
public void deleteNote(String sid, long noteId) throws AuthenticationException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceAdds a new note for the given document- Specified by:
deleteNotein interfaceDocumentService- Parameters:
sid- identifier of the sessionnoteId- identifier of the note- Throws:
AuthenticationException- Invalid sessionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
getNotes
public WSNote[] getNotes(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets the notes for the given document- Specified by:
getNotesin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- identifier of the document- Returns:
- array of notes
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
rateDocument
public WSRating rateDocument(String sid, long docId, int vote) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServicePuts a new rating on the given document- Specified by:
rateDocumentin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- identifier of the documentvote- the vote- Returns:
- the rating
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
getRatings
public WSRating[] getRatings(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets all the ratings of the given document- Specified by:
getRatingsin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- identifier of the document- Returns:
- array of ratings
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- 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:DocumentServiceDeletes a version of a document with the given identifiers. You can not delete the latest version of a document- Specified by:
deleteVersionin 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
-
replaceFile
public void replaceFile(String sid, long docId, String fileVersion, String comment, javax.activation.DataHandler content) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServiceReplaces the file associated to a given version.- Specified by:
replaceFilein 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 sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the databaseIOException- I/O error
-
promoteVersion
public void promoteVersion(String sid, long docId, String version) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServicePromotes 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:
promoteVersionin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- the document to be updatedversion- the version- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the databaseIOException- I/O error
-
saveNote
public WSNote saveNote(String sid, long docId, WSNote note) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceAdds a new note for the given document- Specified by:
saveNotein interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- identifier of the documentnote- the note to add- Returns:
- the added note
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- 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, PermissionException, WebserviceException, PersistenceException, IOException
Description copied from interface:DocumentServiceCreates a new document or updates an existing one.- Specified by:
uploadin 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 sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the databaseIOException- I/O erro
-
getVersions
public WSDocument[] getVersions(String sid, long docId) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets the version history of an existing document with the given identifier- Specified by:
getVersionsin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document id- Returns:
- Array of versions
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
getVersion
public WSDocument getVersion(String sid, long docId, String version) throws AuthenticationException, PermissionException, WebserviceException, PersistenceException
Description copied from interface:DocumentServiceGets a specific version- Specified by:
getVersionin interfaceDocumentService- Parameters:
sid- identifier of the sessiondocId- The document idversion- The version number- Returns:
- The version
- Throws:
AuthenticationException- Invalid sessionPermissionException- The user does not have the required permissionWebserviceException- Error in the webservicePersistenceException- Error in the database
-
-