Jive API (4.5.7.0) Core Javadocs

com.jivesoftware.community
Interface BlogPost

All Superinterfaces:
AttachmentContentResource, com.jivesoftware.community.comments.CommentContentResource, com.jivesoftware.community.ContainerAware, com.jivesoftware.community.DatedObject, ImageContentResource, JiveContentObject, JiveObject, com.jivesoftware.community.objecttype.SubjectAware, UserAuthoredObject

public interface BlogPost
extends JiveContentObject, com.jivesoftware.community.comments.CommentContentResource, AttachmentContentResource, ImageContentResource

A container for blog post data and for a hierarchy of blog comments.

There are two options for navigating through the comments on a post.


Nested Class Summary
 
Nested classes/interfaces inherited from interface com.jivesoftware.community.JiveContentObject
JiveContentObject.Field, JiveContentObject.Status
 
Field Summary
static java.lang.String POST_MODERATION_ENABLED
           
static JiveContentObject.Status STATUS_DEFAULT
          The default public status for a blog post.
static boolean TRACKBACKS_DEFAULT
          The default trackback status for a blog post.
 
Method Summary
 Blog getBlog()
          Returns the blog this post belongs to.
 org.w3c.dom.Document getBody()
          Returns the post body.
 com.jivesoftware.community.comments.CommentDelegator getCommentDelegator()
          Retrieve a comment manager to manage blog post comments.
 int getCommentStatus()
          Returns the comment status of this blog post which may be any one of the following: NONE -- no comments allowed OPEN -- comments are permitted CLOSED -- comments were permitted but are not allowed now

Defaults to OPEN.

 java.util.Date getCreationDate()
          Returns the date that this post was created.
 long getID()
          Returns the unique ID of this post, or -1 if the post hasn't been added to the database yet.
 java.util.Date getModificationDate()
          Returns the date that this post was last modified.
 BlogPost getNextPost()
          Returns the next blogpost that has been published or null if this is the most recent post.
 java.lang.String getPermalink()
          Returns the permalink for this post, where the permalink is a composed only of unreserved characters:

unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"

as according to RFC 3986: http://www.ietf.org/rfc/rfc3986.txt

Space characters and characters not in the list of unreserved characters are replaced with a hyphen character.

 BlogPost getPreviousPost()
          Returns the previous blogpost that has been published or null if this is the first post.
 java.util.Map<java.lang.String,java.lang.String> getProperties()
          Retrieve a map of all the extended properties for the post.
 java.util.Date getPublishDate()
          Returns that date that this post should be published.
 com.jivesoftware.community.rating.RatingDelegator getRatingDelegator()
          Retrieve a rating delegator to manage blog post ratings.
 JiveContentObject.Status getStatus()
          Returns the status of this blog post which may be any one of the following: JiveContentObject.Status.DRAFT -- post has status of unpublished JiveContentObject.Status.PUBLISHED -- post has status of published.
 java.lang.String getSubject()
          Returns the blog post subject.
 com.jivesoftware.community.TagDelegator getTagDelegator()
          Retrieve a tag delegator to manage blog post tags.
 com.jivesoftware.community.TrackbackDelegator getTrackbackDelegator()
          Retrieve a trackback delegator to manage blog post trackbacks.
 java.lang.String getUnfilteredProperty(java.lang.String name)
          Returns an extended property of the blog, bypassing any filters.
 User getUser()
          Returns the User that authored this post.
 int getViewCount()
          Returns the number of times this blog post has been viewed.
 boolean isMinorEdit()
          Returns whether or not the current unsaved changes constitute a minor edit.
 boolean isTrackbacksEnabled()
          Returns true if trackbacks are accepted on this blog post, false if not.
 void save()
          Saves the state of this BlogPost to the database
 void save(boolean fireModifiedEvent)
          Saves the state of this BlogPost to the database
 void setBody(org.w3c.dom.Document body)
          Sets the body of this post.
 void setCommentStatus(int status)
          Sets the comment status of this blog post which may be any one of the following: NONE -- no comments allowed OPEN -- comments are permitted CLOSED -- comments were permitted but are not allowed now
 void setCreationDate(java.util.Date creationDate)
          Sets the creation date of this post.
 void setMinorEdit(boolean minorEdit)
          Set to true to cause the next call to save() to not send notifications to users watching the document.
 void setModificationDate(java.util.Date modificationDate)
          Sets the date this post was last modified.
 void setPublishDate(java.util.Date publishDate)
          Sets the publish date of this post.
 void setStatus(JiveContentObject.Status status)
          Sets the publishing status of this blog post which may be any one of the following: JiveContentObject.Status.DRAFT -- post has status of unpublished JiveContentObject.Status.PUBLISHED -- post has status of published.
 void setSubject(java.lang.String subject)
          Sets the subject of this blog post.
 void setTrackbacksEnabled(boolean enable)
          Enables and disables trackbacks for this blog post.
 
Methods inherited from interface com.jivesoftware.community.JiveContentObject
getContainerID, getContainerType, getJiveObjectType, getPlainBody, getUnfilteredSubject
 
Methods inherited from interface com.jivesoftware.community.UserAuthoredObject
getAuthors
 
Methods inherited from interface com.jivesoftware.community.objecttype.SubjectAware
getPlainSubject
 
Methods inherited from interface com.jivesoftware.community.JiveObject
getObjectType
 
Methods inherited from interface com.jivesoftware.community.ImageContentResource
addImage, createImage, deleteImage, getImage, getImageCount, getImages
 

Field Detail

STATUS_DEFAULT

static final JiveContentObject.Status STATUS_DEFAULT
The default public status for a blog post.


TRACKBACKS_DEFAULT

static final boolean TRACKBACKS_DEFAULT
The default trackback status for a blog post.

See Also:
Constant Field Values

POST_MODERATION_ENABLED

static final java.lang.String POST_MODERATION_ENABLED
See Also:
Constant Field Values
Method Detail

getID

long getID()
Returns the unique ID of this post, or -1 if the post hasn't been added to the database yet.

Specified by:
getID in interface JiveObject
Returns:
the unique ID of the post.

getCreationDate

java.util.Date getCreationDate()
Returns the date that this post was created.

Specified by:
getCreationDate in interface com.jivesoftware.community.DatedObject
Specified by:
getCreationDate in interface JiveContentObject
Returns:
the date this post was created.

setCreationDate

void setCreationDate(java.util.Date creationDate)
                     throws UnauthorizedException
Sets the creation date of this post. In most cases, the creation date will default to when the post was entered into the system. However, the creation date needs to be set manually when importing data. In other words, skin authors should ignore this method since it only intended for system maintenance.

Parameters:
creationDate - the date this post was created.
Throws:
UnauthorizedException - if not an administrator.

getPublishDate

java.util.Date getPublishDate()
Returns that date that this post should be published.

Returns:
the date this post should be published.

setPublishDate

void setPublishDate(java.util.Date publishDate)
                    throws UnauthorizedException
Sets the publish date of this post. In most cases, the publish date will be the date that the post was initially created. However, if the user chooses, he / she can provide a date in the future or in the past to allow for future publishing or post dating.

Parameters:
publishDate - the date this post should be published.
Throws:
UnauthorizedException - if not allowed to edit this blog post.

getModificationDate

java.util.Date getModificationDate()
Returns the date that this post was last modified.

Specified by:
getModificationDate in interface com.jivesoftware.community.DatedObject
Specified by:
getModificationDate in interface JiveContentObject
Returns:
the date this post was last modified.

setModificationDate

void setModificationDate(java.util.Date modificationDate)
                         throws UnauthorizedException
Sets the date this post was last modified. In most cases, last modifed will default to when the post data was last changed. However, the last modified date needs to be set manually when importing data. In other words, skin authors should ignore this method since it only intended for system maintenance.

Parameters:
modificationDate - the date this post was modified.
Throws:
UnauthorizedException - if not an administrator.

getStatus

JiveContentObject.Status getStatus()
Returns the status of this blog post which may be any one of the following:

Defaults to JiveContentObject.Status.DRAFT

Specified by:
getStatus in interface JiveContentObject
Returns:
the publish status of this blog post

setStatus

void setStatus(JiveContentObject.Status status)
               throws UnauthorizedException
Sets the publishing status of this blog post which may be any one of the following:

Parameters:
status - the publish status of this blog post
Throws:
UnauthorizedException - if not allowed to edit this blog post.

getBlog

Blog getBlog()
Returns the blog this post belongs to.

Returns:
the blog this post belongs to.

getSubject

java.lang.String getSubject()
Returns the blog post subject. If system filters are active, the subject returned will be a filtered one. Because filters often provide security functionality, this method is the preferred way to get the subject of a blog post.

Specified by:
getSubject in interface com.jivesoftware.community.objecttype.SubjectAware
Returns:
the subject of this blog post.

setSubject

void setSubject(java.lang.String subject)
                throws UnauthorizedException
Sets the subject of this blog post.

Parameters:
subject - the subject of this blog post.
Throws:
UnauthorizedException - if not allowed to edit this blog post.

getPermalink

java.lang.String getPermalink()
Returns the permalink for this post, where the permalink is a composed only of unreserved characters:

unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"

as according to RFC 3986: http://www.ietf.org/rfc/rfc3986.txt

Space characters and characters not in the list of unreserved characters are replaced with a hyphen character.

If an entry is composed entirely of spaces or characters not in the list of unreserved characters, the permalink will instead be the hashCode of the given entry.

Examples:

NOTES:

Returns:
the permalink for this post

getBody

org.w3c.dom.Document getBody()
Returns the post body. If post filters are active, the body returned will be a filtered one. Because filters often provide security functionality such as stripping out HTML and Javascript, this method is the preferred way to get the body of a post.

Specified by:
getBody in interface JiveContentObject
Returns:
the body of this blog post.

setBody

void setBody(org.w3c.dom.Document body)
             throws UnauthorizedException
Sets the body of this post. If body is larger than message.maxBodySize the body will be truncated.

Parameters:
body - the body of this post.
Throws:
UnauthorizedException - if not allowed to edit this blog post.

getUser

User getUser()
Returns the User that authored this post.

Specified by:
getUser in interface UserAuthoredObject
Returns:
the author of the post.

getPreviousPost

BlogPost getPreviousPost()
                         throws BlogPostNotFoundException
Returns the previous blogpost that has been published or null if this is the first post.

Returns:
blogpost the previous blog post in this blog
Throws:
BlogPostNotFoundException - if the previous blog post could not be loaded

getNextPost

BlogPost getNextPost()
                     throws BlogPostNotFoundException
Returns the next blogpost that has been published or null if this is the most recent post.

Returns:
blogpost the next blog post in this blog
Throws:
BlogPostNotFoundException - if the next blog post could not be loaded

getCommentStatus

int getCommentStatus()
Returns the comment status of this blog post which may be any one of the following:

Defaults to OPEN.

Specified by:
getCommentStatus in interface com.jivesoftware.community.comments.CommentContentResource
Returns:
status the comment status of this blog post

setCommentStatus

void setCommentStatus(int status)
                      throws UnauthorizedException
Sets the comment status of this blog post which may be any one of the following:

Parameters:
status - the comment status of this blog post
Throws:
UnauthorizedException - if not allowed to edit this blog post.

getCommentDelegator

com.jivesoftware.community.comments.CommentDelegator getCommentDelegator()
Retrieve a comment manager to manage blog post comments. Attempting to retrieve a comment manager prior to the blog post being saved will result in an IllegalStateArgument being thrown.

Specified by:
getCommentDelegator in interface com.jivesoftware.community.comments.CommentContentResource
Returns:
a comment manager to manage blog post comments.

isTrackbacksEnabled

boolean isTrackbacksEnabled()
Returns true if trackbacks are accepted on this blog post, false if not. Default is true.

Returns:
true if trackbacks are accepted on this blog post, false if not.

setTrackbacksEnabled

void setTrackbacksEnabled(boolean enable)
Enables and disables trackbacks for this blog post. Default is true.

Parameters:
enable - true to enable trackbacks, false to disable trackbacks

getTrackbackDelegator

com.jivesoftware.community.TrackbackDelegator getTrackbackDelegator()
Retrieve a trackback delegator to manage blog post trackbacks. Attempting to retrieve a trackback delegator prior to the blog post being saved will result in an IllegalStateArgument being thrown.

Returns:
a tag delegator to manage blog post tags.

getTagDelegator

com.jivesoftware.community.TagDelegator getTagDelegator()
Retrieve a tag delegator to manage blog post tags. Attempting to retrieve a tag delegator prior to the blog post being saved will result in an IllegalStateArgument being thrown.

Returns:
a tag delegator to manage blog post tags.

getRatingDelegator

com.jivesoftware.community.rating.RatingDelegator getRatingDelegator()
Retrieve a rating delegator to manage blog post ratings. Attempting to retrieve a rating delegator prior to the blog post being saved will result in an IllegalStateArgument being thrown.

Returns:
a rating delegator to manage blog post ratings.

getProperties

java.util.Map<java.lang.String,java.lang.String> getProperties()
Retrieve a map of all the extended properties for the post. Each post can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface. The map is alterable if the user is authorized to modify the post, however only a mapping of key -> value is allowed. Null keys and values are not allowed.

Values returned from the map are filtered through the filter system. To retrieve unfiltered property values use the getUnfilteredProperty(String) method.

Returns:
a map of post extended properties.

getUnfilteredProperty

java.lang.String getUnfilteredProperty(java.lang.String name)
Returns an extended property of the blog, bypassing any filters. Each blog can have an arbitrary number of extended properties. This allows for enhanced functionality that is not part of the base interface.

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.

Parameters:
name - the name of the property to get.
Returns:
the value of the property.

save

void save()
          throws UnauthorizedException
Saves the state of this BlogPost to the database

Throws:
UnauthorizedException - If the user is not allowed to modify this blogpost
java.lang.IllegalArgumentException - if the subject has already been used on this blog on the given publish date

save

void save(boolean fireModifiedEvent)
          throws UnauthorizedException
Saves the state of this BlogPost to the database

Parameters:
fireModifiedEvent - true if a modified event should get fired after the blog is saved.
Throws:
UnauthorizedException - If the user is not allowed to modify this blogpost
java.lang.IllegalArgumentException - if the subject has already been used on this blog on the given publish date

getViewCount

int getViewCount()
Returns the number of times this blog post has been viewed. A return value of -1 indicates the number of views is unknown or that the feature is disabled.

Returns:
the number of times this blog post has been viewed or -1 if the value is not known.

setMinorEdit

void setMinorEdit(boolean minorEdit)
Set to true to cause the next call to save() to not send notifications to users watching the document.

Parameters:
minorEdit - true to cause the next call to save() to not send notifications to users watching the document.

isMinorEdit

boolean isMinorEdit()
Returns whether or not the current unsaved changes constitute a minor edit.

Returns:
whether the current unsaved changes constitute a minor edit.

Jive Product Page

Copyright © 1999-2007 Jive Software.