com.ibm.commerce.contract.tc.commands

Class ContractTCUpdateCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.CacheableCommandImpl
      • com.ibm.commerce.command.MeasuredCacheableCommandImpl
        • com.ibm.commerce.command.AbstractECTargetableCommand
          • com.ibm.commerce.command.ControllerCommandImpl
            • com.ibm.commerce.contract.tc.commands.ContractTCUpdateCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.AccCommand, com.ibm.commerce.command.ControllerCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, ContractTCUpdateCmd, com.ibm.commerce.security.Protectable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class ContractTCUpdateCmdImpl
    extends com.ibm.commerce.command.ControllerCommandImpl
    implements ContractTCUpdateCmd
    This is the default implementation of the ContractTCUpdateCmd controller command.

    Input parameters:

    Name Description
    contractId The contract ID. It is mandatory.
    XMLString The XML string contains the terms and conditions . It is mandatory.
    path The path where it can find the DTD or XML Schema file(s). It is optional.

    Output parameters:

    None.

    Behaviour:

    Update terms and conditions (WebSphere Commerce Enterprise only). The contract which its belongs to has to be in Draft state.

    Access Beans used:

    • ContractAccessBean
    • TermConditionDescriptionAccessBean
    • ParticipantAccessBean
    • OrderApprovalTCAccessBean
    • PriceTCMasterCatalogWithFilteringAccessBean
    • PriceTCPriceListWithOptionalAdjustmentAccessBean
    • PriceTCMasterCatalogWithOptionalAdjustmentAccessBean
    • PriceTCPriceListWithSelectiveAdjustmentAccessBean
    • ReferralInterfaceTCAccessBean
    • FulfillmentTCAccessBean
    • ObligationToBuyTCByAmountAccessBean
    • PaymentTCAccessBean
    • OrderTCOrderCommentAccessBean
    • OrderTCOrderItemPAttributeAccessBean
    • PriceTCCustomPriceListAccessBean
    • ProductSetTCCustomExclusionAccessBean
    • ProductSetTCCustomInclusionAccessBean
    • ProductSetTCExclusionAccessBean
    • ProductSetTCInclusionAccessBean
    • ReturnTCRefundPaymentMethodAccessBean
    • ReturnTCReturnChargeAccessBean
    • RightToBuyTCByAmountAccessBean
    • ShippingTCShipToAddressAccessBean
    • ShippingTCShippingChargeAccessBean
    • ShippingTCShippingModeAccessBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      org.w3c.dom.Element getElement()
      Returns the term condition element.
      com.ibm.commerce.accesscontrol.AccessVector getResources()
      Gets the access vector accessed by this command.
      void parseXMLElement(org.w3c.dom.Element element)
      Parses the term and condition element and gets the long description and the short description of the term and condition.
      void performExecute()
      Executes the business logic of this command implementation.
      void setElement(org.w3c.dom.Element newElement)
      Sets term and condition Element object.
      void setLanguageId(java.lang.Integer langId)
      Sets the language ID.
      void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
      Retrieves input parameters from the request properties.
      void setTcLongDescription(java.lang.String newTcLongDescription)
      Sets the long description of the term and condition.
      void setTcShortDescription(java.lang.String newTcShortDescription)
      Sets the short description of the term and condition.
      void setTermConditionId(java.lang.Long tcId)
      Sets the ID of the term and condition.
      void setXMLEntityPath(java.lang.String path)
      Sets the XML entity path.
      void validateParameters()
      Checks if the contract object exists.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • 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, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
      • 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, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
      • Methods inherited from interface com.ibm.commerce.security.Protectable

        fulfills, getOwner
    • Field Detail

      • CLASSNAME

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

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

      • ContractTCUpdateCmdImpl

        public ContractTCUpdateCmdImpl()
    • Method Detail

      • getElement

        public org.w3c.dom.Element getElement()
        Returns the term condition element.
        Returns:
        the terms and conditions Element object
      • getResources

        public com.ibm.commerce.accesscontrol.AccessVector getResources()
                                                                 throws com.ibm.commerce.exception.ECException
        Gets the access vector accessed by this command. The default implementation returns ContractAccessBean of the contract which term and condition belongs to.

        Specified by:
        getResources in interface com.ibm.commerce.command.ECCommand
        Overrides:
        getResources in class com.ibm.commerce.command.AbstractECTargetableCommand
        Returns:
        AccessVector - a vector of resource action pairs
        Throws:
        com.ibm.commerce.exception.ECException
        See Also:
        AbstractECTargetableCommand.getResources()
      • parseXMLElement

        public void parseXMLElement(org.w3c.dom.Element element)
        Parses the term and condition element and gets the long description and the short description of the term and condition.
        Parameters:
        element - the term and condition element
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        Executes the business logic of this command implementation. The method creates the term and condition .
        Specified by:
        performExecute in interface com.ibm.commerce.command.ECCommand
        Overrides:
        performExecute in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_RETRIEVE_STORE_ID if the store id cannot be retrieved 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 retrieved 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_SAVE_TC_ATTR if an error occurred when saving the attribute of the term and condition to tcattr table. 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_NUMBER_FORMAT_EXCEPTION if the provided long ID in the description element cannot be converted to an Integer object. The error will be only occurred for DTD based (Version 5) element. Raised with message _ERR_CONTRACT_TC_UPDATE if there is an error rather than the errors mentioned above occurred during the process.
        See Also:
        AbstractECTargetableCommand.performExecute()
      • setElement

        public void setElement(org.w3c.dom.Element newElement)
        Sets term and condition Element object.
        Parameters:
        newElement - the term and condition Element object
      • setLanguageId

        public void setLanguageId(java.lang.Integer langId)
        Sets the language ID. Reserved for IBM internal use.
        Parameters:
        langId - the language ID
      • setRequestProperties

        public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
                                  throws com.ibm.commerce.exception.ECApplicationException
        Retrieves input parameters from the request properties.
        Specified by:
        setRequestProperties in interface com.ibm.commerce.command.ControllerCommand
        Overrides:
        setRequestProperties in class com.ibm.commerce.command.ControllerCommandImpl
        Parameters:
        aRequestProperties - An TypedProperty object contains the input parameters. The mandatory name-value pairs are XMLString, contractId. The optional name-value pair is path. The path parameter indicates the path of the DTD or XML schema files. The default value of the path parameter is specified in WebSphere Commerce instance XML file.
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_MISSING_CMD_PARAMETER when contractId, the input XML string, or redirect URL are missed.
        See Also:
        ControllerCommand.setRequestProperties(TypedProperty)
      • setTcLongDescription

        public void setTcLongDescription(java.lang.String newTcLongDescription)
        Sets the long description of the term and condition. Reserved for IBM internal use.
        Parameters:
        newTcLongDescription - the term and condition long description string
      • setTcShortDescription

        public void setTcShortDescription(java.lang.String newTcShortDescription)
        Sets the short description of the term and condition. Reserved for IBM internal use.
        Parameters:
        newTcShortDescription - the term and condition short description string
      • setTermConditionId

        public void setTermConditionId(java.lang.Long tcId)
        Sets the ID of the term and condition. Reserved for IBM internal use.
        Parameters:
        tcId - the ID of the term and condition in Long object
      • setXMLEntityPath

        public void setXMLEntityPath(java.lang.String path)
        Sets the XML entity path.
        Parameters:
        path - the path where it can find the DTD or XML Schema file(s)
      • validateParameters

        public void validateParameters()
                                throws com.ibm.commerce.exception.ECException
        Checks if the contract object exists.
        Specified by:
        validateParameters in interface com.ibm.commerce.command.ECCommand
        Overrides:
        validateParameters in class com.ibm.commerce.command.AbstractECTargetableCommand
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_CONTRACT_OBJECT_NOT_FOUND if the contract cannot be found in the database based on the provided contract ID. Raised with message _ERR_WRONG_CONTRACT_STATE If the contract is not in Draft or Rejected state. Raised with message _ERR_GENRIC_PARSE_XML_FILE if an error occurred when parse the term and condition element. Raised with message _ERR_NUMBER_FORMAT_EXCEPTION if the term and condition ID cannot be converted to Long object. 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:
        AbstractECTargetableCommand.validateParameters()