Interface CommentLayerService
-
- All Known Implementing Classes:
DefaultCommentLayerService
public interface CommentLayerServiceService 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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanUserCreateComment(UserModel user)Evaluates 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.java.util.Map<java.lang.String,CommentModeExecutor>getCommentLayerModes()Return all configured comment-layer modes in a form of 'mode' - 'mode executor' mapping.CommentMetadataModelgetCommentLocationForPreview(CommentModel comment, MediaModel preview)Returns Comment position meta-data of the givenCommentModelinstance for the given preview media.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.CommentModeExecutorgetModeExecutor(java.lang.String mode)ReturnsCommentModeExecutorfor the target mode.voidreplyToComment(java.lang.String text, AbstractCommentModel comment)Replies the given comment instance with the given text value.
-
-
-
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.
-
getModeExecutor
CommentModeExecutor getModeExecutor(java.lang.String mode)
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
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 commentcomment- - 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- - targetUserModelitem- - target itemItemModel- Returns:
- List of
CommentModels - Throws:
java.lang.IllegalArgumentException- is either user or page is null
-
getCommentLocationForPreview
CommentMetadataModel getCommentLocationForPreview(CommentModel comment, MediaModel preview)
Returns Comment position meta-data of the givenCommentModelinstance for the given preview media.- Parameters:
comment- -CommentModelpreview- - 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- - targetUserModelcomment- - targetCommentModel- 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- - targetUserModelcomment- - targetCommentModel- 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- - targetUserModelcomment- - targetCommentModel- 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 replycomment- -AbstractCommentModelinstance 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- - targetUserModelcomment- - targetCommentModel- 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
-
-