Clearspace API (1.10.16) Core Javadocs

com.jivesoftware.community
Interface BlogManager

All Superinterfaces:
JiveManager

public interface BlogManager
extends JiveManager

Manages blogs, including viewing, creating, and deleting them. If you wish to use a custom implementation, you must set the Jive property BlogManager.className with the name of your BlogManager class. Your class must have a public, no-argument constructor. The class must also create and return Blog object implementations as necessary.

See Also:
Blog

Method Summary
 void addBlog(Blog blog)
          Adds a blog to the database.
 Blog createBlog(User user)
          Creates a new blog.
 void deleteBlog(Blog blog)
          Permanently deletes a blog and all of the blog postings and comments associated with the blog.
 Blog getBlog(long blogID)
          Returns a blog by blog ID.
 Blog getBlog(java.lang.String displayName)
          Returns a blog by blog display name.
 int getBlogCount()
          Returns the total number of blogs on this system.
 int getBlogCount(com.jivesoftware.community.BlogResultFilter resultFilter)
          Returns the total number of blogs on this system that match the criteria specified by the ResultFilter.
 BlogPost getBlogPost(long blogPostID)
          Returns the BlogPost specified by the blog post ID.
 int getBlogPostCount()
          Returns the number of blog posts on the system, by default only includes blog posts where status = BlogPost.STATUS_PUBLISH and publish date less than now().
 int getBlogPostCount(BlogPostResultFilter resultFilter)
          Returns the number of blog posts on the system.
 JiveIterator<BlogPost> getBlogPosts(BlogPostResultFilter resultFilter)
          Returns all the blog posts that match the criteria specified by the BlogPostResultFilter on the entire system.
 JiveIterator<Blog> getBlogs(com.jivesoftware.community.BlogResultFilter resultFilter)
          Returns all the blogs on this system that match the criteria specified by the ResultFilter.
 JiveIterator<Blog> getBlogs(User user)
          Returns all blogs which are associated with the given user.
 JiveIterator<Blog> getBlogsByDisplayName(java.lang.String query, int startIndex, int endIndex, int numResults)
          Returns all the blogs on this system whose display name is LIKE the given query.
 int getBlogsCount(User user)
          Returns the count of all blogs which are associated with the given user.
 int getCommentCount()
          Returns the number of comments on blog posts in the system.
 int getCommentCount(FeedbackResultFilter resultFilter)
          Returns the number of comments on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.
 JiveIterator<Comment> getComments(FeedbackResultFilter resultFilter)
          Returns all the comments on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.
 InterceptorManager getInterceptorManager()
          Returns an interceptor manager that can be used to manage interceptors for all the blogs in the system.
 java.lang.String getPingServices()
          Returns a comma delimited list of available ping services for the system.
 JiveIterator<BlogPost> getPopularBlogPosts()
          Returns the top x blog posts according to blog post views, number of comments & time passed since the blog post was created.
 JiveIterator<Blog> getRecentBlogs()
          Returns (at most) the ten most recent blogs created on this system.
 java.util.Map<java.lang.String,java.lang.Integer> getTags()
          Returns all tags for blogs in the system in a Map where the key is the name of tag and the value is the number of times the tag has been used in this system.
 java.util.Map<java.lang.String,java.lang.Integer> getTags(BlogTagResultFilter resultFilter)
          Returns all tags for blogs in the system in a Map where the key is the name of tag and the value is the number of times the tag has been used in this system filtered by the BlogTagResultFilter.
 int getTrackbackCount()
          Returns the number of trackbacks on blog posts in the system.
 int getTrackbackCount(FeedbackResultFilter resultFilter)
          Returns the number of trackbacks on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.
 JiveIterator<Trackback> getTrackbacks(FeedbackResultFilter resultFilter)
          Returns all the trackbacks on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.
 boolean hasBlog(User user)
          Returns true if the given user has one or more blogs, false if the user does not have a blog.
 boolean isAuthorized(long permissionType)
          Returns true if the handle on the object has the permission specified.
 boolean isBlogsEnabled()
          Returns true if the blogs feature is turned on.
 boolean isCommentsEnabled()
          Returns true if the comments feature is turned on.
 boolean isPingsEnabled()
          Returns true if the pings feature is turned on.
 boolean isPingsOverrideEnabled()
          Returns true if the system has been configured to allow users to override the ping URIs configured for the system.
 boolean isTrackbacksEnabled()
          Returns true if the trackbacks feature is turned on.
 void setBlogsEnabled(boolean blogsEnabled)
          Enables or disables the blogs feature.
 void setCommentsEnabled(boolean commentsEnabled)
          Enables or disables the comments feature system wide.
 void setPingsEnabled(boolean pingsEnabled)
          Enables or disables the pings feature system wide.
 void setPingServices(java.lang.String pingServices)
          Sets the comma delimited list of available ping services for the system.
 void setPingsOverrideEnabled(boolean pingsOverrideEnabled)
          Configures the system to allow users to override the ping URIs configured for all blogs.
 void setTrackbacksEnabled(boolean trackbacksEnabled)
          Enables or disables the trackbacks feature system wide.
 
Methods inherited from interface com.jivesoftware.community.JiveManager
destroy, initialize
 

Method Detail

isBlogsEnabled

boolean isBlogsEnabled()
Returns true if the blogs feature is turned on. When blogs are disabled, other methods serve as no-ops.

Returns:
true if the blogs are enabled

setBlogsEnabled

void setBlogsEnabled(boolean blogsEnabled)
                     throws UnauthorizedException
Enables or disables the blogs feature. When blogs are disabled, other methods serve as no-ops.

Parameters:
blogsEnabled - true to enable the blogs feature, false to disable
Throws:
UnauthorizedException - if not a system administrator

isCommentsEnabled

boolean isCommentsEnabled()
Returns true if the comments feature is turned on. When comments are disabled on the system, all individual blog comment settings are disabled as well.

Returns:
true if the comments are enabled

setCommentsEnabled

void setCommentsEnabled(boolean commentsEnabled)
                        throws UnauthorizedException
Enables or disables the comments feature system wide.

Parameters:
commentsEnabled - true to enable the comments feature, false to disable
Throws:
UnauthorizedException - if not a system administrator

isTrackbacksEnabled

boolean isTrackbacksEnabled()
Returns true if the trackbacks feature is turned on. When trackbacks are disabled on the system, all individual blog trackback settings are disabled as well.

Returns:
true if the comments are enabled

setTrackbacksEnabled

void setTrackbacksEnabled(boolean trackbacksEnabled)
                          throws UnauthorizedException
Enables or disables the trackbacks feature system wide.

Parameters:
trackbacksEnabled - true to enable the trackback feature, false to disable
Throws:
UnauthorizedException - if not a system administrator

isPingsEnabled

boolean isPingsEnabled()
Returns true if the pings feature is turned on. When pings are disabled on the system, all individual blog ping settings are disabled as well.

Returns:
true if pings are enabled

setPingsEnabled

void setPingsEnabled(boolean pingsEnabled)
                     throws UnauthorizedException
Enables or disables the pings feature system wide.

Parameters:
pingsEnabled - true to enable the ping feature, false to disable
Throws:
UnauthorizedException - if not a system administrator

isPingsOverrideEnabled

boolean isPingsOverrideEnabled()
Returns true if the system has been configured to allow users to override the ping URIs configured for the system.

Returns:
true if users can provide their own ping URI's are enabled

setPingsOverrideEnabled

void setPingsOverrideEnabled(boolean pingsOverrideEnabled)
                             throws UnauthorizedException
Configures the system to allow users to override the ping URIs configured for all blogs.

Parameters:
pingsOverrideEnabled - true to enable users to override the system settings, false to use system settings.
Throws:
UnauthorizedException - if not a system administrator

getPingServices

java.lang.String getPingServices()
Returns a comma delimited list of available ping services for the system.

Returns:
a comma delimited list of available ping services for the system.

setPingServices

void setPingServices(java.lang.String pingServices)
                     throws UnauthorizedException
Sets the comma delimited list of available ping services for the system.

Parameters:
pingServices - comma delimited list of available ping services for the system.
Throws:
UnauthorizedException - if not a system administrator

createBlog

Blog createBlog(User user)
                throws UnauthorizedException
Creates a new blog. After an blog is created and the appropriate values are set, it must be added to the database by calling the addBlog(com.jivesoftware.community.Blog) method.

Parameters:
user - the user creating the blog.
Returns:
a new blog.
Throws:
UnauthorizedException - if not allowed to create a blog, not a system administrator or not a community administrator

addBlog

void addBlog(Blog blog)
             throws UnauthorizedException
Adds a blog to the database. This method must be called after the blog is created and all appropriate values on it have been set (which means that at the very least, the blog must have a name and a unique display name). After this method is called, the blog will be immediately viewable to others.

Parameters:
blog - the blog to add to the database.
Throws:
UnauthorizedException - if not allowed to create a blog, not a system administrator or not a community administrator
java.lang.IllegalStateException - if the blog has already been added.

deleteBlog

void deleteBlog(Blog blog)
                throws UnauthorizedException
Permanently deletes a blog and all of the blog postings and comments associated with the blog.

Parameters:
blog - the blog to delete.
Throws:
UnauthorizedException - if not a system administrator or not a community administrator

getBlog

Blog getBlog(long blogID)
             throws BlogNotFoundException,
                    UnauthorizedException
Returns a blog by blog ID.

Parameters:
blogID - the ID of the blog to return.
Returns:
the blog.
Throws:
BlogNotFoundException - if the blog could not be loaded or does not exist.
UnauthorizedException - if not allowed to get the blog.

getBlog

Blog getBlog(java.lang.String displayName)
             throws BlogNotFoundException,
                    UnauthorizedException
Returns a blog by blog display name.

Parameters:
displayName - the displayName of the blog to return.
Returns:
the blog.
Throws:
BlogNotFoundException - if the blog could not be loaded or does not exist.
UnauthorizedException - if not allowed to get the blog.

getBlogCount

int getBlogCount()
Returns the total number of blogs on this system.

Returns:
the total number of blogs on this system.

getBlogCount

int getBlogCount(com.jivesoftware.community.BlogResultFilter resultFilter)
Returns the total number of blogs on this system that match the criteria specified by the ResultFilter.

Parameters:
resultFilter - the besult filter holding the criteria to filter the blog count
Returns:
the total number of blogs on this system that match the criteria specified by the ResultFilter.

getBlogs

JiveIterator<Blog> getBlogs(com.jivesoftware.community.BlogResultFilter resultFilter)
Returns all the blogs on this system that match the criteria specified by the ResultFilter.

Parameters:
resultFilter - a ResultFilter object to perform filtering and sorting with.
Returns:
all the blogs on this system that match the ResultFilter.

getBlogsByDisplayName

JiveIterator<Blog> getBlogsByDisplayName(java.lang.String query,
                                         int startIndex,
                                         int endIndex,
                                         int numResults)
Returns all the blogs on this system whose display name is LIKE the given query. NOTE: This method is designed only to be used only by administrators for administration purposes and will throw an UnauthorizedException if the current user is not a system administrator.

Parameters:
query - a string to search blog display names by
Returns:
all the blogs on this system whose display name is LIKE the given query.

getRecentBlogs

JiveIterator<Blog> getRecentBlogs()
Returns (at most) the ten most recent blogs created on this system.

Returns:
(at most) the ten most recent blogs created on this system.

getTags

java.util.Map<java.lang.String,java.lang.Integer> getTags()
Returns all tags for blogs in the system in a Map where the key is the name of tag and the value is the number of times the tag has been used in this system.

Returns:
all tags for blogs in the system in a Map where the key is the name of tag and the value is the number of times the tag has been used in this system.

getTags

java.util.Map<java.lang.String,java.lang.Integer> getTags(BlogTagResultFilter resultFilter)
Returns all tags for blogs in the system in a Map where the key is the name of tag and the value is the number of times the tag has been used in this system filtered by the BlogTagResultFilter.

Parameters:
resultFilter - the filter to use to restrict tag results
Returns:
all tags for blogs in the system in a Map where the key is the name of tag and the value is the number of times the tag has been used in this system filtered by the BlogTagResultFilter.

getBlogPost

BlogPost getBlogPost(long blogPostID)
                     throws BlogPostNotFoundException
Returns the BlogPost specified by the blog post ID.

Parameters:
blogPostID - the ID of the blog post to return.
Returns:
the blog post.
Throws:
BlogPostNotFoundException - if the blog post could not be loaded or does not exist.
UnauthorizedException - if not allowed to get the blog post.

getBlogPostCount

int getBlogPostCount()
Returns the number of blog posts on the system, by default only includes blog posts where status = BlogPost.STATUS_PUBLISH and publish date less than now().

Returns:
the number of blog posts on the system.

getBlogPostCount

int getBlogPostCount(BlogPostResultFilter resultFilter)
Returns the number of blog posts on the system. The default blog post result filter (BlogPostResultFilter.createDefaultFilter()) only includes blog posts where status = BlogPost.STATUS_PUBLISH and publish date less than now().

Parameters:
resultFilter - the besult filter holding the criteria to filter the blogposts
Returns:
the number of blog posts on the system that match the criteria specified by the BlogPostResultFilter

getBlogPosts

JiveIterator<BlogPost> getBlogPosts(BlogPostResultFilter resultFilter)
Returns all the blog posts that match the criteria specified by the BlogPostResultFilter on the entire system.

Parameters:
resultFilter - a BlogPostResultFilter object to perform filtering and sorting with.
Returns:
all the blog posts that match the ResultFilter.

getCommentCount

int getCommentCount()
Returns the number of comments on blog posts in the system.

Returns:
the number of comments on blog posts in the system.

getCommentCount

int getCommentCount(FeedbackResultFilter resultFilter)
Returns the number of comments on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.

Parameters:
resultFilter - a FeedbackResultFilter object to perform filtering and sorting with.
Returns:
the number of comments on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.

getComments

JiveIterator<Comment> getComments(FeedbackResultFilter resultFilter)
Returns all the comments on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.

Parameters:
resultFilter - a FeedbackResultFilter object to perform filtering and sorting with.
Returns:
all the comments that match the ResultFilter.

getTrackbackCount

int getTrackbackCount()
Returns the number of trackbacks on blog posts in the system.

Returns:
the number of trackbacks on blog posts in the system.

getTrackbackCount

int getTrackbackCount(FeedbackResultFilter resultFilter)
Returns the number of trackbacks on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.

Parameters:
resultFilter - a FeedbackResultFilter object to perform filtering and sorting with.
Returns:
the number of trackbacks on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.

getTrackbacks

JiveIterator<Trackback> getTrackbacks(FeedbackResultFilter resultFilter)
Returns all the trackbacks on blog posts that match the criteria specified by the FeedbackResultFilter in the entire system.

Parameters:
resultFilter - a FeedbackResultFilter object to perform filtering and sorting with.
Returns:
all the trackbacks that match the ResultFilter.

hasBlog

boolean hasBlog(User user)
Returns true if the given user has one or more blogs, false if the user does not have a blog.

Parameters:
user - the user to check to see if they have a blog
Returns:
true if the given user has one or more blogs, false if the user does not have a blog.

getBlogs

JiveIterator<Blog> getBlogs(User user)
Returns all blogs which are associated with the given user.

Parameters:
user - the user to find blogs for
Returns:
all blogs that user is associated with

getBlogsCount

int getBlogsCount(User user)
Returns the count of all blogs which are associated with the given user.

Parameters:
user - the user to find blogs for
Returns:
the count of all blogs which are associated with the given user.

getPopularBlogPosts

JiveIterator<BlogPost> getPopularBlogPosts()
Returns the top x blog posts according to blog post views, number of comments & time passed since the blog post was created. The algorithm is as follows:

Top x of ((blog post views) * (number of blog post comments + 2)) * 1/(1 + number of days since creation date)

The number of blog posts to return is determined by the property "popularBlogPosts.number", defaulting to 5 if the property is not specified. Popular blog posts are only calculated once every 15 minutes.

Returns:
an Iterable of the most popular blog posts.

isAuthorized

boolean isAuthorized(long permissionType)
Returns true if the handle on the object has the permission specified. A list of possible permissions can be found in the Permissions class. Certain methods of this class are restricted to certain permissions as specified in the method comments.

Parameters:
permissionType - permissionType a permission type.
Returns:
true if the handle on the object has the specified permission.
See Also:
Permissions

getInterceptorManager

InterceptorManager getInterceptorManager()
                                         throws UnauthorizedException
Returns an interceptor manager that can be used to manage interceptors for all the blogs in the system.

Returns:
a InterceptorManager to manage interceptors.
Throws:
UnauthorizedException - if does not have admin permissions.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.