com.elasticpath.sfweb.ajax.util.impl
Class OnePageHelperImpl

java.lang.Object
  extended by com.elasticpath.sfweb.ajax.util.impl.OnePageHelperImpl
All Implemented Interfaces:
OnePageHelper

public class OnePageHelperImpl
extends java.lang.Object
implements OnePageHelper

Default implementation of OnePageHelper.


Constructor Summary
OnePageHelperImpl()
           
 
Method Summary
 java.util.List getCartItems(ShoppingCart shoppingCart)
          Method for retreiving convenience-wrapped shopping cart items through dwr.
 java.lang.String getOrderSummary(ShoppingCart shoppingCart)
          Generates the order summary html for the given shopping cart.
 void setDefaultBeanValidator(org.springmodules.commons.validator.DefaultBeanValidator defaultBeanValidator)
          Set the validator.
 void setElasticPath(ElasticPath elasticPath)
           
 void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine)
           
 void validate(java.lang.Object object, java.util.Locale locale)
          Validate an object recieved through dwr.
 void wrapShippingServiceLevels(ShoppingCart shoppingCart)
          Method for wrapping the ShippingServiceLevel objects in the ShoppingCart for easy conversion through dwr.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OnePageHelperImpl

public OnePageHelperImpl()
Method Detail

getCartItems

public java.util.List getCartItems(ShoppingCart shoppingCart)
Method for retreiving convenience-wrapped shopping cart items through dwr.

Specified by:
getCartItems in interface OnePageHelper
Parameters:
shoppingCart - the shopping cart containing the cart items to wrap.
Returns:
a list of cart items wrapped in CartItemBean objects.

getOrderSummary

public java.lang.String getOrderSummary(ShoppingCart shoppingCart)
Generates the order summary html for the given shopping cart.

Specified by:
getOrderSummary in interface OnePageHelper
Parameters:
shoppingCart - the current shopping cart
Returns:
the html code for the updated order summary

setDefaultBeanValidator

public void setDefaultBeanValidator(org.springmodules.commons.validator.DefaultBeanValidator defaultBeanValidator)
Set the validator.

Specified by:
setDefaultBeanValidator in interface OnePageHelper
Parameters:
defaultBeanValidator - the validator

setElasticPath

public void setElasticPath(ElasticPath elasticPath)
Specified by:
setElasticPath in interface OnePageHelper
Parameters:
elasticPath - the elasticPath to set

setVelocityEngine

public void setVelocityEngine(org.apache.velocity.app.VelocityEngine velocityEngine)
Specified by:
setVelocityEngine in interface OnePageHelper
Parameters:
velocityEngine - the velocityEngine to set

validate

public void validate(java.lang.Object object,
                     java.util.Locale locale)
              throws EpDomainException
Validate an object recieved through dwr.

Specified by:
validate in interface OnePageHelper
Parameters:
object - the domain or bean object to be validated
locale - the current locale
Throws:
EpDomainException - if defaultBeanValidator can not be found

wrapShippingServiceLevels

public void wrapShippingServiceLevels(ShoppingCart shoppingCart)
Method for wrapping the ShippingServiceLevel objects in the ShoppingCart for easy conversion through dwr.

Specified by:
wrapShippingServiceLevels in interface OnePageHelper
Parameters:
shoppingCart - the shopping cart containing the shipping service levels to wrap.