Class DefaultCustomerReviewService
- java.lang.Object
-
- de.hybris.platform.customerreview.impl.DefaultCustomerReviewService
-
- All Implemented Interfaces:
CustomerReviewService
public class DefaultCustomerReviewService extends java.lang.Object implements CustomerReviewService
Default implementation for CustomerReviewService.
-
-
Constructor Summary
Constructors Constructor Description DefaultCustomerReviewService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CustomerReviewModelcreateCustomerReview(java.lang.Double rating, java.lang.String headline, java.lang.String comment, UserModel user, ProductModel product)Creates a new customer review based on the given parametersjava.lang.DoublegetAverageRating(ProductModel product)Returns the average rating of all reviews for the given product.protected CustomerReviewDaogetCustomerReviewDao()protected ModelServicegetModelService()java.lang.IntegergetNumberOfReviews(ProductModel product)Returns the number of reviews for the given productjava.util.List<CustomerReviewModel>getReviewsForCustomer(UserModel userModel)Get the reviews for the specified customer.java.util.List<CustomerReviewModel>getReviewsForProduct(ProductModel product)Get the reviews for the specified product.java.util.List<CustomerReviewModel>getReviewsForProductAndLanguage(ProductModel product, LanguageModel language)Get the reviews for the specified product in the specified language.voidsetCustomerReviewDao(CustomerReviewDao customerReviewDao)voidsetModelService(ModelService modelService)
-
-
-
Method Detail
-
createCustomerReview
public CustomerReviewModel createCustomerReview(java.lang.Double rating, java.lang.String headline, java.lang.String comment, UserModel user, ProductModel product)
Description copied from interface:CustomerReviewServiceCreates a new customer review based on the given parameters- Specified by:
createCustomerReviewin interfaceCustomerReviewService- Parameters:
rating- the ratingheadline- the headlinecomment- the commentsuser- the user who created the reviewproduct- the product reviewed- Returns:
- the newly created review
-
getAverageRating
public java.lang.Double getAverageRating(ProductModel product)
Description copied from interface:CustomerReviewServiceReturns the average rating of all reviews for the given product.- Specified by:
getAverageRatingin interfaceCustomerReviewService- Parameters:
product- the product- Returns:
- the average rating
-
getNumberOfReviews
public java.lang.Integer getNumberOfReviews(ProductModel product)
Description copied from interface:CustomerReviewServiceReturns the number of reviews for the given product- Specified by:
getNumberOfReviewsin interfaceCustomerReviewService- Parameters:
product- instance ofProductModelto find the number of reviews for- Returns:
- the number of reviews
-
getReviewsForProduct
public java.util.List<CustomerReviewModel> getReviewsForProduct(ProductModel product)
Description copied from interface:CustomerReviewServiceGet the reviews for the specified product. Gets all the reviews in any language. (Reviews are restricted by approval status) The reviews are ordered by creation date with the most recent first.- Specified by:
getReviewsForProductin interfaceCustomerReviewService- Parameters:
product- the product- Returns:
- the reviews
-
getReviewsForCustomer
public java.util.List<CustomerReviewModel> getReviewsForCustomer(UserModel userModel)
Description copied from interface:CustomerReviewServiceGet the reviews for the specified customer. Gets all the reviews in any language. (Reviews are restricted by approval status) The reviews are ordered by created date with the most recent first.- Specified by:
getReviewsForCustomerin interfaceCustomerReviewService- Parameters:
userModel- the customer- Returns:
- the reviews
-
getReviewsForProductAndLanguage
public java.util.List<CustomerReviewModel> getReviewsForProductAndLanguage(ProductModel product, LanguageModel language)
Description copied from interface:CustomerReviewServiceGet the reviews for the specified product in the specified language. The reviews are ordered by creation date with the most recent first.- Specified by:
getReviewsForProductAndLanguagein interfaceCustomerReviewService- Parameters:
product- the productlanguage- the language- Returns:
- the reviews
-
getCustomerReviewDao
protected CustomerReviewDao getCustomerReviewDao()
-
setCustomerReviewDao
public void setCustomerReviewDao(CustomerReviewDao customerReviewDao)
-
getModelService
protected ModelService getModelService()
-
setModelService
public void setModelService(ModelService modelService)
-
-