|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.campaign.ShoppingCartAttributeLoader
public class ShoppingCartAttributeLoader
A p13n request attribute loader which will load the ShoppingCart into the p13n request.
This will, by default, pull the shopping cart from the pipeline session
at a session attribute "wlcs_shoppingCart", and, if found, set it in the
p13n Request at an attribute called "wlcs_shoppingCart". The attribute
names are controlled by the getShoppingCartSetName()
,
getShoppingCartNamespace(java.lang.Object)
, and getShoppingCartGetNames()
method.
To use this class, register it in your application-config.xml in the following places:
getShoppingCartSetName()
(defaults to
"wlcs_shoppingCart") in <ScenarioService RulesRequestAttrNames="...">
attribute.
Field Summary | |
---|---|
static String[] |
DEF_SHOPPING_CART_GET_NAMES
The default list of names in the PipelineSession to look for the ShoppingCart. |
static String |
DEF_SHOPPING_CART_SET_NAME
The name of the attribute to set the ShoppingCart in the p13n Request. |
static String |
SHOPPING_CART
Deprecated Replaced by DEF_SHOPPING_CART_SET_NAME . |
Constructor Summary | |
---|---|
ShoppingCartAttributeLoader()
|
Method Summary | |
---|---|
Object |
getPipelineSession(HttpServletRequest req)
Get the PipelineSession from the http request. |
Object |
getShoppingCart(Object pSession)
Get the shopping cart from the pipeline session. |
protected String[] |
getShoppingCartGetNames()
Return the list of names of PipelineSession attributes to try to find the shopping cart at. |
protected String |
getShoppingCartNamespace(Object session)
Return the PipelineSession namespace to check for the shopping cart in. |
protected String |
getShoppingCartSetName()
Return the name of the attribute in the p13n Request to set the ShoppingCart to. |
void |
loadAttributes(Request request,
HttpServletRequest origRequest)
Load the shopping cart from the original request to the new request. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String DEF_SHOPPING_CART_SET_NAME
Defaults to "wlcs_shoppingCart"
.
getShoppingCartSetName()
,
PipelineSessionConstants.SHOPPING_CART
,
Constants Summarypublic static final String SHOPPING_CART
DEF_SHOPPING_CART_SET_NAME
.
public static final String[] DEF_SHOPPING_CART_GET_NAMES
Defaults to an array containing "wlcs_shoppingCart"
.
getShoppingCartGetNames()
Constructor Detail |
---|
public ShoppingCartAttributeLoader()
Method Detail |
---|
public void loadAttributes(Request request, HttpServletRequest origRequest)
loadAttributes
in interface Request.AttributeLoader
request
- the p13n destination request.origRequest
- the http source request.getShoppingCart(java.lang.Object)
protected String getShoppingCartSetName()
Defaults to "wlcs_shoppingCart"
.
Subclasses can override this to return something else.
protected String[] getShoppingCartGetNames()
This object will use the first shopping cart found.
Defaults to an array containing
Subclasses can override to return a different list of names to check.
"wlcs_shoppingCart"
.
protected String getShoppingCartNamespace(Object session) throws Exception
This returns the PipelineSession's default namespace, but subclasses can override this.
Exception
public Object getPipelineSession(HttpServletRequest req)
public Object getShoppingCart(Object pSession)
This will look through the pipeline session session attributes
defined by getShoppingCartGetNames()
in the namespace defined by
getShoppingCartNamespace(java.lang.Object)
and return the first ShoppingCart
found.
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |