|
Clearspace API (2.5.18) 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 containers (including possibly user containers) 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. |
void |
addUsers(List<User> users)
Gives a list of users permissions 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(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 = JiveContentObject.Status.PUBLISHED 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 = JiveContentObject.Status.PUBLISHED 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. |
Set<User> |
getContributors()
Returns an alpha-sorted set of all users who have contributed to the blog. |
Date |
getCreationDate()
Returns the date that this blog was created. |
String |
getDescription()
Returns the description of the blog. |
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. |
JiveContainer |
getJiveContainer()
Returns the parent container to which this blog belongs. |
BlogPost |
getLatestPost()
Returns the most recently created and published blog post on this blog. |
Date |
getModificationDate()
Returns the date that the blog name, display name or description was last modified. |
String |
getName()
Returns the name of the blog. |
Permissions |
getPermissions(AuthToken authToken)
Deprecated. |
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. |
Map<String,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. |
Map<String,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. |
Map<String,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. |
Map<String,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. |
String |
getUnfilteredProperty(String name)
Returns an extended property of the blog, bypassing any filters. |
User |
getUser()
If this blog is a "user" blog, this method will return the User to whom this blog belongs, otherwise an IllegalStateException will be thrown. |
int |
getUserCount()
Returns the number of users associated with this blog. |
Iterable<User> |
getUsers()
Return all the users given permission to post to this blog. |
boolean |
isAuthorized(long permissionType)
Deprecated. |
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 |
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 |
isSystemBlog()
Returns true if this blog is a system blog (formerly known as group blogs). |
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. |
boolean |
isUserBlog()
Returns true if this blog is a user's personal blog. |
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 |
setCreationDate(Date creationDate)
Sets the creation date of this blog. |
void |
setDescription(String description)
Sets the description of the blog, max length of 255 characters. |
void |
setDisplayName(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 |
setJiveContainer(JiveContainer container)
Adds or moves the parent container of the blog. |
void |
setModificationDate(Date modificationDate)
Sets the date this blog was last modified. |
void |
setName(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(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.JiveContainer |
|---|
getAvailableContentTypes, getContentTypes, getInterceptorManager, getPermissionsManager, getTaggableTypes, setContentTypes |
| 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 JiveObjectString getName()
getName in interface JiveContainer
void setName(String name)
throws UnauthorizedException
setName in interface JiveContainername - the name of the blog.
UnauthorizedException - if user is not associated with this blog and does not have ADMIN permission.String getDisplayName()
getDisplayName in interface JiveContainer
void setDisplayName(String name)
throws UnauthorizedException
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.
setDisplayName in interface JiveContainername - the display name
UnauthorizedException - if user is not associated with this blog and does not have ADMIN permission.
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.String getDescription()
getDescription in interface JiveContainer
void setDescription(String description)
throws UnauthorizedException
setDescription in interface JiveContainerdescription - the description of the blog.
UnauthorizedException - if user not associated with this blog and does not have ADMIN permission.
IllegalArgumentException - if description is null or greater than 255 characters in length.Date getCreationDate()
getCreationDate in interface JiveContainer
void setCreationDate(Date creationDate)
throws UnauthorizedException
setCreationDate in interface JiveContainercreationDate - the date this blog was created.
UnauthorizedException - if not an administrator.Date getModificationDate()
getModificationDate in interface JiveContainer
void setModificationDate(Date modificationDate)
throws UnauthorizedException
setModificationDate in interface JiveContainermodificationDate - 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 addUsers(List<User> users)
throws UnauthorizedException
users - a list of users permissions to post to this blog.
UnauthorizedException - if does not have permissions to add users
void removeUser(User user)
throws UnauthorizedException
BlogManager.deleteBlog(Blog) method.
user - the user to remove from the blog.
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.
IllegalArgumentException - if user is the only user.
UnauthorizedException - if does not have permission to remove users.
User getUser()
throws IllegalStateException
IllegalStateException - if this blog does not belong to an individual user but has multiple contributors.isUserBlog()Iterable<User> getUsers()
Set<User> getContributors()
int getUserCount()
Map<String,String> getProperties()
Values returned from the map are filtered through the filter system. To retrieve unfiltered property values use the
getUnfilteredProperty(String) method.
getProperties in interface JiveContainerString getUnfilteredProperty(String name)
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.
IllegalStateException - if the blogpost has already been added.
IllegalArgumentException - if the blogpost subject has already been used on the given publish date or
if the permalink is not specified.
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(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()
JiveContentObject.Status.PUBLISHED and publish date less than now().
int getBlogPostCount(BlogPostResultFilter resultFilter)
BlogPostResultFilter.createDefaultFilter()) only includes blog posts where status = JiveContentObject.Status.PUBLISHED 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()
Map<String,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.Map<String,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.Map<String,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 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.String getPingServices()
void setPingServices(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 isSystemBlog()
boolean isUserBlog()
JiveIterator<BlogPost> getPopularBlogPosts()
@Deprecated Permissions getPermissions(AuthToken authToken)
getPermissions in interface JiveContainerauthToken - the auth token to lookup permissions for.
@Deprecated boolean isAuthorized(long permissionType)
isAuthorized in interface JiveContainerpermissionType - permissionType a permission type.
PermissionsJiveContainer getJiveContainer()
void setJiveContainer(JiveContainer container)
container -
|
Clearspace Project Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||