Document
From LogicalDOC Community Wiki
Methods related to document management.
void checkout(String sid, long docId)
This operation allows to mark a document as checked out.
Parameters
- sid - The session identifier.
- docId - The document identifier.
Returns
- none
Throws
- Exception - If there is any error during the checkout operation.
void checkin(String sid, long docId, String comment, String filename, boolean release, DataHandler content)
This operation allows to upload a new version of an already checked out document.
Parameters
- sid - The session identifier.
- docId - The document identifier.
- comment - The operation comment.
- filename - The name of the file to check in.
- release - True if it is a new release rather than a subversion.
- content - The document file content.
Returns
- none
Throws
- Exception - If there is any error during the checkin operation.
WSDocument create(String sid, WSDocument document, DataHandler content)
This operation allows to create a new document. The user can completely customize the document values through a value object containing the metadata of the new document.
Parameters
- sid - The session identifier.
- document - A value object containing the document metadata.
- content - The document file content.
Returns
- A WSDocument.
Throws
- Exception - If there is any error inserting document into the repository.
void delete(String sid, long docId)
This operation allows to delete an existing document with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
Returns
- none
Throws
- Exception - If there is any error deleting document from the repository.
void lock(String sid, long docId)
This operation allows to lock an existing document with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
Returns
- none
Throws
- Exception - If there is any error locking document.
void unlock(String sid, long docId)
This operation allows to unlock an existing document with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
Returns
- none
Throws
- Exception - If there is any error unlocking document.
void rename(String sid, long docId, String name)
This operation allows to rename an existing document's title with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
- name - The new document title.
Returns
- none
Throws
- Exception - If there is any error renaming document.
void renameFile(String sid, long docId, String name)
This operation allows to rename an existing document's file name with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
- name - The new document file name.
Returns
- none
Throws
- Exception - If there is any error renaming document.
void move(String sid, long docId, long folderId)
This operation allows to move an existing document on the folder with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
- folderId - The destination folder id.
Returns
- none
Throws
- Exception - If there is any error moving document.
DataHandler getContent(String sid, long docId)
This operation allows a user to get the content of document with the given identifier. The document content is sent as an attachment.
Parameters
- sid - The session identifier.
- docId - The document identifier.
Returns
- The requested document's binary
Throws
- Exception - If there is any error get document content.
void update(String sid, WSDocument document)
This operation allows to update an existing document. The user can completely customize the document values through a value object containing the metadata of the new document.
Parameters
- sid - The session identifier.
- document - The value object containing the document metadata.
Returns
- none
Throws
- Exception - If the document doesn't exist.
WSDocument getDocument(String sid, long docId)
This operation allows to retrieve an existing document with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
Returns
- A WSDocument.
Throws
- Exception - If there is any error retrieving the document.
void restore(String sid, long docId, long folderId)
This operation allows to restore an existing document with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
- folderId - The folder in which tha document will be restored.
Returns
- Nothing
Throws
- Exception - If there is any error restoring the document.
WSDocument[] getVersions(String sid, long docId)
This operation allows to retrieve all the versions of an existing document with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
Returns
- An array of WSDocument.
Throws
- Exception - If there is any error listing document's versions.
WSDocument[] list(String sid, long folderId)
This operation allows to retrieve all the documents inside an existing folder with the given identifier.
Parameters
- sid - The session identifier.
- folderId - The folder identifier.
Returns
- An array of WSDocument.
Throws
- Exception - If there is any error listing document inside the given folder.
WSDocument[] getDocuments(String sid, long[] docIds)
This operation allows to retrieve all the documents whose id is in the given array.
Parameters
- sid - The session identifier.
- docIds - The documents identifiers.
Returns
- An array of WSDocument.
Throws
- Exception - If there is any error listing document inside the given folder.
boolean isReadable(String sid, long docId)
This operation allows to check if the current user can read the document with the given identifier.
Parameters
- sid - The session identifier.
- docId - The document identifier.
Returns
- True if the current user can read the document.
Throws
- Exception - If the user doesn't have read permission on document's folder.
void sendEmail(String sid, long[] docIds, String recipients, String subject, String message)
This operation allows to send a set of document to a collection of recipients.
Parameters
- sid - The session identifier.
- docIds - Identifiers of the documents to be attached(only readable documents will be attached)
- recipients - Comma-separated list of e-mail addresses.
- subject - The message subject.
- message - Body of the message.
Returns
- Nothing
Throws
- Exception - If there is any error sending the e-mail.
WSDocument createAlias(String sid, long docId, long folderId)
This operation allows to create a new document alias for the given document id and inside the given folder id.
Parameters
- sid - The session identifier.
- docId - The original document identifier.
- folderId - Identifier of the folder in which will be stored the alias.
Returns
- A WSDocument.
Throws
- Exception - If there is any error inserting document alias into the repository.
void reindex(String sid, long docId)
Reindexes(or indexes) a document.
Parameters
- sid - The session identifier.
- docId - The document's identifier.
Returns
- Nothing
Throws
- Exception - If there is any error indexing the document.

del.icio.us
reddit