Class WorkspaceThreadCommentDAO

All Implemented Interfaces:
LogEnabled, Component, Contextualizable, Serviceable

DAO for manipulating thread comments
  • Field Details

    • ROLE

      public static final String ROLE
      Avalon Role
  • Constructor Details

  • Method Details

    • createComment

      public Map<String,Object> createComment(String threadId, String commentText)
      Comment a thread
      Parameters:
      threadId - the thread id
      commentText - the comment text
      Returns:
      The thread data
    • editComment

      public Map<String,Object> editComment(String threadId, String commentId, String commentText)
      Edit a thread comment
      Parameters:
      threadId - the thread id
      commentId - the comment Id
      commentText - the comment text
      Returns:
      The thread data
    • deleteComment

      public Map<String,Object> deleteComment(String threadId, String commentId, Boolean accepted)
      Delete a thread comment
      Parameters:
      threadId - the thread id
      commentId - the comment id
      accepted - filter by accepted answer
      Returns:
      The thread data
    • answerComment

      public Map<String,Object> answerComment(String threadId, String commentId, String commentText)
      Answer to a thread comment
      Parameters:
      threadId - the thread id
      commentId - the comment id
      commentText - the comment text
      Returns:
      The thread data
    • likeOrUnlikeComment

      public Map<String,Object> likeOrUnlikeComment(String threadId, String commentId, Boolean liked)
      Like or unlike a thread's comment
      Parameters:
      threadId - the thread id
      commentId - the comment id
      liked - true if the comment is liked, otherwise the comment is unliked
      Returns:
      The thread data
    • acceptComment

      public Map<String,Object> acceptComment(String threadId, String commentId, String oldCommentId, Boolean accepted)
      Accept a thread's comment
      Parameters:
      threadId - the thread id
      commentId - the comment id to set as new accepted answer
      oldCommentId - the comment id of the old accepted answer, to set to false if it exists
      accepted - filter by accepted answer
      Returns:
      The thread data
    • cancelAcceptComment

      public Map<String,Object> cancelAcceptComment(String threadId, String commentId, Boolean accepted)
      Cancel a comment set as accepted answer
      Parameters:
      threadId - the thread id
      commentId - the comment id to remove as accepted answer
      accepted - filter by accepted answer
      Returns:
      The thread data
    • _setAcceptedComment

      protected RichTextComment _setAcceptedComment(CommentableAmetysObject<RichTextComment> commentableAmetysObject, String commentId, ModifiableTraversableAmetysObject moduleRoot, boolean isAccepted)
      Cancel a comment set as accepted answer
      Parameters:
      commentableAmetysObject - the commentableAmetysObject
      commentId - the comment id to remove as accepted answer
      moduleRoot - the module root
      isAccepted - true to set the comment as accepted answer.
      Returns:
      The commentableAmetysObject
    • reportComment

      public Map<String,Object> reportComment(String threadId, String commentId)
      Report a thread's comment
      Parameters:
      threadId - the thread id
      commentId - the comment id of the comment to report
      Returns:
      The thread data
    • clearReports

      public Map<String,Object> clearReports(String threadId, String commentId)
      Clear reports of a thread's comment
      Parameters:
      threadId - the thread id
      commentId - the comment id of the comment to clear
      Returns:
      The thread data