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 Detail

      • getCommentLayerModes

        java.util.Map<java.lang.String,​CommentModeExecutor> getCommentLayerModes()
        Return all configured comment-layer modes in a form of 'mode' - 'mode executor' mapping.
      • 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

        java.util.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:
        java.lang.IllegalArgumentException - is either user or page is null
      • 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​(java.lang.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