Class DiscussionServiceImpl

  • All Implemented Interfaces:
    DiscussionService

    public class DiscussionServiceImpl
    extends Object
    implements DiscussionService
    Since:
    4.0
    Author:
    Nick Burch (based on existing webscript controllers in the REST API)
    • Constructor Detail

      • DiscussionServiceImpl

        public DiscussionServiceImpl()
    • Method Detail

      • setNodeDAO

        public void setNodeDAO​(NodeDAO nodeDAO)
      • setNodeService

        public void setNodeService​(org.alfresco.service.cmr.repository.NodeService nodeService)
      • setSiteService

        public void setSiteService​(SiteService siteService)
      • setSearchService

        public void setSearchService​(org.alfresco.service.cmr.search.SearchService searchService)
      • setContentService

        public void setContentService​(ContentService contentService)
      • setTaggingService

        public void setTaggingService​(TaggingService taggingService)
      • setNamespaceService

        public void setNamespaceService​(org.alfresco.service.namespace.NamespaceService namespaceService)
      • setTransactionService

        public void setTransactionService​(TransactionService transactionService)
      • setCannedQueryRegistry

        public void setCannedQueryRegistry​(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry)
        Set the registry of canned queries
      • setTenantService

        public void setTenantService​(org.alfresco.repo.tenant.TenantService tenantService)
        Set the TenantService
      • getSiteDiscussionsContainer

        protected org.alfresco.service.cmr.repository.NodeRef getSiteDiscussionsContainer​(String siteShortName,
                                                                                          boolean create)
        Fetches the Discussions Container on a site, creating as required if requested.
      • getForNodeRef

        public org.alfresco.util.Pair<TopicInfo,​PostInfo> getForNodeRef​(org.alfresco.service.cmr.repository.NodeRef nodeRef)
        Description copied from interface: DiscussionService
        For a given NodeRef corresponding to either a TopicInfo or a PostInfo, returns the objects wrapping the Node. For a Topic, the 2nd half of the pair is null. For a Post, both halves of the pair are set. For anything else, the response is null.
        Specified by:
        getForNodeRef in interface DiscussionService
      • getMostRecentPost

        public PostInfo getMostRecentPost​(TopicInfo topic)
        Description copied from interface: DiscussionService
        Retrieves the newest (most recent) Post in a topic, be that the Primary Post or a Reply. This is typically used when identifying if a topic has had new posts added to it since the user last saw it. Note that this works on Created Date, and not Modified/Updated, so edits to an existing post will not change this.
        Specified by:
        getMostRecentPost in interface DiscussionService
      • listTopics

        public org.alfresco.query.PagingResults<TopicInfo> listTopics​(String siteShortName,
                                                                      boolean sortAscending,
                                                                      org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Retrieves all topics in a site, sorted by either oldest or newest topics first.
        Specified by:
        listTopics in interface DiscussionService
      • listTopics

        public org.alfresco.query.PagingResults<TopicInfo> listTopics​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                      boolean sortAscending,
                                                                      org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Retrieves all topics attached to the specified Node, sorted by either oldest or newest topics first.
        Specified by:
        listTopics in interface DiscussionService
      • listTopics

        public org.alfresco.query.PagingResults<TopicInfo> listTopics​(String siteShortName,
                                                                      String username,
                                                                      boolean sortAscending,
                                                                      org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Retrieves all topics in a site, filtered by username, sorted by either oldest or newest topics first.
        Specified by:
        listTopics in interface DiscussionService
      • listTopics

        public org.alfresco.query.PagingResults<TopicInfo> listTopics​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                      String username,
                                                                      boolean sortAscending,
                                                                      org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Retrieves all topics attached to the specified Node, filtered by username, sorted by either oldest or newest topics first.
        Specified by:
        listTopics in interface DiscussionService
      • listTopics

        public org.alfresco.query.PagingResults<TopicInfo> listTopics​(String siteShortName,
                                                                      Date from,
                                                                      Date to,
                                                                      boolean sortAscending,
                                                                      org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Retrieves all topics in a site, created in the given date range, sorted by either oldest or newest topics first.
        Specified by:
        listTopics in interface DiscussionService
      • listTopics

        public org.alfresco.query.PagingResults<TopicInfo> listTopics​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                      Date from,
                                                                      Date to,
                                                                      boolean sortAscending,
                                                                      org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Retrieves all topics attached to the specified Node, created in the given date range, sorted by either oldest or newest topics first.
        Specified by:
        listTopics in interface DiscussionService
      • listHotTopics

        public org.alfresco.query.PagingResults<org.alfresco.util.Pair<TopicInfo,​Integer>> listHotTopics​(String siteShortName,
                                                                                                               Date since,
                                                                                                               org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Finds topics which have had replies since the specified date, and returns them along with the count of replies since then. Primary posts are not included in this.
        Specified by:
        listHotTopics in interface DiscussionService
      • listHotTopics

        public org.alfresco.query.PagingResults<org.alfresco.util.Pair<TopicInfo,​Integer>> listHotTopics​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                                                               Date since,
                                                                                                               org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Finds topics which have had replies since the specified date, and returns them along with the count of replies since then. Primary posts are not included in this.
        Specified by:
        listHotTopics in interface DiscussionService
      • findTopics

        public org.alfresco.query.PagingResults<TopicInfo> findTopics​(String siteShortName,
                                                                      String username,
                                                                      String tag,
                                                                      boolean sortAscending,
                                                                      org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Searches for all topics in a site, filtered by username or tag, sorted by either oldest or newest topics first.
        Specified by:
        findTopics in interface DiscussionService
      • findTopics

        public org.alfresco.query.PagingResults<TopicInfo> findTopics​(org.alfresco.service.cmr.repository.NodeRef nodeRef,
                                                                      String username,
                                                                      String tag,
                                                                      boolean sortAscending,
                                                                      org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Searches for all topics attached to the specified Node, filtered by username or tag, sorted by either oldest or newest topics first.
        Specified by:
        findTopics in interface DiscussionService
      • listPosts

        public org.alfresco.query.PagingResults<PostInfo> listPosts​(TopicInfo topic,
                                                                    org.alfresco.query.PagingRequest paging)
        Description copied from interface: DiscussionService
        Retrieves all posts in a topic, ordered by creation date
        Specified by:
        listPosts in interface DiscussionService