Class BlogServiceImpl

  • All Implemented Interfaces:
    BlogService

    public class BlogServiceImpl
    extends Object
    implements BlogService
    Since:
    4.0
    Author:
    Neil Mc Erlean (based on existing webscript controllers in the REST API)
    • Constructor Detail

      • BlogServiceImpl

        public BlogServiceImpl()
    • Method Detail

      • setCannedQueryRegistry

        public void setCannedQueryRegistry​(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<BlogPostInfo>> cannedQueryRegistry)
      • setPublishedBlogPostsCannedQueryFactory

        public void setPublishedBlogPostsCannedQueryFactory​(GetBlogPostsCannedQueryFactory cannedQueryFactory)
      • setPublishedExternallyBlogPostsCannedQueryFactory

        public void setPublishedExternallyBlogPostsCannedQueryFactory​(GetBlogPostsCannedQueryFactory cannedQueryFactory)
      • setContentService

        public void setContentService​(ContentService contentService)
      • setDictionaryService

        public void setDictionaryService​(DictionaryService dictionaryService)
      • setNamespaceService

        public void setNamespaceService​(NamespaceService namespaceService)
      • setNodeService

        public void setNodeService​(NodeService nodeService)
      • setSiteService

        public void setSiteService​(SiteService siteService)
      • setTransactionService

        public void setTransactionService​(TransactionService transactionService)
      • setPermissionService

        public void setPermissionService​(PermissionService permissionService)
      • setTaggingService

        public void setTaggingService​(TaggingService taggingService)
      • setSearchService

        public void setSearchService​(SearchService searchService)
      • getSiteBlogContainer

        protected NodeRef getSiteBlogContainer​(String siteShortName,
                                               boolean create)
        Fetches the Blogs Container on a site, creating as required if requested.
      • isDraftBlogPost

        public boolean isDraftBlogPost​(NodeRef blogPostNode)
        Description copied from interface: BlogService
        Returns true if the specified blog-post node is a 'draft' blog post.
        Specified by:
        isDraftBlogPost in interface BlogService
        Parameters:
        blogPostNode - a NodeRef representing a blog-post.
        Returns:
        true if it is a draft post, else false.
      • createBlogPost

        public BlogPostInfo createBlogPost​(String siteShortName,
                                           String blogTitle,
                                           String blogContent,
                                           boolean isDraft)
        Description copied from interface: BlogService
        Creates a new blog post in the specified site
        Specified by:
        createBlogPost in interface BlogService
        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

        public BlogPostInfo createBlogPost​(NodeRef blogContainerNode,
                                           String blogTitle,
                                           String blogContent,
                                           boolean isDraft)
        Description copied from interface: BlogService
        Creates a new blog post within the specified container node.
        Specified by:
        createBlogPost in interface BlogService
        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
      • getDrafts

        public org.alfresco.query.PagingResults<BlogPostInfo> getDrafts​(String siteShortName,
                                                                        String username,
                                                                        org.alfresco.query.PagingRequest pagingReq)
        Description copied from interface: BlogService
        Gets the draft blog posts created by the specified user.
        Specified by:
        getDrafts in interface BlogService
        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

        public org.alfresco.query.PagingResults<BlogPostInfo> getDrafts​(NodeRef blogContainerNode,
                                                                        String username,
                                                                        org.alfresco.query.PagingRequest pagingReq)
        Description copied from interface: BlogService
        Gets the draft blog posts created by the specified user.
        Specified by:
        getDrafts in interface BlogService
        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

        public org.alfresco.query.PagingResults<BlogPostInfo> getPublished​(String siteShortName,
                                                                           Date fromDate,
                                                                           Date toDate,
                                                                           String byUser,
                                                                           org.alfresco.query.PagingRequest pagingReq)
        Description copied from interface: BlogService
        Gets the (internally, Alfresco-) published blog posts.
        Specified by:
        getPublished in interface BlogService
        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

        public org.alfresco.query.PagingResults<BlogPostInfo> getPublished​(NodeRef blogContainerNode,
                                                                           Date fromDate,
                                                                           Date toDate,
                                                                           String byUser,
                                                                           org.alfresco.query.PagingRequest pagingReq)
        Description copied from interface: BlogService
        Gets the (internally, Alfresco-) published blog posts.
        Specified by:
        getPublished in interface BlogService
        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
      • getMyDraftsAndAllPublished

        public org.alfresco.query.PagingResults<BlogPostInfo> getMyDraftsAndAllPublished​(NodeRef blogContainerNode,
                                                                                         Date createdFrom,
                                                                                         Date createdTo,
                                                                                         org.alfresco.query.PagingRequest pagingReq)
        Deprecated.
        Description copied from interface: BlogService
        Gets draft blog posts by the currently authenticated user along with all published posts.
        Specified by:
        getMyDraftsAndAllPublished in interface BlogService
        Parameters:
        blogContainerNode - the container node for blog posts (under the site).
        createdFrom - an inclusive date limit for the results (more recent than).
        createdTo - 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