java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.ControllerCommandImpl | +--com.ibm.commerce.order.commands.OrderCalculateCmdImpl
Default implementation of the
OrderCalculate
controller command interface.
This command calls the following TaskCommands:
ResolveOrdersCmd
InvokePersonalizationRuleServiceCommand
ResolveFulfillmentCenterCmd
OrderItemAddCmd
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT The IBM copyright string. |
Fields inherited from class com.ibm.commerce.command. ControllerCommandImpl |
requestProperties,
responseProperties,
retriable,
viewReqProperties |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.order.commands. OrderCalculateCmd |
defaultCommandClassName,
NAME |
Constructor Summary | |
---|---|
OrderCalculateCmdImpl() Constructor for OrderCalculateCmdImpl. |
Method Summary | |
---|---|
protected
void |
addCatalogEntriesToOrder(
OrderAccessBean aabOrder,
java.util.Map amapCatalogEntryQuantitiesToAdd) Adds the specified Map of CatalogEntries and their quantities to the specified Order. |
protected
DiscountContext |
createDiscountContext(
OrderAccessBean aabOrder) Creates the
DiscountContext . |
protected
java.util.Map |
getCatalogEntryQuantitiesToAdd(
OrderAccessBean aabOrder,
java.util.HashMap ahshCustomProperties) Returns the CatalogEntries to add to the Order, and their quantities. |
protected
java.util.Map |
getFreebies(
Discount[] aDiscounts) Returns the freebies in the specified Discounts . |
protected
OrderItemAccessBean[] |
getOrderItems(
OrderAccessBean aabOrder) Returns the OrderItems of the specified Order. |
protected
OrderAccessBean[] |
getOrders() Returns the Orders specified to be processed by this command. |
java.lang.Long[] |
getOutOfInventoryCatalogEntryIds() Returns the identifiers of CatalogEntries that do not have sufficient inventory, when ATP inventory is not enabled. |
protected
java.util.Set |
getOutOfInventoryCatalogEntryIds(java.util.Map amapCatalogEntryQuantitiesToAdd) Returns the CatalogEntries in the specified Map of CatalogEntries/quantities that are out of inventory. |
AccessVector |
getResources() Returns an AccessVector containing the
OrderAccessBean s to be processed. |
protected
java.lang.Integer[] |
getUsageIds() Returns the CalculationUsages specified to be recalculated by this command. |
protected
void |
invokeRuleService(
DiscountContext aDiscountContext) Invokes the rule service "Discount Service". |
void |
performExecute() Executes the main business logic of the command. |
protected
void |
removeExcessFreebies(java.util.Map amapFreebies,
OrderAccessBean aabOrder) Removes excess freebies from the specified Map of freebies. |
void |
reset() Resets instance variables to their initial values. |
void |
setOrders(
OrderAccessBean[] aabOrders) Sets the Orders. |
protected
void |
setOutOfInventoryCatalogEntryIds(java.lang.Long[] anOutOfInventoryCatalogEntryIds) Sets the CatalogEntries that are out of inventory. |
void |
setRequestProperties(
TypedProperty aRequestProperties) Sets the request properties. |
protected
void |
setResponseProperties() Sets the response properties: |
void |
setUsageIds(java.lang.Integer[] anUsageIds) Sets the CalculationUsages. |
protected
void |
updateOrderItemProductTotal(
OrderItemAccessBean aabOrderItem,
java.lang.String astrCurrency) Updates the productTotal of the specified OrderItem. |
protected
void |
updateOrderProductTotal(
OrderAccessBean aabOrder,
OrderItemAccessBean[] aabOrderItems) Updates the productTotal of the specified Order and OrderItems. |
void |
validateParameters() Does nothing. |
Methods inherited from class com.ibm.commerce.command. ControllerCommandImpl |
checkPermission,
fulfills,
getForUserId,
getGeneric,
getOwner,
getRequestProperties,
getResolvedRequestProperties,
getResourceOwners,
getResponseProperties,
getRetriable,
getViewInputProperties,
isGeneric,
isRetriable,
mergeProperties,
setForUserId,
setGeneric,
setOwner,
setResponseProperties,
setRetriable,
setViewInputProperties |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getStoreId,
getUser,
getUserId,
isReadyToCallExecute,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Methods inherited from interface com.ibm.commerce.command. ControllerCommand |
checkPermission,
execute,
getGeneric,
getRequestProperties,
getResolvedRequestProperties,
getResponseProperties,
getRetriable,
getViewInputProperties,
isGeneric,
isRetriable,
mergeProperties,
setGeneric,
setRetriable,
setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command. AccCommand |
accessControlCheck,
getAccCheck,
getForUserId,
getResourceOwners,
setAccCheck,
setForUserId,
setOwner |
Methods inherited from interface com.ibm.commerce.command. ECCommand |
checkIsAllowed,
checkResourcePermission,
createCommandExecutionEvent,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getStoreId,
getUser,
getUserId,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public OrderCalculateCmdImpl()
Method Detail |
---|
public void setOrders(OrderAccessBean[] aabOrders)
OrderCalculateCmd
setOrders
in interface
OrderCalculateCmd
aabOrders
- the Orders.OrderCalculateCmd.setOrders(OrderAccessBean[])
public void setUsageIds(java.lang.Integer[] anUsageIds)
OrderCalculateCmd
setUsageIds
in interface
OrderCalculateCmd
anUsageIds
- the CalculationUsage identifiers.OrderCalculateCmd.setUsageIds(Integer[])
protected void setOutOfInventoryCatalogEntryIds(java.lang.Long[] anOutOfInventoryCatalogEntryIds)
anOutOfInventoryCatalogEntryIds
- the CatalogEntry
identifiers.protected OrderAccessBean[] getOrders()
protected java.lang.Integer[] getUsageIds()
public java.lang.Long[] getOutOfInventoryCatalogEntryIds()
OrderCalculateCmd
getOutOfInventoryCatalogEntryIds
in interface
OrderCalculateCmd
OrderCalculateCmd.getOutOfInventoryCatalogEntryIds()
public void setRequestProperties(TypedProperty aRequestProperties) throws ECException
ControllerCommand
setRequestProperties
in interface
ControllerCommand
setRequestProperties
in class
ControllerCommandImpl
aRequestProperties
- the request properties.
The following request properties are recognized:
ECApplicationException
- The _ERR_BAD_MISSING_CMD_PARAMETER message
is passed, with the name of the invalid or missing property name.ECException
-ControllerCommand.setRequestProperties(TypedProperty)
public AccessVector getResources() throws ECException
AccessVector
containing the
OrderAccessBean
s to be processed.
getResources
in interface
ECCommand
getResources
in class
AbstractECTargetableCommand
AccessVector
.ECException
ECCommand.getResources()
protected OrderItemAccessBean[] getOrderItems(OrderAccessBean aabOrder) throws ECException
aabOrder
- the Order.ECException
protected DiscountContext createDiscountContext(OrderAccessBean aabOrder) throws ECException
DiscountContext
.
aabOrder
- the Order.ECException
protected void invokeRuleService(DiscountContext aDiscountContext) throws ECException
aDiscountContext
- the DiscountContext.ECException
protected java.util.Map getFreebies(Discount[] aDiscounts)
Discounts
.
aDiscounts
- the Discounts.protected void removeExcessFreebies(java.util.Map amapFreebies, OrderAccessBean aabOrder) throws ECException
amapFreebies
- the freebies.
aabOrder
- the Order.ECException
protected java.util.Map getCatalogEntryQuantitiesToAdd(OrderAccessBean aabOrder, java.util.HashMap ahshCustomProperties) throws ECException
aabOrder
- the Order.ahshCustomProperties
- the custom properties.ECException
protected java.util.Set getOutOfInventoryCatalogEntryIds(java.util.Map amapCatalogEntryQuantitiesToAdd) throws ECException
amapCatalogEntryQuantitiesToAdd
- the CatalogEntries and their
quantities (Map
).
Set
of Long
).ECException
protected void addCatalogEntriesToOrder(OrderAccessBean aabOrder, java.util.Map amapCatalogEntryQuantitiesToAdd) throws ECException
aabOrder
- the Order.amapCatalogEntryQuantitiesToAdd
- the CatalogEntries and their
quantities.
ECException
protected void updateOrderItemProductTotal(OrderItemAccessBean aabOrderItem, java.lang.String astrCurrency) throws ECException
aabOrderItem
- the OrderItem.astrCurrency
- the Order currency.ECException
protected void updateOrderProductTotal(OrderAccessBean aabOrder, OrderItemAccessBean[] aabOrderItems) throws ECException
aabOrder
- the Order.aabOrderItems
- the OrderItems.ECException
public void validateParameters() throws ECException
validateParameters
in interface
ECCommand
validateParameters
in class
AbstractECTargetableCommand
ECException
ECCommand.validateParameters()
public void performExecute() throws ECException
OrderItemAdd
controller command to add the CatalogEntries to
the OrdersetResponseProperties()
method.
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
ECCommand.performExecute()
protected void setResponseProperties() throws ECException
outOfInventoryCatalogEntryId
. Its values are the identifiers of
the CatalogEntries that could not be added to the Order due to insufficient
inventory.viewTaskName
property is added. It's value is set to
"RedirectView".ECException
public void reset()
reset
in class
AbstractECTargetableCommand