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 Summary
Modifier and TypeMethodDescriptionbooleanEvaluates if the given user is allowed to create new comments.booleancanUserDeleteComment(UserModel user, AbstractCommentModel comment) Evaluates if the given user is able to delete given comment from the comment layer component.booleancanUserEditComment(UserModel user, AbstractCommentModel comment) Evaluates if the given user is able to edit given comment from the comment layer component.booleancanUserMoveComment(UserModel user, CommentModel comment) Evaluates if the given user is able to move given comment on the comment layer component.booleancanUserReplyToComment(UserModel user, AbstractCommentModel comment) Evaluates if the given user is able to reply given comment from the comment layer component.booleandeleteComment(UserModel user, AbstractCommentModel comment) Removes the given comment by the user.Return all configured comment-layer modes in a form of 'mode' - 'mode executor' mapping.getCommentLocationForPreview(CommentModel comment, MediaModel preview) Returns Comment position meta-data of the givenCommentModelinstance for the given preview media.getCommentsForCommentLayer(UserModel user, ItemModel item) Returns all comments for the given page that the target user is eligible to view on the comment layer.getModeExecutor(String mode) ReturnsCommentModeExecutorfor the target mode.voidreplyToComment(String text, AbstractCommentModel comment) Replies the given comment instance with the given text value.
-
Method Details
-
getCommentLayerModes
Map<String,CommentModeExecutor> getCommentLayerModes()Return all configured comment-layer modes in a form of 'mode' - 'mode executor' mapping. -
getModeExecutor
ReturnsCommentModeExecutorfor 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
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 commentcomment- - comment to remove
-
getCommentsForCommentLayer
Returns all comments for the given page that the target user is eligible to view on the comment layer.- Parameters:
user- - targetUserModelitem- - target itemItemModel- Returns:
- List of
CommentModels - Throws:
IllegalArgumentException- is either user or page is null
-
getCommentLocationForPreview
Returns Comment position meta-data of the givenCommentModelinstance for the given preview media.- Parameters:
comment- -CommentModelpreview- - comment layer target :CommentLayerComponentModel.getCommentLayerTarget()
-
canUserEditComment
Evaluates if the given user is able to edit given comment from the comment layer component.- Parameters:
user- - targetUserModelcomment- - targetCommentModel- Returns:
- true or false
-
canUserReplyToComment
Evaluates if the given user is able to reply given comment from the comment layer component.- Parameters:
user- - targetUserModelcomment- - targetCommentModel- Returns:
- true or false
-
canUserDeleteComment
Evaluates if the given user is able to delete given comment from the comment layer component.- Parameters:
user- - targetUserModelcomment- - targetCommentModel- Returns:
- true or false
-
replyToComment
Replies the given comment instance with the given text value.- Parameters:
text- - text of the replycomment- -AbstractCommentModelinstance to reply.
-
canUserMoveComment
Evaluates if the given user is able to move given comment on the comment layer component.- Parameters:
user- - targetUserModelcomment- - targetCommentModel- Returns:
- true or false
-
canUserCreateComment
Evaluates if the given user is allowed to create new comments.- Parameters:
user-- Returns:
- true or false
-