Class CustomerReviewManager
java.lang.Object
de.hybris.platform.jalo.Manager
de.hybris.platform.jalo.extension.Extension
de.hybris.platform.customerreview.jalo.GeneratedCustomerReviewManager
de.hybris.platform.customerreview.jalo.CustomerReviewManager
- All Implemented Interfaces:
ItemLifecycleListener,Serializable
This is the extension manager of the CustomerReview extension.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class de.hybris.platform.jalo.extension.Extension
Extension.RestrictedLanguagesProvider, Extension.RightsProviderNested classes/interfaces inherited from class de.hybris.platform.jalo.Manager
Manager.GenericManagerSingletonCreator, Manager.ManagerSingletonCreator -
Field Summary
Fields inherited from class de.hybris.platform.customerreview.jalo.GeneratedCustomerReviewManager
DEFAULT_INITIAL_ATTRIBUTES, REVIEWTOPRODUCTRELPRODUCTREVIEWSHANDLER, REVIEWTOUSERRELCUSTOMERREVIEWSHANDLER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a new CustomerReview itemvoidcreateEssentialData(Map params, JspContext jspc) Creates the essential data for CustomerReview.getAllReviews(Product item) Get a list of all reviews for the given product using the current session contextgetAllReviews(SessionContext ctx, Product item) Get a list of all reviews for the given productgetAverageRating(SessionContext ctx, Product item) Calculates the average rating for a productstatic CustomerReviewManagerGets the valid instance of this manager.getNumberOfReviews(SessionContext ctx, Product item) Get the number of reviews for the given productMethods inherited from class de.hybris.platform.customerreview.jalo.GeneratedCustomerReviewManager
addToCustomerReviews, addToCustomerReviews, addToProductReviews, addToProductReviews, createCustomerReview, createCustomerReview, getAverageRating, getAverageRatingAsPrimitive, getAverageRatingAsPrimitive, getCustomerReviews, getCustomerReviews, getDefaultAttributeModes, getName, getNumberOfReviews, getNumberOfReviewsAsPrimitive, getNumberOfReviewsAsPrimitive, getProductReviews, getProductReviews, removeFromCustomerReviews, removeFromCustomerReviews, removeFromProductReviews, removeFromProductReviews, setCustomerReviews, setCustomerReviews, setProductReviews, setProductReviewsMethods inherited from class de.hybris.platform.jalo.extension.Extension
checkBeforeInitialization, checkBeforeItemRemoval, createProjectData, createSampleData, getCreatorDescription, getCreatorName, getCreatorParameterDefault, getCreatorParameterNames, getCreatorParameterPossibleValues, getRemote, isCreatorDisabled, notifyInitializationEnd, notifyInitializationStart, notifyItemRemoval, onFirstSessionCreation, writeReplaceMethods inherited from class de.hybris.platform.jalo.Manager
afterItemCreation, beforeItemCreation, destroy, extractNonRequiredRemoteFromItem, extractRequiredRemoteFromItem, getAllValuesSessionContext, getAttribute, getAttributeMap, getFirstItemByAttribute, getFirstItemByAttribute, getRemoteManagerClass, getSession, getSingletonManagerInstance, getTenant, getTransientObject, getTransientObjectMap, init, setAttribute, setTenant, setTransientObject, wrap
-
Constructor Details
-
CustomerReviewManager
public CustomerReviewManager()
-
-
Method Details
-
getInstance
Gets the valid instance of this manager.- Returns:
- the current instance of this manager
-
createEssentialData
Creates the essential data for CustomerReview. The essential data are restrictions on customerReview item, so that they are not selected and shown for customer users.- Overrides:
createEssentialDatain classExtension- Parameters:
params- Ignoredjspc- Ignored
-
createCustomerReview
public CustomerReview createCustomerReview(Double rating, String headline, String comment, User user, Product product) Creates a new CustomerReview item- Parameters:
rating- The rating for this reviewheadline- The optional headline for this reviewcomment- The optional comment for this reviewuser- The user, who created the reviewproduct- The product for which the review is given- Returns:
- A new CustomerReview item
-
getAverageRating
Calculates the average rating for a product- Specified by:
getAverageRatingin classGeneratedCustomerReviewManager- Parameters:
ctx- The contextitem- The Product for which the average rating shall be calculated- Returns:
- The average of all ratings for the given product.
-
getNumberOfReviews
Get the number of reviews for the given product- Specified by:
getNumberOfReviewsin classGeneratedCustomerReviewManager- Parameters:
ctx- The contextitem- The Product for which the number of review shall be retrieved- Returns:
- The number of reviews for the given product.
-
getAllReviews
Get a list of all reviews for the given product using the current session context- Parameters:
item- The Product for which the list of review shall be retrieved- Returns:
- The list of all reviews for the given product.
-
getAllReviews
Get a list of all reviews for the given product- Parameters:
ctx- The contextitem- The Product for which the list of review shall be retrieved- Returns:
- The list of all reviews for the given product.
-