com.ibm.commerce.contract.commands
Class UpdateContractCmdImpl

java.lang.Object
  |
  +--CacheableCommandImpl
        |
        +--com.ibm.commerce.command.AbstractECTargetableCommand
              |
              +--com.ibm.commerce.command.TaskCommandImpl
                    |
                    +--com.ibm.commerce.contract.commands.UpdateContractCmdImpl
All Implemented Interfaces:
ECCommand, ECTargetableCommand, TaskCommand, UpdateContractCmd

public class UpdateContractCmdImpl
extends TaskCommandImpl
implements UpdateContractCmd

Update a contract based on the given Contract element (WebSphere Commerce Business Edition only). Calling commands: ContractUpdate, ImportDTDContractApprovedVersionCmd, ImportDTDContractDraftVersionCmd The following AccessBeans are used in this default implemention: ContractJDBCHelperAccessBean.addEntryToContractName(String, Long, Integer), ContractAccessBean, TermConditionDescriptionAccessBean, TradingDescriptionAccessBean, ParticipantAccessBean, OrderApprovalTCAccessBean, PriceTCPriceListWithSelectiveAdjustmentAccessBean, PriceTCPriceListWithOptionalAdjustmentAccessBean, PriceTCMasterCatalogWithOptionalAdjustmentAccessBean, FulfillmentTCAccessBean, ObligationToBuyTCByAmountAccessBean, PaymentTCAccessBean, OrderTCOrderCommentAccessBean, OrderTCOrderItemPAttributeAccessBean, PriceTCCustomPriceListAccessBean, ProductSetTCCustomExclusionAccessBean, ProductSetTCCustomInclusionAccessBean, ProductSetTCExclusionAccessBean, ProductSetTCInclusionAccessBean, ReturnTCRefundPaymentMethodAccessBean, ReturnTCReturnChargeAccessBean, RightToBuyTCByAmountAccessBean, ShippingTCShipToAddressAccessBean, ShippingTCShippingChargeAccessBean, ShippingTCShippingModeAccessBean, TradingAgreementAccessBean, OrganizationAccessBean, UserAccessBean, MemberGroupAccessBean.

See Also:
Serialized Form

Field Summary
static java.lang.String CLASSNAME
          The name of this command.
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Fields inherited from class com.ibm.commerce.command. AbstractECTargetableCommand
commandContext
 
Fields inherited from interface com.ibm.commerce.contract.commands. UpdateContractCmd
defaultCommandClassName, NAME
 
Fields inherited from interface com.ibm.commerce.command. ECCommand
defaultCommandClassName
 
Constructor Summary
UpdateContractCmdImpl()
          Constructor for UpdateContractCmdImpl.
 
Method Summary
 java.lang.Long getContractId()
          Returns id of the updated contract.
  AccessVector getResources()
          Gets the access vector accessed by this command.
 void parseXMLDocument()
          Parses the contract XML document.
 void performExecute()
          Updates the contract based on the contract Element object.
 void setContractDescriptionElement(org.w3c.dom.Element cntrDescElement)
          Sets the contract description Element object.
 void setContractElement(org.w3c.dom.Element contractElement)
          Sets the contract Element object.
 void setContractId(java.lang.Long contractId)
          Sets the ID of the contract.
 void setTermConditionId(java.lang.Long tcId)
          Sets the ID of the term and condition
 
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, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties, validateParameters
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values

CLASSNAME

public static final java.lang.String CLASSNAME
The name of this command.
See Also:
Constant Field Values
Constructor Detail

UpdateContractCmdImpl

public UpdateContractCmdImpl()
Constructor for UpdateContractCmdImpl.
Method Detail

getContractId

public java.lang.Long getContractId()
Returns id of the updated contract.
Specified by:
getContractId in interface UpdateContractCmd
Returns:
the id of the updated contract

getResources

public AccessVector getResources()
                          throws ECException
Gets the access vector accessed by this command. The default implementation returns the ContractAccessBean of the contract.
Specified by:
getResources in interface ECCommand
Overrides:
getResources in class AbstractECTargetableCommand
Returns:
AccessVector - a vector of resource action pairs
Throws:
ECException - Raised with message _ERR_FINDER_EXCEPTION if the FinderException occurred. Raised with message _ERR_REMOTE_EXCEPTION if the RemoteException occurred. Raised with message _ERR_NAMING_EXCEPTION if the NamingException occurred. Raised with message _ERR_CREATE_EXCEPTION if the CreateException occurred.
See Also:
AbstratECTargetableCommand#getResources()

parseXMLDocument

public void parseXMLDocument()
Parses the contract XML document.

performExecute

public void performExecute()
                    throws ECException
Updates the contract based on the contract Element object.
Specified by:
performExecute in interface ECCommand
Overrides:
performExecute in class AbstractECTargetableCommand
Throws:
ECException - Raised with message _ERR_RETRIEVE_STORE_ID if the store id cannot be retrived from the information provided in StoreRef element in one of the terms and conditions. Raised with message _ERR_RETRIEVE_POLICY_TYPE if the policy type cannot be retrived based on information in policy reference element. Raised with message _ERR_RETRIEVE_ORG_ID if an error occurred when retrieving the organization ID. Raised with message _ERR_RETRIEVE_USER_ID if an error occurred when retrieving the user ID. Raised with message _ERR_RETRIEVE_MEMBER_GROUP_ID if an error occurred when retrieving the member group ID. Raised with message _ERR_RETRIEVE_OPERATOR_ID if an error occurred when retrieving opeartor_id. The value of "operator" in "AttributeValue" element is incorrect. Raised with message _ERR_RETRIEVE_PATTRIBUTE_ID if an error occurred when retrieving pattribute_id. The value of "attributeName" in "AttributeDetail" element is incorrect. Raised with message _ERR_RETRIEVE_CATENTRY_ID if an error occurred when retrieving catentry_id. The information specified in "OrderTCOrderItemPAttribute" element is incorrect. Raised with message _ERR_RETRIEVE_POLICY_ID if an error occurred when retrieving policy_id. The information specified in the policy reference element is incorrect. Raised with message _ERR_RETRIEVE_FFMCENTER_ID if an error occurred when retrieving ffmcenter_id. The information specified in "FilfillmentCenterRef" element is incorrect. Raised with message _ERR_COLUMN_ACCESSBEANNAME_IN_PATTRIBUTE_NOT_POPULATED if an error occurred when retrieving personalization attribute value accessbean. Column accessbeanname in table pattribute is not populated correctly. Raised with message _ERR_PATTRIBUTE_NOT_REGISTERED_IN_TABLE_PATTRPROD_FOR_CATENTRY if an error occurred when validating whether catentry has the corresponding personalization attribute registered in table PattrProd. catentry_id and pattribute_id retrieved from OrderTCOrderItemPAttribute element should be registered in table PattrProd. Raised with message _ERR_TOO_MANY_FULFILLMENT_TC if a contract has more than three fulfillment centers defined in a term and condition. Raised with message _ERR_DUPLICATE_KEY_IN_PROCESSING_TC if a duplicate key error occurred when processing a term and condition. Raised with message _ERR_FINDER_EXCEPTION if the FinderException occurred. Raised with message _ERR_REMOTE_EXCEPTION if the RemoteException occurred. Raised with message _ERR_NAMING_EXCEPTION if the NamingException occurred. Raised with message _ERR_CREATE_EXCEPTION if the CreateException occurred. Raised with message _ERR_REMOVE_EXCEPTION if the RemoveException occurred. Raised with message _ERR_SQL_EXCEPTION if the SQLException occurred.

setContractDescriptionElement

public void setContractDescriptionElement(org.w3c.dom.Element cntrDescElement)
Sets the contract description Element object.
Parameters:
cntrDescElement - the xml Element object of the contract description

setContractElement

public void setContractElement(org.w3c.dom.Element contractElement)
Sets the contract Element object.
Specified by:
setContractElement in interface UpdateContractCmd
Parameters:
contractElement - the xml Element object of contract

setContractId

public void setContractId(java.lang.Long contractId)
Sets the ID of the contract.
Specified by:
setContractId in interface UpdateContractCmd
Parameters:
contractId - the ID of the contract

setTermConditionId

public void setTermConditionId(java.lang.Long tcId)
Sets the ID of the term and condition
Specified by:
setTermConditionId in interface UpdateContractCmd
Parameters:
tcId - the ID of the term and condition