public class DefaultCommentLayerService extends AbstractBusinessService implements CommentLayerService
AbstractService.SerializableDTOmodelService, sessionService, txManagertenant| Constructor and Description |
|---|
DefaultCommentLayerService() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canUserCreateComment(UserModel user)
Evaluates if the given user is allowed to create new comments.
|
boolean |
canUserDeleteComment(UserModel curentUser,
AbstractCommentModel comment)
Evaluates if the given user is able to delete given comment from the comment layer component.
|
boolean |
canUserEditComment(UserModel user,
AbstractCommentModel comment)
Evaluates if the given user is able to edit given comment from the comment layer component.
|
boolean |
canUserMoveComment(UserModel user,
CommentModel comment)
Evaluates if the given user is able to move given comment on the comment layer component.
|
boolean |
canUserReplyToComment(UserModel user,
AbstractCommentModel comment)
Evaluates if the given user is able to reply given comment from the comment layer component.
|
boolean |
deleteComment(UserModel user,
AbstractCommentModel comment)
Removes the given comment by the user.
|
protected java.util.List<CommentModel> |
filterCommentsWithoutPositionMetaData(java.util.List<CommentModel> input) |
java.util.Map<java.lang.String,CommentModeExecutor> |
getCommentLayerModes()
Return all configured comment-layer modes in a form of 'mode' - 'mode executor' mapping.
|
CommentMetadataModel |
getCommentLocationForPreview(CommentModel comment,
MediaModel preview)
Returns Comment position meta-data of the given
CommentModel instance 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.
|
protected CommentTypeModel |
getCommentType() |
protected UserModel |
getCurentUser() |
protected ComponentModel |
getCurrentComponent() |
protected DomainModel |
getDomain() |
CommentModeExecutor |
getModeExecutor(java.lang.String mode)
Returns
CommentModeExecutor for the target mode. |
void |
replyToComment(java.lang.String text,
AbstractCommentModel comment)
Replies the given comment instance with the given text value.
|
void |
setCockpitCommentService(CockpitCommentService cockpitCommentService) |
void |
setCommentsCommands(java.util.Map<java.lang.String,CommentModeExecutor> commentsCommands) |
void |
setCommentService(CommentService commentService) |
void |
setUserCanCreateCommentStrategy(CommentPermissionCheckStrategy userCanCreateCommentStrategy) |
void |
setUserCanDeleteCommentStrategy(CommentPermissionCheckStrategy userCanDeleteCommentStrategy) |
void |
setUserCanEditCommentStrategy(CommentPermissionCheckStrategy userCanEditCommentStrategy) |
void |
setUserCanMoveCommentStrategy(CommentPermissionCheckStrategy userCanMoveCommentStrategy) |
void |
setUserCanReplyCommentStrategy(CommentPermissionCheckStrategy userCanReplyCommentStrategy) |
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerafterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplacepublic java.util.Map<java.lang.String,CommentModeExecutor> getCommentLayerModes()
CommentLayerServicegetCommentLayerModes in interface CommentLayerServicepublic boolean canUserEditComment(UserModel user, AbstractCommentModel comment)
CommentLayerServicecanUserEditComment in interface CommentLayerServiceuser - - target UserModelcomment - - target CommentModelpublic boolean canUserReplyToComment(UserModel user, AbstractCommentModel comment)
CommentLayerServicecanUserReplyToComment in interface CommentLayerServiceuser - - target UserModelcomment - - target CommentModelpublic boolean canUserCreateComment(UserModel user)
CommentLayerServicecanUserCreateComment in interface CommentLayerServicepublic boolean canUserMoveComment(UserModel user, CommentModel comment)
CommentLayerServicecanUserMoveComment in interface CommentLayerServiceuser - - target UserModelcomment - - target CommentModelpublic boolean canUserDeleteComment(UserModel curentUser, AbstractCommentModel comment)
CommentLayerServicecanUserDeleteComment in interface CommentLayerServicecurentUser - - target UserModelcomment - - target CommentModelpublic boolean deleteComment(UserModel user, AbstractCommentModel comment)
CommentLayerServicedeleteComment in interface CommentLayerServiceuser - - user who tries to remove the commentcomment - - comment to removepublic java.util.List<CommentModel> getCommentsForCommentLayer(UserModel user, ItemModel item)
CommentLayerServicegetCommentsForCommentLayer in interface CommentLayerServiceuser - - target UserModelitem - - target item ItemModelCommentModelsprotected java.util.List<CommentModel> filterCommentsWithoutPositionMetaData(java.util.List<CommentModel> input)
public CommentModeExecutor getModeExecutor(java.lang.String mode)
CommentLayerServiceCommentModeExecutor for the target mode. Use any custom mode or one of out-of-the-box comment
layer modes.getModeExecutor in interface CommentLayerServicemode - target modepublic CommentMetadataModel getCommentLocationForPreview(CommentModel comment, MediaModel preview)
CommentLayerServiceCommentModel instance for the given preview media.getCommentLocationForPreview in interface CommentLayerServicecomment - - CommentModelpreview - - comment layer target :
CommentLayerComponentModel.getCommentLayerTarget()protected UserModel getCurentUser()
protected DomainModel getDomain()
protected ComponentModel getCurrentComponent()
protected CommentTypeModel getCommentType()
public void setCommentsCommands(java.util.Map<java.lang.String,CommentModeExecutor> commentsCommands)
public void replyToComment(java.lang.String text,
AbstractCommentModel comment)
CommentLayerServicereplyToComment in interface CommentLayerServicetext - - text of the replycomment - - AbstractCommentModel instance to reply.public void setUserCanDeleteCommentStrategy(CommentPermissionCheckStrategy userCanDeleteCommentStrategy)
public void setUserCanMoveCommentStrategy(CommentPermissionCheckStrategy userCanMoveCommentStrategy)
public void setUserCanCreateCommentStrategy(CommentPermissionCheckStrategy userCanCreateCommentStrategy)
public void setUserCanEditCommentStrategy(CommentPermissionCheckStrategy userCanEditCommentStrategy)
public void setUserCanReplyCommentStrategy(CommentPermissionCheckStrategy userCanReplyCommentStrategy)
public void setCockpitCommentService(CockpitCommentService cockpitCommentService)
public void setCommentService(CommentService commentService)
Copyright © 2018 SAP SE. All Rights Reserved.