|
Clearspace API (1.3.0) Core Javadocs | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Blog
A container for a list of blog postings by a user or group of users. Every blog is associated with one or more users and contains a name and a short description. Each blog can have an arbitrary number of extended properties, which allow extra data about the blog to be stored.
| Field Summary | |
|---|---|
static int |
COMMENT_AUTH_DEFAULT
The default comment authentication value. |
static int |
COMMENT_AUTH_OPTIONAL
Value for comment authentication which indicates that users need not register with the system nor do they have to provide an email address as part of a comment. |
static int |
COMMENT_AUTH_OPTIONAL_WITH_EMAIL
Value for comment authentication which indicates that users must either register and authenticate with the system or provide an email address as part of an anonymous comment before submitting a comment. |
static int |
COMMENT_AUTH_REQUIRED
Value for comment authentication which indicates that users must register and authenticate with the system before adding a comment. |
static int |
SORT_ACTIVITY
|
static int |
SORT_BLOGID
|
static int |
SORT_DISPLAYNAME
|
static int |
SORT_NAME
|
| Method Summary | |
|---|---|
void |
addBlogPost(BlogPost post)
Adds a blogpost to the database. |
void |
addUser(User user)
Gives a user permission to post to this blog. |
BlogPost |
createBlogPost(User user)
Creates a new blog post. |
void |
deleteBlogPost(BlogPost post)
Deletes a blogpost. |
BlogPost |
getBlogPost(long blogPostID)
Returns a blogpost by blogpost ID. |
BlogPost |
getBlogPost(java.lang.String permalink,
int year,
int month,
int day)
Returns a blog post for a given permalink and year/month/day combination, where the permalink is the subject turned into a string value suitable to be a directory name. |
int |
getBlogPostCount()
Returns the number of blog posts on this blog, 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 this blog The default blog post result filter ( BlogPostResultFilter.createDefaultFilter())
only includes blog posts where status =
BlogPost.STATUS_PUBLISH and publish date less than now(). |
JiveIterator<BlogPost> |
getBlogPosts(BlogPostResultFilter resultFilter)
Returns all the blog posts that match the criteria specified by the BlogPostResultFilter on a specific blog. |
Comment |
getComment(long commentID)
Returns a comment by comment ID. |
int |
getCommentAuthenticationStrategy()
Returns the comment authentication strategy of this blog which may be any one of the following: COMMENT_AUTH_REQUIRED -- must register and login to comment
COMMENT_AUTH_OPTIONAL_WITH_EMAIL -- must either register and login or
provide an email address in the comment form. |
int |
getCommentCount()
Returns the total number of comments on this blog. |
int |
getCommentCount(FeedbackResultFilter resultFilter)
Returns the total number of comments on this blog that match the criteria specified by the ResultFilter. |
JiveIterator<Comment> |
getComments(FeedbackResultFilter resultFilter)
Returns all the comments on this blog that match the criteria specified by the ResultFilter. |
JiveIterator<Community> |
getCommunities()
Returns the communities this blog has been associated with. |
java.util.Date |
getCreationDate()
Returns the date that this blog was created. |
java.lang.String |
getDescription()
Returns the description of the blog. |
java.lang.String |
getDisplayName()
Gets the display name of a blog. |
BlogPost |
getFirstPost()
Returns the first blog post on this blog. |
long |
getID()
Returns the unique ID of the blog, or -1 if the blog hasn't been added to the database yet. |
InterceptorManager |
getInterceptorManager()
Returns an interceptor manager that can be used to manage the interceptors for this blog. |
BlogPost |
getLatestPost()
Returns the most recently created and published blog post on this blog. |
java.util.Date |
getModificationDate()
Returns the date that the blog name, display name or description was last modified. |
java.lang.String |
getName()
Returns the name of the blog. |
Permissions |
getPermissions(AuthToken authToken)
Returns the permissions for the blog that correspond to the passed-in AuthToken. |
java.lang.String |
getPingServices()
Returns a line break separated list of services that the user has chosen to ping. |
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. |
java.util.Map<java.lang.String,java.lang.Integer> |
getPopularTags()
Returns the 20 most popular tags for a given blog 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 blog. |
java.util.Map<java.lang.String,java.lang.String> |
getProperties()
Retrieve a map of all the extended properties for the blog. |
JiveIterator<BlogPost> |
getRecentBlogPosts()
Returns (at most) the ten most recent blog posts on this blog. |
JiveIterator<Comment> |
getRecentComments()
Returns (at most) the ten most recent comments on this blog. |
java.util.Map<java.lang.String,java.lang.Integer> |
getTags()
Returns all tags for a given blog 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 blog. |
java.util.Map<java.lang.String,java.lang.Integer> |
getTags(BlogTagResultFilter resultFilter)
Returns all tags for a given blog 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 blog
filtered by the BlogTagResultFilter. |
Trackback |
getTrackback(long trackbackID)
Returns a trackback by trackback ID. |
int |
getTrackbackCount()
Returns the total number of trackbacks on this blog. |
int |
getTrackbackCount(FeedbackResultFilter resultFilter)
Returns the total number of trackbacks on this blog that match the criteria specified by the ResultFilter. |
JiveIterator<Trackback> |
getTrackbacks(FeedbackResultFilter resultFilter)
Returns all the trackbacks on this blog that match the criteria specified by the ResultFilter. |
java.lang.String |
getUnfilteredProperty(java.lang.String name)
Returns an extended property of the blog, bypassing any filters. |
int |
getUserCount()
Returns the number of users associated with this blog. |
java.lang.Iterable<User> |
getUsers()
Return all the users given permission to post to this blog. |
boolean |
isAuthorized(long permissionType)
Returns true if the handle on the object has the permission specified. |
boolean |
isCommentModerationEnabled()
Returns true if comment moderation is enabled for this blog, false if not. |
boolean |
isCommentNotificationEnabled()
Returns true if comment notification is enabled for this blog, false if not. |
boolean |
isCommunityBlog()
Returns true if this blog is a community blog, false if not. |
boolean |
isFeedEnabled()
Returns true if feeds are enabled for this blog, false if not. |
boolean |
isFeedFullContent()
Returns true if the full blog post should be published in feeds, false to instead include an excerpt of the blog post. |
boolean |
isOverridePing()
Returns true if the blog has been configured to override the system settings, false to use the system blog ping settings. |
boolean |
isTrackbackModerationEnabled()
Returns true if trackback moderation is enabled for this blog, false if not. |
boolean |
isTrackbackNotificationEnabled()
Returns true if trackback notification is enabled for this blog, false if not. |
void |
removeUser(User user)
Removes a user from having permission to post to this blog. |
void |
removeUser(User user,
boolean deletePosts)
Removes a user from having permission to post to this blog and optionally deletes posts by this user. |
void |
save()
Saves the state of this Blog to the database |
void |
setCommentAuthenticationStrategy(int strategy)
Set the comment authentication strategy of this blog which may be any one of the following: COMMENT_AUTH_REQUIRED -- must register and login to comment
COMMENT_AUTH_OPTIONAL_WITH_EMAIL -- must either register and login or
provide an email address in the comment form. |
void |
setCommentModerationEnabled(boolean enable)
Enables and disables comment moderation for this blog. |
void |
setCommentNotificationEnabled(boolean enable)
Enables and disables comment notification for this blog. |
void |
setCommunityBlog(boolean enable)
Enables and disables the community aspects of this blog. |
void |
setCreationDate(java.util.Date creationDate)
Sets the creation date of this blog. |
void |
setDescription(java.lang.String description)
Sets the description of the blog, max length of 255 characters. |
void |
setDisplayName(java.lang.String name)
Sets the display name of the blog that is used as the URI. |
void |
setFeedEnabled(boolean enable)
Enables and disables feeds for this blog. |
void |
setFeedFullContent(boolean enable)
Enables or disables the publishing of the full blog post in feeds. |
void |
setModificationDate(java.util.Date modificationDate)
Sets the date this blog was last modified. |
void |
setName(java.lang.String name)
Sets the name of a blog. |
void |
setOverridePing(boolean override)
Enables or disables the blog to override the ping settings in the system. |
void |
setPingServices(java.lang.String services)
A line break separated list of services that the user has chosen to ping. |
void |
setTrackbackModerationEnabled(boolean enable)
Enables and disables trackback moderation for this blog. |
void |
setTrackbackNotificationEnabled(boolean enable)
Enables and disables trackback notification for this blog. |
| Methods inherited from interface com.jivesoftware.community.JiveObject |
|---|
getObjectType |
| Field Detail |
|---|
static final int COMMENT_AUTH_DEFAULT
static final int COMMENT_AUTH_REQUIRED
static final int COMMENT_AUTH_OPTIONAL_WITH_EMAIL
static final int COMMENT_AUTH_OPTIONAL
static final int SORT_BLOGID
static final int SORT_DISPLAYNAME
static final int SORT_NAME
static final int SORT_ACTIVITY
| Method Detail |
|---|
long getID()
getID in interface JiveObjectjava.lang.String getName()
void setName(java.lang.String name)
throws UnauthorizedException
name - the name of the blog.
UnauthorizedException - if user is not associated with this blog
and does not have ADMIN permission.java.lang.String getDisplayName()
void setDisplayName(java.lang.String name)
throws UnauthorizedException
http://jivesoftware.org/community/blogs/openfireteam
This method will throw an IllegalArgumentException if
BlogManager.getBlog(String) method to find out if
a blog with the new name already exists and
BlogUtils.isValidDisplayName(String)
to test a string for non alphanumeric characters.
name - the display name
UnauthorizedException - if user is not associated with this blog
and does not have ADMIN permission.
java.lang.IllegalArgumentException - if the name is already associated with another blog,
or if the name is the same as the username of another user,
or if the name contains non-alphanumeric characters.java.lang.String getDescription()
void setDescription(java.lang.String description)
throws UnauthorizedException
description - the description of the blog.
UnauthorizedException - if user not associated with this blog
and does not have ADMIN permission.
java.lang.IllegalArgumentException - if description is null or greater than
255 characters in length.java.util.Date getCreationDate()
void setCreationDate(java.util.Date creationDate)
throws UnauthorizedException
creationDate - the date this blog was created.
UnauthorizedException - if not an administrator.java.util.Date getModificationDate()
void setModificationDate(java.util.Date modificationDate)
throws UnauthorizedException
modificationDate - the date this blog name, display name or description was modified.
UnauthorizedException - if not an administrator.
void addUser(User user)
throws UnauthorizedException
user - the user to add post permission for
UnauthorizedException - if does not have permission to add user
void removeUser(User user)
throws UnauthorizedException
Removing a user also deletes all of the given users' posts in this blog. The search index and other resources that reference the posts will also be updated appropriately.
Note: because at least one user must be associated with a blog, an
IllegalArgumentException will thrown if user is the only user. To
delete an entire blog, use the
BlogManager.deleteBlog(Blog) method.
user - the user to remove from the blog.
java.lang.IllegalArgumentException - if user is the only user
UnauthorizedException - if does not have permission to remove users.
void removeUser(User user,
boolean deletePosts)
throws UnauthorizedException
removeUser(User user) method
since it will delete all posts by this user in this blog.
If deletePosts is false, then posts will not be deleted
but will continue to exist as having been posted by the user but
the user will no longer have permission to post to this blog.
Note: because at least one user must be associated with a blog, an
IllegalArgumentException will thrown if user is the only user. To
delete an entire blog, use the
BlogManager.deleteBlog(Blog) method.
user - the user to remove.deletePosts - true if posts by this user should be deleted, false if
posts should be associated with the primary user.
java.lang.IllegalArgumentException - if user is the only user.
UnauthorizedException - if does not have permission to remove users.java.lang.Iterable<User> getUsers()
int getUserCount()
java.util.Map<java.lang.String,java.lang.String> getProperties()
Values returned from the map are filtered through the filter system. To retrieve unfiltered
property values use the getUnfilteredProperty(String) method.
java.lang.String getUnfilteredProperty(java.lang.String name)
Because properties are not filtered before being returned, this method should be used with caution. In particular, you should avoid showing unfiltered data in an environment where embedded HTML might be interpreted.
name - the name of the property to get.
void save()
throws UnauthorizedException
UnauthorizedException - If the user is not allowed to modify this blog
BlogPost createBlogPost(User user)
throws UnauthorizedException
addBlogPost(com.jivesoftware.community.BlogPost) method.
user - the user adding the blog post
UnauthorizedException - if not allowed to create a blogpost.
void addBlogPost(BlogPost post)
throws RejectedException,
UnauthorizedException
post - the blogpost to add to the database.
RejectedException - if one of the installed interceptors prevents the
blog post from being posted.
UnauthorizedException - if not allowed to create a blogpost.
java.lang.IllegalStateException - if the blogpost has already been added.
java.lang.IllegalArgumentException - if the blogpost subject has already been used
on the given publish date.
void deleteBlogPost(BlogPost post)
throws UnauthorizedException
post - the blogpost to delete.
UnauthorizedException - if not allowed to delete the blogpost.BlogPost getFirstPost()
BlogPost getLatestPost()
ThreadResultFilter, but this
method offers a simpler, more optimized way to access the data.
BlogPost getBlogPost(long blogPostID)
throws BlogPostNotFoundException,
UnauthorizedException
blogPostID - the ID of the blogpost to return.
BlogPostNotFoundException - if the blogpost
could not be loaded, does not exist or if the blog post does exist
but hasn't been published and the user doesn't have appropriate
permissions to view unpublished material.
UnauthorizedException - if not allowed to get the blogpost.
BlogPost getBlogPost(java.lang.String permalink,
int year,
int month,
int day)
throws BlogPostNotFoundException,
UnauthorizedException
permalink - the permalink to return the blog post foryear - the year the blog post was publishedmonth - the month the blog post was publishedday - the day the blog post was published
BlogPostNotFoundException - if the blogpost
could not be loaded, does not exist or if the blog post does exist
but hasn't been published and the user doesn't have appropriate
permissions to view unpublished material.
UnauthorizedException - if not allowed to get the blogpost.BlogPost.getPermalink()int getBlogPostCount()
BlogPost.STATUS_PUBLISH
and publish date less than now().
int getBlogPostCount(BlogPostResultFilter resultFilter)
BlogPostResultFilter.createDefaultFilter())
only includes blog posts where status =
BlogPost.STATUS_PUBLISH and publish date less than now().
resultFilter - the filter to use to filter blog posts
JiveIterator<BlogPost> getBlogPosts(BlogPostResultFilter resultFilter)
resultFilter - a BlogPostResultFilter object to perform filtering and sorting with.
JiveIterator<BlogPost> getRecentBlogPosts()
java.util.Map<java.lang.String,java.lang.Integer> getPopularTags()
Map where the key is the
name of tag and the value is the number of times the tag has been used in this blog.
Map where the key is the
name of tag and the value is the number of times the tag has been used in this blog.java.util.Map<java.lang.String,java.lang.Integer> getTags()
Map where the key is the
name of tag and the value is the number of times the tag has been used in this blog.
Map where the key is the
name of tag and the value is the number of times the tag has been used in this blog.java.util.Map<java.lang.String,java.lang.Integer> getTags(BlogTagResultFilter resultFilter)
Map where the key is the
name of tag and the value is the number of times the tag has been used in this blog
filtered by the BlogTagResultFilter.
resultFilter - the filter to use to restrict tag results
Map where the key is the
name of tag and the value is the number of times the tag has been used in this blog
filtered by the BlogTagResultFilter.
Comment getComment(long commentID)
throws CommentNotFoundException,
UnauthorizedException
commentID - the ID of the comment to return.
CommentNotFoundException - if the comment could not be loaded or does not exist
UnauthorizedException - if the user doesn't have appropriate
permissions to edit the comment.int getCommentCount()
int getCommentCount(FeedbackResultFilter resultFilter)
resultFilter - the filter to use to filter comments
JiveIterator<Comment> getComments(FeedbackResultFilter resultFilter)
resultFilter - a ResultFilter object to perform filtering and sorting with.
JiveIterator<Comment> getRecentComments()
Trackback getTrackback(long trackbackID)
throws com.jivesoftware.community.TrackbackNotFoundException,
UnauthorizedException
trackbackID - the ID of the trackback to return.
TrackbackNotFoundException - if the trackback could not be loaded or does not exist
UnauthorizedException - if the user doesn't have appropriate
permissions to get the trackback.int getTrackbackCount()
int getTrackbackCount(FeedbackResultFilter resultFilter)
resultFilter - the filter to use to filter trackbacks
JiveIterator<Trackback> getTrackbacks(FeedbackResultFilter resultFilter)
resultFilter - a ResultFilter object to perform filtering and sorting with.
boolean isTrackbackModerationEnabled()
void setTrackbackModerationEnabled(boolean enable)
throws UnauthorizedException
enable - true to enable trackback moderation, false to disable trackback moderation.
UnauthorizedException - if user not associated with this blog
and does not have ADMIN permission.boolean isCommentModerationEnabled()
void setCommentModerationEnabled(boolean enable)
throws UnauthorizedException
enable - true to enable comment moderation, false to disable comment moderation.
UnauthorizedException - if user not associated with this blog
and does not have ADMIN permission.int getCommentAuthenticationStrategy()
COMMENT_AUTH_REQUIRED -- must register and login to comment
COMMENT_AUTH_OPTIONAL_WITH_EMAIL -- must either register and login or
provide an email address in the comment form.
COMMENT_AUTH_OPTIONAL -- no registration / login or email address required.
COMMENT_AUTH_REQUIRED.
void setCommentAuthenticationStrategy(int strategy)
throws UnauthorizedException
COMMENT_AUTH_REQUIRED -- must register and login to comment
COMMENT_AUTH_OPTIONAL_WITH_EMAIL -- must either register and login or
provide an email address in the comment form.
COMMENT_AUTH_OPTIONAL -- no registration / login or email address required.
strategy - the comment authentication strategy for this blog
UnauthorizedException - if user not associated with this blog
and does not have ADMIN permission.boolean isCommentNotificationEnabled()
void setCommentNotificationEnabled(boolean enable)
throws UnauthorizedException
enable - true to enable comment notification, false to disable
comment notification.
UnauthorizedException - if user not associated with this blog
and does not have ADMIN permission.boolean isTrackbackNotificationEnabled()
void setTrackbackNotificationEnabled(boolean enable)
throws UnauthorizedException
enable - true to enable trackback notification, false to disable
trackback notification.
UnauthorizedException - if user not associated with this blog
and does not have ADMIN permission.
void setFeedEnabled(boolean enable)
throws UnauthorizedException
enable - true to enable feeds on this blog, false to disable feeds.
UnauthorizedException - if user not associated with this blog and does not have
ADMIN permission.boolean isFeedEnabled()
void setFeedFullContent(boolean enable)
throws UnauthorizedException
enable - true to enable full content on feeds in this blog, false
to show an excerpt.
UnauthorizedException - if user not associated with this blog and does not have
ADMIN permission.boolean isFeedFullContent()
boolean isOverridePing()
void setOverridePing(boolean override)
override - true to override the ping settings in the system, false
to use the system settings.
UnauthorizedException - if user not associated with this blog, does not have
ADMIN permission, or the system has not been configured to allow users to override
ping settings.java.lang.String getPingServices()
void setPingServices(java.lang.String services)
services - a line break separated list of services that the user has chosen to ping
UnauthorizedException - if user not associated with this blog, does not
have ADMIN permission, or the system has not been configured to allow users
to override ping settings.boolean isCommunityBlog()
void setCommunityBlog(boolean enable)
throws UnauthorizedException
enable - true to enable community blog functionality, false to disable
community blog functionality.
UnauthorizedException - if user not associated with this blog
and does not have ADMIN permission.JiveIterator<BlogPost> getPopularBlogPosts()
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.
Permissions getPermissions(AuthToken authToken)
authToken - the auth token to lookup permissions for.
boolean isAuthorized(long permissionType)
permissionType - permissionType a permission type.
Permissions
InterceptorManager getInterceptorManager()
throws UnauthorizedException
UnauthorizedException - if not an administrator.JiveIterator<Community> getCommunities()
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||