Class CancelOrderPageController


  • @Controller
    @RequestMapping("/my-account/order")
    public class CancelOrderPageController
    extends AbstractSearchPageController
    Controller for cancel order pages
    • Constructor Detail

      • CancelOrderPageController

        public CancelOrderPageController()
    • Method Detail

      • showCancelOrderPage

        @RequestMapping(value="/{orderCode:.*}/cancel",
                        method={POST,GET})
        public java.lang.String showCancelOrderPage​(@PathVariable("orderCode")
                                                    java.lang.String orderCode,
                                                    org.springframework.ui.Model model,
                                                    org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
                                             throws CMSItemNotFoundException
        Throws:
        CMSItemNotFoundException
      • confirmCancelOrderPage

        @RequestMapping(value="/{orderCode:.*}/cancel/cancelconfirmation",
                        method=POST)
        public java.lang.String confirmCancelOrderPage​(@PathVariable("orderCode")
                                                       java.lang.String orderCode,
                                                       @ModelAttribute("orderEntryCancelForm")
                                                       OrderEntryCancelForm orderEntryCancelForm,
                                                       org.springframework.ui.Model model,
                                                       org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
                                                throws CMSItemNotFoundException
        Throws:
        CMSItemNotFoundException
      • submitCancelOrderPage

        @RequestMapping(value="/{orderCode:.*}/cancel/submit",
                        method=POST)
        public java.lang.String submitCancelOrderPage​(@PathVariable("orderCode")
                                                      java.lang.String orderCode,
                                                      @ModelAttribute("orderEntryCancelForm")
                                                      OrderEntryCancelForm orderEntryCancelForm,
                                                      org.springframework.ui.Model model,
                                                      org.springframework.web.servlet.mvc.support.RedirectAttributes redirectModel)
                                               throws CMSItemNotFoundException
        Throws:
        CMSItemNotFoundException
      • isMultidimensionalEntry

        protected boolean isMultidimensionalEntry​(OrderEntryData orderEntry)
        Confirms if the given OrderEntryData is for multidimensional product
        Parameters:
        orderEntry - the given OrderEntryData
        Returns:
        true, if the given OrderEntryData is for multidimensional product
      • prepareOrderCancelRequestData

        protected OrderCancelRequestData prepareOrderCancelRequestData​(java.lang.String orderCode,
                                                                       java.util.Map<java.lang.Integer,​java.lang.Integer> cancelEntryQuantityMap)
        It prepares the OrderCancelRequestData object by taking the order code and a map of order entry and cancel quantity and sets the user
        Parameters:
        orderCode - which we want to request to cancel
        cancelEntryQuantityMap - map of order entry and cancel quantity
        Returns:
        Populated OrderCancelRequestData
      • prepareOrderCancelEntryData

        protected java.util.List<OrderCancelEntryData> prepareOrderCancelEntryData​(java.util.Map<java.lang.Integer,​java.lang.Integer> cancelEntryQuantityMap)
        It prepares a list of OrderCancelEntryData object to be set in the entries of OrderCancelRequestData
        Parameters:
        cancelEntryQuantityMap - map of order entry and cancel quantity
        Returns:
        list of OrderCancelEntryData representing the map of order entry and cancel quantity
      • initializeForm

        protected OrderEntryCancelForm initializeForm​(OrderData orderData)
        initialize the input form and takes care of the multiD case
        Parameters:
        orderData - The order to be cancelled
        Returns:
        initialized form with initial values of 0
      • populateOrderCancelEntries

        protected void populateOrderCancelEntries​(OrderData orderData,
                                                  java.util.Map<java.lang.Integer,​java.lang.Integer> cancelEntryQuantity)
        Populates the order cancel entries quantity map
        Parameters:
        orderData - the OrderData which is used to populate the map
        cancelEntryQuantity - the map to be populated