Interface CommentLayerService

All Known Implementing Classes:
DefaultCommentLayerService

public interface CommentLayerService
Service focused on comment layer - component that should be transparent over the preview content. It contains comments and markups related to the currently displayed preview.
  • Method Details

    • getCommentLayerModes

      Map<String,CommentModeExecutor> getCommentLayerModes()
      Return all configured comment-layer modes in a form of 'mode' - 'mode executor' mapping.
    • getModeExecutor

      CommentModeExecutor getModeExecutor(String mode)
      Returns CommentModeExecutor for the target mode. Use any custom mode or one of out-of-the-box comment layer modes.
      Parameters:
      mode - target mode
      Throws:
      UnknownIdentifierException - if no executor found for the given mode
    • deleteComment

      boolean deleteComment(UserModel user, AbstractCommentModel comment)
      Removes the given comment by the user. Checks if the user can remove the comment and if can, removes it.
      Parameters:
      user - - user who tries to remove the comment
      comment - - comment to remove
    • getCommentsForCommentLayer

      List<CommentModel> getCommentsForCommentLayer(UserModel user, ItemModel item)
      Returns all comments for the given page that the target user is eligible to view on the comment layer.
      Parameters:
      user - - target UserModel
      item - - target item ItemModel
      Returns:
      List of CommentModels
      Throws:
      IllegalArgumentException - is either user or page is null
    • getCommentLocationForPreview

      CommentMetadataModel getCommentLocationForPreview(CommentModel comment, MediaModel preview)
      Returns Comment position meta-data of the given CommentModel instance for the given preview media.
      Parameters:
      comment - - CommentModel
      preview - - comment layer target : CommentLayerComponentModel.getCommentLayerTarget()
    • canUserEditComment

      boolean canUserEditComment(UserModel user, AbstractCommentModel comment)
      Evaluates if the given user is able to edit given comment from the comment layer component.
      Parameters:
      user - - target UserModel
      comment - - target CommentModel
      Returns:
      true or false
    • canUserReplyToComment

      boolean canUserReplyToComment(UserModel user, AbstractCommentModel comment)
      Evaluates if the given user is able to reply given comment from the comment layer component.
      Parameters:
      user - - target UserModel
      comment - - target CommentModel
      Returns:
      true or false
    • canUserDeleteComment

      boolean canUserDeleteComment(UserModel user, AbstractCommentModel comment)
      Evaluates if the given user is able to delete given comment from the comment layer component.
      Parameters:
      user - - target UserModel
      comment - - target CommentModel
      Returns:
      true or false
    • replyToComment

      void replyToComment(String text, AbstractCommentModel comment)
      Replies the given comment instance with the given text value.
      Parameters:
      text - - text of the reply
      comment - - AbstractCommentModel instance to reply.
    • canUserMoveComment

      boolean canUserMoveComment(UserModel user, CommentModel comment)
      Evaluates if the given user is able to move given comment on the comment layer component.
      Parameters:
      user - - target UserModel
      comment - - target CommentModel
      Returns:
      true or false
    • canUserCreateComment

      boolean canUserCreateComment(UserModel user)
      Evaluates if the given user is allowed to create new comments.
      Parameters:
      user -
      Returns:
      true or false