Class AddToCartController


  • @Controller("TelcoAddToCartController")
    public class AddToCartController
    extends AbstractController
    Controller for Add to Cart functionality which is not specific to a certain page.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String addBpoToCart​(java.util.List<java.lang.String> simpleProductOfferings, java.lang.String processType, java.lang.String rootBpoCode, int cartGroupNo, java.lang.String subscriptionTermId, java.lang.String subscriberIdentity, java.lang.String subscriberBillingId, org.springframework.ui.Model model)
      Adds multiple TmaSimpleProductOfferingModel entries to cart, as part of a bundle product offering specified by the given rootBpoCode.
      java.lang.String addpreConfig​(java.lang.String preConfig, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)  
      java.lang.String addSpoToBpoConfiguration​(java.lang.String productCodePost, long qty, java.lang.String processType, java.lang.String rootBpoCode, java.lang.String currentStep, int rootGroupNumber, org.springframework.ui.Model model, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel, java.lang.String query, java.lang.String page)
      Adds a new TmaSimpleProductOfferingModel entry to cart for the BPO.
      java.lang.String addSpoToCart​(java.lang.String productCodePost, java.lang.String processType, long qty, java.lang.String rootBpoCode, int cartGroupNo, java.lang.String subscriptionTermId, java.lang.String subscriberIdentity, java.lang.String subscriberBillingId, org.springframework.ui.Model model)
      Adds a new TmaSimpleProductOfferingModel entry to cart.
      protected de.hybris.platform.commercefacades.order.CartFacade getCartFacade()  
      protected EntryGroupFacade getEntryGroupFacade()  
      protected de.hybris.platform.commercefacades.product.ProductFacade getProductFacade()  
      TmaBpoPreConfigFacade getTmaBpoPreConfigFacade()  
      protected TmaCartFacade getTmaCartFacade()  
      void initBinder​(org.springframework.web.bind.WebDataBinder binder)  
      java.lang.String removeSpoFromJourneyStep​(long entryNumber, java.lang.String bpoCode, java.lang.String groupId, java.lang.String cartGroupNumber, org.springframework.ui.Model model, @Valid UpdateQuantityForm form, org.springframework.validation.BindingResult bindingResult, org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
      Removes the SPO added to the journey step
      protected void setCartFacade​(de.hybris.platform.commercefacades.order.CartFacade cartFacade)  
      void setEntryGroupFacade​(EntryGroupFacade entryGroupFacade)  
      void setProductFacade​(de.hybris.platform.commercefacades.product.ProductFacade productFacade)  
      void setTmaBpoPreConfigFacade​(TmaBpoPreConfigFacade tmaBpoPreConfigFacade)  
      void setTmaCartFacade​(TmaCartFacade tmaCartFacade)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • AddToCartController

        public AddToCartController()
    • Method Detail

      • addSpoToCart

        @RequestMapping(value="/cart/add",
                        method=POST,
                        produces="application/json")
        public java.lang.String addSpoToCart​(@RequestParam("productCodePost")
                                             java.lang.String productCodePost,
                                             @RequestParam("processType")
                                             java.lang.String processType,
                                             @RequestParam(value="qty",required=false,defaultValue="1")
                                             long qty,
                                             @RequestParam(value="rootBpoCode",required=false)
                                             java.lang.String rootBpoCode,
                                             @RequestParam(value="cartGroupNo",required=false,defaultValue="-1")
                                             int cartGroupNo,
                                             @RequestParam(value="subscriptionTermId",required=false)
                                             java.lang.String subscriptionTermId,
                                             @RequestParam(value="subscriberIdentity",required=false)
                                             java.lang.String subscriberIdentity,
                                             @RequestParam(value="subscriberBillingId",required=false)
                                             java.lang.String subscriberBillingId,
                                             org.springframework.ui.Model model)
        Adds a new TmaSimpleProductOfferingModel entry to cart. The entry can be added as a simple product offering, or also as part of a bundled product offering identified through the rootBpoCode parameter.
        Parameters:
        productCodePost - ProductModel.CODE
        processType - represents the process flow in the context of which the entry is added to cart (Acquisition, Retention, etc.)
        qty - quantity to be added;default value is 1
        rootBpoCode - ProductModel.CODE of the root Bundled Product Offering, as part of which the TmaSimpleProductOfferingModel is added
        cartGroupNo - specifies the cart entries group number where the entry to be added too; if -1, then a separate cart entry group is created
        subscriptionTermId - specifies the identifier of the new subscription term
        subscriberIdentity - represents subscriber identity for an existing customer
        subscriberBillingId - represents subscriber billing system id for an existing customer
        model - the Spring model
        Returns:
        the path for AddToCart popup showing the new added entries
      • addBpoToCart

        @RequestMapping(value="/cart/addBpo",
                        method=POST)
        public java.lang.String addBpoToCart​(@RequestParam("simpleProductOfferings")
                                             java.util.List<java.lang.String> simpleProductOfferings,
                                             @RequestParam("processType")
                                             java.lang.String processType,
                                             @RequestParam("rootBpoCode")
                                             java.lang.String rootBpoCode,
                                             @RequestParam(value="cartGroupNo",required=false,defaultValue="-1")
                                             int cartGroupNo,
                                             @RequestParam(value="subscriptionTermId",required=false)
                                             java.lang.String subscriptionTermId,
                                             @RequestParam(value="subscriberIdentity",required=false)
                                             java.lang.String subscriberIdentity,
                                             @RequestParam(value="subscriberBillingId",required=false)
                                             java.lang.String subscriberBillingId,
                                             org.springframework.ui.Model model)
        Adds multiple TmaSimpleProductOfferingModel entries to cart, as part of a bundle product offering specified by the given rootBpoCode. The entries can be added under an existing cart entries group indicated by the cartGroupNo parameter, or under a new entry group .
        Parameters:
        simpleProductOfferings - a list of ProductModel.CODE
        processType - represents the process flow in the context of which the entry is added to cart (Acquisition, Retention, etc.)
        rootBpoCode - ProductModel.CODE of the root Bundled Product Offering, as part of which the TmaSimpleProductOfferingModel are added
        cartGroupNo - specifies the cart entries group number where the entries to be added; if -1, then a separate cart entry group is created
        model - the Spring model
        Returns:
        the link to cart page
      • addSpoToBpoConfiguration

        @RequestMapping(value="/cart/addSpo",
                        method=POST,
                        produces="application/json")
        public java.lang.String addSpoToBpoConfiguration​(@RequestParam("productCodePost")
                                                         java.lang.String productCodePost,
                                                         @RequestParam(value="qty",required=false,defaultValue="1")
                                                         long qty,
                                                         @RequestParam("processType")
                                                         java.lang.String processType,
                                                         @RequestParam("rootBpoCode")
                                                         java.lang.String rootBpoCode,
                                                         @RequestParam(value="currentStep",required=false)
                                                         java.lang.String currentStep,
                                                         @RequestParam(value="rootGroupNumber",required=false,defaultValue="-1")
                                                         int rootGroupNumber,
                                                         org.springframework.ui.Model model,
                                                         org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel,
                                                         @RequestParam(value="q",required=false)
                                                         java.lang.String query,
                                                         @RequestParam(value="page",required=false)
                                                         java.lang.String page)
        Adds a new TmaSimpleProductOfferingModel entry to cart for the BPO. The entry can be added as a simple product offering as a part of a bundled product offering identified through the rootBpoCode parameter and group number if any
        Parameters:
        productCodePost - ProductModel.CODE
        qty - quantity to be added;default value is 1
        processType - represents the process flow in the context of which the entry is added to cart (Acquisition, Retention, etc.)
        rootBpoCode - ProductModel.CODE of the root Bundled Product Offering, as part of which the TmaSimpleProductOfferingModel is added
        currentStep - Step id or the group Id from where the SPO is added to the BPO
        rootGroupNumber - specifies the cart entries group number where the entry to be added too; if -1, then a separate cart entry group is created
        model - the Spring model
        query - The applied query on page
        page - The page number from which the product is added to the cart
        Returns:
        the path for bpo guided selling for the group appended with the group number
      • removeSpoFromJourneyStep

        @RequestMapping(value="/cart/removeSpo",
                        method=POST)
        public java.lang.String removeSpoFromJourneyStep​(@RequestParam("entryNumber")
                                                         long entryNumber,
                                                         @RequestParam("bpoCode")
                                                         java.lang.String bpoCode,
                                                         @RequestParam("groupId")
                                                         java.lang.String groupId,
                                                         @RequestParam("cartGroupNumber")
                                                         java.lang.String cartGroupNumber,
                                                         org.springframework.ui.Model model,
                                                         @Valid
                                                         @Valid UpdateQuantityForm form,
                                                         org.springframework.validation.BindingResult bindingResult,
                                                         org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
        Removes the SPO added to the journey step
        Parameters:
        entryNumber - entry number of the cart entry to be updated
        groupId - The groupId of the journey
        bpoCode - The parent BPO code for the journey
        cartGroupNumber - specifies the cart entries group number where the entry is to be removed from
        model - page model to be populated with information
        form - update quantity form specifying the new quantity of the product from the entry with the number given
        bindingResult - request binding result to retrieve validation errors from
        redirectModel - redirect model to be populated with information
        Returns:
        redirect url to the journey page
      • addpreConfig

        @RequestMapping(value="/cart/preconfig/{preConfig}",
                        method=GET)
        public java.lang.String addpreConfig​(@PathVariable("preConfig")
                                             java.lang.String preConfig,
                                             org.springframework.ui.Model model,
                                             org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
      • getCartFacade

        protected de.hybris.platform.commercefacades.order.CartFacade getCartFacade()
      • setCartFacade

        protected void setCartFacade​(de.hybris.platform.commercefacades.order.CartFacade cartFacade)
      • getProductFacade

        protected de.hybris.platform.commercefacades.product.ProductFacade getProductFacade()
      • setProductFacade

        public void setProductFacade​(de.hybris.platform.commercefacades.product.ProductFacade productFacade)
      • setTmaCartFacade

        public void setTmaCartFacade​(TmaCartFacade tmaCartFacade)
      • setEntryGroupFacade

        public void setEntryGroupFacade​(EntryGroupFacade entryGroupFacade)
      • setTmaBpoPreConfigFacade

        public void setTmaBpoPreConfigFacade​(TmaBpoPreConfigFacade tmaBpoPreConfigFacade)
      • initBinder

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