com.elasticpath.sfweb.ajax.service.impl
Class CustomerAjaxControllerImpl

java.lang.Object
  extended by com.elasticpath.sfweb.ajax.service.impl.CustomerAjaxControllerImpl
All Implemented Interfaces:
CustomerAjaxController

public class CustomerAjaxControllerImpl
extends java.lang.Object
implements CustomerAjaxController

The default implementation of CustomerAjaxComtroller.


Constructor Summary
CustomerAjaxControllerImpl()
           
 
Method Summary
 ShoppingCartBean addCustomer(Customer customer, javax.servlet.http.HttpServletRequest request)
          Pass call on to the service layer to add the customer.
 ShoppingCartBean anonymousSignIn(AnonymousSignInFormBean anonymousSignInFormBean, javax.servlet.http.HttpServletRequest request)
          Perform anonymous customer sign in for dwr.
 Customer getCustomer(javax.servlet.http.HttpServletRequest request)
          Method to retrieve the current Customer through dwr.
 java.lang.String resetPassword(java.lang.String email, javax.servlet.http.HttpServletRequest request)
          Resets the customer's password for the specified email.
 void setAuthenticationManager(org.acegisecurity.AuthenticationManager authenticationManager)
           
 void setCheckoutService(CheckoutService checkoutService)
           
 void setCustomerService(CustomerService customerService)
           
 void setCustomerSessionService(CustomerSessionService customerSessionService)
           
 void setOnePageHelper(OnePageHelper onePageHelper)
           
 void setRequestHelper(RequestHelper requestHelper)
           
 ShoppingCartBean signIn(SignInFormBean signInFormBean, javax.servlet.http.HttpServletRequest request)
          Perform customer sign in for dwr.
 ShoppingCartBean updateAddress(CustomerAddress address, boolean isShippingAddress, javax.servlet.http.HttpServletRequest request)
          Updates the billing or shipping address selection and adds the address if it is new.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomerAjaxControllerImpl

public CustomerAjaxControllerImpl()
Method Detail

addCustomer

public ShoppingCartBean addCustomer(Customer customer,
                                    javax.servlet.http.HttpServletRequest request)
                             throws DwrValidationException
Pass call on to the service layer to add the customer. Any validation errors generated are caught here and localized.

Specified by:
addCustomer in interface CustomerAjaxController
Parameters:
customer - the customer to be added.
request - the current HttpServletRequest.
Returns:
the updated ShoppingCartBean object
Throws:
DwrValidationException - the validation errors to be displayed

anonymousSignIn

public ShoppingCartBean anonymousSignIn(AnonymousSignInFormBean anonymousSignInFormBean,
                                        javax.servlet.http.HttpServletRequest request)
                                 throws DwrValidationException
Perform anonymous customer sign in for dwr.

Specified by:
anonymousSignIn in interface CustomerAjaxController
Parameters:
anonymousSignInFormBean - the form bean containing the sign in info
request - the current request object
Returns:
the updated ShoppingCartBean object
Throws:
DwrValidationException - the validation errors to be displayed

getCustomer

public Customer getCustomer(javax.servlet.http.HttpServletRequest request)
Method to retrieve the current Customer through dwr.

Specified by:
getCustomer in interface CustomerAjaxController
Parameters:
request - the current HttpServletRequest
Returns:
the current Customer object

resetPassword

public java.lang.String resetPassword(java.lang.String email,
                                      javax.servlet.http.HttpServletRequest request)
Resets the customer's password for the specified email.

Specified by:
resetPassword in interface CustomerAjaxController
Parameters:
email - The email address of the customer whose password is to be reset
request - The current http request
Returns:
the confirmation message string if everything went smoothly

setAuthenticationManager

public void setAuthenticationManager(org.acegisecurity.AuthenticationManager authenticationManager)
Specified by:
setAuthenticationManager in interface CustomerAjaxController
Parameters:
authenticationManager - the acegi AuthenticationManager

setCheckoutService

public void setCheckoutService(CheckoutService checkoutService)
Specified by:
setCheckoutService in interface CustomerAjaxController
Parameters:
checkoutService - the checkoutService to set

setCustomerService

public void setCustomerService(CustomerService customerService)
Specified by:
setCustomerService in interface CustomerAjaxController
Parameters:
customerService - the CustomerService object

setCustomerSessionService

public void setCustomerSessionService(CustomerSessionService customerSessionService)
Specified by:
setCustomerSessionService in interface CustomerAjaxController
Parameters:
customerSessionService - the customer session service object

setOnePageHelper

public void setOnePageHelper(OnePageHelper onePageHelper)
Specified by:
setOnePageHelper in interface CustomerAjaxController
Parameters:
onePageHelper - the onePageHelper to set

setRequestHelper

public void setRequestHelper(RequestHelper requestHelper)
Specified by:
setRequestHelper in interface CustomerAjaxController
Parameters:
requestHelper - the request helper

signIn

public ShoppingCartBean signIn(SignInFormBean signInFormBean,
                               javax.servlet.http.HttpServletRequest request)
                        throws DwrValidationException
Perform customer sign in for dwr.

Specified by:
signIn in interface CustomerAjaxController
Parameters:
signInFormBean - the form bean containing the sign in info
request - the current request object
Returns:
the updated ShoppingCartBean object
Throws:
DwrValidationException - the validation errors to be displayed

updateAddress

public ShoppingCartBean updateAddress(CustomerAddress address,
                                      boolean isShippingAddress,
                                      javax.servlet.http.HttpServletRequest request)
Updates the billing or shipping address selection and adds the address if it is new.

Specified by:
updateAddress in interface CustomerAjaxController
Parameters:
address - the selected CustomerAddress, possibly a new one
isShippingAddress - true if this is a shipping address, false if it is a biling address
request - the current HttpServletRequest
Returns:
the updated ShoppingCartBean object