Class DefaultCommentLayerService
java.lang.Object
de.hybris.platform.servicelayer.internal.service.AbstractService
de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
de.hybris.platform.cockpit.services.comments.impl.DefaultCommentLayerService
- All Implemented Interfaces:
CommentLayerService,Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
public class DefaultCommentLayerService
extends AbstractBusinessService
implements CommentLayerService
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
AbstractService.SerializableDTO -
Field Summary
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
modelService, sessionService, txManagerFields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanEvaluates if the given user is allowed to create new comments.booleancanUserDeleteComment(UserModel curentUser, 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.protected List<CommentModel>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.protected CommentTypeModelprotected UserModelprotected ComponentModelprotected DomainModelgetModeExecutor(String mode) ReturnsCommentModeExecutorfor the target mode.voidreplyToComment(String text, AbstractCommentModel comment) Replies the given comment instance with the given text value.voidsetCockpitCommentService(CockpitCommentService cockpitCommentService) voidsetCommentsCommands(Map<String, CommentModeExecutor> commentsCommands) voidsetCommentService(CommentService commentService) voidsetUserCanCreateCommentStrategy(CommentPermissionCheckStrategy userCanCreateCommentStrategy) voidsetUserCanDeleteCommentStrategy(CommentPermissionCheckStrategy userCanDeleteCommentStrategy) voidsetUserCanEditCommentStrategy(CommentPermissionCheckStrategy userCanEditCommentStrategy) voidsetUserCanMoveCommentStrategy(CommentPermissionCheckStrategy userCanMoveCommentStrategy) voidsetUserCanReplyCommentStrategy(CommentPermissionCheckStrategy userCanReplyCommentStrategy) Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManagerMethods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
Constructor Details
-
DefaultCommentLayerService
public DefaultCommentLayerService()
-
-
Method Details
-
getCommentLayerModes
Description copied from interface:CommentLayerServiceReturn all configured comment-layer modes in a form of 'mode' - 'mode executor' mapping.- Specified by:
getCommentLayerModesin interfaceCommentLayerService
-
canUserEditComment
Description copied from interface:CommentLayerServiceEvaluates if the given user is able to edit given comment from the comment layer component.- Specified by:
canUserEditCommentin interfaceCommentLayerService- Parameters:
user- - targetUserModelcomment- - targetCommentModel- Returns:
- true or false
-
canUserReplyToComment
Description copied from interface:CommentLayerServiceEvaluates if the given user is able to reply given comment from the comment layer component.- Specified by:
canUserReplyToCommentin interfaceCommentLayerService- Parameters:
user- - targetUserModelcomment- - targetCommentModel- Returns:
- true or false
-
canUserCreateComment
Description copied from interface:CommentLayerServiceEvaluates if the given user is allowed to create new comments.- Specified by:
canUserCreateCommentin interfaceCommentLayerService- Returns:
- true or false
-
canUserMoveComment
Description copied from interface:CommentLayerServiceEvaluates if the given user is able to move given comment on the comment layer component.- Specified by:
canUserMoveCommentin interfaceCommentLayerService- Parameters:
user- - targetUserModelcomment- - targetCommentModel- Returns:
- true or false
-
canUserDeleteComment
Description copied from interface:CommentLayerServiceEvaluates if the given user is able to delete given comment from the comment layer component.- Specified by:
canUserDeleteCommentin interfaceCommentLayerService- Parameters:
curentUser- - targetUserModelcomment- - targetCommentModel- Returns:
- true or false
-
deleteComment
Description copied from interface:CommentLayerServiceRemoves the given comment by the user. Checks if the user can remove the comment and if can, removes it.- Specified by:
deleteCommentin interfaceCommentLayerService- Parameters:
user- - user who tries to remove the commentcomment- - comment to remove
-
getCommentsForCommentLayer
Description copied from interface:CommentLayerServiceReturns all comments for the given page that the target user is eligible to view on the comment layer.- Specified by:
getCommentsForCommentLayerin interfaceCommentLayerService- Parameters:
user- - targetUserModelitem- - target itemItemModel- Returns:
- List of
CommentModels
-
filterCommentsWithoutPositionMetaData
-
getModeExecutor
Description copied from interface:CommentLayerServiceReturnsCommentModeExecutorfor the target mode. Use any custom mode or one of out-of-the-box comment layer modes.- Specified by:
getModeExecutorin interfaceCommentLayerService- Parameters:
mode- target mode
-
getCommentLocationForPreview
Description copied from interface:CommentLayerServiceReturns Comment position meta-data of the givenCommentModelinstance for the given preview media.- Specified by:
getCommentLocationForPreviewin interfaceCommentLayerService- Parameters:
comment- -CommentModelpreview- - comment layer target :CommentLayerComponentModel.getCommentLayerTarget()
-
getCurentUser
-
getDomain
-
getCurrentComponent
-
getCommentType
-
setCommentsCommands
-
replyToComment
Description copied from interface:CommentLayerServiceReplies the given comment instance with the given text value.- Specified by:
replyToCommentin interfaceCommentLayerService- Parameters:
text- - text of the replycomment- -AbstractCommentModelinstance to reply.
-
setUserCanDeleteCommentStrategy
public void setUserCanDeleteCommentStrategy(CommentPermissionCheckStrategy userCanDeleteCommentStrategy) -
setUserCanMoveCommentStrategy
public void setUserCanMoveCommentStrategy(CommentPermissionCheckStrategy userCanMoveCommentStrategy) -
setUserCanCreateCommentStrategy
public void setUserCanCreateCommentStrategy(CommentPermissionCheckStrategy userCanCreateCommentStrategy) -
setUserCanEditCommentStrategy
public void setUserCanEditCommentStrategy(CommentPermissionCheckStrategy userCanEditCommentStrategy) -
setUserCanReplyCommentStrategy
public void setUserCanReplyCommentStrategy(CommentPermissionCheckStrategy userCanReplyCommentStrategy) -
setCockpitCommentService
-
setCommentService
-