com.elasticpath.sfweb.ajax.service
Interface CustomerAjaxController

All Known Implementing Classes:
CustomerAjaxControllerImpl

public interface CustomerAjaxController

Provides customer related services for ajax.


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.
 

Method Detail

addCustomer

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

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

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

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

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

Parameters:
request - the current HttpServletRequest
Returns:
the current Customer object

resetPassword

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

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

void setAuthenticationManager(org.acegisecurity.AuthenticationManager authenticationManager)
Parameters:
authenticationManager - the acegi AuthenticationManager

setCheckoutService

void setCheckoutService(CheckoutService checkoutService)
Parameters:
checkoutService - the checkoutService to set

setCustomerService

void setCustomerService(CustomerService customerService)
Parameters:
customerService - the CustomerService object

setCustomerSessionService

void setCustomerSessionService(CustomerSessionService customerSessionService)
Parameters:
customerSessionService - the customer session service object

setOnePageHelper

void setOnePageHelper(OnePageHelper onePageHelper)
Parameters:
onePageHelper - the onePageHelper to set

setRequestHelper

void setRequestHelper(RequestHelper requestHelper)
Parameters:
requestHelper - the request helper

signIn

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

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

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.

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