Clearspace API (2.0.15) Web Services Client Javadocs

com.jivesoftware.community.webservices
Interface CommentService


public interface CommentService


Method Summary
 WSComment addComment(int objectType, long objectID, long userID, java.lang.String body)
          Adds a new comment to an object.
 WSComment addCommentToComment(int objectType, long objectID, long commentID, long userID, java.lang.String body)
          Adds a new comment having a parent comment to the object.
 void deleteAllComments(int objectType, long objectID)
          Deletes all comments on the object.
 void deleteComment(int objectType, long objectID, long commentID)
          Deletes a comment in the object.
 void deleteCommentRecursive(int objectType, long objectID, long commentID, boolean recursive)
          Deletes a comment in the object.
 WSComment getComment(int objectType, long objectID, long commentID)
          Acquire a comment.
 int getCommentCount(int objectType, long objectID)
          Returns the number of comments in the object.
 int getCommentCountWithFilter(int objectType, long objectID, WSCommentResultFilter filter)
          Returns the number of comments in the object based on the specified ResultFilter.
 WSComment[] getComments(int objectType, long objectID)
          Returns an array of all the comments in the object.
 int getUserContentCommentCount(long userID)
          Returns a count of all the comments in all content which has been authored by the supplied user.
 int getUserContentCommentCountWithFilter(long userID, WSUserContentCommentResultFilter filter)
          Returns a count of all the comments in all content which has been authored by the supplied user.
 WSComment[] getUserContentComments(long userID)
          Returns array of all the comments in all content which has been authored by the supplied user.
 WSComment[] getUserContentCommentsWithFilter(long userID, WSUserContentCommentResultFilter filter)
          Returns array of all the comments in all content which has been authored by the supplied user.
 void updateComment(int objectType, long objectID, WSComment comment)
          Updates an existing comment.
 

Method Detail

getCommentCount

int getCommentCount(int objectType,
                    long objectID)
Returns the number of comments in the object.

Parameters:
objectType - The type of object to acquire comment count for.
objectID - The id of the manager.
Returns:
the number of comments in the object.

getCommentCountWithFilter

int getCommentCountWithFilter(int objectType,
                              long objectID,
                              WSCommentResultFilter filter)
Returns the number of comments in the object based on the specified ResultFilter. This is useful for determining such things as the number of comments in a date range, etc.

Parameters:
objectType - The object type.
objectID - The id of the object.
filter - a filter to limit the query on.
Returns:
the number of comments in the object based on the filter.

getComments

WSComment[] getComments(int objectType,
                        long objectID)
Returns an array of all the comments in the object.

Parameters:
objectType - The object type of the parent.
objectID - The object id of the parent.
Returns:
an iterable for the comments in the object.

addComment

WSComment addComment(int objectType,
                     long objectID,
                     long userID,
                     java.lang.String body)
                     throws RejectedException,
                            com.jivesoftware.community.NotFoundException
Adds a new comment to an object.

Parameters:
objectType - The object type of the parent.
objectID - The object id of the parent.
userID - The id of the user.
body - The comment body.
Returns:
The newly created comment.
Throws:
UserNotFoundException - Thrown if the specified user does not exist.
RejectedException - Thrown if the message is rejected for some unknown reason.
com.jivesoftware.community.NotFoundException

addCommentToComment

WSComment addCommentToComment(int objectType,
                              long objectID,
                              long commentID,
                              long userID,
                              java.lang.String body)
                              throws com.jivesoftware.community.NotFoundException,
                                     RejectedException
Adds a new comment having a parent comment to the object.

Parameters:
objectType - The parent jive object's object type.
objectID - The parent object's id.
commentID - The id of the parent comment.
body - Body of the new comment.
userID - Add the id of the new user.
Returns:
The newly created comment.
Throws:
RejectedException - if one of the installed interceptors prevents the comment from being posted.
UnauthorizedException - if user does not have CREATE_COMMENT permissions.
java.lang.IllegalStateException - if the object hasn't yet been added to a community.
com.jivesoftware.community.NotFoundException - If the parent objects, and user do not exist.

updateComment

void updateComment(int objectType,
                   long objectID,
                   WSComment comment)
                   throws NotFoundException,
                          RejectedException
Updates an existing comment.

Parameters:
objectType - The object type of the parent object.
objectID - The object id of the parent object.
comment - the comment to update.
Throws:
UnauthorizedException - if the user does not have permissions.
NotFoundException - Thrown if the parent object does not exist.
RejectedException - Thrown if the comment update was rejected.

deleteComment

void deleteComment(int objectType,
                   long objectID,
                   long commentID)
                   throws com.jivesoftware.community.NotFoundException
Deletes a comment in the object. Deleting a comment also deletes all of its children comments. The search index and other resources that referenced the comment and its children will also be updated appropriately.

Parameters:
objectType - The owner's object type.
objectID - The owner's object id.
commentID - the id of the comment to delete
Throws:
java.lang.IllegalArgumentException - if the comment does not belong to the object.
UnauthorizedException - if user does not have administrator permissions.
com.jivesoftware.community.NotFoundException - Thrown if the parent object does not exist, or the comment does not exist.

deleteCommentRecursive

void deleteCommentRecursive(int objectType,
                            long objectID,
                            long commentID,
                            boolean recursive)
                            throws com.jivesoftware.community.NotFoundException
Deletes a comment in the object. The search index and other resources that referenced the comment will also be updated appropriately.

Parameters:
objectType - The object type of the parent.
objectID - The object id of the parent.
commentID - The id of the comment to delete.
recursive - true to delete all the child comments, false to leave the children.
Throws:
java.lang.IllegalArgumentException - if the comment does not belong to the object.
UnauthorizedException - if user does not have administrator permissions.
com.jivesoftware.community.NotFoundException - Thrown if the parent object or the community does not exist.

deleteAllComments

void deleteAllComments(int objectType,
                       long objectID)
                       throws com.jivesoftware.community.NotFoundException
Deletes all comments on the object.

Parameters:
objectType - The object type of the parent object.
objectID - The object id of the parent id.
Throws:
UnauthorizedException - if user does not have administrator permissions.
com.jivesoftware.community.NotFoundException - Thrown if the parent object does not exist.

getComment

WSComment getComment(int objectType,
                     long objectID,
                     long commentID)
                     throws com.jivesoftware.community.NotFoundException
Acquire a comment.

Parameters:
objectType - The object type of the parent.
objectID - The object id of the parent.
commentID - The id of the comment.
Returns:
The comment matching the id.
Throws:
com.jivesoftware.community.NotFoundException - Thrown if the comment or parent object doesn't exist.

getUserContentCommentCount

int getUserContentCommentCount(long userID)
                               throws UserNotFoundException
Returns a count of all the comments in all content which has been authored by the supplied user.

Parameters:
userID - the id of the user whose content will be searched for comments.
Returns:
a count of comments.
Throws:
UserNotFoundException - Thrown if the specified user does not exist.

getUserContentComments

WSComment[] getUserContentComments(long userID)
                                   throws UserNotFoundException
Returns array of all the comments in all content which has been authored by the supplied user.

Parameters:
userID - the User whose content will be searched for comments.
Returns:
a JiveIterator for the comments in the object that match the ResultFilter.
Throws:
UserNotFoundException - Thrown if the specified user does not exist.

getUserContentCommentCountWithFilter

int getUserContentCommentCountWithFilter(long userID,
                                         WSUserContentCommentResultFilter filter)
                                         throws UserNotFoundException
Returns a count of all the comments in all content which has been authored by the supplied user.

Parameters:
userID - the id of the user whose content will be searched for comments.
filter - The filter to apply to the results
Returns:
a count of comments.
Throws:
UserNotFoundException - Thrown if the specified user does not exist.

getUserContentCommentsWithFilter

WSComment[] getUserContentCommentsWithFilter(long userID,
                                             WSUserContentCommentResultFilter filter)
                                             throws UserNotFoundException
Returns array of all the comments in all content which has been authored by the supplied user.

Parameters:
userID - the User whose content will be searched for comments.
filter - The filter to apply to the results
Returns:
a JiveIterator for the comments in the object that match the ResultFilter.
Throws:
UserNotFoundException - Thrown if the specified user does not exist.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.