org.broadleafcommerce.profile.web.controller
Class CustomerPhoneController

java.lang.Object
  extended by org.broadleafcommerce.profile.web.controller.CustomerPhoneController

@Controller(value="blCustomerPhoneController")
@RequestMapping(value="/myaccount/phone")
public class CustomerPhoneController
extends Object

Provides access and mutator functions to manage a customer's phones.

Author:
sconlon

Constructor Summary
CustomerPhoneController()
           
 
Method Summary
 String deletePhone(Long customerPhoneId, javax.servlet.http.HttpServletRequest request)
          Completely deletes the customerPhone with the given customerPhoneId from the database.
 PhoneNameForm initPhoneNameForm(javax.servlet.http.HttpServletRequest request, org.springframework.ui.Model model)
          Called before each and every request comes into the controller, and is placed on the request for use by those methods.
 String makePhoneDefault(Long customerPhoneId, javax.servlet.http.HttpServletRequest request)
          Sets the passed in customerPhoneId as the default phone for the user.
 String savePhone(PhoneNameForm phoneNameForm, org.springframework.validation.BindingResult errors, javax.servlet.http.HttpServletRequest request, Long customerPhoneId, Long phoneId)
          Creates a new phone if no customerPhoneId & phoneId are passed in; otherwise, it creates a new customerPhone object otherwise.
 void setCustomerPhoneService(CustomerPhoneService customerPhoneService)
           
 void setCustomerPhoneValidator(CustomerPhoneValidator customerPhoneValidator)
           
 void setCustomerState(CustomerState customerState)
           
 void setdeletePhoneSuccessView(String deletePhoneSuccessView)
           
 void setEntityConfiguration(EntityConfiguration entityConfiguration)
           
 void setmakePhoneDefaultSuccessView(String makePhoneDefaultSuccessView)
           
 void setPhoneFormatter(PhoneFormatter phoneFormatter)
           
 void setPhoneValidator(PhoneValidator phoneValidator)
           
 void setsavePhoneErrorView(String savePhoneErrorView)
           
 void setsavePhoneSuccessView(String savePhoneSuccessView)
           
 void setviewPhoneErrorView(String viewPhoneErrorView)
           
 void setviewPhoneSuccessView(String viewPhoneSuccessView)
           
 String viewPhone(Long customerPhoneId, javax.servlet.http.HttpServletRequest request, PhoneNameForm phoneNameForm, org.springframework.validation.BindingResult errors)
          Provides a blank template for a new Customer Phone to be created if no customerPhoneId is provided.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomerPhoneController

public CustomerPhoneController()
Method Detail

deletePhone

@RequestMapping(value="deletePhone",
                method={GET,POST})
public String deletePhone(@RequestParam(required=true)
                                         Long customerPhoneId,
                                         javax.servlet.http.HttpServletRequest request)
Completely deletes the customerPhone with the given customerPhoneId from the database.

Parameters:
customerPhoneId -
request -
Returns:

initPhoneNameForm

@ModelAttribute(value="phoneNameForm")
public PhoneNameForm initPhoneNameForm(javax.servlet.http.HttpServletRequest request,
                                                      org.springframework.ui.Model model)
Called before each and every request comes into the controller, and is placed on the request for use by those methods.

Parameters:
request -
model -
Returns:

makePhoneDefault

@RequestMapping(value="makePhoneDefault",
                method={GET,POST})
public String makePhoneDefault(@RequestParam(required=true)
                                              Long customerPhoneId,
                                              javax.servlet.http.HttpServletRequest request)
Sets the passed in customerPhoneId as the default phone for the user.

Parameters:
customerPhoneId -
request -
Returns:

savePhone

@RequestMapping(value="savePhone",
                method={GET,POST})
public String savePhone(@ModelAttribute(value="phoneNameForm")
                                       PhoneNameForm phoneNameForm,
                                       org.springframework.validation.BindingResult errors,
                                       javax.servlet.http.HttpServletRequest request,
                                       @RequestParam(required=false)
                                       Long customerPhoneId,
                                       @RequestParam(required=false)
                                       Long phoneId)
Creates a new phone if no customerPhoneId & phoneId are passed in; otherwise, it creates a new customerPhone object otherwise. If they are passed in, it is assumed that there is an update.

Parameters:
phoneNameForm -
errors -
request -
customerPhoneId - DOCUMENT ME!
phoneId - DOCUMENT ME!
Returns:

setCustomerPhoneService

public void setCustomerPhoneService(CustomerPhoneService customerPhoneService)

setCustomerPhoneValidator

public void setCustomerPhoneValidator(CustomerPhoneValidator customerPhoneValidator)

setCustomerState

public void setCustomerState(CustomerState customerState)

setdeletePhoneSuccessView

public void setdeletePhoneSuccessView(String deletePhoneSuccessView)

setEntityConfiguration

public void setEntityConfiguration(EntityConfiguration entityConfiguration)

setmakePhoneDefaultSuccessView

public void setmakePhoneDefaultSuccessView(String makePhoneDefaultSuccessView)

setPhoneFormatter

public void setPhoneFormatter(PhoneFormatter phoneFormatter)

setPhoneValidator

public void setPhoneValidator(PhoneValidator phoneValidator)

setsavePhoneErrorView

public void setsavePhoneErrorView(String savePhoneErrorView)

setsavePhoneSuccessView

public void setsavePhoneSuccessView(String savePhoneSuccessView)

setviewPhoneErrorView

public void setviewPhoneErrorView(String viewPhoneErrorView)

setviewPhoneSuccessView

public void setviewPhoneSuccessView(String viewPhoneSuccessView)

viewPhone

@RequestMapping(value="viewPhone",
                method={GET,POST})
public String viewPhone(@RequestParam(required=false)
                                       Long customerPhoneId,
                                       javax.servlet.http.HttpServletRequest request,
                                       @ModelAttribute(value="phoneNameForm")
                                       PhoneNameForm phoneNameForm,
                                       org.springframework.validation.BindingResult errors)
Provides a blank template for a new Customer Phone to be created if no customerPhoneId is provided. Otherwise, when a customerPhoneId is provided, the associated customerPhone object is retrieved, and placed on the request.

Parameters:
customerPhoneId -
request -
phoneNameForm -
errors -
Returns:


Copyright © 2013. All Rights Reserved.