org.alfresco.service.cmr.blog
Interface BlogService

All Known Implementing Classes:
BlogServiceImpl

public interface BlogService

The Blog Service handles the management (CRUD) of Alfresco blog data, namely the blog posts which are exposed in the Share UI under the "Blog" heading. The BlogIntegrationService, a separate service, is concerned with the integration of Alfresco blog content with external Blog-hosting sites.

Please note that this service is a work in progress and currently exists primarily to support the blogs REST API.

Since:
4.0

Nested Class Summary
static class BlogService.RangedDateProperty
          A simple data object for expressing a date range search parameter.
 
Method Summary
 BlogPostInfo createBlogPost(org.alfresco.service.cmr.repository.NodeRef blogContainerNode, java.lang.String blogTitle, java.lang.String blogContent, boolean isDraft)
          Creates a new blog post within the specified container node.
 BlogPostInfo createBlogPost(java.lang.String siteShortName, java.lang.String blogTitle, java.lang.String blogContent, boolean isDraft)
          Creates a new blog post in the specified site
 void deleteBlogPost(BlogPostInfo post)
          Deletes an existing BlogPostInfo from the repository.
 org.alfresco.query.PagingResults findBlogPosts(org.alfresco.service.cmr.repository.NodeRef blogContainerNode, BlogService.RangedDateProperty dateRange, java.lang.String tag, org.alfresco.query.PagingRequest pagingReq)
          Finds blog posts by the specified user tagged with the given tag string.
 org.alfresco.query.PagingResults findBlogPosts(java.lang.String siteShortName, BlogService.RangedDateProperty dateRange, java.lang.String tag, org.alfresco.query.PagingRequest pagingReq)
          Finds blog posts by the specified user tagged with the given tag string.
 BlogPostInfo getBlogPost(org.alfresco.service.cmr.repository.NodeRef parentNodeRef, java.lang.String postName)
          Retrieves an existing BlogPostInfo from the repository, which is attached to the specified Node.
 BlogPostInfo getBlogPost(java.lang.String siteShortName, java.lang.String postName)
          Retrieves an existing BlogPostInfo from the repository, which is within a site
 org.alfresco.query.PagingResults getDrafts(org.alfresco.service.cmr.repository.NodeRef blogContainerNode, java.lang.String username, org.alfresco.query.PagingRequest pagingReq)
          Gets the draft blog posts created by the specified user.
 org.alfresco.query.PagingResults getDrafts(java.lang.String siteShortName, java.lang.String username, org.alfresco.query.PagingRequest pagingReq)
          Gets the draft blog posts created by the specified user.
 BlogPostInfo getForNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
          For a given NodeRef corresponding to a BlogPostInfo, returns the object wrapping the Node.
 org.alfresco.query.PagingResults getMyDraftsAndAllPublished(org.alfresco.service.cmr.repository.NodeRef blogContainerNode, java.util.Date fromDate, java.util.Date toDate, org.alfresco.query.PagingRequest pagingReq)
          Deprecated. This method is a domain-specific query used by the Blog REST API and is not considered suitable for general use.
 org.alfresco.query.PagingResults getPublished(org.alfresco.service.cmr.repository.NodeRef blogContainerNode, java.util.Date fromDate, java.util.Date toDate, java.lang.String byUser, org.alfresco.query.PagingRequest pagingReq)
          Gets the (internally, Alfresco-) published blog posts.
 org.alfresco.query.PagingResults getPublished(java.lang.String siteShortName, java.util.Date fromDate, java.util.Date toDate, java.lang.String byUser, org.alfresco.query.PagingRequest pagingReq)
          Gets the (internally, Alfresco-) published blog posts.
 org.alfresco.query.PagingResults getPublishedExternally(org.alfresco.service.cmr.repository.NodeRef blogContainerNode, org.alfresco.query.PagingRequest pagingReq)
          Gets blog posts published externally (i.e.
 org.alfresco.query.PagingResults getPublishedExternally(java.lang.String siteShortName, org.alfresco.query.PagingRequest pagingReq)
          Gets blog posts published externally (i.e.
 boolean isDraftBlogPost(org.alfresco.service.cmr.repository.NodeRef blogPostNode)
          Deprecated. Add this to the BlogPostInfo shortly
 BlogPostInfo updateBlogPost(BlogPostInfo post)
          Updates an existing BlogPostInfo in the repository.
 

Method Detail

createBlogPost

BlogPostInfo createBlogPost(java.lang.String siteShortName,
                            java.lang.String blogTitle,
                            java.lang.String blogContent,
                            boolean isDraft)
Creates a new blog post in the specified site

Parameters:
siteShortName - the name of the site to add the post to.
blogTitle - the title of the blog post.
blogContent - text/html content of the blog post.
isDraft - true if the blog post is a draft post, else false.
Returns:
The BlogPostInfo of the newly created blog post.
See Also:
to retrieve the blogContainerNode

createBlogPost

BlogPostInfo createBlogPost(org.alfresco.service.cmr.repository.NodeRef blogContainerNode,
                            java.lang.String blogTitle,
                            java.lang.String blogContent,
                            boolean isDraft)
Creates a new blog post within the specified container node.

Parameters:
blogContainerNode - the container node for blog posts (under the site).
blogTitle - the title of the blog post.
blogContent - text/html content of the blog post.
isDraft - true if the blog post is a draft post, else false.
Returns:
The BlogPostInfo of the newly created blog post.
See Also:
to retrieve the blogContainerNode

updateBlogPost

BlogPostInfo updateBlogPost(BlogPostInfo post)
Updates an existing BlogPostInfo in the repository.

Returns:
The updated BlogPostInfo

deleteBlogPost

void deleteBlogPost(BlogPostInfo post)
Deletes an existing BlogPostInfo from the repository.


getForNodeRef

@NotAuditable
BlogPostInfo getForNodeRef(org.alfresco.service.cmr.repository.NodeRef nodeRef)
For a given NodeRef corresponding to a BlogPostInfo, returns the object wrapping the Node. For anything else, the response is null.


getBlogPost

BlogPostInfo getBlogPost(java.lang.String siteShortName,
                         java.lang.String postName)
Retrieves an existing BlogPostInfo from the repository, which is within a site


getBlogPost

BlogPostInfo getBlogPost(org.alfresco.service.cmr.repository.NodeRef parentNodeRef,
                         java.lang.String postName)
Retrieves an existing BlogPostInfo from the repository, which is attached to the specified Node. The parent Node should normally be a Site Container


getDrafts

org.alfresco.query.PagingResults getDrafts(java.lang.String siteShortName,
                                           java.lang.String username,
                                           org.alfresco.query.PagingRequest pagingReq)
Gets the draft blog posts created by the specified user.

Parameters:
siteShortName - the name of the site to add the post to.
username - to limit results to blogs with this cm:creator. null means all users.
pagingReq - an object defining the paging parameters for the result set.
Returns:
a PagingResults object containing some or all of the results (subject to paging).
See Also:
to retrieve the blogContainerNode

getDrafts

org.alfresco.query.PagingResults getDrafts(org.alfresco.service.cmr.repository.NodeRef blogContainerNode,
                                           java.lang.String username,
                                           org.alfresco.query.PagingRequest pagingReq)
Gets the draft blog posts created by the specified user.

Parameters:
blogContainerNode - the container node for blog posts (under the site).
username - to limit results to blogs with this cm:creator. null means all users.
pagingReq - an object defining the paging parameters for the result set.
Returns:
a PagingResults object containing some or all of the results (subject to paging).
See Also:
to retrieve the blogContainerNode

getPublished

org.alfresco.query.PagingResults getPublished(java.lang.String siteShortName,
                                              java.util.Date fromDate,
                                              java.util.Date toDate,
                                              java.lang.String byUser,
                                              org.alfresco.query.PagingRequest pagingReq)
Gets the (internally, Alfresco-) published blog posts.

Parameters:
siteShortName - the name of the site to add the post to.
fromDate - an inclusive date limit for the results (more recent than).
toDate - an inclusive date limit for the results (before).
byUser - if not null limits results to posts by the specified user. if null results will be by all users.
pagingReq - an object defining the paging parameters for the result set.
Returns:
a PagingResults object containing some or all of the results (subject to paging).
See Also:
to retrieve the blogContainerNode

getPublished

org.alfresco.query.PagingResults getPublished(org.alfresco.service.cmr.repository.NodeRef blogContainerNode,
                                              java.util.Date fromDate,
                                              java.util.Date toDate,
                                              java.lang.String byUser,
                                              org.alfresco.query.PagingRequest pagingReq)
Gets the (internally, Alfresco-) published blog posts.

Parameters:
blogContainerNode - the container node for blog posts (under the site).
fromDate - an inclusive date limit for the results (more recent than).
toDate - an inclusive date limit for the results (before).
byUser - if not null limits results to posts by the specified user. if null results will be by all users.
pagingReq - an object defining the paging parameters for the result set.
Returns:
a PagingResults object containing some or all of the results (subject to paging).
See Also:
to retrieve the blogContainerNode

getPublishedExternally

org.alfresco.query.PagingResults getPublishedExternally(java.lang.String siteShortName,
                                                        org.alfresco.query.PagingRequest pagingReq)
Gets blog posts published externally (i.e. to an external blog hosting site).

Parameters:
siteShortName - the name of the site to add the post to.
pagingReq - an object defining the paging parameters for the result set.
Returns:
a PagingResults object containing some or all of the results (subject to paging).
See Also:
to retrieve the blogContainerNode

getPublishedExternally

org.alfresco.query.PagingResults getPublishedExternally(org.alfresco.service.cmr.repository.NodeRef blogContainerNode,
                                                        org.alfresco.query.PagingRequest pagingReq)
Gets blog posts published externally (i.e. to an external blog hosting site).

Parameters:
blogContainerNode - the container node for blog posts (under the site).
pagingReq - an object defining the paging parameters for the result set.
Returns:
a PagingResults object containing some or all of the results (subject to paging).
See Also:
to retrieve the blogContainerNode

getMyDraftsAndAllPublished

org.alfresco.query.PagingResults getMyDraftsAndAllPublished(org.alfresco.service.cmr.repository.NodeRef blogContainerNode,
                                                            java.util.Date fromDate,
                                                            java.util.Date toDate,
                                                            org.alfresco.query.PagingRequest pagingReq)
Deprecated. This method is a domain-specific query used by the Blog REST API and is not considered suitable for general use.

Gets draft blog posts by the currently authenticated user along with all published posts.

Parameters:
blogContainerNode - the container node for blog posts (under the site).
fromDate - an inclusive date limit for the results (more recent than).
toDate - an inclusive date limit for the results (before).
pagingReq - an object defining the paging parameters for the result set.
Returns:
a PagingResults object containing some or all of the results (subject to paging).
See Also:
to retrieve the blogContainerNode

findBlogPosts

org.alfresco.query.PagingResults findBlogPosts(java.lang.String siteShortName,
                                               BlogService.RangedDateProperty dateRange,
                                               java.lang.String tag,
                                               org.alfresco.query.PagingRequest pagingReq)
Finds blog posts by the specified user tagged with the given tag string. This method allows date ranges to be applied to any valid DataTypeDefinition.DATE or DataTypeDefinition.DATETIME property. Examples include ContentModel.PROP_CREATED or ContentModel.PROP_PUBLISHED.

Parameters:
siteShortName - the name of the site to add the post to.
dateRange - a BlogService.RangedDateProperty parameter object. Can be null.
tag - tag string.
pagingReq - an object defining the paging parameters for the result set.
Returns:
a PagingResults object containing some or all of the results (subject to paging).
See Also:
to retrieve the blogContainerNode

findBlogPosts

org.alfresco.query.PagingResults findBlogPosts(org.alfresco.service.cmr.repository.NodeRef blogContainerNode,
                                               BlogService.RangedDateProperty dateRange,
                                               java.lang.String tag,
                                               org.alfresco.query.PagingRequest pagingReq)
Finds blog posts by the specified user tagged with the given tag string. This method allows date ranges to be applied to any valid DataTypeDefinition.DATE or DataTypeDefinition.DATETIME property. Examples include ContentModel.PROP_CREATED or ContentModel.PROP_PUBLISHED.

Parameters:
blogContainerNode - the container node for blog posts (under the site).
dateRange - a BlogService.RangedDateProperty parameter object. Can be null.
tag - tag string.
pagingReq - an object defining the paging parameters for the result set.
Returns:
a PagingResults object containing some or all of the results (subject to paging).
See Also:
to retrieve the blogContainerNode

isDraftBlogPost

boolean isDraftBlogPost(org.alfresco.service.cmr.repository.NodeRef blogPostNode)
Deprecated. Add this to the BlogPostInfo shortly

Returns true if the specified blog-post node is a 'draft' blog post.

Parameters:
blogPostNode - a NodeRef representing a blog-post.
Returns:
true if it is a draft post, else false.


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.