com.ibm.commerce.orderitems.commands
Class OrderItemBaseCmdImpl

com.ibm.commerce.command.AbstractECTargetableCommand
  |
  +--com.ibm.commerce.command.ControllerCommandImpl
        |
        +--com.ibm.commerce.orderitems.commands.OrderItemBaseCmdImpl
All Implemented Interfaces:
AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, OrderItemAddCmd, OrderItemUpdateCmd, Protectable
Direct Known Subclasses:
OrderItemAddCmdImpl, OrderItemUpdateCmdImpl

public class OrderItemBaseCmdImpl
extends ControllerCommandImpl
implements OrderItemAddCmd, OrderItemUpdateCmd

This is the base class for OrderItemAdd and OrderItemUpdate.


Field Summary
static java.lang.String CLASS_NAME
           
static java.lang.String COPYRIGHT
           
static int GENERATED_ORDERITEM
           
protected  com.ibm.commerce.orderitems.commands.ATPParameters iATPParms
           
protected  boolean iCommandExecuted
           
protected  java.util.Hashtable ihsATPParmsDefaults
           
protected  java.util.Hashtable ihshAddress_id
           
protected  java.util.Hashtable ihshAttr_name
           
protected  java.util.Hashtable ihshAttr_value
           
protected  java.util.Hashtable ihshCatentry_id
           
protected  java.util.Hashtable ihshComment
           
protected  java.util.Hashtable ihshConfigurationId
           
protected  java.util.Hashtable ihshContract_id
           
protected  java.util.Hashtable ihshCorrelationGroup
           
protected  java.util.Hashtable ihshDescription
           
protected  java.util.Hashtable ihshField1
           
protected  java.util.Hashtable ihshField2
           
protected  java.util.Hashtable ihshKey
           
protected  java.util.Hashtable ihshMember_id
           
protected  java.util.Hashtable ihshOffer_id
           
protected  java.util.Hashtable ihshOrderitem_id
           
protected  java.util.Hashtable ihshOrderResourceList
           
protected  java.util.Hashtable ihshOutOrderItemId
           
protected  java.util.Hashtable ihshPart_number
           
protected  java.util.Hashtable ihshQuantity
           
protected  java.util.Hashtable ihshShipmode_id
           
protected  java.util.Hashtable ihshStoreResourceList
           
protected  java.util.Hashtable ihshUom
           
protected  java.lang.String[] iList_id
           
protected  java.lang.Long iList_order_id
           
protected  java.lang.String iNew_order_id
           
protected  boolean iNewQuantity
           
protected  java.lang.Long inItemSpecId
           
protected  java.lang.String iOrder_desc
           
protected  TypedProperty iOrderIdProperty
           
protected  java.lang.String[] iOut_order_name
           
protected  java.lang.String[] iOut_orderitem_name
           
protected  java.util.Vector iResolvedOrderIdList
           
protected  TypedProperty iResolvedRequestProperties
           
protected  AccessVector iResourcelist
           
protected  java.util.Hashtable iUniqueOrderIdList
           
protected  java.util.Hashtable iUniqueOrderitemIdList
           
protected  java.util.Hashtable iUniqueStoreIdList
           
protected  java.lang.String[] iValidInputPOrderValues
           
protected  java.util.Vector ivecComponentList
           
static int MANUAL_FULFILLMENT_CENTER
           
static int MANUAL_PRICE
           
static int NORMAL_ORDERITEM
           
protected static java.lang.String STR_ADDRESS_ID
           
protected static java.lang.String STR_ATTR_NAME
           
protected static java.lang.String STR_ATTR_VALUE
           
protected static java.lang.String STR_CATENTRY_ID
           
protected static java.lang.String STR_COMMENT
           
protected static java.lang.String STR_CONFIGURATION_ID
           
protected static java.lang.String STR_CONTRACT_ID
           
protected static java.lang.String STR_CORRELATION_GROUP
           
protected static java.lang.String STR_DESCRIPTION
           
protected static java.lang.String STR_FIELD1
           
protected static java.lang.String STR_FIELD2
           
static java.lang.String STR_INVALID_INPUT_ERROR_VIEW
           
protected static java.lang.String STR_LIST_ID
           
protected static java.lang.String STR_MEMBER_ID
           
protected static java.lang.String STR_OFFER_ID
           
protected static java.lang.String STR_ORDER_DESC
           
protected static java.lang.String STR_ORDER_ID
           
protected static java.lang.String STR_ORDERITEM_ID
           
protected static java.lang.String STR_OUT_ORDER_NAME
           
protected static java.lang.String STR_OUT_ORDERITEM_NAME
           
protected static java.lang.String STR_PART_NUMBER
           
protected static java.lang.String STR_QUANTITY
           
protected static java.lang.String STR_SHIPMODE_ID
           
protected static java.lang.String STR_STORE_ID
           
protected static java.lang.String STR_UOM
           
 
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.orderitems.commands.OrderItemAddCmd
badPartNumberErrorView, badPartNumberList, badPartNumberQuantityList, defaultCommandClassName, goodPartNumberList, goodPartNumberQuantityList, NAME
 
Fields inherited from interface com.ibm.commerce.orderitems.commands.OrderItemUpdateCmd
defaultCommandClassName, NAME
 
Constructor Summary
OrderItemBaseCmdImpl()
           
 
Method Summary
protected  void checkBuyable(java.lang.Long catentry_id)
          Checks whether the catalog entry is buyable and available in the store.
protected  void checkProductEntitlement(java.lang.Long catentry_id, java.lang.Long member_id)
          Checks whether the user is entitled to buy this product.
protected  void checkValidStatus(OrderAccessBean orderAB)
          Checks whether the status of the order is valid when you modify the order.
protected  java.lang.String createOrder()
          Creates a new order.
protected  java.lang.Long getAddressId(java.lang.Integer i)
          Gets the input parameter addressId with enumeration group i.
 com.ibm.commerce.fulfillment.commands.ATPParameters getATPParms()
          Gets the input ATP parameters.
protected  java.util.Hashtable getAttributeNVP(java.lang.Integer i)
          Gets the input parameter attrName_i and attrValue_i and puts them into a hashtable.
protected  java.lang.Long getCatEntryId(java.lang.Integer i)
          Gets the input parameter catEntryId with enumeration group i.
protected  java.lang.String getComment(java.lang.Integer i)
          Gets the input parameter comment with enumeration group i.
protected  java.lang.String getConfigurationId(java.lang.Integer i)
          Gets the input parameter configurationId with enumeration group i.
protected  java.lang.Long[] getContractId(java.lang.Integer i)
          Gets the input parameter contarctId with enumeration group i.
protected  java.lang.Long getCorrelationGroup(java.lang.Integer i)
          Gets the input parameter correlationGroup with enumeration group i.
protected  java.lang.String getDescription(java.lang.Integer i)
          Gets the input parameter Description with enumeration group i.
protected  java.lang.Integer getField1(java.lang.Integer i)
          Gets the input parameter field1 with enumeration group i.
protected  java.lang.String getField2(java.lang.Integer i)
          Gets the input parameter field2 with enumeration group i.
protected  java.lang.Long getItemSpecId()
          Gets the itemSpecId.
protected  java.lang.Long getMemberId(java.lang.Integer i)
          Gets the input parameter memberId with enumeration group i.
 java.lang.Long getNewOrderId()
          Gets the id of the newly created order.
 java.util.Hashtable getNewOrderItemIds()
          Gets a list ids of newly created order items.
protected  java.lang.Long[] getOfferId(java.lang.Integer i)
          Gets the input parameter offerId with enumeration group i.
protected  java.lang.String getOrderDesc()
          Gets the input parameter OrderDesc.
protected  java.lang.String[] getOrderId()
          Gets the resolved order ids.
 java.lang.String[] getOrderIds()
          Return a list of order ids which are touched or created by the command.
protected  java.lang.Long getOrderItemId(java.lang.Integer i)
          Gets the input parameter orderItemId with enumeration group i.
 java.lang.String[] getOrderItemIds()
          Return a list of order item ids which are created or updated by the command.
protected  java.lang.String getPartNumber(java.lang.Integer i)
          Gets the input parameter partNumber with enumeration group i.
protected  java.lang.Double getQuantity(java.lang.Integer i)
          Gets the input parameter quantity with enumeration group i.
 TypedProperty getResolvedRequestProperties()
          Gets the resolved request properties.
 AccessVector getResources()
          Gets the access vector accessed by this command.
protected  QuantityAmount getRoundedQuantityAmount(java.lang.Long catentry_id, java.lang.Double quantity)
          Returns a rounded quantity amount based on the catalog entry.
protected  java.lang.Integer getShipModeId(java.lang.Integer i)
          Gets the input parameter shipModeId with enumeration group i.
 UserAccessBean getTheUser()
          Returns super.getUser().
 java.lang.Long getTheUserId()
          Returns super.getUserId().
protected  java.lang.Long[] getTradingId(java.lang.Integer i)
          Gets the input parameter contractId with enumeration group i.
protected  java.lang.String getUOM(java.lang.Integer i)
          Gets the input parameter UOM with enumeration group i.
protected  void insertAddressId(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          Inserts a default address to the order item.
protected  void insertItemSpecId(OrderItemAccessBean orderitemAB)
          Inserts an item spec id to the order item.
protected  void insertOrderItem(java.lang.Integer i, java.lang.Long catentry_id)
          Inserts a new order item to each resolved orders.
protected  void insertOrderItem(InterestItemAccessBean iitemAB)
          Creates a new order item based on the interest item and insert into the order.
protected  void insertPartNumber(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          Inserts the part number to the order item.
protected  void invalidateAllocation(OrderItemAccessBean aabOI)
          Invalidate the allocation for the order item.
 boolean isReadyToCallExecute()
          isReadyToCallExecute method is called by the Targettable Command frame work before the execution of the command.
protected  void migrateInterestItemsToOrderItems()
          Migrate all interest items to order items when listId is specified.
 void performExecute()
           For each enumeration group i: it checks whether the parameters orderItemId_i, partNumber_i or catEntryId_i are specified. If the parameter orderItemId_i is specified, the parameters partNumber_i and catEntryId_i are ignored. If the parameters partNumber_i is specified, the parameter catEntryId_i is ignored. If orderItemId_i is specified, it updates the order item by calling updateOrderItem(i, orderItemId); If partNumber_i or catEntryId_i are specified, it creates a new order item by calling insertOrderItem(i, catEntryId); In case of partNumber_i is specified, the catEntryId_i is found in the CATENTRY table by partNumber_i and memberId_i.
 void reset()
          This method should be called after a command has been executed to reset its states variables.
protected  void resolveOrderId()
          Resolves order ids by calling MiscCmd.getListOfPendingOrders().
 void setAddressId(java.util.Hashtable ahshAddress_id)
          Set the address id parameters (optional).
 void setATPParms(com.ibm.commerce.fulfillment.commands.ATPParameters newATPParms)
          Set the ATP parameters.
 void setAttrName(java.util.Hashtable ahshAttr_name)
          Set the attribute name parameters (optional).
 void setAttrValue(java.util.Hashtable ahshAttr_value)
          Set the attribute value parameters (optional).
 void setCatEntryId(java.util.Hashtable ahshCatentry_id)
          Set the attribute name parameters.
 void setComment(java.util.Hashtable ahshComment)
          Set the comment parameters (optional).
 void setConfigurationId(java.util.Hashtable ahshConfigurationId)
          Set the configurationId parameter.
 void setContractId(java.util.Hashtable ahshContract_id)
          Set the contract id parameters (optional).
 void setCorrelationGroup(java.util.Hashtable ahshCorrelationGroup)
          Set the correlation group parameters.
 void setDescription(java.util.Hashtable ahshDescription)
          Set the description parameters (optional).
 void setField1(java.util.Hashtable ahshField1)
          Set the field1 parameters (optional).
 void setField2(java.util.Hashtable ahshField2)
          Set the field2 parameters (optional).
protected  void setItemSpecId(java.lang.Long anItemSpecId)
          Sets the ItemSpecId
 void setListId(java.lang.String[] aList_id)
          Set the interest item list id parameters (optional).
 void setMemberId(java.util.Hashtable ahshMember_id)
          Set the member id parameters (optional).
 void setOfferId(java.util.Hashtable ahshOffer_id)
          Set the offer id parameters (optional).
 void setOrderDesc(java.lang.String aOrder_desc)
          Set the Order description parameter (optional).
 void setOrderId(java.lang.String[] aOrder_id)
          Set the order id parameters (optional).
 void setOrderItemId(java.util.Hashtable ahshOrderitem_id)
          Set the order item ids for which to update.
 void setOutOrderItemName(java.lang.String[] aOut_orderitem_name)
          Set the out order item name parameters (optional).
 void setOutOrderName(java.lang.String[] aOut_order_name)
          Set the out order name parameters (optional).
 void setPartNumber(java.util.Hashtable ahshPart_number)
          Set the part number parameters (optional).
 void setQuantity(java.util.Hashtable ahshQuantity)
          Set the quantity parameters.
 void setQuantity(java.lang.Integer i, java.lang.Double aQuantity)
          Set the quantity parameters.
 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 setShipmodeId(java.util.Hashtable ahshShipmode_id)
          Set the ship mode id parameters (optional).
 void setTradingId(java.util.Hashtable ahshTrading_id)
          Set the trading id parameters (optional).
 void setUom(java.util.Hashtable ahshUom)
          Set the unit of measure parameters (optional).
protected  void unLockOrder(java.lang.String orderId)
          Unlocks the order.
protected  void updateAddressId(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          Updates the address for the order item.
protected  void updateAllShippingAndAddress()
          It calls updateShippingAndAddress() to update the shipping address and shipping mode for each order item.
protected  void updateComponentList(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          Updates the component list for the order item.
protected  void updateCorrelationGroup(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          Updates the correlation group for the order item.
protected  void updateCurrency(OrderAccessBean orderAB)
          Updates the currency for the order.
protected  void updateFulfillmentCenter()
          Updates the fulfillment centers and checks for available inventory for all order items modified or created.
protected  void updateItemSpecId(OrderItemAccessBean orderitemAB)
          Updates the item spec id for the order item.
protected  void updateOrderItem(java.lang.Integer i, java.lang.Long orderitem_id)
          Updates the order item.
protected  void updateOrderItem(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          Updates the order item.
protected  void updateOutOrderItemId()
          Adds the ids of the newly created order items to the response properties with key being the input parameter value of outOrderItemName concatenated with "_i" and the value being the id of the order item.
protected  void updateOutOrderItemName()
          Adds the ids of the created and updated order items to the response properties with key being the input parameter value of outOrderItemName and the value being the String array of order item ids.
protected  void updateOutOrderName()
          Adds the ids of the created and updated orders to the response properties with key being the input parameter value of outOrderName and the value being the String array of order ids.
protected  void updatePrice(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          Calculates the best price for the input orderitem.
protected  boolean updateQuantity(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          Updates the quantity for the order item.
protected  void updateResourceList()
          Updates the resources list.
protected  void updateShipModeId(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          Updates the shipping mode id for the order item.
protected  void updateShippingAndAddress(OrderItemAccessBean orderitemAB, java.lang.Integer i)
          It calls updateAddressId() and updateShipModeId() to update the shipping address and shipping mode for the order item.
 void validateParameters()
          Verify the input parameters.
protected  void validateTradingPaymentMethods()
          Validate the trading agreements used by the orderitems in an order by checking if they define compatible payment methods and are associated with the same account as the other orderitems in the order.
 
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setForUserId, 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.command.ControllerCommand
execute, getGeneric, getRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
 
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, setAccCheck, setForUserId, setOwner
 
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties
 
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
 

Field Detail

CLASS_NAME

public static final java.lang.String CLASS_NAME

COPYRIGHT

public static final java.lang.String COPYRIGHT

GENERATED_ORDERITEM

public static final int GENERATED_ORDERITEM

iATPParms

protected com.ibm.commerce.orderitems.commands.ATPParameters iATPParms

iCommandExecuted

protected boolean iCommandExecuted

ihsATPParmsDefaults

protected java.util.Hashtable ihsATPParmsDefaults

ihshAddress_id

protected java.util.Hashtable ihshAddress_id

ihshAttr_name

protected java.util.Hashtable ihshAttr_name

ihshAttr_value

protected java.util.Hashtable ihshAttr_value

ihshCatentry_id

protected java.util.Hashtable ihshCatentry_id

ihshComment

protected java.util.Hashtable ihshComment

ihshConfigurationId

protected java.util.Hashtable ihshConfigurationId

ihshContract_id

protected java.util.Hashtable ihshContract_id

ihshCorrelationGroup

protected java.util.Hashtable ihshCorrelationGroup

ihshDescription

protected java.util.Hashtable ihshDescription

ihshField1

protected java.util.Hashtable ihshField1

ihshField2

protected java.util.Hashtable ihshField2

ihshKey

protected java.util.Hashtable ihshKey

ihshMember_id

protected java.util.Hashtable ihshMember_id

ihshOffer_id

protected java.util.Hashtable ihshOffer_id

ihshOrderitem_id

protected java.util.Hashtable ihshOrderitem_id

ihshOrderResourceList

protected java.util.Hashtable ihshOrderResourceList

ihshOutOrderItemId

protected java.util.Hashtable ihshOutOrderItemId

ihshPart_number

protected java.util.Hashtable ihshPart_number

ihshQuantity

protected java.util.Hashtable ihshQuantity

ihshShipmode_id

protected java.util.Hashtable ihshShipmode_id

ihshStoreResourceList

protected java.util.Hashtable ihshStoreResourceList

ihshUom

protected java.util.Hashtable ihshUom

iList_id

protected java.lang.String[] iList_id

iList_order_id

protected java.lang.Long iList_order_id

iNew_order_id

protected java.lang.String iNew_order_id

iNewQuantity

protected boolean iNewQuantity

inItemSpecId

protected java.lang.Long inItemSpecId

iOrder_desc

protected java.lang.String iOrder_desc

iOrderIdProperty

protected TypedProperty iOrderIdProperty

iOut_order_name

protected java.lang.String[] iOut_order_name

iOut_orderitem_name

protected java.lang.String[] iOut_orderitem_name

iResolvedOrderIdList

protected java.util.Vector iResolvedOrderIdList

iResolvedRequestProperties

protected TypedProperty iResolvedRequestProperties

iResourcelist

protected AccessVector iResourcelist

iUniqueOrderIdList

protected java.util.Hashtable iUniqueOrderIdList

iUniqueOrderitemIdList

protected java.util.Hashtable iUniqueOrderitemIdList

iUniqueStoreIdList

protected java.util.Hashtable iUniqueStoreIdList

iValidInputPOrderValues

protected java.lang.String[] iValidInputPOrderValues

ivecComponentList

protected java.util.Vector ivecComponentList

MANUAL_FULFILLMENT_CENTER

public static final int MANUAL_FULFILLMENT_CENTER

MANUAL_PRICE

public static final int MANUAL_PRICE

NORMAL_ORDERITEM

public static final int NORMAL_ORDERITEM

STR_ADDRESS_ID

protected static final java.lang.String STR_ADDRESS_ID

STR_ATTR_NAME

protected static final java.lang.String STR_ATTR_NAME

STR_ATTR_VALUE

protected static final java.lang.String STR_ATTR_VALUE

STR_CATENTRY_ID

protected static final java.lang.String STR_CATENTRY_ID

STR_COMMENT

protected static final java.lang.String STR_COMMENT

STR_CONFIGURATION_ID

protected static final java.lang.String STR_CONFIGURATION_ID

STR_CONTRACT_ID

protected static final java.lang.String STR_CONTRACT_ID

STR_CORRELATION_GROUP

protected static final java.lang.String STR_CORRELATION_GROUP

STR_DESCRIPTION

protected static final java.lang.String STR_DESCRIPTION

STR_FIELD1

protected static final java.lang.String STR_FIELD1

STR_FIELD2

protected static final java.lang.String STR_FIELD2

STR_INVALID_INPUT_ERROR_VIEW

public static final java.lang.String STR_INVALID_INPUT_ERROR_VIEW

STR_LIST_ID

protected static final java.lang.String STR_LIST_ID

STR_MEMBER_ID

protected static final java.lang.String STR_MEMBER_ID

STR_OFFER_ID

protected static final java.lang.String STR_OFFER_ID

STR_ORDER_DESC

protected static final java.lang.String STR_ORDER_DESC

STR_ORDER_ID

protected static final java.lang.String STR_ORDER_ID

STR_ORDERITEM_ID

protected static final java.lang.String STR_ORDERITEM_ID

STR_OUT_ORDER_NAME

protected static final java.lang.String STR_OUT_ORDER_NAME

STR_OUT_ORDERITEM_NAME

protected static final java.lang.String STR_OUT_ORDERITEM_NAME

STR_PART_NUMBER

protected static final java.lang.String STR_PART_NUMBER

STR_QUANTITY

protected static final java.lang.String STR_QUANTITY

STR_SHIPMODE_ID

protected static final java.lang.String STR_SHIPMODE_ID

STR_STORE_ID

protected static final java.lang.String STR_STORE_ID

STR_UOM

protected static final java.lang.String STR_UOM
Constructor Detail

OrderItemBaseCmdImpl

public OrderItemBaseCmdImpl()
Method Detail

checkBuyable

protected void checkBuyable(java.lang.Long catentry_id)
                     throws ECException,
                            javax.ejb.FinderException,
                            javax.ejb.CreateException,
                            javax.naming.NamingException,
                            java.rmi.RemoteException,
                            java.sql.SQLException
Checks whether the catalog entry is buyable and available in the store.
Throws:
ECApplicationException - with message key _ERR_PROD_NOT_ORDERABLE if the product is not buyable.
ECApplicationException - with message key _ERR_CATENTRY_NOT_EXISTING_IN_STORE if the product is not available in the store.

checkProductEntitlement

protected void checkProductEntitlement(java.lang.Long catentry_id,
                                       java.lang.Long member_id)
                                throws ECException,
                                       javax.ejb.FinderException,
                                       javax.ejb.CreateException,
                                       javax.naming.NamingException,
                                       java.rmi.RemoteException,
                                       java.sql.SQLException
Checks whether the user is entitled to buy this product.
Throws:
ECApplicationException - with message key _ERR_PS_ENTRY_INVALID if the user is not entitled to buy this product.

checkValidStatus

protected void checkValidStatus(OrderAccessBean orderAB)
                         throws ECException,
                                javax.ejb.FinderException,
                                javax.ejb.CreateException,
                                javax.naming.NamingException,
                                java.rmi.RemoteException,
                                java.sql.SQLException
Checks whether the status of the order is valid when you modify the order. The valid status are 'P' and 'E'.
Throws:
ECApplicationException - with message key _ERR_ORDER_WRONG_STATUS if the status is not valid.

createOrder

protected java.lang.String createOrder()
                                throws ECException,
                                       javax.ejb.FinderException,
                                       javax.ejb.CreateException,
                                       javax.naming.NamingException,
                                       java.rmi.RemoteException,
                                       java.sql.SQLException
Creates a new order.

getAddressId

protected java.lang.Long getAddressId(java.lang.Integer i)
                               throws InvalidParameterValueException
Gets the input parameter addressId with enumeration group i.

getATPParms

public com.ibm.commerce.fulfillment.commands.ATPParameters getATPParms()
Gets the input ATP parameters.

getAttributeNVP

protected java.util.Hashtable getAttributeNVP(java.lang.Integer i)
                                       throws InvalidParameterValueException
Gets the input parameter attrName_i and attrValue_i and puts them into a hashtable.

getCatEntryId

protected java.lang.Long getCatEntryId(java.lang.Integer i)
                                throws InvalidParameterValueException
Gets the input parameter catEntryId with enumeration group i.

getComment

protected java.lang.String getComment(java.lang.Integer i)
Gets the input parameter comment with enumeration group i.

getConfigurationId

protected java.lang.String getConfigurationId(java.lang.Integer i)
Gets the input parameter configurationId with enumeration group i.

getContractId

protected java.lang.Long[] getContractId(java.lang.Integer i)
                                  throws InvalidParameterValueException
Gets the input parameter contarctId with enumeration group i.

getCorrelationGroup

protected java.lang.Long getCorrelationGroup(java.lang.Integer i)
                                      throws InvalidParameterValueException
Gets the input parameter correlationGroup with enumeration group i.

getDescription

protected java.lang.String getDescription(java.lang.Integer i)
Gets the input parameter Description with enumeration group i.

getField1

protected java.lang.Integer getField1(java.lang.Integer i)
                               throws InvalidParameterValueException
Gets the input parameter field1 with enumeration group i.

getField2

protected java.lang.String getField2(java.lang.Integer i)
Gets the input parameter field2 with enumeration group i.

getItemSpecId

protected java.lang.Long getItemSpecId()
Gets the itemSpecId.

getMemberId

protected java.lang.Long getMemberId(java.lang.Integer i)
                              throws InvalidParameterValueException
Gets the input parameter memberId with enumeration group i.

getNewOrderId

public java.lang.Long getNewOrderId()
Gets the id of the newly created order.

getNewOrderItemIds

public java.util.Hashtable getNewOrderItemIds()
Gets a list ids of newly created order items.

getOfferId

protected java.lang.Long[] getOfferId(java.lang.Integer i)
                               throws InvalidParameterValueException
Gets the input parameter offerId with enumeration group i.

getOrderDesc

protected java.lang.String getOrderDesc()
Gets the input parameter OrderDesc.

getOrderId

protected java.lang.String[] getOrderId()
                                 throws ECException
Gets the resolved order ids.

getOrderIds

public java.lang.String[] getOrderIds()
Return a list of order ids which are touched or created by the command. These order ids are also appended to redirection url.
Specified by:
getOrderIds in interface OrderItemAddCmd

getOrderItemId

protected java.lang.Long getOrderItemId(java.lang.Integer i)
                                 throws InvalidParameterValueException
Gets the input parameter orderItemId with enumeration group i.

getOrderItemIds

public java.lang.String[] getOrderItemIds()
Return a list of order item ids which are created or updated by the command. These order item ids are also appended to redirection url.
Specified by:
getOrderItemIds in interface OrderItemAddCmd

getPartNumber

protected java.lang.String getPartNumber(java.lang.Integer i)
Gets the input parameter partNumber with enumeration group i.

getQuantity

protected java.lang.Double getQuantity(java.lang.Integer i)
                                throws InvalidParameterValueException
Gets the input parameter quantity with enumeration group i.

getResolvedRequestProperties

public TypedProperty getResolvedRequestProperties()
Gets the resolved request properties. For example, if the input parameter orderId=., this parameter value will be replaced by the current order id.
Specified by:
getResolvedRequestProperties in interface ControllerCommand
Overrides:
getResolvedRequestProperties in class ControllerCommandImpl
Following copied from interface: com.ibm.commerce.command.ControllerCommand
Returns:
com.ibm.commerce.datatype.TypeProperty

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 AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Returns:
AccessVector - a vector of resource action pairs

getRoundedQuantityAmount

protected QuantityAmount getRoundedQuantityAmount(java.lang.Long catentry_id,
                                                  java.lang.Double quantity)
                                           throws ECException
Returns a rounded quantity amount based on the catalog entry. It calls com.ibm.commerce.price.utils.Helper.createRoundedQuantityAmount() to get the rounded quantity amount.

getShipModeId

protected java.lang.Integer getShipModeId(java.lang.Integer i)
                                   throws InvalidParameterValueException
Gets the input parameter shipModeId with enumeration group i.

getTheUser

public UserAccessBean getTheUser()
                          throws ECSystemException
Returns super.getUser().

getTheUserId

public java.lang.Long getTheUserId()
Returns super.getUserId().

getTradingId

protected java.lang.Long[] getTradingId(java.lang.Integer i)
                                 throws InvalidParameterValueException
Gets the input parameter contractId with enumeration group i.

getUOM

protected java.lang.String getUOM(java.lang.Integer i)
Gets the input parameter UOM with enumeration group i.

insertAddressId

protected void insertAddressId(OrderItemAccessBean orderitemAB,
                               java.lang.Integer i)
                        throws ECException,
                               javax.ejb.FinderException,
                               javax.ejb.CreateException,
                               javax.naming.NamingException,
                               java.rmi.RemoteException,
                               java.sql.SQLException
Inserts a default address to the order item.

insertItemSpecId

protected void insertItemSpecId(OrderItemAccessBean orderitemAB)
                         throws ECException
Inserts an item spec id to the order item.

insertOrderItem

protected void insertOrderItem(java.lang.Integer i,
                               java.lang.Long catentry_id)
                        throws ECException,
                               javax.ejb.FinderException,
                               javax.ejb.CreateException,
                               javax.naming.NamingException,
                               java.rmi.RemoteException,
                               java.sql.SQLException
Inserts a new order item to each resolved orders. It calls the following task commands and methods:

insertOrderItem

protected void insertOrderItem(InterestItemAccessBean iitemAB)
                        throws ECException,
                               javax.ejb.FinderException,
                               javax.ejb.CreateException,
                               javax.naming.NamingException,
                               java.rmi.RemoteException,
                               java.sql.SQLException
Creates a new order item based on the interest item and insert into the order. It calls the following methods:

insertPartNumber

protected void insertPartNumber(OrderItemAccessBean orderitemAB,
                                java.lang.Integer i)
                         throws ECException,
                                javax.ejb.FinderException,
                                javax.ejb.CreateException,
                                javax.naming.NamingException,
                                java.rmi.RemoteException,
                                java.sql.SQLException
Inserts the part number to the order item.

invalidateAllocation

protected void invalidateAllocation(OrderItemAccessBean aabOI)
                             throws ECException,
                                    javax.ejb.FinderException,
                                    javax.ejb.CreateException,
                                    javax.naming.NamingException,
                                    java.rmi.RemoteException,
                                    java.sql.SQLException
Invalidate the allocation for the order item.

isReadyToCallExecute

public boolean isReadyToCallExecute()
Description copied from class: AbstractECTargetableCommand
isReadyToCallExecute method is called by the Targettable Command frame work before the execution of the command. The default implementation is to return true.

Overrides:
isReadyToCallExecute in class AbstractECTargetableCommand
Following copied from class: com.ibm.commerce.command.AbstractECTargetableCommand
Returns:
boolean - true if we can execute the command false if we canot execute the command

migrateInterestItemsToOrderItems

protected void migrateInterestItemsToOrderItems()
                                         throws ECException,
                                                javax.ejb.FinderException,
                                                javax.ejb.CreateException,
                                                javax.naming.NamingException,
                                                java.rmi.RemoteException,
                                                java.sql.SQLException
Migrate all interest items to order items when listId is specified.

performExecute

public void performExecute()
                    throws ECException
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
com.ibm.commerce.command.CommandException - The superclass for all ECExceptions.

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 AbstractECTargetableCommand

resolveOrderId

protected void resolveOrderId()
                       throws ECException
Resolves order ids by calling MiscCmd.getListOfPendingOrders().

setAddressId

public void setAddressId(java.util.Hashtable ahshAddress_id)
Set the address id parameters (optional).
Specified by:
setAddressId in interface OrderItemAddCmd
Following copied from interface: com.ibm.commerce.orderitems.commands.OrderItemAddCmd
Parameters:
ahshAddress_id - Contains a list of address ids. The key is the enumeration group (Integer) and the value is the address id (String). For example, if you have input parameters: addressId_1=123&addressId=234, the hashtable can be constructed by:
    ahshAddress_id.put(new Integer(1), new String("123"));
    ahshAddress_id.put(new Integer(2), new String("234"));
 

setATPParms

public void setATPParms(com.ibm.commerce.fulfillment.commands.ATPParameters newATPParms)
Set the ATP parameters.

setAttrName

public void setAttrName(java.util.Hashtable ahshAttr_name)
Description copied from interface: OrderItemAddCmd
Set the attribute name parameters (optional). The attribute name, together with the attribute value are used to determine a SKU.
Specified by:
setAttrName in interface OrderItemAddCmd
Following copied from interface: com.ibm.commerce.orderitems.commands.OrderItemAddCmd
Parameters:
ahshAttr_name - Contains a list of attribute names. The key is the enumeration group (Integer) and the value is the attribute name (String[]). For example, if you have input parameters: attrName_1=123&attrName_1=234&attrName_2=123, the hashtable can be constructed by:
    ahshAttr_name.put(new Integer(1), new String[] {"123", "234"});
    ahshAttr_name.put(new Integer(2), new String[] {"123"});
 

setAttrValue

public void setAttrValue(java.util.Hashtable ahshAttr_value)
Set the attribute value parameters (optional). The attribute name, together with the attribute value are used to determine a SKU.
Specified by:
setAttrValue in interface OrderItemAddCmd

setCatEntryId

public void setCatEntryId(java.util.Hashtable ahshCatentry_id)
Set the attribute name parameters. This parameter is mandatory if the partNumber parameter is not set. This parameter is ignored when the partNumber parameter is set.
Specified by:
setCatEntryId in interface OrderItemAddCmd

setComment

public void setComment(java.util.Hashtable ahshComment)
Set the comment parameters (optional).
Specified by:
setComment in interface OrderItemAddCmd

setConfigurationId

public void setConfigurationId(java.util.Hashtable ahshConfigurationId)
Set the configurationId parameter. This parameter is optional unless the OrderItem is for a dynamic kit with components.
Specified by:
setConfigurationId in interface OrderItemAddCmd

setContractId

public void setContractId(java.util.Hashtable ahshContract_id)
Set the contract id parameters (optional). It is used to calculate the price.
Specified by:
setContractId in interface OrderItemAddCmd

setCorrelationGroup

public void setCorrelationGroup(java.util.Hashtable ahshCorrelationGroup)
Set the correlation group parameters. It is optional.
Specified by:
setCorrelationGroup in interface OrderItemAddCmd

setDescription

public void setDescription(java.util.Hashtable ahshDescription)
Set the description parameters (optional).
Specified by:
setDescription in interface OrderItemAddCmd

setField1

public void setField1(java.util.Hashtable ahshField1)
Set the field1 parameters (optional).
Specified by:
setField1 in interface OrderItemAddCmd

setField2

public void setField2(java.util.Hashtable ahshField2)
Set the field2 parameters (optional).
Specified by:
setField2 in interface OrderItemAddCmd

setItemSpecId

protected void setItemSpecId(java.lang.Long anItemSpecId)
                      throws ECException
Sets the ItemSpecId

setListId

public void setListId(java.lang.String[] aList_id)
Set the interest item list id parameters (optional).
Specified by:
setListId in interface OrderItemAddCmd

setMemberId

public void setMemberId(java.util.Hashtable ahshMember_id)
Set the member id parameters (optional). It is the catalog owner's member id. It is necessary when the partNumber parameter is set. Together with the partNumber, the catalog entry id can uniquely be determined.
Specified by:
setMemberId in interface OrderItemAddCmd

setOfferId

public void setOfferId(java.util.Hashtable ahshOffer_id)
Set the offer id parameters (optional). It is used to calculate the price.
Specified by:
setOfferId in interface OrderItemAddCmd

setOrderDesc

public void setOrderDesc(java.lang.String aOrder_desc)
Set the Order description parameter (optional).
Specified by:
setOrderDesc in interface OrderItemAddCmd

setOrderId

public void setOrderId(java.lang.String[] aOrder_id)
Set the order id parameters (optional). If it is not set, the current pending order id will be used. If there is no current pending order, a new order will be created.
Specified by:
setOrderId in interface OrderItemAddCmd

setOrderItemId

public void setOrderItemId(java.util.Hashtable ahshOrderitem_id)
Set the order item ids for which to update.
Specified by:
setOrderItemId in interface OrderItemUpdateCmd

setOutOrderItemName

public void setOutOrderItemName(java.lang.String[] aOut_orderitem_name)
Set the out order item name parameters (optional). If it is not set, the default name is "orderItemId".
Specified by:
setOutOrderItemName in interface OrderItemAddCmd

setOutOrderName

public void setOutOrderName(java.lang.String[] aOut_order_name)
Set the out order name parameters (optional). If it is not set, the default name is "orderId".
Specified by:
setOutOrderName in interface OrderItemAddCmd

setPartNumber

public void setPartNumber(java.util.Hashtable ahshPart_number)
Set the part number parameters (optional).
Specified by:
setPartNumber in interface OrderItemAddCmd

setQuantity

public void setQuantity(java.util.Hashtable ahshQuantity)
Set the quantity parameters. It is mandatory if adding a new order item.
Specified by:
setQuantity in interface OrderItemAddCmd

setQuantity

public void setQuantity(java.lang.Integer i,
                        java.lang.Double aQuantity)
Set the quantity parameters. It is mandatory if adding a new order item.

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 ControllerCommandImpl
Following copied from interface: com.ibm.commerce.command.ControllerCommand
Parameters:
requestProperties - com.ibm.commerce.datatype.TypedProperty
Throws:
com.ibm.commerce.exception.ECException. -  

setShipmodeId

public void setShipmodeId(java.util.Hashtable ahshShipmode_id)
Set the ship mode id parameters (optional).
Specified by:
setShipmodeId in interface OrderItemAddCmd

setTradingId

public void setTradingId(java.util.Hashtable ahshTrading_id)
Set the trading id parameters (optional). It is used to calculate the price.
Specified by:
setTradingId in interface OrderItemAddCmd

setUom

public void setUom(java.util.Hashtable ahshUom)
Set the unit of measure parameters (optional).
Specified by:
setUom in interface OrderItemAddCmd

unLockOrder

protected void unLockOrder(java.lang.String orderId)
                    throws ECException,
                           javax.ejb.FinderException,
                           javax.ejb.CreateException,
                           javax.naming.NamingException,
                           java.rmi.RemoteException,
                           java.sql.SQLException
Unlocks the order. If the status of the order is empty, it sets the default status to 'P'. If the status of the order is not empty, it calls checkValidStatus() to check the validation of the status.

updateAddressId

protected void updateAddressId(OrderItemAccessBean orderitemAB,
                               java.lang.Integer i)
                        throws ECException,
                               javax.ejb.FinderException,
                               javax.ejb.CreateException,
                               javax.naming.NamingException,
                               java.rmi.RemoteException,
                               java.sql.SQLException
Updates the address for the order item. It also verifies that if the address is still a permanent address.

updateAllShippingAndAddress

protected void updateAllShippingAndAddress()
                                    throws ECException,
                                           javax.ejb.FinderException,
                                           javax.ejb.CreateException,
                                           javax.naming.NamingException,
                                           java.rmi.RemoteException,
                                           java.sql.SQLException
It calls updateShippingAndAddress() to update the shipping address and shipping mode for each order item.

updateComponentList

protected void updateComponentList(OrderItemAccessBean orderitemAB,
                                   java.lang.Integer i)
                            throws ECException,
                                   javax.ejb.FinderException,
                                   javax.ejb.CreateException,
                                   javax.naming.NamingException,
                                   java.rmi.RemoteException,
                                   java.sql.SQLException
Updates the component list for the order item.

updateCorrelationGroup

protected void updateCorrelationGroup(OrderItemAccessBean orderitemAB,
                                      java.lang.Integer i)
                               throws ECException,
                                      javax.ejb.FinderException,
                                      javax.ejb.CreateException,
                                      javax.naming.NamingException,
                                      java.rmi.RemoteException,
                                      java.sql.SQLException
Updates the correlation group for the order item.

updateCurrency

protected void updateCurrency(OrderAccessBean orderAB)
                       throws ECException,
                              javax.ejb.FinderException,
                              javax.ejb.CreateException,
                              javax.naming.NamingException,
                              java.rmi.RemoteException,
                              java.sql.SQLException
Updates the currency for the order. It uses the currency in the command context.

updateFulfillmentCenter

protected void updateFulfillmentCenter()
                                throws ECException,
                                       javax.ejb.FinderException,
                                       javax.ejb.CreateException,
                                       javax.naming.NamingException,
                                       java.rmi.RemoteException,
                                       java.sql.SQLException
Updates the fulfillment centers and checks for available inventory for all order items modified or created. If ATP inventory is enabled, it calls AllocateInventoryCmd. Otherwise it calls ResolveFulfillmentCenterCmd.

updateItemSpecId

protected void updateItemSpecId(OrderItemAccessBean orderitemAB)
                         throws ECException
Updates the item spec id for the order item.

updateOrderItem

protected void updateOrderItem(java.lang.Integer i,
                               java.lang.Long orderitem_id)
                        throws ECException,
                               javax.ejb.FinderException,
                               javax.ejb.CreateException,
                               javax.naming.NamingException,
                               java.rmi.RemoteException,
                               java.sql.SQLException
Updates the order item. It first tries to find the order item from database with key orderitem_id, it then calls updateOrderItem(OrderItemAccessBean, Integer) to do the actual updating.
Throws:
ECApplicationException - with message key _ERR_INVALID_ORDER_ITEM_ID if the order item cannot be found in the database.

updateOrderItem

protected void updateOrderItem(OrderItemAccessBean orderitemAB,
                               java.lang.Integer i)
                        throws ECException,
                               javax.ejb.FinderException,
                               javax.ejb.CreateException,
                               javax.naming.NamingException,
                               java.rmi.RemoteException,
                               java.sql.SQLException
Updates the order item. It calls the following methods:

updateOutOrderItemId

protected void updateOutOrderItemId()
Adds the ids of the newly created order items to the response properties with key being the input parameter value of outOrderItemName concatenated with "_i" and the value being the id of the order item.

updateOutOrderItemName

protected void updateOutOrderItemName()
Adds the ids of the created and updated order items to the response properties with key being the input parameter value of outOrderItemName and the value being the String array of order item ids.

updateOutOrderName

protected void updateOutOrderName()
Adds the ids of the created and updated orders to the response properties with key being the input parameter value of outOrderName and the value being the String array of order ids.

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
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.

Parameters:
orderitemAB - the access bean of the orderitem whose price is to be calculated.
i - the enumeration group.

updateQuantity

protected boolean updateQuantity(OrderItemAccessBean orderitemAB,
                                 java.lang.Integer i)
                          throws ECException,
                                 javax.ejb.FinderException,
                                 javax.ejb.CreateException,
                                 javax.naming.NamingException,
                                 java.rmi.RemoteException,
                                 java.sql.SQLException
Updates the quantity for the order item. If quantity = 0, the order item will be removed. If quantity < 0, InvalidParameterValueException is thrown.

updateResourceList

protected void updateResourceList()
                           throws ECException,
                                  javax.ejb.FinderException,
                                  javax.ejb.CreateException,
                                  javax.naming.NamingException,
                                  java.rmi.RemoteException
Updates the resources list. It is called by validateParameters() and the resource list is used in the getResources().

updateShipModeId

protected void updateShipModeId(OrderItemAccessBean orderitemAB,
                                java.lang.Integer i)
                         throws ECException,
                                javax.ejb.FinderException,
                                javax.ejb.CreateException,
                                javax.naming.NamingException,
                                java.rmi.RemoteException,
                                java.sql.SQLException
Updates the shipping mode id for the order item.

updateShippingAndAddress

protected void updateShippingAndAddress(OrderItemAccessBean orderitemAB,
                                        java.lang.Integer i)
                                 throws ECException,
                                        javax.ejb.FinderException,
                                        javax.ejb.CreateException,
                                        javax.naming.NamingException,
                                        java.rmi.RemoteException,
                                        java.sql.SQLException
It calls updateAddressId() and updateShipModeId() to update the shipping address and shipping mode for the order item.

validateParameters

public void validateParameters()
                        throws ECException
Verify the input parameters.
Specified by:
validateParameters in interface ECCommand
Overrides:
validateParameters in class AbstractECTargetableCommand
Following copied from interface: com.ibm.commerce.command.ECCommand
Throws:
ECException. -  

validateTradingPaymentMethods

protected void validateTradingPaymentMethods()
                                      throws ECException,
                                             javax.ejb.FinderException,
                                             javax.ejb.CreateException,
                                             javax.naming.NamingException,
                                             java.rmi.RemoteException,
                                             java.sql.SQLException
Validate the trading agreements used by the orderitems in an order by checking if they define compatible payment methods and are associated with the same account as the other orderitems in the order.