Class DefaultCockpitCommentService
- java.lang.Object
-
- de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
-
- de.hybris.platform.cockpit.services.impl.DefaultCockpitCommentService
-
- All Implemented Interfaces:
CockpitCommentService
public class DefaultCockpitCommentService extends AbstractServiceImpl implements CockpitCommentService
-
-
Field Summary
-
Fields inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
modelService, typeService
-
-
Constructor Summary
Constructors Constructor Description DefaultCockpitCommentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CommentModelcreateItemComment(UserModel author, ComponentModel component, CommentTypeModel type, java.util.Collection<ItemModel> items, java.lang.String subject, java.lang.String text)Creates and returns a new item comment.ReplyModelcreateReply(UserModel author, AbstractCommentModel comment, java.lang.String text)Creates and returns a new comment reply.java.util.List<CommentModel>getComments(UserModel user, java.util.Collection<ComponentModel> components, java.util.Collection<CommentTypeModel> types, int offset, int count)Returns all comments in the specified domain components which are of the specified types and whereuseris a participant.CommentServicegetCommentService()Deprecated.since 6.3java.util.List<CommentModel>getCurrentUserComments()Returns all comments in the default domain components which are of the default types and where the current user is a participant.java.util.List<CommentModel>getCurrentUserComments(org.zkoss.zk.ui.Desktop desktop)Returns all comments in the default domain components which are of the default types and where the current user is a participant.QuerygetCurrentUserCommentsQuery()Get current user comments query.java.util.List<ReplyModel>getDirectReplies(CommentModel comment, int offset, int count)Returns all direct comment replies for the specified comment.java.util.List<CommentModel>getItemComments(ItemModel item, UserModel user, java.util.Collection<ComponentModel> components, java.util.Collection<CommentTypeModel> types, int offset, int count)Gets comments.QuerygetItemCommentsQuery(ItemModel item, UserModel user, java.util.Collection<ComponentModel> components, java.util.Collection<CommentTypeModel> types)Get item comments query.java.util.List<ItemModel>getItemsFromCommentAttachments(AbstractCommentModel abstractComment)Returns all attachments of the abstract commentUserServicegetUserService()Deprecated.since 6.3booleanisRead(TypedObject commentItem)Return if the comment is read by the current user or notvoidsaveChangedComments(java.util.List<CommentModel> comments)Saves only modified comments from comments listvoidsetCommentService(CommentService commentService)voidsetRead(TypedObject commentItem, boolean read)Sets the read status of the specified commentItem for the current userprotected voidsetRead(UserModel user, AbstractCommentModel commentItemModel, boolean read)voidsetUserService(UserService userService)-
Methods inherited from class de.hybris.platform.cockpit.services.impl.AbstractServiceImpl
getEnum, getEnums, getLocalizedLabel, getLocalizedLabel, getModelService, getTypeService, setCockpitTypeService, setLabelResolver, setModelService
-
-
-
-
Method Detail
-
getItemComments
public java.util.List<CommentModel> getItemComments(ItemModel item, UserModel user, java.util.Collection<ComponentModel> components, java.util.Collection<CommentTypeModel> types, int offset, int count)
Description copied from interface:CockpitCommentServiceGets comments.- Specified by:
getItemCommentsin interfaceCockpitCommentService- Parameters:
item- the item that has been commented onuser- the authorcomponents- the related comment componentstypes- the comment typeoffset- the search offsetcount- the maximum number of comments to return- Returns:
- list of all the comments matching the specified criteria
-
getItemCommentsQuery
public Query getItemCommentsQuery(ItemModel item, UserModel user, java.util.Collection<ComponentModel> components, java.util.Collection<CommentTypeModel> types)
Description copied from interface:CockpitCommentServiceGet item comments query.- Specified by:
getItemCommentsQueryin interfaceCockpitCommentService- Parameters:
item- the item that has been commented onuser- the author or the watcher or the user assigned to the commentcomponents- the related comment componentstypes- the comment type- Returns:
- query for getting all comments matching the specified criteria
-
getCurrentUserCommentsQuery
public Query getCurrentUserCommentsQuery()
Description copied from interface:CockpitCommentServiceGet current user comments query.- Specified by:
getCurrentUserCommentsQueryin interfaceCockpitCommentService- Returns:
- query for getting all current user comments
-
createReply
public ReplyModel createReply(UserModel author, AbstractCommentModel comment, java.lang.String text)
Description copied from interface:CockpitCommentServiceCreates and returns a new comment reply.- Specified by:
createReplyin interfaceCockpitCommentService- Parameters:
author- reply authorcomment- comment to reply totext- reply content- Returns:
- created reply
-
createItemComment
public CommentModel createItemComment(UserModel author, ComponentModel component, CommentTypeModel type, java.util.Collection<ItemModel> items, java.lang.String subject, java.lang.String text)
Description copied from interface:CockpitCommentServiceCreates and returns a new item comment.- Specified by:
createItemCommentin interfaceCockpitCommentService- Parameters:
author- comment authorcomponent- comment domain componenttype- comment typeitems- related itemssubject- comment subjecttext- comment content- Returns:
- created comment
-
getDirectReplies
public java.util.List<ReplyModel> getDirectReplies(CommentModel comment, int offset, int count)
Description copied from interface:CockpitCommentServiceReturns all direct comment replies for the specified comment.- Specified by:
getDirectRepliesin interfaceCockpitCommentService- Parameters:
comment- the commentoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
getComments
public java.util.List<CommentModel> getComments(UserModel user, java.util.Collection<ComponentModel> components, java.util.Collection<CommentTypeModel> types, int offset, int count)
Description copied from interface:CockpitCommentServiceReturns all comments in the specified domain components which are of the specified types and whereuseris a participant.- Specified by:
getCommentsin interfaceCockpitCommentService- Parameters:
user- comment participantcomponents- domain componentstypes- comment typesoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
getCurrentUserComments
public java.util.List<CommentModel> getCurrentUserComments()
Description copied from interface:CockpitCommentServiceReturns all comments in the default domain components which are of the default types and where the current user is a participant.- Specified by:
getCurrentUserCommentsin interfaceCockpitCommentService- Returns:
- all found comments in the default range
-
getCurrentUserComments
public java.util.List<CommentModel> getCurrentUserComments(org.zkoss.zk.ui.Desktop desktop)
Description copied from interface:CockpitCommentServiceReturns all comments in the default domain components which are of the default types and where the current user is a participant.- Specified by:
getCurrentUserCommentsin interfaceCockpitCommentService- Returns:
- all found comments in the default range
-
isRead
public boolean isRead(TypedObject commentItem)
Description copied from interface:CockpitCommentServiceReturn if the comment is read by the current user or not- Specified by:
isReadin interfaceCockpitCommentService- Returns:
- true, if comment is read, false otherwise
-
setRead
public void setRead(TypedObject commentItem, boolean read)
Description copied from interface:CockpitCommentServiceSets the read status of the specified commentItem for the current user- Specified by:
setReadin interfaceCockpitCommentService- Parameters:
commentItem- the commentItem (comment or reply)read- true, if commentItem should be marked as read, false otherwise
-
setRead
protected void setRead(UserModel user, AbstractCommentModel commentItemModel, boolean read)
-
getCommentService
@Deprecated public CommentService getCommentService()
Deprecated.since 6.3
-
setCommentService
public void setCommentService(CommentService commentService)
-
getUserService
@Deprecated public UserService getUserService()
Deprecated.since 6.3
-
setUserService
public void setUserService(UserService userService)
-
getItemsFromCommentAttachments
public java.util.List<ItemModel> getItemsFromCommentAttachments(AbstractCommentModel abstractComment)
Description copied from interface:CockpitCommentServiceReturns all attachments of the abstract comment- Specified by:
getItemsFromCommentAttachmentsin interfaceCockpitCommentService- Parameters:
abstractComment- abstract comment to get attachments from- Returns:
- all items of the comments ItemAttachment
-
saveChangedComments
public void saveChangedComments(java.util.List<CommentModel> comments)
Description copied from interface:CockpitCommentServiceSaves only modified comments from comments list- Specified by:
saveChangedCommentsin interfaceCockpitCommentService- Parameters:
comments- list of comments
-
-