Clearspace API (2.5.29) Core Javadocs

com.jivesoftware.community
Class BlogPostResultFilter

java.lang.Object
  extended by com.jivesoftware.community.ResultFilter
      extended by com.jivesoftware.community.ThreadResultFilter
          extended by com.jivesoftware.community.BlogPostResultFilter

public class BlogPostResultFilter
extends ThreadResultFilter

Filters and sorts BlogPosts.


Field Summary
static int PUBLISH_DATE
          Sort on the publish date.
 
Fields inherited from class com.jivesoftware.community.ResultFilter
AND_MODE, ASCENDING, CONTAINS_MATCH, DESCENDING, EXACT_MATCH, NULL_INT, OR_MODE
 
Constructor Summary
BlogPostResultFilter()
           
 
Method Summary
static BlogPostResultFilter createDefaultFilter()
          Creates a default blog post ResultFilter: only blog posts that have status = BlogPost#STATUS_PUBLISH with results sorted on the blog post publish date (newest blog posts first).
 long getBlogID()
          Returns the blogID that results will be filtered on.
 Date getPublishDateRangeMax()
          Returns a date that represents the upper boundry for blog posts to be selected by the result filter.
 Date getPublishDateRangeMin()
          Returns the publish date that represents the lower boundary for blog posts to be filtered on.
 boolean isIncludeMapped()
           
 boolean isOnlyDraft()
          Returns whether the result to be selected by the result filter should include draft blog posts.
 boolean isOnlyPublished()
          Returns whether the result to be selected by the result filter should include published blog posts.
 boolean isOnlyWaitingMod()
          Returns whether the result to be selected by the result filter should include only those posts that are waiting for moderator approval.
 void setBlogID(long blogID)
          Sets the blogID that results will be filtered on.
 void setIncludeMapped(boolean mapped)
          Indicates tha the search should include legacy blog mappings defined prior to 2.1.
 void setOnlyDraft(boolean onlyDraft)
          Sets whether the result to be selected by the result filter should include published blog posts.
 void setOnlyPublished(boolean onlyPublished)
          Sets whether the result to be selected by the result filter should include published blog posts.
 void setOnlyWaitingMod(boolean onlyWaitingMod)
          Sets whether the result to be selected by the result filter shoudl inlcude only blog posts that are currently waiting to be approved by a moderator.
 void setPublishDateRangeMax(Date publishDateRangeMax)
          Sets a date that represents the upper boundry for blog posts to be selected by the result filter.
 void setPublishDateRangeMin(Date publishDateRangeMin)
          Sets the date that represents the lower boundary for blog posts to be selected by the result filter.
 
Methods inherited from class com.jivesoftware.community.ThreadResultFilter
addResolutionState, clearResolutionStates, createDefaultMessageFilter, createDefaultThreadFilter, createDefaultUserMessagesFilter, equals, getModerationRangeMax, getModerationRangeMin, getResolutionDateRangeMax, getResolutionDateRangeMin, getResolutionStates, getShowModerated, getSortField, hashCode, removeResolutionState, roundDate, roundDate, setModerationRangeMax, setModerationRangeMin, setResolutionDateRangeMax, setResolutionDateRangeMin, setShowModerated, setSortField, toString
 
Methods inherited from class com.jivesoftware.community.ResultFilter
addProperty, addProperty, addTag, createDefaultContentFilter, createDefaultRecursiveContentFilter, getCreationDateRangeMax, getCreationDateRangeMin, getModificationDateRangeMax, getModificationDateRangeMin, getNumResults, getPropertyCount, getPropertyMatchType, getPropertyMode, getPropertyName, getPropertyValue, getPropertyValueString, getSortOrder, getSortPropertyName, getStartIndex, getTags, getUserID, isAllTagsRequired, isPerformDistinctCount, isRecursive, setAllTagsRequired, setCreationDateRangeMax, setCreationDateRangeMin, setModificationDateRangeMax, setModificationDateRangeMin, setNumResults, setPerformDistinctCount, setPropertyMode, setRecursive, setSortOrder, setSortPropertyName, setStartIndex, setTags, setUserID
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PUBLISH_DATE

public static final int PUBLISH_DATE
Sort on the publish date.

See Also:
Constant Field Values
Constructor Detail

BlogPostResultFilter

public BlogPostResultFilter()
Method Detail

createDefaultFilter

public static BlogPostResultFilter createDefaultFilter()
Creates a default blog post ResultFilter: only blog posts that have status = BlogPost#STATUS_PUBLISH with results sorted on the blog post publish date (newest blog posts first).

NOTE: The resulting BlogPostResultFilter should not be stored by invoking classes; this filter is the default blog post filter at the time it's being invoked.


isOnlyPublished

public boolean isOnlyPublished()
Returns whether the result to be selected by the result filter should include published blog posts. The default value is true, to include only published blog posts.

NOTE: This method only looks at the blog post publish status value and NOT the publish date. Under most circumstances, you'll want to use this method in conjunction with the publish date max and min methods.

Returns:
whether the result to be selected by the result filter should include published blog posts.

setOnlyPublished

public void setOnlyPublished(boolean onlyPublished)
Sets whether the result to be selected by the result filter should include published blog posts. The default value is true, to include only published blog posts.

NOTE: This method only looks at the blog post publish status value and NOT the publish date. Under most circumstances, you'll want to use this method in conjunction with the publish date max and min methods.


isOnlyDraft

public boolean isOnlyDraft()
Returns whether the result to be selected by the result filter should include draft blog posts. The default value is false, to include only published blog posts. If true, blog posts of state draft and scheduled will be included.

Returns:
whether the result to be selected by the result filter should include draft blog posts.

setOnlyDraft

public void setOnlyDraft(boolean onlyDraft)
Sets whether the result to be selected by the result filter should include published blog posts. The default value is true, to include only published blog posts. When set to true, blog posts of state draft and scheduled will be included.

Parameters:
onlyDraft - true if the result filter should only include draft blog posts, false otherwise.

isOnlyWaitingMod

public boolean isOnlyWaitingMod()
Returns whether the result to be selected by the result filter should include only those posts that are waiting for moderator approval.

Returns:
whether the result to be selected by the result filter should contain only blog posts waiting for moderator approval.

setOnlyWaitingMod

public void setOnlyWaitingMod(boolean onlyWaitingMod)
Sets whether the result to be selected by the result filter shoudl inlcude only blog posts that are currently waiting to be approved by a moderator. Published blog posts will not be included in teh result.

Parameters:
onlyWaitingMod - true if the result filter should only include posts waiting for moderation, false otherwise.

getPublishDateRangeMin

public Date getPublishDateRangeMin()
Returns the publish date that represents the lower boundary for blog posts to be filtered on. If this value has not been set, the method will return null.

Returns:
a Date representing the lower bound for publish dates to filter on.

setPublishDateRangeMin

public void setPublishDateRangeMin(Date publishDateRangeMin)
Sets the date that represents the lower boundary for blog posts to be selected by the result filter. If this value is not set the results filter will be unbounded for the earliest publish date selected.

Setting a date range for a BlogPostResultFilter is a potential performance bottleneck. For example, if the argument for the date range is "new Date()" then the corresponding database query will map to an accuracy of a particular millesecond in time. This means that the results can't be cached. A better solution is to round dates to the nearest minute, hour, etc (whatever accuracy you need).

Parameters:
publishDateRangeMin - Date representing the filter lowest value of the publish date to be selected.

getPublishDateRangeMax

public Date getPublishDateRangeMax()
Returns a date that represents the upper boundry for blog posts to be selected by the result filter. If this value is not set it will return null and the results filter will be unbounded for the latest publish date selected.

Returns:
a Date representing the filter highest value of the publish date to be selected.

setPublishDateRangeMax

public void setPublishDateRangeMax(Date publishDateRangeMax)
Sets a date that represents the upper boundry for blog posts to be selected by the result filter. If this value is not set the results filter will be unbounded for the latest publish date selected. Setting a date range for a BlogPostResultFilter is a potential performance bottleneck. For example, if the argument for the date range is "new Date()" then the corresponding database query will map to an accuracy of a particular millesecond in time. This means that the results can't be cached. A better solution is to round dates to the nearest minute, hour, etc (whatever accuracy you need).

Parameters:
publishDateRangeMax - Date representing the filter lowest value of the publish date range.

getBlogID

public long getBlogID()
Returns the blogID that results will be filtered on. The method will return NULL_INT if no blog to filter on has been specified.

Returns:
the blogID that results will be filtered on.

setBlogID

public void setBlogID(long blogID)
Sets the blogID that results will be filtered on. By default, no filtering on blogID's will take place. If you'd like to change so that no filtering is performed, pass in ResultFilter.NULL_INT.

Parameters:
blogID - the blog ID to filter on.

setIncludeMapped

public void setIncludeMapped(boolean mapped)
Indicates tha the search should include legacy blog mappings defined prior to 2.1. As of 2.1, no new mappings are included. Enabling this option will impede the performance of the getBlogPosts query.

Parameters:
mapped -

isIncludeMapped

public boolean isIncludeMapped()

Clearspace Project Page

Copyright © 1999-2007 Jive Software.