com.ibm.commerce.contract.tc.commands

Class ContractTCCreateCmdImpl

  • 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.ContractTCCreateCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.AccCommand, com.ibm.commerce.command.ControllerCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, ContractTCCreateCmd, com.ibm.commerce.security.Protectable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


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

    Input parameters:

    Name Description
    XMLString The url parameter name for XML string. It is mandatory.
    contractId The contract ID. It is mandatory.
    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. It is optional.

    Output parameters:

    None.

    Behaviour:

    Create terms and conditions based on the TermCondition element XML string to the specified contract. The contract has to be in Draft state. (WebSphere Commerce Enterprise only).

    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 anTCElement)
      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 setContractId(java.lang.Long contractId)
      Sets the ID of the contract which the term and condition will be added to.
      void setElement(org.w3c.dom.Element anElement)
      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 tcLongDescription)
      Sets the long description of the term and condition.
      void setTcReferenceNumber(java.lang.Long tcId)
      Sets the ID of the term and condition.
      void setTcReferenceNumber(java.lang.String tcIdStr)
      Sets the ID of the term and condition.
      void setTcShortDescription(java.lang.String tcShortDescription)
      Sets the short description 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

      • ContractTCCreateCmdImpl

        public ContractTCCreateCmdImpl()
    • 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 the term and condition will be added 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 anTCElement)
        Parses the term and condition element and gets the long description and the short description of the term and condition.
        Parameters:
        anTCElement - 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_CMD_EXEC if any other types of errors occurred.
        See Also:
        AbstractECTargetableCommand.performExecute()
      • setContractId

        public void setContractId(java.lang.Long contractId)
        Sets the ID of the contract which the term and condition will be added to.
        Parameters:
        contractId - the contract ID
      • setElement

        public void setElement(org.w3c.dom.Element anElement)
        Sets term and condition Element object.
        Parameters:
        anElement - 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 or the input XML string is missed.
        See Also:
        ControllerCommand.setRequestProperties(TypedProperty)
      • setTcLongDescription

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

        public void setTcReferenceNumber(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
      • setTcReferenceNumber

        public void setTcReferenceNumber(java.lang.String tcIdStr)
        Sets the ID of the term and condition. Reserved for IBM internal use.
        Parameters:
        tcIdStr - the ID of the term and condition in String object
      • setTcShortDescription

        public void setTcShortDescription(java.lang.String tcShortDescription)
        Sets the short description of the term and condition. Reserved for IBM internal use.
        Parameters:
        tcShortDescription - the short description of the term and condition
      • 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_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()