Class CustomerPhoneController
java.lang.Object
org.broadleafcommerce.profile.web.controller.CustomerPhoneController
@Controller("blCustomerPhoneController")
@RequestMapping("/myaccount/phone")
public class CustomerPhoneController
extends Object
Provides access and mutator functions to manage a customer's phones.
- Author:
- sconlon
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondeletePhone(Long customerPhoneId, jakarta.servlet.http.HttpServletRequest request) Completely deletes the customerPhone with the given customerPhoneId from the database.initPhoneNameForm(jakarta.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.makePhoneDefault(Long customerPhoneId, jakarta.servlet.http.HttpServletRequest request) Sets the passed in customerPhoneId as the default phone for the user.savePhone(PhoneNameForm phoneNameForm, org.springframework.validation.BindingResult errors, jakarta.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.voidsetCustomerPhoneService(CustomerPhoneService customerPhoneService) voidsetCustomerPhoneValidator(CustomerPhoneValidator customerPhoneValidator) voidsetCustomerState(CustomerState customerState) voidsetdeletePhoneSuccessView(String deletePhoneSuccessView) voidsetEntityConfiguration(EntityConfiguration entityConfiguration) voidsetmakePhoneDefaultSuccessView(String makePhoneDefaultSuccessView) voidsetPhoneFormatter(PhoneFormatter phoneFormatter) voidsetPhoneValidator(PhoneValidator phoneValidator) voidsetsavePhoneErrorView(String savePhoneErrorView) voidsetsavePhoneSuccessView(String savePhoneSuccessView) voidsetviewPhoneErrorView(String viewPhoneErrorView) voidsetviewPhoneSuccessView(String viewPhoneSuccessView) viewPhone(Long customerPhoneId, jakarta.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.
-
Constructor Details
-
CustomerPhoneController
public CustomerPhoneController()
-
-
Method Details
-
deletePhone
@RequestMapping(value="deletePhone", method={GET,POST}) public String deletePhone(@RequestParam(required=true) Long customerPhoneId, jakarta.servlet.http.HttpServletRequest request) Completely deletes the customerPhone with the given customerPhoneId from the database.- Parameters:
customerPhoneId-request-- Returns:
-
initPhoneNameForm
@ModelAttribute("phoneNameForm") public PhoneNameForm initPhoneNameForm(jakarta.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, jakarta.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("phoneNameForm") PhoneNameForm phoneNameForm, org.springframework.validation.BindingResult errors, jakarta.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
-
setCustomerPhoneValidator
-
setCustomerState
-
setdeletePhoneSuccessView
-
setEntityConfiguration
-
setmakePhoneDefaultSuccessView
-
setPhoneFormatter
-
setPhoneValidator
-
setsavePhoneErrorView
-
setsavePhoneSuccessView
-
setviewPhoneErrorView
-
setviewPhoneSuccessView
-
viewPhone
@RequestMapping(value="viewPhone", method={GET,POST}) public String viewPhone(@RequestParam(required=false) Long customerPhoneId, jakarta.servlet.http.HttpServletRequest request, @ModelAttribute("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:
-