com.day.cq.collab.blog
Interface BlogEntry


public interface BlogEntry

BlogEntry represents a blog entry.


Field Summary
static String DEFAULT_TEXT
           
static String NODE_COMMENTS
           
static String NODE_ENTRY
           
static String PATH_USERCONTENT
           
static String PROP_CREATED
           
static String PROP_LASTMODIFIED
           
static String PROP_LASTMODIFIEDBY
           
static String PROP_LASTPUBLISHED
           
static String PROP_LASTPUBLISHEDBY
           
static String PROP_TEXT
           
static String PROP_TITLE
           
static String TYPE_BLOGENTRY
           
 
Method Summary
 void addComment(String text, String author, String email, String url)
          Adds a comment to this blog entry.
 List<String> getAttachments()
          Returns the paths to the attachments of this blog entry.
 String getAuthor()
          Returns the author of this blog entry.
 Blog getBlog()
          Returns the blog this blog entry belongs to or null if no blog can be found.
 ParagraphSystem getComments()
          Returns a paragraph system with the comments for this blog entry.
 Date getDate()
          Returns the date this blog entry has been created.
 String getFeedUrl()
          Returns the URL of the feed for this blog entry.
 String getFullUrl()
          Returns the full URL of this blog entry, including scheme, server name and port.
 Page getPage()
          Returns the page associated with this blog entry.
 org.apache.sling.api.resource.Resource getResource()
          Returns the resource associated with this blog entry.
 com.day.cq.tagging.Tag[] getTags()
          Returns the tags associated with this blog entry.
 String getTagsAsHTML()
          Returns a comma-separated string of HTML links for the specified tags.
 String getText()
          Returns the text of this blog entry.
 String getTitle()
          Returns the title of this blog entry.
 String getTrackBackUrl()
          Returns the track back URL for this blog entry.
 String getUrl()
          Returns the server-local URL of this blog entry, omitting scheme, server name and port number.
 boolean hasAttachments()
          Returns true if this blog entry has one or more attachments.
 boolean hasComments()
          Returns true if this blog entry has one or more comments.
 boolean hasTag(String path)
          Returns true if this blog entry is filed under the tag at the specified path.
 boolean isModified()
          Returns whether this blog entry has been modified and needs to be saved.
 void save()
          Saves all changes made to this blog entry.
 void setAuthor(String author)
          Sets the author of this blog entry.
 void setTags(com.day.cq.tagging.Tag[] tags)
          Sets the tags associated with this blog entry.
 void setText(String text)
          Sets the text of this blog entry.
 void setTitle(String title)
          Sets the title of this blog entry.
 

Field Detail

DEFAULT_TEXT

static final String DEFAULT_TEXT
See Also:
Constant Field Values

PROP_TITLE

static final String PROP_TITLE
See Also:
Constant Field Values

PROP_TEXT

static final String PROP_TEXT
See Also:
Constant Field Values

PROP_CREATED

static final String PROP_CREATED
See Also:
Constant Field Values

PROP_LASTMODIFIED

static final String PROP_LASTMODIFIED
See Also:
Constant Field Values

PROP_LASTMODIFIEDBY

static final String PROP_LASTMODIFIEDBY
See Also:
Constant Field Values

PROP_LASTPUBLISHED

static final String PROP_LASTPUBLISHED
See Also:
Constant Field Values

PROP_LASTPUBLISHEDBY

static final String PROP_LASTPUBLISHEDBY
See Also:
Constant Field Values

NODE_ENTRY

static final String NODE_ENTRY
See Also:
Constant Field Values

NODE_COMMENTS

static final String NODE_COMMENTS
See Also:
Constant Field Values

PATH_USERCONTENT

static final String PATH_USERCONTENT
See Also:
Constant Field Values

TYPE_BLOGENTRY

static final String TYPE_BLOGENTRY
See Also:
Constant Field Values
Method Detail

getTitle

String getTitle()
Returns the title of this blog entry.

Returns:
The title

setTitle

void setTitle(String title)
Sets the title of this blog entry.

Parameters:
title - The title

getText

String getText()
Returns the text of this blog entry.

Returns:
The text

setText

void setText(String text)
Sets the text of this blog entry.

Parameters:
text - The text

getAuthor

String getAuthor()
Returns the author of this blog entry.

Returns:
The author

setAuthor

void setAuthor(String author)
Sets the author of this blog entry.

Parameters:
author - The author

getDate

Date getDate()
Returns the date this blog entry has been created.

Returns:
The date

getTags

com.day.cq.tagging.Tag[] getTags()
Returns the tags associated with this blog entry.

Returns:
The tags

setTags

void setTags(com.day.cq.tagging.Tag[] tags)
Sets the tags associated with this blog entry. Refer to the TagManager in order to retrieve and/or create tags.

Parameters:
tags - The tags

getTagsAsHTML

String getTagsAsHTML()
Returns a comma-separated string of HTML links for the specified tags.

Returns:
The tags as HTML

getAttachments

List<String> getAttachments()
Returns the paths to the attachments of this blog entry.

Returns:
The attachments

getComments

ParagraphSystem getComments()
Returns a paragraph system with the comments for this blog entry.

Returns:
The comments

addComment

void addComment(String text,
                String author,
                String email,
                String url)
                throws BlogException
Adds a comment to this blog entry.

Parameters:
text - The text
author - The author of the comment
email - The author's e-mail address
url - The URL of the author's website
Throws:
BlogException - If the comment cannot be created

getBlog

Blog getBlog()
Returns the blog this blog entry belongs to or null if no blog can be found.

Returns:
The blog

getResource

org.apache.sling.api.resource.Resource getResource()
Returns the resource associated with this blog entry.

Returns:
The resource

getPage

Page getPage()
Returns the page associated with this blog entry.

Returns:
The page

getUrl

String getUrl()
Returns the server-local URL of this blog entry, omitting scheme, server name and port number.

Returns:
The URL

getFullUrl

String getFullUrl()
Returns the full URL of this blog entry, including scheme, server name and port.

Returns:
The full URL

getFeedUrl

String getFeedUrl()
Returns the URL of the feed for this blog entry.

Returns:
The feed URL

getTrackBackUrl

String getTrackBackUrl()
Returns the track back URL for this blog entry.

Returns:
The track back URL

hasTag

boolean hasTag(String path)
Returns true if this blog entry is filed under the tag at the specified path.

Parameters:
path - the tag path
Returns:
true if blog entry has this tag, false otherwise

hasAttachments

boolean hasAttachments()
Returns true if this blog entry has one or more attachments.

Returns:
true if blog entry has attachments, false otherwise

hasComments

boolean hasComments()
Returns true if this blog entry has one or more comments.

Returns:
true if blog entry has comments, false otherwise

isModified

boolean isModified()
Returns whether this blog entry has been modified and needs to be saved.

Returns:
true if blog entry is modified, false otherwise
See Also:
save()

save

void save()
          throws BlogException
Saves all changes made to this blog entry. In case the blog entry doesn't exist yet, it will be created.

Throws:
BlogException - if saving fails


Copyright © 2009 Day Management AG. All Rights Reserved.