|
Clearspace API (2.5.29) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.jivesoftware.community.ResultFilter
com.jivesoftware.community.ThreadResultFilter
public class ThreadResultFilter
Filters and sorts lists of ForumThreads and ForumMessages. This allows for a very rich set of
possible queries that can be run on forum data. Some examples are: "Show all messages posted in the forum during the
last year by a certain user" or "Show all threads in the forum, sorted by their modification date".
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.
ForumManager.getThreads(JiveContainer ,ThreadResultFilter),
ForumManager.getMessages(JiveContainer ,ThreadResultFilter),
ForumThread.getMessages(ThreadResultFilter)| Field Summary |
|---|
| Fields inherited from class com.jivesoftware.community.ResultFilter |
|---|
AND_MODE, ASCENDING, CONTAINS_MATCH, DESCENDING, EXACT_MATCH, NULL_INT, OR_MODE |
| Constructor Summary | |
|---|---|
ThreadResultFilter()
|
|
| Method Summary | |
|---|---|
void |
addResolutionState(Question.State resolutionState)
Adds a resolution state to the set of states that will be included in filtered results. |
void |
clearResolutionStates()
Removes all resolution states from the set of states that will be included in filtered results. |
static ThreadResultFilter |
createDefaultMessageFilter()
Creates a default message ResultFilter: no filtering with results sorted on the message creation date in ascending order. |
static ThreadResultFilter |
createDefaultThreadFilter()
Creates a default thread ResultFilter: no filtering with results sorted on the thread modification date. |
static ThreadResultFilter |
createDefaultUserMessagesFilter()
Creates a default user messages ResultFilter: no filtering with results sorted on the message creation date descending (newest messages appear first). |
boolean |
equals(Object o)
|
int |
getModerationRangeMax()
Returns the moderation value that represents the upper bound for messages or threads to be selected by the result filter. |
int |
getModerationRangeMin()
Returns the moderation value that represents the lower boundry for messages or threads to be selected by the result filter. |
int |
getResolutionDateRangeMax()
Returns a date that represents the upper boundry for the resolution date of questions to be selected by the result filter. |
int |
getResolutionDateRangeMin()
Returns a date that represents the lower boundary for the resolution date of questions to be selected by the result filter. |
Set<Question.State> |
getResolutionStates()
Returns the set resolution states that will be included in filtered results. |
boolean |
getShowModerated()
|
int |
getSortField()
Returns the currently selected sort field. |
int |
hashCode()
|
void |
removeResolutionState(Question.State resolutionState)
Removes a resolution state from the set of states that will be included in filtered results. |
static Date |
roundDate(Date date,
int seconds)
|
static long |
roundDate(long date,
int seconds)
|
void |
setModerationRangeMax(int moderationRangeMax)
Sets the upper bound for the moderation value that will pass the result filter. |
void |
setModerationRangeMin(int moderationRangeMin)
Sets the moderation value that represents the lower bound for messages or threads to be selected by the result filter. |
void |
setResolutionDateRangeMax(int resolutionnDateRangeMax)
Sets a date that represents the upper boundry for the resolution date of questions to be selected by the result filter. |
void |
setResolutionDateRangeMin(int resolutionDateRangeMin)
Sets a date that represents the lower boundary for messages or threads to be selected by the result filter. |
void |
setShowModerated(boolean showModerated)
|
void |
setSortField(int sortField)
Sets the sort field to use. |
String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ThreadResultFilter()
| Method Detail |
|---|
public boolean getShowModerated()
public void setShowModerated(boolean showModerated)
public static ThreadResultFilter createDefaultThreadFilter()
public static ThreadResultFilter createDefaultMessageFilter()
public static ThreadResultFilter createDefaultUserMessagesFilter()
public int getSortField()
ResultFilter.setSortPropertyName(String).Valid sort fields for object types are as follows:
getSortField in class ResultFilterpublic void setSortField(int sortField)
ResultFilter.setSortPropertyName(String).Valid sort fields for object types are as follows:
setSortField in class ResultFiltersortField - the field that will be used for sorting.public int getModerationRangeMin()
public void setModerationRangeMin(int moderationRangeMin)
moderationRangeMin - int representing the lowest value of the moderation value range to be selected by the
result filter.public int getModerationRangeMax()
public void setModerationRangeMax(int moderationRangeMax)
moderationRangeMax - the max value of the moderation value range.public Set<Question.State> getResolutionStates()
public void addResolutionState(Question.State resolutionState)
resolutionState - resolution state.public void removeResolutionState(Question.State resolutionState)
resolutionState - resolution state.public void clearResolutionStates()
public int getResolutionDateRangeMin()
public void setResolutionDateRangeMin(int resolutionDateRangeMin)
resolutionDateRangeMin - the lowest value of the resolution date to be selected by the filter.public int getResolutionDateRangeMax()
public void setResolutionDateRangeMax(int resolutionnDateRangeMax)
resolutionnDateRangeMax - the highest value of the resolution date to be selected by the filter.
public static Date roundDate(Date date,
int seconds)
DateUtils.roundDate(Date, int)
public static long roundDate(long date,
int seconds)
DateUtils.roundDate(long, int)public boolean equals(Object o)
equals in class ResultFilterpublic int hashCode()
hashCode in class ResultFilterpublic String toString()
toString in class ResultFilter
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||