Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Class CommentResultFilter

java.lang.Object
  extended by com.jivesoftware.community.ResultFilter
      extended by com.jivesoftware.community.CommentResultFilter

public class CommentResultFilter
extends ResultFilter

Filters and sorts lists of Comments. This allows for a very rich set of possible queries that can be run. An example: "Show all comment posted in the document during the last year by a certain user".

The class also supports pagination of results with the setStartIndex(int) and setNumResults(int) methods. If the start index is not set, it will begin at index 0 (the start of results). If the number of results is not set, it will be unbounded and return as many results as available.

By default, result filters will obey the moderation rules as they are set for each community. You can override this behavior by setting a moderation range.

Factory methods to create common queries are provided for convenience.

See Also:
CommentManager#getComments(JiveObject,CommentResultFilter), CommentManager#getCommentCount(JiveObject,CommentResultFilter)

Field Summary
 
Fields inherited from class com.jivesoftware.community.ResultFilter
AND_MODE, ASCENDING, CONTAINS_MATCH, DESCENDING, EXACT_MATCH, NULL_INT, OR_MODE
 
Constructor Summary
CommentResultFilter()
           
 
Method Summary
static CommentResultFilter createDefaultFilter()
          Creates a default comment ResultFilter: no filtering with results sorted on the comment creation date.
static CommentResultFilter createDefaultFilter(Community community)
          Creates a default comment ResultFilter: no filtering with results sorted on the comment creation date.
 long getCommunityID()
          Returns the communityID.
 boolean isIncludeModerated()
          Returns whether the result to be selected by the result filter should include moderated comments.
 void setCommunityID(long communityID)
          Sets the communityID to use to restrict results to be selected by the result filter.
 void setIncludeModerated(boolean include)
          Sets whether the result to be selected by the result filter should include moderated comments.
 
Methods inherited from class com.jivesoftware.community.ResultFilter
addProperty, addProperty, addTag, createDefaultContentFilter, createDefaultRecursiveContentFilter, equals, getCreationDateRangeMax, getCreationDateRangeMin, getModificationDateRangeMax, getModificationDateRangeMin, getNumResults, getPropertyCount, getPropertyMatchType, getPropertyMode, getPropertyName, getPropertyValue, getPropertyValueString, getSortField, getSortOrder, getSortPropertyName, getStartIndex, getTags, getUserID, hashCode, isAllTagsRequired, isPerformDistinctCount, isRecursive, setAllTagsRequired, setCreationDateRangeMax, setCreationDateRangeMin, setModificationDateRangeMax, setModificationDateRangeMin, setNumResults, setPerformDistinctCount, setPropertyMode, setRecursive, setSortField, setSortOrder, setSortPropertyName, setStartIndex, setTags, setUserID, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CommentResultFilter

public CommentResultFilter()
Method Detail

createDefaultFilter

public static CommentResultFilter createDefaultFilter()
Creates a default comment ResultFilter: no filtering with results sorted on the comment creation date. The moderation minimum value will be the highest moderation minimum value of any community the parent object belongs to.


createDefaultFilter

public static CommentResultFilter createDefaultFilter(Community community)
Creates a default comment ResultFilter: no filtering with results sorted on the comment creation date. The moderation minimum value will be value retrieved from the given community.

Parameters:
community - - the community to get the default moderation minimum value from.

getCommunityID

public long getCommunityID()
Returns the communityID. This can be used to restrict results to be selected by the result filter. This is most useful when you only want the results inside of a particular community (i.e. list all comments that are moderated appropriately within a specific community).

Returns:
the current communityID, or -1 if it is not set.

setCommunityID

public void setCommunityID(long communityID)
Sets the communityID to use to restrict results to be selected by the result filter. This is most useful when you only want the results inside of a particular community (i.e. list all comments that are moderated appropriately within a specific community).

Parameters:
communityID - the community that will be used to restrict results.

isIncludeModerated

public boolean isIncludeModerated()
Returns whether the result to be selected by the result filter should include moderated comments. The default value is false, or not to include moderated comments.

Returns:
whether the result to be selected by the result filter should include moderated comments.

setIncludeModerated

public void setIncludeModerated(boolean include)
Sets whether the result to be selected by the result filter should include moderated comments. The default value is false, or not to include moderated comments.

Parameters:
include - true to include moderated comments, false otherwise.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.