Class CommentServiceImpl

java.lang.Object
org.springframework.extensions.surf.util.AbstractLifecycleBean
org.alfresco.repo.forum.CommentServiceImpl
All Implemented Interfaces:
EventListener, CommentService, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy, ClassPolicy, Policy, org.springframework.beans.factory.Aware, org.springframework.context.ApplicationContextAware, org.springframework.context.ApplicationListener

public class CommentServiceImpl extends org.springframework.extensions.surf.util.AbstractLifecycleBean implements CommentService, NodeServicePolicies.BeforeDeleteNodePolicy, NodeServicePolicies.OnUpdatePropertiesPolicy
Since:
4.0
Author:
Neil Mc Erlean
  • Constructor Details

    • CommentServiceImpl

      public CommentServiceImpl()
  • Method Details

    • setSiteService

      public void setSiteService(SiteService siteService)
    • setActivityService

      public void setActivityService(ActivityService activityService)
    • setNodeService

      public void setNodeService(NodeService nodeService)
    • setContentService

      public void setContentService(ContentService contentService)
    • setCannedQueryRegistry

      public void setCannedQueryRegistry(org.alfresco.util.registry.NamedObjectRegistry<org.alfresco.query.CannedQueryFactory<? extends Object>> cannedQueryRegistry)
    • setPolicyComponent

      public void setPolicyComponent(PolicyComponent policyComponent)
    • setBehaviourFilter

      public void setBehaviourFilter(BehaviourFilter behaviourFilter)
    • setPermissionService

      public void setPermissionService(PermissionService permissionService)
    • setLockService

      public void setLockService(LockService lockService)
    • setDictionaryService

      public void setDictionaryService(DictionaryService dictionaryService)
    • onBootstrap

      protected void onBootstrap(org.springframework.context.ApplicationEvent event)
      Specified by:
      onBootstrap in class org.springframework.extensions.surf.util.AbstractLifecycleBean
    • onShutdown

      protected void onShutdown(org.springframework.context.ApplicationEvent event)
      Specified by:
      onShutdown in class org.springframework.extensions.surf.util.AbstractLifecycleBean
    • getDiscussableAncestor

      public NodeRef getDiscussableAncestor(NodeRef descendantNodeRef)
      Description copied from interface: CommentService
      Thi method retrieves the ancestor in the repository containment hierarchy having the fm:discussable aspect.
      Specified by:
      getDiscussableAncestor in interface CommentService
      Parameters:
      descendantNodeRef - The nodeRef which descends from the f:discussable node.
      Returns:
      the fm:discussable ancestor if there is one, else null
    • listComments

      public org.alfresco.query.PagingResults<NodeRef> listComments(NodeRef discussableNode, org.alfresco.query.PagingRequest paging)
      Description copied from interface: CommentService
      Returns a paged list of comments.
      Specified by:
      listComments in interface CommentService
      Parameters:
      discussableNode - the node which is being commented on .
      paging - paging.
      Returns:
      a list of comment nodes
    • getShareCommentsTopic

      public NodeRef getShareCommentsTopic(NodeRef discussableNode)
      Description copied from interface: CommentService
      This method retrieves the fm:topic NodeRef which holds the Share comments for the specified fm:discussable node.
      Specified by:
      getShareCommentsTopic in interface CommentService
      Parameters:
      discussableNode - the node whose Share comments are sought.
      Returns:
      the fm:topic NodeRef, if one exists, else null.
    • createComment

      public NodeRef createComment(NodeRef discussableNode, String title, String comment, boolean suppressRollups)
      Description copied from interface: CommentService
      Creates a comment for the discussableNode
      Specified by:
      createComment in interface CommentService
      Parameters:
      discussableNode - the node in Share which is being commented on .
      title - - title of the comment
      comment - - body of the comment
      suppressRollups - - should it suppressRollups
      Returns:
      NodeRef - the created node reference
    • updateComment

      public void updateComment(NodeRef commentNodeRef, String title, String comment)
      Description copied from interface: CommentService
      Updates the comment
      Specified by:
      updateComment in interface CommentService
      Parameters:
      commentNodeRef - the comment node.
      title - - title of the comment
      comment - - body of the comment
    • deleteComment

      public void deleteComment(NodeRef commentNodeRef)
      Description copied from interface: CommentService
      Deletes the comment for the discussableNode
      Specified by:
      deleteComment in interface CommentService
      Parameters:
      commentNodeRef - the node in Share which is being commented on.
    • getCommentPermissions

      public Map<String,Boolean> getCommentPermissions(NodeRef discussableNode, NodeRef commentNodeRef)
      Description copied from interface: CommentService
      canEdit / canDelete
      Specified by:
      getCommentPermissions in interface CommentService
      Returns:
    • onUpdateProperties

      public void onUpdateProperties(NodeRef commentNodeRef, Map<QName,Serializable> before, Map<QName,Serializable> after)
      Description copied from interface: NodeServicePolicies.OnUpdatePropertiesPolicy
      Called after a node's properties have been changed.
      Specified by:
      onUpdateProperties in interface NodeServicePolicies.OnUpdatePropertiesPolicy
      Parameters:
      commentNodeRef - reference to the updated node
      before - the node's properties before the change
      after - the node's properties after the change
    • beforeDeleteNode

      public void beforeDeleteNode(NodeRef commentNodeRef)
      Description copied from interface: NodeServicePolicies.BeforeDeleteNodePolicy
      Called before a node is deleted.
      Specified by:
      beforeDeleteNode in interface NodeServicePolicies.BeforeDeleteNodePolicy
      Parameters:
      commentNodeRef - the node reference