org.broadleafcommerce.core.web.controller.order
Class WishlistController

java.lang.Object
  extended by org.broadleafcommerce.core.web.controller.order.AbstractCartController
      extended by org.broadleafcommerce.core.web.controller.order.CartController
          extended by org.broadleafcommerce.core.web.controller.order.WishlistController

@Controller(value="blWishlistController")
@RequestMapping(value="/wishlist")
public class WishlistController
extends CartController

1) Created the WishlistController as an extension of the CartController 2) Methods addItem, addItems, removeItem, and updateItemQuantity are defined in the CartController 3) Renamed selectWishlist method to viewWishlists 4) Renamed addWishlist method to createWishlist 5) Modified the moveItemToCart method to take in a OrderItem object 6) Removed the displayWishlist method because it is not needed 7) Changed all the Error objects to BindingResult 8) Override the retrieveOrder method to return a wishlist order


Field Summary
 
Fields inherited from class org.broadleafcommerce.core.web.controller.order.AbstractCartController
addItemView, addItemViewRedirect, cartService, cartView, cartViewRedirect, catalogService, customerState, fulfillmentGroupService, offerService, removeItemView, removeItemViewRedirect
 
Constructor Summary
WishlistController()
           
 
Method Summary
 String addToWishlist(org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request, WishlistRequest wishlistRequest, org.springframework.validation.BindingResult errors)
           
 String createWishlist(org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request, WishlistRequest wishlistRequest)
           
protected  Order createWishlistCart(javax.servlet.http.HttpServletRequest request, String wishlistName)
           
 String createWishlistName(org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request)
           
 String moveAllItemsToCart(String wishlistName, org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request)
           
 String moveItemToCart(long orderItemId, String wishlistName, org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request)
           
 String removeWishlist(String wishlistName, org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request)
           
 String removeWishlistItem(long orderItemId, long orderId, org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request)
           
 String showWishlists(org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request)
           
 String viewWishlist(org.springframework.ui.ModelMap model, javax.servlet.http.HttpServletRequest request, Long id)
           
 
Methods inherited from class org.broadleafcommerce.core.web.controller.order.AbstractCartController
addItem, addPromoCode, beginCheckout, checkout, createFulfillmentGroup, initFulfillmentGroups, removeItem, removePromoCode, retrieveCartOrder, setAddItemView, setAddItemViewRedirect, setCartView, setCartViewRedirect, setRemoveItemView, setRemoveItemViewRedirect, updateFulfillmentGroups, updateItemQuantity, updateShipping, viewCart
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WishlistController

public WishlistController()
Method Detail

addToWishlist

@RequestMapping(method=POST,
                params="addToWishlist")
public String addToWishlist(org.springframework.ui.ModelMap model,
                                           javax.servlet.http.HttpServletRequest request,
                                           @ModelAttribute
                                           WishlistRequest wishlistRequest,
                                           org.springframework.validation.BindingResult errors)

showWishlists

@RequestMapping(method=GET)
public String showWishlists(org.springframework.ui.ModelMap model,
                                           javax.servlet.http.HttpServletRequest request)

viewWishlist

@RequestMapping(method=GET)
public String viewWishlist(org.springframework.ui.ModelMap model,
                                          javax.servlet.http.HttpServletRequest request,
                                          @RequestParam(value="id")
                                          Long id)

createWishlist

@RequestMapping(method={GET,POST})
public String createWishlist(org.springframework.ui.ModelMap model,
                                            javax.servlet.http.HttpServletRequest request,
                                            @ModelAttribute
                                            WishlistRequest wishlistRequest)

createWishlistName

@RequestMapping(method={GET,POST})
public String createWishlistName(org.springframework.ui.ModelMap model,
                                                javax.servlet.http.HttpServletRequest request)

removeWishlist

@RequestMapping(method={GET,POST})
public String removeWishlist(@RequestParam
                                            String wishlistName,
                                            org.springframework.ui.ModelMap model,
                                            javax.servlet.http.HttpServletRequest request)

removeWishlistItem

@RequestMapping(method=GET)
public String removeWishlistItem(@RequestParam
                                                long orderItemId,
                                                @RequestParam
                                                long orderId,
                                                org.springframework.ui.ModelMap model,
                                                javax.servlet.http.HttpServletRequest request)

moveItemToCart

@RequestMapping(method={GET,POST})
public String moveItemToCart(@RequestParam
                                            long orderItemId,
                                            @RequestParam
                                            String wishlistName,
                                            org.springframework.ui.ModelMap model,
                                            javax.servlet.http.HttpServletRequest request)

moveAllItemsToCart

@RequestMapping(method=GET)
public String moveAllItemsToCart(@RequestParam
                                                String wishlistName,
                                                org.springframework.ui.ModelMap model,
                                                javax.servlet.http.HttpServletRequest request)

createWishlistCart

protected Order createWishlistCart(javax.servlet.http.HttpServletRequest request,
                                   String wishlistName)


Copyright © 2012. All Rights Reserved.