Class ProductPageController


@Controller @Scope("tenant") @RequestMapping("/**/p") public class ProductPageController extends AbstractPageController
Controller for product details page.
  • Constructor Details

    • ProductPageController

      public ProductPageController()
  • Method Details

    • productDetail

      @RequestMapping(value="/{productCode:.*}", method=GET) public String productDetail(@PathVariable("productCode") String productCode, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException, UnsupportedEncodingException
      View product details page.
      Parameters:
      productCode - product code
      model - page model
      request - http request
      response - http response
      Returns:
      path to PDP page
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException - thrown in case the product with ID specified is not found
      UnsupportedEncodingException - thrown in case encoding is not supported
    • showZoomImages

      @RequestMapping(value="/{productCode:.*}/zoomImages", method=GET) public String showZoomImages(@PathVariable("productCode") String productCode, @RequestParam(value="galleryPosition",required=false) String galleryPosition, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request)
      Zoom images.
      Parameters:
      productCode - product code
      galleryPosition - position of the gallery
      model - page model
      Returns:
      path to zoom images fragment
    • showQuickView

      @RequestMapping(value="/{productCode:.*}/quickView", method=GET) public String showQuickView(@PathVariable("productCode") String productCode, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request)
      Quick view.
      Parameters:
      productCode - product code
      model - page model
      request - http request
      Returns:
      path to quick view fragment
    • postReview

      @RequestMapping(value="/{productCode:.*}/review", method={GET,POST}) public String postReview(@PathVariable String productCode, ReviewForm form, org.springframework.validation.BindingResult result, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Post review.
      Parameters:
      productCode - the product code
      form - review form
      result - binding result
      model - page model
      request - htto request
      redirectAttrs - redirect attributes
      Returns:
      returns the path to PDP page
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException - in case setup of review page fails the error is thrown
    • reviewHtml

      @RequestMapping(value="/{productCode:.*}/reviewhtml/{numberOfReviews:.*}", method=GET) public String reviewHtml(@PathVariable("productCode") String productCode, @PathVariable("numberOfReviews") String numberOfReviews, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request)
      Show review.
      Parameters:
      productCode - the product code
      numberOfReviews - number of reviews
      model - page model
      request - http request
      Returns:
      the path to reviews page tab
    • writeReview

      @RequestMapping(value="/{productCode:.*}/writeReview", method=GET) public String writeReview(@PathVariable String productCode, org.springframework.ui.Model model) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Write review dialog.
      Parameters:
      productCode - product code
      model - page model
      Returns:
      path to review page
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException - in case setup of review page fails the error is thrown
    • setUpReviewPage

      protected void setUpReviewPage(org.springframework.ui.Model model, ProductModel productModel) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
    • writeReview

      @RequestMapping(value="/{productCode:.*}/writeReview", method=POST) public String writeReview(@PathVariable String productCode, ReviewForm form, org.springframework.validation.BindingResult result, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectAttrs) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Write review.
      Parameters:
      productCode - the product code
      form - input form object
      result - binding result
      model - page model
      request - request object
      redirectAttrs - redirect attributes
      Returns:
      returns path to PDP page with review message on the model
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException - in case
    • handleUnknownIdentifierException

      @ExceptionHandler(de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException.class) public String handleUnknownIdentifierException(de.hybris.platform.servicelayer.exceptions.UnknownIdentifierException exception, javax.servlet.http.HttpServletRequest request)
      Unknown identifier error.
      Parameters:
      exception - exception o bject
      request - http request
      Returns:
      forward patch to a 404 error page
    • updatePageTitle

      protected void updatePageTitle(ProductModel productModel, org.springframework.ui.Model model)
    • populateProductDetailForDisplay

      protected void populateProductDetailForDisplay(TmaProductOfferingModel productModel, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
    • populateProductData

      protected void populateProductData(ProductData productData, org.springframework.ui.Model model, javax.servlet.http.HttpServletRequest request)
    • sortVariantOptionData

      protected void sortVariantOptionData(ProductData productData)
    • getGalleryImages

      protected List<Map<String,ImageData>> getGalleryImages(ProductData productData)
    • getReviewValidator

      protected ReviewValidator getReviewValidator()
    • getPageForProduct

      protected AbstractPageModel getPageForProduct(String productCode) throws de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
      Throws:
      de.hybris.platform.cms2.exceptions.CMSItemNotFoundException
    • getProductOfferFacade

      protected TmaProductOfferFacade getProductOfferFacade()
    • getTmaPoService

      protected TmaPoService getTmaPoService()
    • getTmaPriceOrganizationService

      protected TmaPriceOrganizationService getTmaPriceOrganizationService()
    • initBinder

      @InitBinder public void initBinder(org.springframework.web.bind.WebDataBinder binder)