Package fr.becpg.repo.comment
Interface CommentThreadService
- All Known Implementing Classes:
CommentThreadServiceImpl
public interface CommentThreadService
Organises the comments of a node into threads: a root comment and the replies linked to it by
bcpg:commentReplyTo. Threads are one level deep: a reply always targets a root comment.- Author:
- matthieu
-
Method Summary
Modifier and TypeMethodDescriptionorg.alfresco.service.cmr.repository.NodeRefattachToThreadRoot(org.alfresco.service.cmr.repository.AssociationRef replyAssocRef) Validates a newly created reply link and moves it onto the thread root when it targets a reply.List<org.alfresco.service.cmr.repository.NodeRef> getReplies(org.alfresco.service.cmr.repository.NodeRef rootCommentNodeRef) Returns the replies of a root comment, oldest first.org.alfresco.service.cmr.repository.NodeRefgetThreadRoot(org.alfresco.service.cmr.repository.NodeRef commentNodeRef) Returns the root comment of the thread a comment belongs to.voidinheritRestrictedAccess(org.alfresco.service.cmr.repository.NodeRef replyNodeRef) Restricts the reply when the root comment of its thread is restricted, so that an external user never sees a reply to a comment hidden from them.voidrestrictReplies(org.alfresco.service.cmr.repository.NodeRef rootCommentNodeRef) Restricts every reply of a root comment, whoever wrote them.
-
Method Details
-
getThreadRoot
org.alfresco.service.cmr.repository.NodeRef getThreadRoot(org.alfresco.service.cmr.repository.NodeRef commentNodeRef) Returns the root comment of the thread a comment belongs to.- Parameters:
commentNodeRef- a root comment or a reply- Returns:
- the replied comment for a reply, the comment itself otherwise
-
getReplies
List<org.alfresco.service.cmr.repository.NodeRef> getReplies(org.alfresco.service.cmr.repository.NodeRef rootCommentNodeRef) Returns the replies of a root comment, oldest first.- Parameters:
rootCommentNodeRef- the root comment- Returns:
- the replies, empty when the comment has none
-
attachToThreadRoot
org.alfresco.service.cmr.repository.NodeRef attachToThreadRoot(org.alfresco.service.cmr.repository.AssociationRef replyAssocRef) Validates a newly created reply link and moves it onto the thread root when it targets a reply.- Parameters:
replyAssocRef- thebcpg:commentReplyToassociation just created- Returns:
- the root comment the reply is now linked to
- Throws:
IllegalArgumentException- when the target is not a comment of the same node
-
inheritRestrictedAccess
void inheritRestrictedAccess(org.alfresco.service.cmr.repository.NodeRef replyNodeRef) Restricts the reply when the root comment of its thread is restricted, so that an external user never sees a reply to a comment hidden from them.- Parameters:
replyNodeRef- the reply
-
restrictReplies
void restrictReplies(org.alfresco.service.cmr.repository.NodeRef rootCommentNodeRef) Restricts every reply of a root comment, whoever wrote them.- Parameters:
rootCommentNodeRef- the root comment that has just been restricted
-