java.lang.Object | +--CacheableCommandImpl | +--com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.TaskCommandImpl | +--com.ibm.commerce.command.BusinessPolicyCommandImpl | +--com.ibm.commerce.order.calculation.CalculationCmdImpl | +--com.ibm.commerce.order.calculation.CalculationCodeCombineCmdImpl
The default implementation of
CalculationCodeCombineCmd
.
Its behaviour is as follows:
CalculationCodeQualifyCmd
) to trim the list of items if the
calculation code is restricted (see CALCODE.FLAGS).Commands used:
Access beans used:OrderItemAccessBean
StoreEntityCalculationUsageAccessBean
CalculationMethodAccessBean
CalculationCodeAccessBean
Field Summary | |
---|---|
static java.lang.String |
COPYRIGHT The IBM copyright notice field. |
Fields inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
policyId,
requestProperties |
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.order.calculation. CalculationCodeCombineCmd |
defaultCommandClassName,
NAME |
Fields inherited from interface com.ibm.commerce.command. ECCommand |
defaultCommandClassName |
Constructor Summary | |
---|---|
CalculationCodeCombineCmdImpl() Constructor for CalculationCodeCombineCmdImpl. |
Method Summary | |
---|---|
protected
void |
addItem(
GroupKey aKey,
Item aItem) Adds an item to a group with the specified key. |
protected
Item[] |
callCodeQualify(CalculationCodeAccessBean aabCode,
Item[] aItems) Invokes the calculation method of type "CalculationCodeQualify" referenced by the calculation code (see CALCODE.CALMETHOD_ID_QFY, CalculationCodeQualifyCmd ) to determine the qualifying
items. |
protected
GroupKey |
createGroupKey(CalculationCodeAccessBean aabCode,
Item aItem) Generates a group key from a calculation code and an item. |
protected
Group[] |
createGroups() Generates the groups. |
protected
CalculationCodeAccessBean[] |
getCodes(
Item aItem) Returns the calculation codes attached to an item. |
protected
CalculationCodeAccessBean |
getDefaultCode() Returns the default calculation code. |
protected
CalculationCodeAccessBean[] |
getDirectlyAttachedCodes(
Item aItem) Returns the calculation codes directly attached to an item. |
Group[] |
getGroups() Returns the groups. |
protected
CalculationCodeAccessBean[] |
getIndirectlyAttachedCodes(
Item aItem) Returns the calculation codes indirectly attached to an item. |
protected
Item[] |
getItems() Returns the items. |
protected
java.lang.Integer[] |
getTaxCategoryIds() Returns the tax categories. |
protected
boolean |
isDirectAttachmentsOverride(
Item aItem) Returns whether the calculation codes directly attached to an item should override the ones indirectly attached to it. |
protected
boolean |
isRestricted(CalculationCodeAccessBean aabCode) Returns whether a calculation code is restricted. |
void |
performExecute() The business logic for this command. |
protected
void |
processItem(
Item aItem) Processes an item. |
void |
reset() This method should be called after a command has been executed to reset its states variables. |
protected
void |
setGroups(
Group[] aGroups) Sets the groups. |
void |
setItems(
Item[] aItems) Sets the items. |
void |
setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds) Sets the tax categories that should be active during execution. |
protected
java.lang.String |
toString(CalculationCodeAccessBean[] aabCodes) Returns the string representation of a list of calculation codes for diagnostic purposes. |
Methods inherited from class com.ibm.commerce.order.calculation. CalculationCmdImpl |
createCommand,
getCurrency,
getCustomProperties,
getCustomProperty,
getTimestamp,
getUsageId,
setCurrency,
setCustomProperties,
setCustomProperty,
setTimestamp,
setUsageId |
Methods inherited from class com.ibm.commerce.command. BusinessPolicyCommandImpl |
getPolicyId,
getRequestProperties,
setPolicyId,
setRequestProperties |
Methods inherited from class com.ibm.commerce.command. AbstractECTargetableCommand |
accessControlCheck,
checkIsAllowed,
checkParameters,
checkResourcePermission,
createCommandExecutionEvent,
execute,
finalize,
getAccCheck,
getCommandContext,
getCommandIfName,
getCommandName,
getCommandStoreId,
getDefaultProperties,
getResources,
getStoreId,
getUser,
getUserId,
isReadyToCallExecute,
setAccCheck,
setCommandContext,
setCommandIfName,
setCommandStoreId,
setDefaultProperties,
validateParameters |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait,
wait, wait |
Methods inherited from interface com.ibm.commerce.order.calculation. CalculationCmd |
getCurrency,
getCustomProperties,
getCustomProperty,
getTimestamp,
getUsageId,
setCurrency,
setCustomProperties,
setCustomProperty,
setTimestamp,
setUsageId |
Methods inherited from interface com.ibm.commerce.command. BusinessPolicyCommand |
getPolicyId,
getRequestProperties,
setPolicyId,
setRequestProperties |
Field Detail |
---|
public static final java.lang.String COPYRIGHT
Constructor Detail |
---|
public CalculationCodeCombineCmdImpl()
Method Detail |
---|
protected void addItem(GroupKey aKey, Item aItem)
processItem(Item)
.
aKey
- the key.aItem
- the item.protected Item[] callCodeQualify(CalculationCodeAccessBean aabCode, Item[] aItems) throws ECException
CalculationCodeQualifyCmd
) to determine the qualifying items.
This method is called by
createGroups()
.
aabCode
- the calculation code.aItems
- the items.ECException
protected GroupKey createGroupKey(CalculationCodeAccessBean aabCode, Item aItem) throws ECException
aabCode
- the calculation code.aItem
- the item.ECException
protected Group[] createGroups() throws ECException
performExecute()
.
ECException
protected CalculationCodeAccessBean[] getCodes(Item aItem) throws ECException
processItem(Item)
.
aItem
- the item.ECException
protected CalculationCodeAccessBean getDefaultCode() throws ECException
getCodes(Item)
.
ECException
protected CalculationCodeAccessBean[] getDirectlyAttachedCodes(Item aItem) throws ECException
getCodes(Item)
.
aItem
- the item.ECException
public Group[] getGroups()
getGroups
in interface
CalculationCodeCombineCmd
protected CalculationCodeAccessBean[] getIndirectlyAttachedCodes(Item aItem) throws ECException
getCodes(Item)
.
aItem
- the item.ECException
protected Item[] getItems()
protected java.lang.Integer[] getTaxCategoryIds()
protected boolean isDirectAttachmentsOverride(Item aItem) throws ECException
getCodes(Item)
.
aItem
- the item.ECException
protected boolean isRestricted(CalculationCodeAccessBean aabCode) throws ECException
aabCode
- the calculation code.ECException
public void performExecute() throws ECException
AbstractECTargetableCommand
performExecute
in interface
ECCommand
performExecute
in class
AbstractECTargetableCommand
ECException
ECCommand.performExecute()
protected void processItem(Item aItem) throws ECException
getCodes(Item)
to identify the calculation codes attached to
the item.addItem(GroupKey, Item)
to add the item to an appropiate
group.aItem
- the item.ECException
public void reset()
AbstractECTargetableCommand
reset
in class
CalculationCmdImpl
com.ibm.websphere.command.Command#reset()
protected void setGroups(Group[] aGroups)
aGroups
- the groups.public void setItems(Item[] aItems)
setItems
in interface
CalculationCodeCombineCmd
aItems
- the items.public void setTaxCategoryIds(java.lang.Integer[] anTaxCategoryIds)
setTaxCategoryIds
in interface
CalculationCodeCombineCmd
anTaxCategoryIds
- the tax category IDs.protected java.lang.String toString(CalculationCodeAccessBean[] aabCodes) throws ECException
aabCodes
- the calculation codes.ECException