com.ibm.commerce.orderitems.commands
Class AdminOrderItemUpdateCmdImpl
com.ibm.commerce.command.AbstractECTargetableCommand
|
+--com.ibm.commerce.command.ControllerCommandImpl
|
+--com.ibm.commerce.orderitems.commands.OrderItemBaseCmdImpl
|
+--com.ibm.commerce.orderitems.commands.OrderItemUpdateCmdImpl
|
+--com.ibm.commerce.orderitems.commands.AdminOrderItemUpdateCmdImpl
- All Implemented Interfaces:
- AccCommand, AdminOrderItemUpdateCmd, ControllerCommand, ECCommand, ECTargetableCommand, OrderItemAddCmd, OrderItemUpdateCmd, Protectable
- public class AdminOrderItemUpdateCmdImpl
- extends OrderItemUpdateCmdImpl
- implements AdminOrderItemUpdateCmd
This is an administrator's command.
It allows an administrator to manually add or update a price and currency for the order item
instead of retrieving the price from catalog entry.
Fields inherited from class com.ibm.commerce.orderitems.commands.OrderItemBaseCmdImpl |
CLASS_NAME, GENERATED_ORDERITEM, iATPParms, iCommandExecuted, ihsATPParmsDefaults, ihshAddress_id, ihshAttr_name, ihshAttr_value, ihshCatentry_id, ihshComment, ihshConfigurationId, ihshContract_id, ihshCorrelationGroup, ihshDescription, ihshField1, ihshField2, ihshKey, ihshMember_id, ihshOffer_id, ihshOrderitem_id, ihshOrderResourceList, ihshOutOrderItemId, ihshPart_number, ihshQuantity, ihshShipmode_id, ihshStoreResourceList, ihshUom, iList_id, iList_order_id, iNew_order_id, iNewQuantity, inItemSpecId, iOrder_desc, iOrderIdProperty, iOut_order_name, iOut_orderitem_name, iResolvedOrderIdList, iResolvedRequestProperties, iResourcelist, iUniqueOrderIdList, iUniqueOrderitemIdList, iUniqueStoreIdList, iValidInputPOrderValues, ivecComponentList, MANUAL_FULFILLMENT_CENTER, MANUAL_PRICE, NORMAL_ORDERITEM, STR_ADDRESS_ID, STR_ATTR_NAME, STR_ATTR_VALUE, STR_CATENTRY_ID, STR_COMMENT, STR_CONFIGURATION_ID, STR_CORRELATION_GROUP, STR_DESCRIPTION, STR_FIELD1, STR_FIELD2, STR_INVALID_INPUT_ERROR_VIEW, STR_LIST_ID, STR_MEMBER_ID, STR_OFFER_ID, STR_ORDER_DESC, STR_ORDER_ID, STR_ORDERITEM_ID, STR_OUT_ORDER_NAME, STR_OUT_ORDERITEM_NAME, STR_PART_NUMBER, STR_QUANTITY, STR_SHIPMODE_ID, STR_STORE_ID, STR_UOM |
Method Summary |
protected java.lang.String |
getCurrency(java.lang.Integer i)
|
protected java.lang.Integer |
getFulfillmentCenterId(java.lang.Integer i)
|
protected java.lang.String |
getPrice(java.lang.Integer i)
|
AccessVector |
getResources()
Gets the access vector accessed by this command. |
UserAccessBean |
getTheUser()
Returns super.getUser(). |
java.lang.Long |
getTheUserId()
Returns super.getUserId(). |
void |
reset()
This method should be called after a command has been executed to reset its states variables. |
void |
setCurrency(java.util.Hashtable ahshCurrency)
Set the currency. |
void |
setForUserId(java.lang.Long aForUserId)
Set the for user id. |
void |
setFulfillmentCenterId(java.util.Hashtable ahshFulfillmentCenterId)
Sets the fulfillment center id id to be stored in OrderItem. |
void |
setPrice(java.util.Hashtable ahshPrice)
Set the price. |
void |
setRequestProperties(TypedProperty aRequestProperties)
The WebController calls this method before invoking the execute method in this command to
set the request properties for this command. |
void |
setTradingId(java.lang.Long anTradingId)
Sets the trading id to be stored in OrderItem. |
protected void |
updatePrice(OrderItemAccessBean orderitemAB,
java.lang.Integer i)
Calculates the best price for the input orderitem. |
Methods inherited from class com.ibm.commerce.orderitems.commands.OrderItemBaseCmdImpl |
checkBuyable, checkProductEntitlement, checkValidStatus, createOrder, getAddressId, getATPParms, getAttributeNVP, getCatEntryId, getComment, getConfigurationId, getContractId, getCorrelationGroup, getDescription, getField1, getField2, getItemSpecId, getMemberId, getNewOrderId, getNewOrderItemIds, getOfferId, getOrderDesc, getOrderId, getOrderIds, getOrderItemId, getOrderItemIds, getPartNumber, getQuantity, getResolvedRequestProperties, getRoundedQuantityAmount, getShipModeId, getTradingId, getUOM, insertAddressId, insertItemSpecId, insertOrderItem, insertOrderItem, insertPartNumber, invalidateAllocation, isReadyToCallExecute, migrateInterestItemsToOrderItems, performExecute, resolveOrderId, setAddressId, setATPParms, setAttrName, setAttrValue, setCatEntryId, setComment, setConfigurationId, setContractId, setCorrelationGroup, setDescription, setField1, setField2, setItemSpecId, setListId, setMemberId, setOfferId, setOrderDesc, setOrderId, setOrderItemId, setOutOrderItemName, setOutOrderName, setPartNumber, setQuantity, setQuantity, setShipmodeId, setTradingId, setUom, unLockOrder, updateAddressId, updateAllShippingAndAddress, updateComponentList, updateCorrelationGroup, updateCurrency, updateFulfillmentCenter, updateItemSpecId, updateOrderItem, updateOrderItem, updateOutOrderItemId, updateOutOrderItemName, updateOutOrderName, updateQuantity, updateResourceList, updateShipModeId, updateShippingAndAddress, validateParameters, validateTradingPaymentMethods |
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl |
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Methods inherited from interface com.ibm.commerce.orderitems.commands.OrderItemUpdateCmd |
getOrderIds, getOrderItemIds, setAddressId, setAttrName, setAttrValue, setCatEntryId, setComment, setConfigurationId, setContractId, setCorrelationGroup, setDescription, setField1, setField2, setListId, setMemberId, setOfferId, setOrderDesc, setOrderId, setOrderItemId, setOutOrderItemName, setOutOrderName, setPartNumber, setQuantity, setShipmodeId, setTradingId, setUom |
Methods inherited from interface com.ibm.commerce.command.ControllerCommand |
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, performExecute, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters |
COPYRIGHT
public static final java.lang.String COPYRIGHT
iForUserId
protected java.lang.Long iForUserId
ihshCurrency
protected java.util.Hashtable ihshCurrency
ihshFulfillmentCenterId
protected java.util.Hashtable ihshFulfillmentCenterId
ihshPrice
protected java.util.Hashtable ihshPrice
inTradingId
protected java.lang.Long inTradingId
STR_CONTRACT_ID
protected static final java.lang.String STR_CONTRACT_ID
STR_CURRENCY
protected static final java.lang.String STR_CURRENCY
STR_FOR_USER_ID
protected static final java.lang.String STR_FOR_USER_ID
STR_PRICE
protected static final java.lang.String STR_PRICE
AdminOrderItemUpdateCmdImpl
public AdminOrderItemUpdateCmdImpl()
getCurrency
protected java.lang.String getCurrency(java.lang.Integer i)
getFulfillmentCenterId
protected java.lang.Integer getFulfillmentCenterId(java.lang.Integer i)
throws InvalidParameterValueException
getPrice
protected java.lang.String getPrice(java.lang.Integer i)
getResources
public AccessVector getResources()
throws ECException
- Description copied from interface:
ECCommand
- Gets the access vector accessed by this command.
The default implementation returns null indicating that no protectable resource is
accessed by this command. It is the responsibilities of the command writer to
return the protectable primary resource(s) and the corresponding actions accessed
by this command.
- Specified by:
getResources
in interface ECCommand
- Overrides:
getResources
in class OrderItemBaseCmdImpl
- Following copied from interface:
com.ibm.commerce.command.ECCommand
- Returns:
- AccessVector - a vector of resource action pairs
getTheUser
public UserAccessBean getTheUser()
throws ECSystemException
- Description copied from class:
OrderItemBaseCmdImpl
- Returns super.getUser().
- Overrides:
getTheUser
in class OrderItemBaseCmdImpl
getTheUserId
public java.lang.Long getTheUserId()
- Description copied from class:
OrderItemBaseCmdImpl
- Returns super.getUserId().
- Overrides:
getTheUserId
in class OrderItemBaseCmdImpl
reset
public void reset()
- Description copied from class:
AbstractECTargetableCommand
- This method should be called after a command has been executed to reset its states variables.
After the call to reset, we should be able to execute the command again.
- Overrides:
reset
in class OrderItemBaseCmdImpl
setCurrency
public void setCurrency(java.util.Hashtable ahshCurrency)
- Set the currency.
- Specified by:
setCurrency
in interface AdminOrderItemUpdateCmd
setForUserId
public void setForUserId(java.lang.Long aForUserId)
- Set the for user id.
- Specified by:
setForUserId
in interface AdminOrderItemUpdateCmd
- Overrides:
setForUserId
in class ControllerCommandImpl
- Following copied from interface:
com.ibm.commerce.command.AccCommand
- Parameters:
id
- - the id for the user
setFulfillmentCenterId
public void setFulfillmentCenterId(java.util.Hashtable ahshFulfillmentCenterId)
- Sets the fulfillment center id id to be stored in OrderItem.
- Specified by:
setFulfillmentCenterId
in interface AdminOrderItemUpdateCmd
setPrice
public void setPrice(java.util.Hashtable ahshPrice)
- Set the price.
- Specified by:
setPrice
in interface AdminOrderItemUpdateCmd
setRequestProperties
public void setRequestProperties(TypedProperty aRequestProperties)
throws ECApplicationException
- Description copied from interface:
ControllerCommand
- The WebController calls this method before invoking the execute method in this command to
set the request properties for this command.
It is the responsibility of the implementer of the ControllerCommand to extract the
required input parameters from the request properties and perform parameter checking.
- Specified by:
setRequestProperties
in interface ControllerCommand
- Overrides:
setRequestProperties
in class OrderItemBaseCmdImpl
- Following copied from interface:
com.ibm.commerce.command.ControllerCommand
- Parameters:
requestProperties
- com.ibm.commerce.datatype.TypedProperty- Throws:
com.ibm.commerce.exception.ECException.
-
setTradingId
public void setTradingId(java.lang.Long anTradingId)
- Sets the trading id to be stored in OrderItem.
- Specified by:
setTradingId
in interface AdminOrderItemUpdateCmd
- Parameters:
anTradingId
- the trading id to be stored in OrderItem.
updatePrice
protected void updatePrice(OrderItemAccessBean orderitemAB,
java.lang.Integer i)
throws ECException,
javax.ejb.FinderException,
javax.ejb.CreateException,
javax.naming.NamingException,
java.rmi.RemoteException,
java.sql.SQLException
- Description copied from class:
OrderItemBaseCmdImpl
- Calculates the best price for the input orderitem.
It calls GetContractUnitPriceCmd task command to calculate the price.
If GetContractUnitPriceCmd is not available, it calls GetBaseUnitPriceCmd.
If input trading agreements and/or offers are specified, they will be used
providing they are valid. Otherwise, eligible trading agreements will be
obtained.
If price has been obtainted previously, the price will be refreshed according
to the Price Refresh Flag (PRICEREFFLAGS) in STORE as follows:
0: Default, same as 1 except that it will not save the trading id and the offer id.
1: This means useCurrentOnly. This uses the prices directly referenced by the OrderItems.
Fail if they can no longer be used.
2: This means useCurrentOrSearchAgain. This is the same as useCurrentOnly,
but instead of failing when they can no longer be used, it searches the ones that were
originally searched when the OrderItems were created or updated with new
trading ids/offer ids specified.
4: This means alwaysSearchAgain. This option always searches the prices that were
originally searched when the OrderItems were created or updated with new
trading ids/offer ids specified.
- Overrides:
updatePrice
in class OrderItemBaseCmdImpl
- Following copied from class:
com.ibm.commerce.orderitems.commands.OrderItemBaseCmdImpl
- Parameters:
orderitemAB
- the access bean of the orderitem whose price is to be calculated.i
- the enumeration group.