Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


oracle.webcenter.comments
Interface CommentsManager


public interface CommentsManager

The access point for all operations related to retrieving and posting comments on objects in WebCenter.

An instance of this can be obtained via a call to CommentsServiceFactory.getCommentsManager().

Since:
release specific (what release of product did this appear in)

Nested Class Summary
static class CommentsManager.SortCriteria
           

 

Method Summary
 CommentsSummary createCommentsSummary(java.lang.Object... summaryData)
          Constructs a summary of comments on a WebCenter object out of raw data.
 void deleteComment(java.lang.String commentId)
          Delete a comment
 java.lang.Object getCommentById(java.lang.String commentId)
           
 java.util.List<Comment> getComments(ActivityElement activity, CommentsManager.SortCriteria sortCriteria)
          Returns all the comments that have been posted on a specified WebCenter object.
 java.util.List<Comment> getComments(ActivityElement activity, CommentsManager.SortCriteria sortCriteria, int startIndex, int itemsPerPage)
          Returns all the comments that have been posted on a specified WebCenter object.
 java.util.List<Comment> getComments(ActivityObject objId, CommentsManager.SortCriteria sortCriteria)
          Returns all the comments that have been posted on a specified WebCenter object.
 java.util.List<Comment> getComments(ActivityObject objId, CommentsManager.SortCriteria sortCriteria, int startIndex, int itemsPerPage)
          Returns all the comments that have been posted on a specified WebCenter object.
 Comment postComment(ActivityElement activity, java.lang.String commentText)
          Allows the current user to post a comment on a specified WebCenter object.
 Comment postComment(ActivityObject objId, java.lang.String commentText, oracle.webcenter.framework.service.Scope scope)
          Allows the current user to post a comment on a specified WebCenter object.
 Comment postComment(ActivityObject objId, java.lang.String commentText, oracle.webcenter.framework.service.Scope scope, java.lang.String activityId)
          Allows the current user to post a comment on a specified WebCenter object.

 

Method Detail

getComments

java.util.List<Comment> getComments(ActivityObject objId,
                                    CommentsManager.SortCriteria sortCriteria)
                                    throws CommentsException
Returns all the comments that have been posted on a specified WebCenter object.
Parameters:
objId - Object carrying information identifying the WebCenter object for which comments are to be retreived. The key properties needed to be specified on it are the service ID, the object type, and the object ID. It can be constructed by calling ActivityStreamingService.createObject(java.lang.String, oracle.webcenter.framework.service.ServiceObjectType, java.lang.String) passing in the appropriate object ID and object type, and then calling ActivityObject.setServiceID(java.lang.String) on it. The display name on the ActivityObject can be any non-null non-empty string, and need not even be the correct display name of the actual WebCenter object it represents.
sortCriteria - (optional) Criteria in which to order the list of comments being returned. If not specified, the list will be ordered in reverse chronological order of creation.
Returns:
List of comments that have been posted on the specified WebCenter object.
Throws:
CommentsException - If objId is null or incomplete, or any error occurs retrieving the comments.

getComments

java.util.List<Comment> getComments(ActivityObject objId,
                                    CommentsManager.SortCriteria sortCriteria,
                                    int startIndex,
                                    int itemsPerPage)
                                    throws CommentsException
Returns all the comments that have been posted on a specified WebCenter object.
Parameters:
objId - Object carrying information identifying the WebCenter object for which comments are to be retreived. The key properties needed to be specified on it are the service ID, the object type, and the object ID. It can be constructed by calling ActivityStreamingService.createObject(java.lang.String, oracle.webcenter.framework.service.ServiceObjectType, java.lang.String) passing in the appropriate object ID and object type, and then calling ActivityObject.setServiceID(java.lang.String) on it. The display name on the ActivityObject can be any non-null non-empty string, and need not even be the correct display name of the actual WebCenter object it represents.
sortCriteria - (optional) Criteria in which to order the list of comments being returned. If not specified, the list will be ordered in reverse chronological order of creation.
startIndex - The start index for the query (1 based)
itemsPerPage - The number of items to return
Returns:
List of comments that have been posted on the specified WebCenter object.
Throws:
CommentsException - If objId is null or incomplete, or any error occurs retrieving the comments.

postComment

Comment postComment(ActivityObject objId,
                    java.lang.String commentText,
                    oracle.webcenter.framework.service.Scope scope)
                    throws CommentsException
Allows the current user to post a comment on a specified WebCenter object.
Parameters:
objId - Object carrying information identifying the WebCenter object for which comments are to be retreived. The key properties needed to be specified on it are the service ID, the object type, and the object ID. It can be constructed by calling ActivityStreamingService.createObject(java.lang.String, oracle.webcenter.framework.service.ServiceObjectType, java.lang.String) passing in the appropriate object ID and object type, and then calling ActivityObject.setServiceID(java.lang.String) on it. The display name on the ActivityObject can be any non-null non-empty string, and need not even be the correct display name of the actual WebCenter object it represents.
commentText - Non-null non-empty string carrying the text of the comment that is to posted.
scope - The WebCenter scope to which the object belongs.
Returns:
Object representing the newly created comment.
Throws:
CommentsException - If objId is null or incomplete, commentText is null or empty, or any error occurs posting the comment.

postComment

Comment postComment(ActivityObject objId,
                    java.lang.String commentText,
                    oracle.webcenter.framework.service.Scope scope,
                    java.lang.String activityId)
                    throws CommentsException
Allows the current user to post a comment on a specified WebCenter object.
Parameters:
objId - Object carrying information identifying the WebCenter object for which comments are to be retreived. The key properties needed to be specified on it are the service ID, the object type, and the object ID. It can be constructed by calling ActivityStreamingService.createObject(java.lang.String, oracle.webcenter.framework.service.ServiceObjectType, java.lang.String) passing in the appropriate object ID and object type, and then calling ActivityObject.setServiceID(java.lang.String) on it. The display name on the ActivityObject can be any non-null non-empty string, and need not even be the correct display name of the actual WebCenter object it represents.
commentText - Non-null non-empty string carrying the text of the comment that is to posted.
scope - The WebCenter scope to which the object belongs.
activityId - An optional (non-null) original activity on which this comment is to be applied. If specified, the activity's timestamp will be incremented to current, moving the activity to the top of the activity stream.
Returns:
Object representing the newly created comment.
Throws:
CommentsException - If objId is null or incomplete, commentText is null or empty, or any error occurs posting the comment.

getComments

java.util.List<Comment> getComments(ActivityElement activity,
                                    CommentsManager.SortCriteria sortCriteria)
                                    throws CommentsException
Returns all the comments that have been posted on a specified WebCenter object.
Parameters:
activity - Object carrying information identifying the activity object for which comments are to be retreived.
sortCriteria - (optional) Criteria in which to order the list of comments being returned. If not specified, the list will be ordered in reverse chronological order of creation.
Returns:
List of comments that have been posted on the specified WebCenter object.
Throws:
CommentsException - If objId is null or incomplete, or any error occurs retrieving the comments.

getComments

java.util.List<Comment> getComments(ActivityElement activity,
                                    CommentsManager.SortCriteria sortCriteria,
                                    int startIndex,
                                    int itemsPerPage)
                                    throws CommentsException
Returns all the comments that have been posted on a specified WebCenter object.
Parameters:
activity - Object carrying information identifying the activity object for which comments are to be retreived.
sortCriteria - (optional) Criteria in which to order the list of comments being returned. If not specified, the list will be ordered in reverse chronological order of creation.
startIndex - The start index for the query (1 based)
itemsPerPage - The number of items to return
Returns:
List of comments that have been posted on the specified WebCenter object.
Throws:
CommentsException - If objId is null or incomplete, or any error occurs retrieving the comments.

postComment

Comment postComment(ActivityElement activity,
                    java.lang.String commentText)
                    throws CommentsException
Allows the current user to post a comment on a specified WebCenter object.
Parameters:
activity - Object carrying information identifying the activity object for which comments are to be retreived.
commentText - Non-null non-empty string carrying the text of the comment that is to posted.
Returns:
Object representing the newly created comment.
Throws:
CommentsException - If activity is null or incomplete, commentText is null or empty, or any error occurs posting the comment.

deleteComment

void deleteComment(java.lang.String commentId)
                   throws CommentsException
Delete a comment
Parameters:
commentId - The ID of the comment being deleted.
Throws:
CommentsException

getCommentById

java.lang.Object getCommentById(java.lang.String commentId)
                                throws CommentsException
Throws:
CommentsException

createCommentsSummary

CommentsSummary createCommentsSummary(java.lang.Object... summaryData)
                                      throws CommentsException
Constructs a summary of comments on a WebCenter object out of raw data.

The intended use of this method is for WebCenter services (that store their data in WebCenter DB and support commenting on their objects) to do a DB table join with the WC_AS_ACTOR_DETAIL table in order to fetch columns representing the comments information on their objects and then construct a meaningful comment summary for each object out of the fetched data.

Parameters:
summaryData - Series of objects, typically values in the comments-related column for a row in the WC_AS_ACTOR_DETAIL DB table. The first object should correspond to the COMMENTS_COUNT column, and the second should correspond to the RECENT_COMMENTS column.
Returns:
Summary of comments prepared from the the supplied raw data.
Throws:
CommentsException - If any error occurs preparing the summary

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle WebCenter Portal
11g Release 1 (11.1.1.7.0)
E15995-06


Copyright © 2009, 2013, Oracle and/or its affiliates. All rights reserved.