Clearspace API (2.0.15) Web Services Client Javadocs

com.jivesoftware.community.webservices
Interface DocumentService


public interface DocumentService

This service provides methods to load and manipulate documents, comments.


Method Summary
 void addAttachmentToDocumentByDocumentID(java.lang.String documentID, java.lang.String name, java.lang.String contentType, byte[] source)
          Add a new attachment to the document with the specified id.
 void addAttachmentToDocumentByInternalDocID(long internalDocID, java.lang.String name, java.lang.String contentType, byte[] source)
          Add a new attachment to the document with the specified internal id.
 void addAuthor(long documentID, long userID)
          Adds the user with the supplied id as an author of this document of the specified document.
 void addDocumentApproverOnCommunity(long communityID, long userID)
          Add the user as a document approver for this entire community.
 void addDocumentApproverOnDocument(long documentID, long userID)
          Adds a user as a document approver for this document.
 void addImageToDocumentByDocumentID(java.lang.String documentID, java.lang.String name, java.lang.String contentType, byte[] source)
          Add a new image to the document with the specified id.
 void addImageToDocumentByInternalDocID(long internalDocID, java.lang.String name, java.lang.String contentType, byte[] source)
          Add a new image to the document with the specified internal id.
 WSDocument createBinaryDocument(long communityID, long userID, long documentTypeID, java.lang.String documentID, java.lang.String title, java.lang.String filename, java.lang.String contentType, byte[] data)
          Creates a new binary document.
 WSDocument createDocument(long communityID, long userID, long documentTypeID, java.lang.String documentID, java.lang.String title, java.lang.String body)
          Create a new document.
 void deleteDocument(long documentID)
          Deletes a document.
 void deleteDocumentProperty(java.lang.String name, long documentID)
          Delete a property with the given name from the document with the given ID.
 java.util.List<WSApprovalStatus> getApprovalStatusForDocument(long documentID)
          Returns a collection of WSApprovalStatus objects.
 int getAttachmentCountByDocumentID(java.lang.String documentID)
          Returns the number of attachments on the document with the specified id.
 int getAttachmentCountByInternalDocID(long internalDocID)
          Returns the number of attachments on the document with the specified internal id.
 java.util.List<WSAttachment> getAttachmentsByDocumentID(java.lang.String documentID)
          Acquire the attachments for a document by the document id.
 java.util.List<WSAttachment> getAttachmentsByInternalDocID(long internalDocID)
          Acquire the attachments for a document by the internal document id.
 java.util.List<WSUser> getAuthors(long documentID)
          Returns the userss who are allowed to edit the document.
 WSBinaryBody getBinaryDocumentContent(java.lang.String documentID)
          Returns the content of the binary document.
 java.util.List<WSUser> getDocumentApproversOnCommunity(long communityID)
          Returns all of the users that must approve new documents before they reach a PUBLISHED state when it is in a PENDING_APPROVAL state.
 java.util.List<WSUser> getDocumentApproversOnDocument(long documentID)
          Returns all of the users that must approve new documents before they reach a PUBLISHED state when it is in a PENDING_APPROVAL state.
 WSDocument getDocumentByDocumentID(java.lang.String documentID)
          Returns a document from the community based on its document ID.
 WSDocument getDocumentByDocumentIDAndVersion(java.lang.String documentID, int version)
          Returns the revision of the document with the specified docID and version number.
 WSDocument getDocumentByInternalDocID(long internalDocID)
          Returns the document with the specified docID.
 WSDocument getDocumentByInternalDocIDAndVersion(long internalDocID, int version)
          Returns the revision of document with the specified docID and version number.
 java.util.List<WSProperty> getDocumentProperties(long documentID)
          Returns all tbe extended properties for the message with the specified ID.
 java.lang.String getDocumentProperty(java.lang.String name, long documentID)
          Returns a specific extended property for the document with the specified property name and document ID.
 java.util.List<WSDocument> getDocumentsByCommunity(long communityID)
          Returns all of the documents for the specified community.
 java.util.List<WSDocument> getDocumentsByCommunityAndFilter(long communityID, WSDocumentResultFilter filter)
          Returns all of the documents in the given community after the specified filter has been applied.
 int getImageCountByDocumentID(java.lang.String documentID)
          Returns the number of images on the document with the specified id.
 int getImageCountByInternalDocID(long internalDocID)
          Returns the number of images on the document with the specified internal id.
 java.util.List<WSDocument> getPopularDocuments()
          Returns the top x documents across all communities according to ratings, document views and time passed since the document was created.
 java.util.List<WSDocument> getPopularDocumentsByCommunity(long communityID)
          Returns the top x documents in the given community according to ratings, document views & time passed since the document was created.
 java.util.List<WSDocument> getPopularDocumentsByLanguage(java.util.List<java.lang.String> languages)
          Returns the top x documents across all communities according to ratings, document views and time passed since the document was created in the languages specified.
 java.util.List<WSDocument> getUserApprovalDocuments(long userID)
          Returns a list of documents that a user needs to approve.
 boolean isCommentsEnabled()
          Returns true if the comments feature is turned on.
 boolean isTrackbacksEnabled()
          Returns true if the trackbacks feature is turned on.
 void moveDocument(long documentID, long communityID)
          Moves a document from it's current community to another.
 WSDocument publishDocument(long communityID, long userID, long documentTypeID, java.lang.String documentID, java.lang.String title, java.lang.String body)
          Publish a new document.
 void removeAuthor(long documentID, long userID)
          Removes the user with the supplied id as an author of this document.
 void setCommentsEnabled(boolean enableComments)
          Enables or disables the comments feature system wide.
 void setDocumentProperty(java.lang.String name, java.lang.String value, long documentID)
          Set an extended for the property with the given document id.
 void setTrackbacksEnabled(boolean enableTrackbacks)
          Enables or disables the trackbacks feature system wide.
 void updateDocument(WSDocument document)
           
 

Method Detail

createDocument

WSDocument createDocument(long communityID,
                          long userID,
                          long documentTypeID,
                          java.lang.String documentID,
                          java.lang.String title,
                          java.lang.String body)
                          throws DuplicateIDException,
                                 DocumentObjectNotFoundException,
                                 UserNotFoundException,
                                 CommunityNotFoundException,
                                 DocumentAlreadyExistsException,
                                 RejectedException
Create a new document.

If a documentID is not provided (i.e. it's null, or empty string) one will be automatically created. By default the autogenerated ID will be 'tempDOC-#' however the 'tempDOC-#' prefix can be controlled by changing the 'jive.temporaryDocPrefix' jive property.

Parameters:
communityID - The id of the community to create the document.
userID - The id of the author of the new document
documentTypeID - the id of the document type of the new document
documentID - the document ID of the new document
title - the title of the new document
body - the body of the new document @return the new document
Returns:
The newly created document.
Throws:
DuplicateIDException - if the documentID provided is the same as an already existing document
UserNotFoundException - If the id of the specified user does not exist.
com.jivesoftware.community.DocumentObjectNotFoundException - If the id of the specified document does not exist.
CommunityNotFoundException - Thrown if the specified community does not exist.
com.jivesoftware.community.DocumentAlreadyExistsException - Thrown if the document with that documentID already already exists.
RejectedException - Thrown if the document can not be added for some unknown reason.
DocumentObjectNotFoundException
DocumentAlreadyExistsException

publishDocument

WSDocument publishDocument(long communityID,
                           long userID,
                           long documentTypeID,
                           java.lang.String documentID,
                           java.lang.String title,
                           java.lang.String body)
                           throws DuplicateIDException,
                                  DocumentObjectNotFoundException,
                                  UserNotFoundException,
                                  CommunityNotFoundException,
                                  DocumentAlreadyExistsException,
                                  RejectedException
Publish a new document. Unlike create, this document will go straight to the published state.

If a documentID is not provided (i.e. it's null or empty string) one will be automatically created. By default the autogenerated ID will be 'tempDOC-#' however the 'tempDOC-#' prefix can be controlled by changing the 'jive.temporaryDocPrefix' jive property.

Parameters:
communityID - The id of the community to create the document.
userID - The id of the author of the new document
documentTypeID - the id of the document type of the new document
documentID - the document ID of the new document
title - the title of the new document
body - the body of the new document @return the new document
Returns:
The newly created document.
Throws:
DuplicateIDException - if the documentID provided is the same as an already existing document
UserNotFoundException - If the id of the specified user does not exist.
com.jivesoftware.community.DocumentObjectNotFoundException - If the id of the specified document does not exist.
CommunityNotFoundException - Thrown if the specified community does not exist.
com.jivesoftware.community.DocumentAlreadyExistsException - Thrown if the document with that documentID already already exists.
RejectedException - Thrown if the document can not be added for some unknown reason.
DocumentObjectNotFoundException
DocumentAlreadyExistsException

updateDocument

void updateDocument(WSDocument document)
                    throws UserNotFoundException,
                           DocumentObjectNotFoundException,
                           DocumentAlreadyExistsException
Throws:
UserNotFoundException
DocumentObjectNotFoundException
DocumentAlreadyExistsException

createBinaryDocument

WSDocument createBinaryDocument(long communityID,
                                long userID,
                                long documentTypeID,
                                java.lang.String documentID,
                                java.lang.String title,
                                java.lang.String filename,
                                java.lang.String contentType,
                                byte[] data)
                                throws UserNotFoundException,
                                       DocumentObjectNotFoundException,
                                       DuplicateIDException,
                                       BinaryBodyException,
                                       java.io.IOException,
                                       CommunityNotFoundException,
                                       DocumentAlreadyExistsException,
                                       RejectedException
Creates a new binary document.

If a documentID is not provided (i.e. it's null) one will be automatically created. By default the autogenerated ID will be 'tempDOC-#' however the 'tempDOC-#' prefix can be controlled by changing the 'jive.temporaryDocPrefix' jive property.

Parameters:
communityID - The id of the community to create the document in.
userID - The id of the author of the new document
documentTypeID - the id of the document type of the new document
documentID - the document ID of the new document
title - The title of the document
filename - The name of the file.
contentType - The file's mime content type.
data - @throws java.io.IOException Thrown if there is problems reading the datasouce
Returns:
The newly created document. * @throws DuplicateIDException if the documentID provided is the same as an already existing document
Throws:
com.jivesoftware.community.DuplicateIDException - Thrown if the document id already exists.
UserNotFoundException - Thrown if the user is not found.
com.jivesoftware.community.BinaryBodyException - thrown if the document does not have a binary body.
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the document type does not exist.
CommunityNotFoundException - Thrown if the specified community does not exist.
com.jivesoftware.community.DocumentAlreadyExistsException - Thrown if the document with that documentID already already exists.
RejectedException - Thrown if the document can not be added for some unknown reason.
java.io.IOException - Thrown if their are issues reading the binary document.
DocumentObjectNotFoundException
DuplicateIDException
BinaryBodyException
DocumentAlreadyExistsException

getBinaryDocumentContent

WSBinaryBody getBinaryDocumentContent(java.lang.String documentID)
                                      throws DocumentObjectNotFoundException
Returns the content of the binary document.

Parameters:
documentID - The id of the document.
Returns:
The file data.
Throws:
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the document does not exist.
DocumentObjectNotFoundException

getPopularDocuments

java.util.List<WSDocument> getPopularDocuments()
Returns the top x documents across all communities according to ratings, document views and time passed since the document was created. The algorithm is as follows:

Top x of ((document views) * (document mean rating+2)) * 1/(1 + number of days since creation date)

The number of documents to return is determined by the property "popularDocuments.number", defaulting to 5 if the property is not specified. Popular documents are only calculated once every 15 minutes.

Returns:
a list of the most popular documents.

getPopularDocumentsByCommunity

java.util.List<WSDocument> getPopularDocumentsByCommunity(long communityID)
                                                          throws CommunityNotFoundException
Returns the top x documents in the given community according to ratings, document views & time passed since the document was created. The algorithm is as follows:

Top x of ((document views) * (document mean rating+2)) * 1/(1 + number of days since creation date)

The number of documents to return is determined by the property "popularDocuments.number", defaulting to 5 if the property is not specified. Popular documents are only calculated once every 15 minutes.

Parameters:
communityID - The community to fetch documents for
Returns:
a list of the most popular documents in the community
Throws:
CommunityNotFoundException

getDocumentsByCommunityAndFilter

java.util.List<WSDocument> getDocumentsByCommunityAndFilter(long communityID,
                                                            WSDocumentResultFilter filter)
                                                            throws CommunityNotFoundException
Returns all of the documents in the given community after the specified filter has been applied.

Parameters:
communityID - The community to fetch documents for
filter - The filter to apply to the results
Returns:
a list of the most recent documents in the community
Throws:
CommunityNotFoundException
See Also:
com.jivesoftware.community.action.RecentDocumentsAction

getDocumentsByCommunity

java.util.List<WSDocument> getDocumentsByCommunity(long communityID)
                                                   throws CommunityNotFoundException
Returns all of the documents for the specified community.

Parameters:
communityID - The id of the community.
Returns:
returns the documents for a community.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getPopularDocumentsByLanguage

java.util.List<WSDocument> getPopularDocumentsByLanguage(java.util.List<java.lang.String> languages)
Returns the top x documents across all communities according to ratings, document views and time passed since the document was created in the languages specified. The algorithm is as follows:

Top x of ((document views) * (document mean rating+2)) * 1/(1 + number of days since creation date)

The number of documents to return is determined by the property "popularDocuments.number", defaulting to 5 if the property is not specified. Popular documents are only calculated once every 15 minutes.

Parameters:
languages - a list of ISO-639 language codes to restrict returned documents to.
Returns:
a list of the most popular documents.

getUserApprovalDocuments

java.util.List<WSDocument> getUserApprovalDocuments(long userID)
                                                    throws UserNotFoundException
Returns a list of documents that a user needs to approve.

Parameters:
userID - The user to acquire the documents for.
Returns:
The collection documents the user needs to approve.
Throws:
UserNotFoundException - Thrown if the id of the user specified is not found.

moveDocument

void moveDocument(long documentID,
                  long communityID)
                  throws UnauthorizedException,
                         DocumentObjectNotFoundException,
                         CommunityNotFoundException
Moves a document from it's current community to another.

Parameters:
documentID - the id of the document to move.
communityID - the id of the community to move the document to.
Throws:
UnauthorizedException - if user does not have administrator permissions for the document's current community.
CommunityNotFoundException - Thrown if the specified community does not exist.
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the specified document does not exist.
DocumentObjectNotFoundException

deleteDocument

void deleteDocument(long documentID)
                    throws DocumentObjectNotFoundException
Deletes a document. Once a document is deleted, the document object should no longer be used. The search index and other resources that referenced the document and its comments will also be updated appropriately.

Note that since documents are versioned you may want to just delete or archive the specific version of the document instead of deleting the document which will delete all versions of the document. If this is the case see com.jivesoftware.community.Document#getVersionManager()

Parameters:
documentID - the id of the document to delete.
Throws:
UnauthorizedException - if user does not have administrator permissions for the community.
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the specified document does not exist.
DocumentObjectNotFoundException

isCommentsEnabled

boolean isCommentsEnabled()
Returns true if the comments feature is turned on. When comments are disabled on the system, all individual document comment settings are disabled as well.

Returns:
true if the comments are enabled

setCommentsEnabled

void setCommentsEnabled(boolean enableComments)
Enables or disables the comments feature system wide.

Parameters:
enableComments - true to enableComments the comments feature, false to disable
Throws:
UnauthorizedException - if not a system administrator

isTrackbacksEnabled

boolean isTrackbacksEnabled()
Returns true if the trackbacks feature is turned on. When trackbacks are disabled on the system, all individual document trackback settings are disabled as well.

Returns:
true if the comments are enabled

setTrackbacksEnabled

void setTrackbacksEnabled(boolean enableTrackbacks)
Enables or disables the trackbacks feature system wide.

Parameters:
enableTrackbacks - true to enableTrackbacks the trackback feature, false to disable
Throws:
UnauthorizedException - if not a system administrator

getDocumentByInternalDocID

WSDocument getDocumentByInternalDocID(long internalDocID)
                                      throws DocumentObjectNotFoundException
Returns the document with the specified docID. It's a good idea to only display the string version of ID's to users so most often this method will be used only internally to the API.

Parameters:
internalDocID - the long doc ID of the document
Returns:
the document with the specified ID
Throws:
DocumentObjectNotFoundException - if no document with the specified ID can be found
UnauthorizedException - if the user doesn't have permissions to view the document.

getDocumentByInternalDocIDAndVersion

WSDocument getDocumentByInternalDocIDAndVersion(long internalDocID,
                                                int version)
                                                throws DocumentObjectNotFoundException
Returns the revision of document with the specified docID and version number. It's a good idea to only display the string version of ID's to users so most often this method will be used only internally to the API.

Parameters:
internalDocID - the long doc ID of the document
version - the version number of the document
Returns:
the document with the specified ID
Throws:
DocumentObjectNotFoundException - if no document with the specified ID can be found
UnauthorizedException - if the user doesn't have permissions to view the document.

getDocumentByDocumentID

WSDocument getDocumentByDocumentID(java.lang.String documentID)
                                   throws DocumentObjectNotFoundException
Returns a document from the community based on its document ID.

Parameters:
documentID - the document ID of the document to retrieve.
Returns:
a Document object based on its document ID.
Throws:
DocumentObjectNotFoundException - if no document with the specified ID can be found
UnauthorizedException - if the user doesn't have permissions to view the document.

getDocumentByDocumentIDAndVersion

WSDocument getDocumentByDocumentIDAndVersion(java.lang.String documentID,
                                             int version)
                                             throws DocumentObjectNotFoundException
Returns the revision of the document with the specified docID and version number.

Parameters:
documentID - the document ID of the document to retrieve.
version - the version number of the document.
Returns:
a Document object based on its document ID.
Throws:
DocumentObjectNotFoundException - if no document with the specified ID can be found
UnauthorizedException - if the user doesn't have permissions to view the document.

getApprovalStatusForDocument

java.util.List<WSApprovalStatus> getApprovalStatusForDocument(long documentID)
                                                              throws DocumentObjectNotFoundException
Returns a collection of WSApprovalStatus objects. The WSApprovalStatus objects contain show which user has approved the Document and which hasn't.

Parameters:
documentID - Thrown if the specified document does not exist.
Returns:
A collection of WSApprovalStatus documents.
Throws:
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the specified document does not exist.
DocumentObjectNotFoundException
See Also:
WSApprovalStatus

addDocumentApproverOnDocument

void addDocumentApproverOnDocument(long documentID,
                                   long userID)
                                   throws com.jivesoftware.community.DocumentObjectNotFoundException,
                                          UserNotFoundException
Adds a user as a document approver for this document. If document approval is enabled for this document this user will have to approve this document to before it will be changed to a PUBLISHED status when it is edited.

Parameters:
documentID - The id of the document.
userID - The user to add as a document approver
Throws:
UserNotFoundException - Throws an exception if the user does not exist.
com.jivesoftware.community.DocumentObjectNotFoundException - Throws an exception if the document specified does not exist.

addDocumentApproverOnCommunity

void addDocumentApproverOnCommunity(long communityID,
                                    long userID)
                                    throws CommunityNotFoundException,
                                           UserNotFoundException
Add the user as a document approver for this entire community.

This user will be required to approve all document edits for all documents in this community that have document approval enabled.

Parameters:
communityID - The id of the community.
userID - The id of the user to add as a document approver.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.
UserNotFoundException - Thrown if the specified user does not exist.

getDocumentApproversOnDocument

java.util.List<WSUser> getDocumentApproversOnDocument(long documentID)
                                                      throws com.jivesoftware.community.DocumentObjectNotFoundException
Returns all of the users that must approve new documents before they reach a PUBLISHED state when it is in a PENDING_APPROVAL state.

Parameters:
documentID - The id of the document.
Returns:
All of the document approvers.
Throws:
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the id of the document does not exist.

getDocumentApproversOnCommunity

java.util.List<WSUser> getDocumentApproversOnCommunity(long communityID)
                                                       throws CommunityNotFoundException
Returns all of the users that must approve new documents before they reach a PUBLISHED state when it is in a PENDING_APPROVAL state.

Parameters:
communityID - The id of the community.
Returns:
All of the document approvers.
Throws:
CommunityNotFoundException - Thrown if the specified community does not exist.

getAuthors

java.util.List<WSUser> getAuthors(long documentID)
                                  throws DocumentObjectNotFoundException
Returns the userss who are allowed to edit the document. If no users are specifically allowed to edit, then anyone with appropriate permissions can do so.

Parameters:
documentID - Thrown if the specified document does not exist.
Returns:
the users who are allowed to edit the document. If no users are specifically allowed to edit, then anyone with appropriate permissions can do so.
Throws:
com.jivesoftware.community.DocumentObjectNotFoundException - If the specified document does not exist.
DocumentObjectNotFoundException

addAuthor

void addAuthor(long documentID,
               long userID)
               throws DocumentObjectNotFoundException,
                      UserNotFoundException
Adds the user with the supplied id as an author of this document of the specified document. Once any users have been added, the document is no longer available for editing by just anyone with the appropriate permissions.

Parameters:
userID - the id of the user to add as an author.
documentID - the document to add a user too.
Throws:
UserNotFoundException - Thrown if the specified user does not exist.
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the specified document does not exist.
DocumentObjectNotFoundException

removeAuthor

void removeAuthor(long documentID,
                  long userID)
                  throws UserNotFoundException,
                         DocumentObjectNotFoundException
Removes the user with the supplied id as an author of this document.

Parameters:
documentID - The id of the document to remove the user as an author from.
userID - The id of the user to remove as a document author.
Throws:
UserNotFoundException - Thrown if the user with the specified id does not exist.
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the document with the specified id does not exist.
DocumentObjectNotFoundException

getDocumentProperties

java.util.List<WSProperty> getDocumentProperties(long documentID)
                                                 throws DocumentObjectNotFoundException
Returns all tbe extended properties for the message with the specified ID.

Parameters:
documentID - The ID of the document to retrieve properties for.
Returns:
An array of properties for the document with the given ID.
Throws:
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the specified document does not exist.
DocumentObjectNotFoundException

getDocumentProperty

java.lang.String getDocumentProperty(java.lang.String name,
                                     long documentID)
                                     throws DocumentObjectNotFoundException
Returns a specific extended property for the document with the specified property name and document ID.

Parameters:
name - The name of the property.
documentID - The ID of the document to retrieve the property for.
Returns:
The value of the property, null if not found.
Throws:
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the specified document does not exist.
DocumentObjectNotFoundException

setDocumentProperty

void setDocumentProperty(java.lang.String name,
                         java.lang.String value,
                         long documentID)
                         throws DocumentObjectNotFoundException
Set an extended for the property with the given document id.

Parameters:
name - The name of the property.
value - The value of the property.
documentID - The ID of the document to set an extended property for.
Throws:
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the specified message does not exist.
DocumentObjectNotFoundException

deleteDocumentProperty

void deleteDocumentProperty(java.lang.String name,
                            long documentID)
                            throws DocumentObjectNotFoundException
Delete a property with the given name from the document with the given ID.

Parameters:
name - The name of the property to delete.
documentID - The ID of the message to delete the property from.
Throws:
com.jivesoftware.community.DocumentObjectNotFoundException - Thrown if the specified message does not exist.
DocumentObjectNotFoundException

getAttachmentsByDocumentID

java.util.List<WSAttachment> getAttachmentsByDocumentID(java.lang.String documentID)
                                                        throws DocumentObjectNotFoundException
Acquire the attachments for a document by the document id.

Parameters:
documentID - The id of the document.
Returns:
Attachments associated with the specified document.
Throws:
DocumentObjectNotFoundException - If the document specified does not exist.

getAttachmentsByInternalDocID

java.util.List<WSAttachment> getAttachmentsByInternalDocID(long internalDocID)
                                                           throws com.jivesoftware.community.DocumentObjectNotFoundException
Acquire the attachments for a document by the internal document id.

Parameters:
internalDocID - The internal id of the document.
Returns:
Attachments associated with the specified document.
Throws:
DocumentObjectNotFoundException - If the document specified does not exist.

addAttachmentToDocumentByDocumentID

void addAttachmentToDocumentByDocumentID(java.lang.String documentID,
                                         java.lang.String name,
                                         java.lang.String contentType,
                                         byte[] source)
                                         throws DocumentObjectNotFoundException,
                                                AttachmentException
Add a new attachment to the document with the specified id.

Parameters:
documentID - The id of the document.
name - The name of the file that is being added as an attachment.
contentType - The mime type of the file.
source - The file content.
Throws:
DocumentObjectNotFoundException - Thrown if the specified document does not exist.
AttachmentException - Thrown if there is a problem adding the attachment.

addAttachmentToDocumentByInternalDocID

void addAttachmentToDocumentByInternalDocID(long internalDocID,
                                            java.lang.String name,
                                            java.lang.String contentType,
                                            byte[] source)
                                            throws DocumentObjectNotFoundException,
                                                   AttachmentException
Add a new attachment to the document with the specified internal id.

Parameters:
internalDocID - The id of the document.
name - The name of the file that is being added as an attachment.
contentType - The mime type of the file.
source - The file content.
Throws:
DocumentObjectNotFoundException - Thrown if the specified document does not exist.
AttachmentException - Thrown if there is a problem adding the attachment.

getAttachmentCountByDocumentID

int getAttachmentCountByDocumentID(java.lang.String documentID)
                                   throws DocumentObjectNotFoundException
Returns the number of attachments on the document with the specified id.

Parameters:
documentID - The id of the document.
Returns:
The number of attachments.
Throws:
DocumentObjectNotFoundException - Thrown if the specified document does not exist.

getAttachmentCountByInternalDocID

int getAttachmentCountByInternalDocID(long internalDocID)
                                      throws DocumentObjectNotFoundException
Returns the number of attachments on the document with the specified internal id.

Parameters:
internalDocID - The id of the document.
Returns:
The number of attachments.
Throws:
DocumentObjectNotFoundException - Thrown if the specified document does not exist.

addImageToDocumentByDocumentID

void addImageToDocumentByDocumentID(java.lang.String documentID,
                                    java.lang.String name,
                                    java.lang.String contentType,
                                    byte[] source)
                                    throws DocumentObjectNotFoundException,
                                           ImageException
Add a new image to the document with the specified id.

Parameters:
documentID - The id of the document.
name - The name of the image that is being added.
contentType - The mime type of the image.
source - The image content.
Throws:
DocumentObjectNotFoundException - Thrown if the specified document does not exist.
ImageException - Thrown if there is a problem adding the image.

addImageToDocumentByInternalDocID

void addImageToDocumentByInternalDocID(long internalDocID,
                                       java.lang.String name,
                                       java.lang.String contentType,
                                       byte[] source)
                                       throws DocumentObjectNotFoundException,
                                              ImageException
Add a new image to the document with the specified internal id.

Parameters:
internalDocID - The internal id of the document.
name - The name of the image that is being added.
contentType - The mime type of the image.
source - The image content.
Throws:
DocumentObjectNotFoundException - Thrown if the specified document does not exist.
ImageException - Thrown if there is a problem adding the image.

getImageCountByDocumentID

int getImageCountByDocumentID(java.lang.String documentID)
                              throws DocumentObjectNotFoundException
Returns the number of images on the document with the specified id.

Parameters:
documentID - The id of the document.
Returns:
The number of images.
Throws:
DocumentObjectNotFoundException - Thrown if the specified document does not exist.

getImageCountByInternalDocID

int getImageCountByInternalDocID(long internalDocID)
                                 throws DocumentObjectNotFoundException
Returns the number of images on the document with the specified internal id.

Parameters:
internalDocID - The id of the document.
Returns:
The number of images.
Throws:
DocumentObjectNotFoundException - Thrown if the specified document does not exist.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.