Class DefaultCommentService
- java.lang.Object
-
- de.hybris.platform.servicelayer.internal.service.AbstractService
-
- de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
-
- de.hybris.platform.comments.services.impl.DefaultCommentService
-
- All Implemented Interfaces:
CommentService,java.io.Serializable,org.springframework.beans.factory.Aware,org.springframework.beans.factory.BeanNameAware,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AbstractWarehousingCommentService,DefaultCommerceCommentService
public class DefaultCommentService extends AbstractBusinessService implements CommentService
Default comment service implementation.- See Also:
- Serialized Form
-
-
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, txManager
-
Fields inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
tenant
-
-
Constructor Summary
Constructors Constructor Description DefaultCommentService()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description ReplyModelcreateReply(UserModel author, AbstractCommentModel comment, java.lang.String text)Creates and returns a new comment reply.java.util.Collection<CommentTypeModel>getAvailableCommentTypes(ComponentModel component)Returns the available comment types for a given component.CommentDaogetCommentDao()Deprecated.since agesjava.util.List<CommentModel>getComments(UserModel user, DomainModel domain, int offset, int count)Returns all comments in the specified domain whereuseris a participant.java.util.List<CommentModel>getComments(UserModel user, DomainModel domain, java.util.Collection<CommentTypeModel> types, int offset, int count)Returns all comments in the specified domain which are of the specified types and whereuseris a participant.java.util.List<CommentModel>getComments(UserModel user, java.util.Collection<ComponentModel> components, int offset, int count)Returns all comments in the specified domain components whereuseris a participant.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.CommentTypeModelgetCommentTypeByCode(ComponentModel component, java.lang.String commentTypeCode)CommentTypeModelgetCommentTypeForCode(ComponentModel comp, java.lang.String commentTypeCode)Returns the comment type with the specified code.ComponentModelgetComponentByCode(DomainModel domain, java.lang.String componentCode)ComponentModelgetComponentForCode(DomainModel domain, java.lang.String componentCode)Returns the domain component with the specified code.java.util.List<ReplyModel>getDirectReplies(CommentModel comment, int offset, int count)Returns all direct comment replies for the specified comment.DomainModelgetDomainByCode(java.lang.String domainCode)DomainModelgetDomainForCode(java.lang.String domainCode)Returns the domain with specified code.protected FlexibleSearchServicegetFlexibleSearchService()Deprecated.since agesjava.util.List<CommentModel>getItemComments(ItemModel item, UserModel user, DomainModel domain, int offset, int count)Returns all item comments for the specified item, which are in the specified domain and whereuseris a participant.java.util.List<CommentModel>getItemComments(ItemModel item, UserModel user, DomainModel domain, java.util.Collection<CommentTypeModel> types, int offset, int count)Returns all item comments for the specified item, which are in the specified domain, of the specified types and whereuseris a participant.java.util.List<CommentModel>getItemComments(ItemModel item, UserModel user, java.util.Collection<ComponentModel> components, int offset, int count)Returns all item comments for the specified item, which are in the specified domain components and whereuseris a participant.java.util.List<CommentModel>getItemComments(ItemModel item, UserModel user, java.util.Collection<ComponentModel> components, java.util.Collection<CommentTypeModel> types, int offset, int count)Returns all item comments for the specified item, which are in the specified domain components, of the specified types and whereuseris a participant.CommentUserSettingModelgetUserSetting(UserModel user, AbstractCommentModel commentItem)Returns the CommentUserSettingModel attached to the comment for the given user.voidsetCommentDao(CommentDao commentDao)voidsetFlexibleSearchService(FlexibleSearchService flexibleSearchService)Deprecated.since ages-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractBusinessService
getModelService, getSessionService, getTxManager, setModelService, setSessionService, setTxManager
-
Methods inherited from class de.hybris.platform.servicelayer.internal.service.AbstractService
afterPropertiesSet, getCurrentTenant, setBeanName, setCurrentTenant, writeReplace
-
-
-
-
Method Detail
-
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:CommentServiceReturns all comments in the specified domain components which are of the specified types and whereuseris a participant.- Specified by:
getCommentsin interfaceCommentService- Parameters:
user- comment participantcomponents- domain componentstypes- comment typesoffset- 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, int offset, int count)
Description copied from interface:CommentServiceReturns all comments in the specified domain components whereuseris a participant.- Specified by:
getCommentsin interfaceCommentService- Parameters:
user- comment participantcomponents- domain componentsoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
getComments
public java.util.List<CommentModel> getComments(UserModel user, DomainModel domain, java.util.Collection<CommentTypeModel> types, int offset, int count)
Description copied from interface:CommentServiceReturns all comments in the specified domain which are of the specified types and whereuseris a participant.- Specified by:
getCommentsin interfaceCommentService- Parameters:
user- comment participantdomain- comment domaintypes- comment typesoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
getComments
public java.util.List<CommentModel> getComments(UserModel user, DomainModel domain, int offset, int count)
Description copied from interface:CommentServiceReturns all comments in the specified domain whereuseris a participant.- Specified by:
getCommentsin interfaceCommentService- Parameters:
user- comment participantdomain- comment domainoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
getDirectReplies
public java.util.List<ReplyModel> getDirectReplies(CommentModel comment, int offset, int count)
Description copied from interface:CommentServiceReturns all direct comment replies for the specified comment.- Specified by:
getDirectRepliesin interfaceCommentService- Parameters:
comment- the commentoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
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:CommentServiceReturns all item comments for the specified item, which are in the specified domain components, of the specified types and whereuseris a participant.- Specified by:
getItemCommentsin interfaceCommentService- Parameters:
item- related itemuser- comment participantcomponents- domain componentstypes- comment typesoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
getItemComments
public java.util.List<CommentModel> getItemComments(ItemModel item, UserModel user, java.util.Collection<ComponentModel> components, int offset, int count)
Description copied from interface:CommentServiceReturns all item comments for the specified item, which are in the specified domain components and whereuseris a participant.- Specified by:
getItemCommentsin interfaceCommentService- Parameters:
item- related itemuser- comment participantcomponents- domain componentsoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
getItemComments
public java.util.List<CommentModel> getItemComments(ItemModel item, UserModel user, DomainModel domain, java.util.Collection<CommentTypeModel> types, int offset, int count)
Description copied from interface:CommentServiceReturns all item comments for the specified item, which are in the specified domain, of the specified types and whereuseris a participant.- Specified by:
getItemCommentsin interfaceCommentService- Parameters:
item- related itemuser- comment participantdomain- comment domaintypes- comment typesoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
getItemComments
public java.util.List<CommentModel> getItemComments(ItemModel item, UserModel user, DomainModel domain, int offset, int count)
Description copied from interface:CommentServiceReturns all item comments for the specified item, which are in the specified domain and whereuseris a participant.- Specified by:
getItemCommentsin interfaceCommentService- Parameters:
item- related itemuser- comment participantdomain- comment domainoffset- search offsetcount- max hit count- Returns:
- all found comments in the specified range
-
getComponentForCode
public ComponentModel getComponentForCode(DomainModel domain, java.lang.String componentCode)
Description copied from interface:CommentServiceReturns the domain component with the specified code.- Specified by:
getComponentForCodein interfaceCommentService- Parameters:
domain- domaincomponentCode- domain component code- Returns:
- component in the specified domain with the specified code or
nullif component could not be found
-
getDomainForCode
public DomainModel getDomainForCode(java.lang.String domainCode)
Description copied from interface:CommentServiceReturns the domain with specified code.- Specified by:
getDomainForCodein interfaceCommentService- Parameters:
domainCode- domain code- Returns:
- domain with the specified code or
nullif no domain with the code could be found
-
getCommentTypeForCode
public CommentTypeModel getCommentTypeForCode(ComponentModel comp, java.lang.String commentTypeCode)
Description copied from interface:CommentServiceReturns the comment type with the specified code.- Specified by:
getCommentTypeForCodein interfaceCommentService- Parameters:
comp- domain componentcommentTypeCode- comment type code- Returns:
- comment type in the specified domain component with the specified code or
nullif type could not be found
-
setCommentDao
public void setCommentDao(CommentDao commentDao)
-
getCommentDao
@Deprecated public CommentDao getCommentDao()
Deprecated.since ages
-
setFlexibleSearchService
@Deprecated public void setFlexibleSearchService(FlexibleSearchService flexibleSearchService)
Deprecated.since ages
-
getFlexibleSearchService
@Deprecated protected FlexibleSearchService getFlexibleSearchService()
Deprecated.since ages
-
getUserSetting
public CommentUserSettingModel getUserSetting(UserModel user, AbstractCommentModel commentItem)
Description copied from interface:CommentServiceReturns the CommentUserSettingModel attached to the comment for the given user. Creates a new one, if none is present.- Specified by:
getUserSettingin interfaceCommentService
-
createReply
public ReplyModel createReply(UserModel author, AbstractCommentModel comment, java.lang.String text)
Description copied from interface:CommentServiceCreates and returns a new comment reply.- Specified by:
createReplyin interfaceCommentService- Parameters:
author- reply authorcomment- comment to reply totext- reply content- Returns:
- created reply
-
getAvailableCommentTypes
public java.util.Collection<CommentTypeModel> getAvailableCommentTypes(ComponentModel component)
Description copied from interface:CommentServiceReturns the available comment types for a given component.- Specified by:
getAvailableCommentTypesin interfaceCommentService
-
getCommentTypeByCode
public CommentTypeModel getCommentTypeByCode(ComponentModel component, java.lang.String commentTypeCode)
- Specified by:
getCommentTypeByCodein interfaceCommentService
-
getComponentByCode
public ComponentModel getComponentByCode(DomainModel domain, java.lang.String componentCode)
- Specified by:
getComponentByCodein interfaceCommentService
-
getDomainByCode
public DomainModel getDomainByCode(java.lang.String domainCode)
- Specified by:
getDomainByCodein interfaceCommentService
-
-