|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object atg.nucleus.logging.VariableArgumentApplicationLoggingImpl atg.nucleus.GenericService atg.commerce.order.purchase.PurchaseProcessHelper
public class PurchaseProcessHelper
PurchaseProcessHelper contains the common functionality required by the purchase process form handlers as well as commerce web services.
Field Summary | |
---|---|
static java.lang.String |
CLASS_VERSION
Class version string |
static java.lang.String |
ERROR_FETCHING_PROFILE
|
static java.lang.String |
MSG_ERROR_ADDING_CREDIT_CARD
|
static java.lang.String |
MSG_ERROR_ADDING_SHIPPINGGROUP
|
static java.lang.String |
MSG_ERROR_ADDING_TO_ORDER
|
static java.lang.String |
MSG_ERROR_CREATING_ORDER
|
static java.lang.String |
MSG_ERROR_MOVING_ITEM_BETWEEN_SHIPPING_GROUPS
|
static java.lang.String |
MSG_ERROR_PROCESS_ADD_ITEM_CHAIN
|
static java.lang.String |
MSG_ERROR_REMOVING_ITEM
|
static java.lang.String |
MSG_ERROR_REMOVING_ITEM_FROM_SHIPPING_GROUP
|
static java.lang.String |
MSG_ERROR_REPRICING_ORDER_AFTER_ADD_ITEM
|
static java.lang.String |
MSG_ERROR_SETTING_ORDER_AMOUNT
|
static java.lang.String |
MSG_INVALID_PROFILE_ID
|
Fields inherited from class atg.nucleus.GenericService |
---|
SERVICE_INFO_KEY |
Fields inherited from interface atg.nucleus.logging.TraceApplicationLogging |
---|
DEFAULT_LOG_TRACE_STATUS |
Fields inherited from interface atg.nucleus.logging.ApplicationLogging |
---|
DEFAULT_LOG_DEBUG_STATUS, DEFAULT_LOG_ERROR_STATUS, DEFAULT_LOG_INFO_STATUS, DEFAULT_LOG_WARNING_STATUS |
Constructor Summary | |
---|---|
PurchaseProcessHelper()
|
Method Summary | |
---|---|
CreditCard |
addCreditCardToOrder(Order pOrder,
atg.payment.creditcard.BasicCreditCardInfoImpl pCreditCardInfo,
java.lang.String pCreditCardPaymentGroupType)
Adds a new CreditCard payment group to the order. |
java.util.List |
addItemsToOrder(Order pOrder,
ShippingGroup pShippingGroup,
RepositoryItem pProfile,
atg.commerce.order.purchase.AddCommerceItemInfo[] pItemInfos,
java.util.Locale pUserLocale,
java.lang.String pCatalogKey,
PricingModelHolder pUserPricingModels,
atg.commerce.util.PipelineErrorHandler pErrorHandler)
Add one or more items to the order (the shopping cart). |
java.util.List |
addItemsToOrder(Order pOrder,
ShippingGroup pShippingGroup,
RepositoryItem pProfile,
atg.commerce.order.purchase.AddCommerceItemInfo[] pItemInfos,
java.util.Locale pUserLocale,
java.lang.String pCatalogKey,
PricingModelHolder pUserPricingModels,
atg.commerce.util.PipelineErrorHandler pErrorHandler,
java.util.Map pExtraParameters)
Add one or more items to the order (the shopping cart). |
protected void |
addItemToShippingGroup(CommerceItem pItem,
atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo,
Order pOrder,
ShippingGroup pShippingGroup)
Associate a commerce item with the shipping group specified by the shippingGroup property. |
ShippingGroup |
addShippingAddressToOrder(Order pOrder,
Address pAddress)
Adds a new HardgoodShippingGroup with the given address to the order. |
void |
adjustItemRelationshipsForQuantityChange(Order pOrder,
CommerceItem pItem,
long pNewQuantity)
Adjusts the shipping group relationship quantities when an item's quantity is changed. |
protected void |
adjustNonGiftHandlingInstructionsForQuantityDecrease(Order pOrder,
ShippingGroup pShippingGroup,
CommerceItem pCommerceItem,
long pNewQuantity,
long pQuantityDecrease)
Adjusts the non-gift handling instruction for a quantity decrease. |
protected void |
adjustNonGiftHandlingInstructionsForQuantityIncrease(Order pOrder,
ShippingGroup pShippingGroup,
CommerceItem pCommerceItem,
long pNewQuantity,
long pQuantityIncreasee)
Adjusts the non-gift handling instruction for a quantity increase. |
protected void |
applyValueDictionary(java.lang.Object pBean,
java.util.Dictionary pValues,
java.lang.String pPropertyPathPrefix)
Copy properties from the value dictionary or one of its descendents. |
void |
copyCreditCardInfo(atg.payment.creditcard.BasicCreditCardInfo pCreditCardInfo,
CreditCard pCard)
Copies credit card information into the credit card payment group. |
protected CommerceItem |
createCommerceItem(atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo,
java.lang.String pCatalogKey,
Order pOrder)
Create a commerce item and add it to the order. |
protected void |
createConfigurableSubitems(CommerceItem pItem,
atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo,
Order pOrder)
Create subitems for a base configurable commerce item. |
Order |
createOrder(java.lang.String pOrderType,
java.lang.String pProfileId)
Creates an Order of the given type for the given user within a transaction. |
protected void |
decreaseRelationshipQuantity(Order pOrder,
ShippingGroupCommerceItemRelationship pRelationship,
long pQuantityDecrease)
Decrease the quantity of a relationship by the given amount. |
java.util.List |
deleteItems(Order pOrder,
java.lang.String[] pRemovalCommerceIds,
PricingModelHolder pUserPricingModels,
java.util.Locale pUserLocale,
RepositoryItem pProfile,
atg.commerce.util.PipelineErrorHandler pErrorHandler)
Delete all items from the order whose id appears in the RemovalCommerceIds property. |
java.util.List |
deleteItems(Order pOrder,
java.lang.String[] pRemovalCommerceIds,
PricingModelHolder pUserPricingModels,
java.util.Locale pUserLocale,
RepositoryItem pProfile,
atg.commerce.util.PipelineErrorHandler pErrorHandler,
java.util.Map pExtraParameters)
Delete all items from the order whose id appears in the RemovalCommerceIds property. |
java.lang.String |
getAddItemToOrderChainId()
Gets the addItemToOrder pipeline chain id. |
java.lang.String |
getAddItemToOrderPricingOp()
Gets the addItemToOrder pricing operation. |
CommerceItemManager |
getCommerceItemManager()
Gets the CommerceItemManager component. |
java.lang.String |
getDefaultHardgoodShippingGroupType()
Gets the DefaultHardgoodShippingGroupType. |
java.lang.String |
getDeleteItemsFromOrderPricingOp()
Gets the deleteItemsToOrder pricing operation. |
GiftlistManager |
getGiftlistManager()
Gets the GiftlistManager component. |
OrderManager |
getOrderManager()
Sets the OrderManager component. |
PipelineManager |
getPipelineManager()
Gets the PipelineManager component. |
java.lang.String |
getRepriceOrderChainId()
Gets the reprice order pipeline chain id. |
ShippingGroup |
getShippingGroupForItem(Order pOrder,
atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo,
ShippingGroup pShippingGroup,
java.lang.String pCatalogKey)
This method returns a shipping group whose type is appropriate for a new item being added to an order. |
ShippingGroupManager |
getShippingGroupManager()
Gets the ShippingGroupManager component. |
javax.transaction.TransactionManager |
getTransactionManager()
Gets the TransactionManager component. |
protected void |
increaseRelationshipQuantity(Order pOrder,
ShippingGroupCommerceItemRelationship pRelationship,
long pQuantityIncrease)
Increases the relationship quantity by the given amount. |
boolean |
isAddItemToDefaultShippingGroup()
This property tells addItemsToOrder whether to add new items to a default
shipping group that is passed in or to shipping groups whose types are appropriate
for the items. |
protected boolean |
isTransactionMarkedAsRollBack()
Returns true if the transaction associated with the current thread is marked for rollback. |
void |
moveItemBetweenShippingGroups(Order pOrder,
java.lang.String pCommerceItemId,
long pQuantity,
java.lang.String pSourceShippingGroupId,
java.lang.String pTargetShippingGroupId)
Move the given quantity of the commerce item from one shipping group into another. |
protected void |
processGiftAddition(CommerceItem pItem,
atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo,
Order pOrder,
RepositoryItem pProfile,
ShippingGroup pShippingGroup)
Perform giftlist related processing for an item being ordered from a giftlist. |
void |
processPipelineErrors(PipelineResult pResult,
atg.commerce.util.PipelineErrorHandler pErrorHandler)
|
protected void |
removeEntireRelationshipQuantity(Order pOrder,
ShippingGroupCommerceItemRelationship pRelationship)
Decreases the quantity of a relationship to zero Called by adjustItemRelationshipsForQuantityChange when the quantity of a relationship is being
decreased to zero. |
void |
removeItemQuantityFromShippingGroup(Order pOrder,
java.lang.String pCommerceItemId,
java.lang.String pShippingGroupId,
long pQuantity)
Remove the quantity of the given item from the shipping group. |
protected PipelineResult |
runProcess(java.lang.String pChainId,
java.util.Map pParameters)
Executes a Pipeline Chain. |
protected PipelineResult |
runProcess(java.lang.String pChainId,
Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Executes a Pipeline Chain and places the supplies method parameters into a HashMap which is supplied to the chain to execute. |
protected PipelineResult |
runProcess(java.lang.String pChainId,
Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pParameters,
java.util.Map pExtraParameters)
Executes a Pipeline Chain and places the supplies method parameters into a HashMap which is supplied to the chain to execute. |
protected void |
runProcessAddItemToOrder(Order pOrder,
CommerceItem pCommerceItem,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
atg.commerce.util.PipelineErrorHandler pErrorHandler)
Run the pipeline which should be executed when the handleAddItemToOrder method is invoked
This method will add pCommerceItem to pExtraParameters unless the key
PipelineConstants.COMMERCEITEM is already in the map |
void |
runProcessRepriceOrder(java.lang.String pPricingOperation,
Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters,
atg.commerce.util.PipelineErrorHandler pErrorHandler)
Run the pipeline which should be executed when the order needs to be repriced |
protected void |
runProcessSendScenarioEvent(Order pOrder,
CommerceItem pItem,
long pQuantity,
java.lang.String pType,
atg.commerce.util.PipelineErrorHandler pErrorHandler)
The runProcessSendScenarioEvent method sends a scenario event. |
protected void |
runProcessSendScenarioEvent(Order pOrder,
CommerceItem pItem,
long pQuantity,
java.lang.String pType,
atg.commerce.util.PipelineErrorHandler pErrorHandler,
java.lang.String pSiteId)
The runProcessSendScenarioEvent method sends a scenario event. |
protected PipelineResult |
runRepricingProcess(java.lang.String pChainId,
java.lang.String pPricingOperation,
Order pOrder,
PricingModelHolder pPricingModels,
java.util.Locale pLocale,
RepositoryItem pProfile,
java.util.Map pExtraParameters)
Executes a Pipeline Chain and places the supplies method parameters into a HashMap which is supplied to the chain to execute. |
void |
setAddItemToDefaultShippingGroup(boolean pAddItemToDefaultShippingGroup)
This property tells addItemsToOrder whether to add new items to a default
shipping group that is passed in or to shipping groups whose types are appropriate
for the items. |
void |
setAddItemToOrderChainId(java.lang.String pAddItemToOrderChainId)
Sets the addItemToOrder pipeline chain id. |
void |
setAddItemToOrderPricingOp(java.lang.String pAddItemToOrderPricingOp)
Sets the addItemToOrder pricing operation. |
void |
setCommerceItemManager(CommerceItemManager pCommerceItemManager)
Sets the CommerceItemManager component. |
protected void |
setCommerceItemProperties(CommerceItem pItem,
atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo)
Fill in "extra" commerce item properties. |
void |
setDefaultHardgoodShippingGroupType(java.lang.String pDefaultHardgoodShippingGroupType)
Sets the defaultHardgoodShippingGroupType. |
void |
setDeleteItemsFromOrderPricingOp(java.lang.String pDeleteItemsFromOrderPricingOp)
Sets the deleteItemsToOrder pricing operation. |
void |
setGiftlistManager(GiftlistManager pGiftlistManager)
Sets the GiftlistManager component. |
void |
setOrderAmountToPaymentGroup(Order pOrder,
java.lang.String pPaymentGroupId,
double pAmount)
Sets the given order amount to the given payment group. |
void |
setOrderManager(OrderManager pOrderManager)
Gets the OrderManager component. |
void |
setPipelineManager(PipelineManager pPipelineManager)
Sets the PipelineManager component. |
void |
setRepriceOrderChainId(java.lang.String pRepriceOrderChainId)
Sets the reprice order pipeline chain id. |
void |
setShippingGroupManager(ShippingGroupManager pShippingGroupManager)
Sets the ShippingGroupManager component. |
void |
setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
Sets the TransactionManager component. |
Methods inherited from class atg.nucleus.logging.VariableArgumentApplicationLoggingImpl |
---|
vlogDebug, vlogDebug, vlogDebug, vlogDebug, vlogError, vlogError, vlogError, vlogError, vlogInfo, vlogInfo, vlogInfo, vlogInfo, vlogTrace, vlogTrace, vlogTrace, vlogTrace, vlogWarning, vlogWarning, vlogWarning, vlogWarning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String CLASS_VERSION
public static final java.lang.String MSG_ERROR_ADDING_TO_ORDER
public static final java.lang.String MSG_ERROR_REMOVING_ITEM
public static final java.lang.String MSG_ERROR_CREATING_ORDER
public static final java.lang.String MSG_ERROR_ADDING_SHIPPINGGROUP
public static final java.lang.String MSG_ERROR_SETTING_ORDER_AMOUNT
public static final java.lang.String MSG_ERROR_ADDING_CREDIT_CARD
public static final java.lang.String MSG_ERROR_REMOVING_ITEM_FROM_SHIPPING_GROUP
public static final java.lang.String MSG_ERROR_MOVING_ITEM_BETWEEN_SHIPPING_GROUPS
public static final java.lang.String ERROR_FETCHING_PROFILE
public static final java.lang.String MSG_INVALID_PROFILE_ID
public static final java.lang.String MSG_ERROR_REPRICING_ORDER_AFTER_ADD_ITEM
public static final java.lang.String MSG_ERROR_PROCESS_ADD_ITEM_CHAIN
Constructor Detail |
---|
public PurchaseProcessHelper()
Method Detail |
---|
public java.lang.String getRepriceOrderChainId()
public void setRepriceOrderChainId(java.lang.String pRepriceOrderChainId)
public OrderManager getOrderManager()
public void setOrderManager(OrderManager pOrderManager)
public PipelineManager getPipelineManager()
public void setPipelineManager(PipelineManager pPipelineManager)
public javax.transaction.TransactionManager getTransactionManager()
public void setTransactionManager(javax.transaction.TransactionManager pTransactionManager)
public void setCommerceItemManager(CommerceItemManager pCommerceItemManager)
public CommerceItemManager getCommerceItemManager()
public void setGiftlistManager(GiftlistManager pGiftlistManager)
public GiftlistManager getGiftlistManager()
public void setShippingGroupManager(ShippingGroupManager pShippingGroupManager)
public ShippingGroupManager getShippingGroupManager()
public void setAddItemToOrderPricingOp(java.lang.String pAddItemToOrderPricingOp)
public java.lang.String getAddItemToOrderPricingOp()
public void setAddItemToOrderChainId(java.lang.String pAddItemToOrderChainId)
public java.lang.String getAddItemToOrderChainId()
public void setDeleteItemsFromOrderPricingOp(java.lang.String pDeleteItemsFromOrderPricingOp)
public java.lang.String getDeleteItemsFromOrderPricingOp()
public void setDefaultHardgoodShippingGroupType(java.lang.String pDefaultHardgoodShippingGroupType)
public java.lang.String getDefaultHardgoodShippingGroupType()
public boolean isAddItemToDefaultShippingGroup()
addItemsToOrder
whether to add new items to a default
shipping group that is passed in or to shipping groups whose types are appropriate
for the items.
This property is used only if the AddCommerceItemInfo
does not supply the shipping group type
and this property is used in getShippingGroupForItem(Order, AddCommerceItemInfo, ShippingGroup, String)
.
The default value for this property is true
.
If the property is false
, then the system will identify shipping groups
based on the new items' shipping group types.
Otherwise the system will use the default shipping group that is passed in.
getShippingGroupForItem(Order, AddCommerceItemInfo, ShippingGroup, String)
public void setAddItemToDefaultShippingGroup(boolean pAddItemToDefaultShippingGroup)
addItemsToOrder
whether to add new items to a default
shipping group that is passed in or to shipping groups whose types are appropriate
for the items.
This property is used only if the AddCommerceItemInfo
does not supply the shipping group type
and this property is used in getShippingGroupForItem(Order, AddCommerceItemInfo, ShippingGroup, String)
.
The default value for this property is true
.
If the property is false
, then the system will identify shipping groups
based on the new items' shipping group types.
Otherwise the system will use the default shipping group that is passed in.
pAddItemToDefaultShippingGroup
- the value to setgetShippingGroupForItem(Order, AddCommerceItemInfo, ShippingGroup, String)
public void runProcessRepriceOrder(java.lang.String pPricingOperation, Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, atg.commerce.util.PipelineErrorHandler pErrorHandler) throws RunProcessException
pPricingOperation
- the pricing operation (e.g. order total, subtotal, shipping, etc) that
should be performed.pOrder
- the order to repricepPricingModels
- the set of all pricing models for the user (item, order, shipping, tax)pLocale
- the locale that the order should be priced withinpProfile
- the user who owns the orderpExtraParameters
- A Map of extra parameters to be used in the pricing
RunProcessException
- if an error occursprotected PipelineResult runRepricingProcess(java.lang.String pChainId, java.lang.String pPricingOperation, Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws RunProcessException
pChainId
- the pipeline chain to executepPricingOperation
- a String
valuepOrder
- the order to repricepPricingModels
- the set of all pricing models for the user (item, order, shipping, tax)pLocale
- the locale that the order should be priced withinpProfile
- the user who owns the orderpExtraParameters
- A Map of extra parameters to be used in the pricing
PipelineResult
value
RunProcessException
- if an error occursprotected PipelineResult runProcess(java.lang.String pChainId, Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pParameters, java.util.Map pExtraParameters) throws RunProcessException
pChainId
- the pipeline chain to executepOrder
- the order to repricepPricingModels
- the set of all pricing models for the user (item, order, shipping, tax)pLocale
- the locale that the order should be priced withinpProfile
- the user who owns the orderpParameters
- A Map of parameters to be used when calling the PipelineChainpExtraParameters
- A Map of extra parameters to be used in the pricing
PipelineResult
value
RunProcessException
- if an error occursprotected PipelineResult runProcess(java.lang.String pChainId, Order pOrder, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters) throws RunProcessException
pChainId
- the pipeline chain to executepOrder
- the order to repricepPricingModels
- the set of all pricing models for the user (item, order, shipping, tax)pLocale
- the locale that the order should be priced withinpProfile
- the user who owns the orderpExtraParameters
- A Map of extra parameters to be used in the pricing
PipelineResult
value
RunProcessException
- if an error occursprotected PipelineResult runProcess(java.lang.String pChainId, java.util.Map pParameters) throws RunProcessException
pChainId
- the pipeline chain to executepParameters
- A Map of parameters to be passed to the chain during execution
PipelineResult
value
RunProcessException
- if an error occurspublic Order createOrder(java.lang.String pOrderType, java.lang.String pProfileId) throws CommerceException
pOrderType
- The type of order to create. Null will use the default order type.pProfileId
- The profile of the user for whom the order is created.
CommerceException
- if an error occurs while creating the order.public ShippingGroup addShippingAddressToOrder(Order pOrder, Address pAddress) throws CommerceException
defaultHardgoodShippingGroupType
when creating the shipping group
If a failure occurs, the transaction will be rolled back.
pOrder
- The order which will be given the new shipping group.pAddress
- The address of the shipping group.
CommerceException
- If the operation fails.public void setOrderAmountToPaymentGroup(Order pOrder, java.lang.String pPaymentGroupId, double pAmount) throws CommerceException
pOrder
- The order containing the payment group.pPaymentGroupId
- The id of the payment group.pAmount
- The amount to assign to the payment group.
CommerceException
- if the operation fails.public CreditCard addCreditCardToOrder(Order pOrder, atg.payment.creditcard.BasicCreditCardInfoImpl pCreditCardInfo, java.lang.String pCreditCardPaymentGroupType) throws CommerceException
pOrder
- The order which will be given the new credit card payment group.pCreditCardInfo
- The number, expiration date, and address of the credit card.
CommerceException
- If the operation fails.public void copyCreditCardInfo(atg.payment.creditcard.BasicCreditCardInfo pCreditCardInfo, CreditCard pCard) throws CommerceException
pCreditCardInfo
- the credit card informationpCard
- the credit card payment group
CommerceException
- in subclasses, if the copy cannot be completed.public void removeItemQuantityFromShippingGroup(Order pOrder, java.lang.String pCommerceItemId, java.lang.String pShippingGroupId, long pQuantity) throws CommerceException
pOrder
- the order containing the shipping group.pCommerceItemId
- the id of the item to be removed.pQuantity
- the quantity of item to remove.pShippingGroupId
- the id of the shipping group from which the
item will be removed.
CommerceException
- if an error occurs.public void moveItemBetweenShippingGroups(Order pOrder, java.lang.String pCommerceItemId, long pQuantity, java.lang.String pSourceShippingGroupId, java.lang.String pTargetShippingGroupId) throws CommerceException
pOrder
- the order containing the item to move.pCommerceItemId
- the id of the item to move.pQuantity
- the quantity of item to move.pSourceShippingGroupId
- the id of the source shipping group.pTargetShippingGroupId
- the id of the target shipping group.
CommerceException
- if there is an error moving the item.public java.util.List addItemsToOrder(Order pOrder, ShippingGroup pShippingGroup, RepositoryItem pProfile, atg.commerce.order.purchase.AddCommerceItemInfo[] pItemInfos, java.util.Locale pUserLocale, java.lang.String pCatalogKey, PricingModelHolder pUserPricingModels, atg.commerce.util.PipelineErrorHandler pErrorHandler, java.util.Map pExtraParameters) throws CommerceException
pItemInfos
array. Items with a quantity
of 0 or less are not added.
Each commerce item is created by calling a series of small methods:
Input property validation is the caller's responsibility.
pOrder
- the Order to which the items will be added.pShippingGroup
- the shipping group to which the items will be added.pProfile
- the owner of the order, used for repricing.pItemInfos
- the array of informational objects about the items to add.pUserLocale
- the locale of the user.pCatalogKey
- the key of the catalog of the items.pUserPricingModels
- the promotions for the userpErrorHandler
- the object that will handle pipelne errors.
CommerceException
- if an error occurs.public java.util.List addItemsToOrder(Order pOrder, ShippingGroup pShippingGroup, RepositoryItem pProfile, atg.commerce.order.purchase.AddCommerceItemInfo[] pItemInfos, java.util.Locale pUserLocale, java.lang.String pCatalogKey, PricingModelHolder pUserPricingModels, atg.commerce.util.PipelineErrorHandler pErrorHandler) throws CommerceException
pItemInfos
array. Items with a quantity
of 0 or less are not added.
CommerceException
addItemsToOrder(atg.commerce.order.Order, atg.commerce.order.ShippingGroup, atg.repository.RepositoryItem, atg.commerce.order.purchase.AddCommerceItemInfo[], java.util.Locale, java.lang.String, atg.commerce.pricing.PricingModelHolder, atg.commerce.util.PipelineErrorHandler, java.util.Map)
public java.util.List deleteItems(Order pOrder, java.lang.String[] pRemovalCommerceIds, PricingModelHolder pUserPricingModels, java.util.Locale pUserLocale, RepositoryItem pProfile, atg.commerce.util.PipelineErrorHandler pErrorHandler, java.util.Map pExtraParameters) throws CommerceException
pOrder
- the order from which the items will be removed.pRemovalCommerceIds
- the array of commerce items ids to be removed.pUserPricingModels
- the promotions for the user.pUserLocale
- the locale of the user.pProfile
- the user profile.pErrorHandler
- the object which will handle pipeline errors.
CommerceException
- if an error occurs.public java.util.List deleteItems(Order pOrder, java.lang.String[] pRemovalCommerceIds, PricingModelHolder pUserPricingModels, java.util.Locale pUserLocale, RepositoryItem pProfile, atg.commerce.util.PipelineErrorHandler pErrorHandler) throws CommerceException
CommerceException
deleteItems(atg.commerce.order.Order, java.lang.String[], atg.commerce.pricing.PricingModelHolder, java.util.Locale, atg.repository.RepositoryItem, atg.commerce.util.PipelineErrorHandler, java.util.Map)
protected CommerceItem createCommerceItem(atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo, java.lang.String pCatalogKey, Order pOrder) throws CommerceException
pItemIndex
- the index of the items
array element that
supplies input for the new itempCatalogKey
- the catalog key reference (locale) for the new item
CommerceException
- if there was an error while executing the codeprotected void setCommerceItemProperties(CommerceItem pItem, atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo) throws CommerceException
pItem
- the CommerceItempItemIndex
- the index of the items
array element that
supplies input for the commerce item
CommerceException
- if there was an error while executing the codeprotected void applyValueDictionary(java.lang.Object pBean, java.util.Dictionary pValues, java.lang.String pPropertyPathPrefix) throws CommerceException
pBean
- the object to which to copy dictionary valuespValues
- the dictionary from which to copy valuespPropertyPathPrefix
- the name prefix for dictionary entries
(null
for the top level dictionary)
CommerceException
- if there was an error while executing the codeprotected void addItemToShippingGroup(CommerceItem pItem, atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo, Order pOrder, ShippingGroup pShippingGroup) throws CommerceException
shippingGroup
property.
pItem
- the CommerceItempItemIndex
- the index of the items
array element that
supplies input for the commerce item
CommerceException
- if there was an error while executing the codeprotected void createConfigurableSubitems(CommerceItem pItem, atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo, Order pOrder) throws CommerceException
pItem
- the base CommerceItempItemIndex
- the index of the items
array element that
supplies input for the base commerce item
CommerceException
- if there was an error while executing the codeprotected void processGiftAddition(CommerceItem pItem, atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo, Order pOrder, RepositoryItem pProfile, ShippingGroup pShippingGroup) throws CommerceException
pItem
- the CommerceItempItemIndex
- the index of the items
array element that
supplies input for the commerce item
CommerceException
- if there was an error while executing the codeprotected void runProcessAddItemToOrder(Order pOrder, CommerceItem pCommerceItem, PricingModelHolder pPricingModels, java.util.Locale pLocale, RepositoryItem pProfile, java.util.Map pExtraParameters, atg.commerce.util.PipelineErrorHandler pErrorHandler) throws RunProcessException
handleAddItemToOrder
method is invoked
This method will add pCommerceItem to pExtraParameters unless the key
PipelineConstants.COMMERCEITEM is already in the map
pOrder
- the order to repricepPricingModels
- the set of all pricing models for the user (item, order, shipping, tax)pLocale
- the locale that the order should be priced withinpProfile
- the user who owns the orderpExtraParameters
- A Map of extra parameters to be used in the pricing
RunProcessException
protected void runProcessSendScenarioEvent(Order pOrder, CommerceItem pItem, long pQuantity, java.lang.String pType, atg.commerce.util.PipelineErrorHandler pErrorHandler) throws RunProcessException
runProcessSendScenarioEvent
method sends a scenario event.
pOrder
- an Order
valuepItem
- a CommerceItem
valuepQuantity
- the quantity affectedpType
- a String
value
RunProcessException
- if an error occursprotected void runProcessSendScenarioEvent(Order pOrder, CommerceItem pItem, long pQuantity, java.lang.String pType, atg.commerce.util.PipelineErrorHandler pErrorHandler, java.lang.String pSiteId) throws RunProcessException
runProcessSendScenarioEvent
method sends a scenario event.
pOrder
- an Order
valuepItem
- a CommerceItem
valuepQuantity
- the quantity affectedpType
- a String
valuepSiteId
- The site ID associated with a scenario event
RunProcessException
- if an error occurspublic void processPipelineErrors(PipelineResult pResult, atg.commerce.util.PipelineErrorHandler pErrorHandler)
public void adjustItemRelationshipsForQuantityChange(Order pOrder, CommerceItem pItem, long pNewQuantity) throws CommerceException
pOrder
- the order which contains the itempItem
- the itempNewQuantity
-
CommerceException
increaseRelationshipQuantity(Order, ShippingGroupCommerceItemRelationship, long)
,
decreaseRelationshipQuantity(Order, ShippingGroupCommerceItemRelationship, long)
,
removeEntireRelationshipQuantity(Order, ShippingGroupCommerceItemRelationship)
protected void increaseRelationshipQuantity(Order pOrder, ShippingGroupCommerceItemRelationship pRelationship, long pQuantityIncrease) throws CommerceException
Called by adjustItemRelationshipsForQuantityChange
when the quantity of an item is being increased
for a relationship. Gift quantity is also increased, if necessary.
Gift quantities and other handling isntructions are also adjusted
pOrder
- pRelationship
- pQuantity
- to quantity by which to increase
CommerceException
GiftlistManager.adjustGiftsForQuantityIncrease(Order, ShippingGroup, CommerceItem, long, long)
,
adjustNonGiftHandlingInstructionsForQuantityIncrease(Order, ShippingGroup, CommerceItem, long, long)
protected void removeEntireRelationshipQuantity(Order pOrder, ShippingGroupCommerceItemRelationship pRelationship) throws CommerceException
adjustItemRelationshipsForQuantityChange
when the quantity of a relationship is being
decreased to zero. This method removes all handling instructions before removing the item's quantity from the
shipping group.
pOrder
- pShippingGroup
- pCommerceItem
-
CommerceException
protected void decreaseRelationshipQuantity(Order pOrder, ShippingGroupCommerceItemRelationship pRelationship, long pQuantityDecrease) throws CommerceException
Called by adjustItemRelationshipsForQuantityChange
when the quantity of a relationship is being
partially decreased by the given value.
Gift quantities and other handling instructions are also adjusted
pOrder
- pRelationship
- pQuantityDecrease
-
CommerceException
GiftlistManager.adjustGiftsForQuantityDecrease(Order, ShippingGroup, CommerceItem, long, long)
,
adjustNonGiftHandlingInstructionsForQuantityDecrease(Order, ShippingGroup, CommerceItem, long, long)
protected void adjustNonGiftHandlingInstructionsForQuantityDecrease(Order pOrder, ShippingGroup pShippingGroup, CommerceItem pCommerceItem, long pNewQuantity, long pQuantityDecrease) throws CommerceException
This method adjusts the quantity of the handling instruction to the given new quantity if its quantity currently higher than the new quantity.
Applications should extend this method to handle custom handling instructions accordlingly.
pOrder
- pShippingGroup
- pCommerceItem
- pNewQuantity
- pQuantityDecrease
-
CommerceException
protected void adjustNonGiftHandlingInstructionsForQuantityIncrease(Order pOrder, ShippingGroup pShippingGroup, CommerceItem pCommerceItem, long pNewQuantity, long pQuantityIncreasee) throws CommerceException
This method increases the quantity of all non-gift handling instructions by the given quantity increase.
Applications should extend this method to handle custom handling instructions accordlingly.
pOrder
- pShippingGroup
- pCommerceItem
- pNewQuantity
- pQuantityIncreasee
-
CommerceException
public ShippingGroup getShippingGroupForItem(Order pOrder, atg.commerce.order.purchase.AddCommerceItemInfo pItemInfo, ShippingGroup pShippingGroup, java.lang.String pCatalogKey) throws CommerceException
AddCommerceItemInfo
, that type is used.
Otherwise, this method checks to see if the addItemToDefaultShippingGroup
flag is turned on/off.
If the addItemToDefaultShippingGroup
flag value is true, this method returns the default shipping group
pShippingGroup
. If the addItemToDefaultShippingGroup
flag is false, this method calls
getShippingGroupManager().getFirstShippingGroupType()
to identify the right shipping group type for the item.
Once the item's shipping group type has been identified, this method uses the following logic to locate an appropriate shipping group in the order or to create a new shipping group:
This method is used to get a shipping group for gift or normal commerce item.
If the AddCommerceItemInfo.getGiftlistId()
or AddCommerceItemInfo.getGiftlistItemId()
is not empty a commerce item is considered as a gift item. For gift items, this method checks
only the shipping group type.
The following logic is used for a gift item to find an appropriate shipping group:
pShippingGroup
if it has the right type.pOrder
for an existing shipping group that matches the new item's
shipping group type. If the shipping group type matches, return that shipping group.The following logic is used for a NON-GIFT item to find an appropriate shipping group:
pShippingGroup
if it has the right type and is a non gift shipping group.pOrder
for an existing shipping group that matches the new item's
shipping group type. If the shipping group type matches and it is non gift shipping group, return that shipping group.
pOrder
- the Order to which the item will be added.pItemInfo
- detailed information about the item to be added.pShippingGroup
- a candidate or default shipping group to use.pCatalogKey
- the key of the catalog of the items.
CommerceException
GiftlistManager.isGiftShippingGroup(ShippingGroup)
protected boolean isTransactionMarkedAsRollBack()
boolean
value
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |