com.ibm.commerce.contract.commands

Class ImportDTDContractDraftVersionCmdImpl

  • java.lang.Object
    • com.ibm.websphere.command.CacheableCommandImpl
      • com.ibm.commerce.command.MeasuredCacheableCommandImpl
        • com.ibm.commerce.command.AbstractECTargetableCommand
          • com.ibm.commerce.command.TaskCommandImpl
            • com.ibm.commerce.contract.commands.ImportDTDContractDraftVersionCmdImpl
  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.command.TaskCommand, ImportDTDContractDraftVersionCmd, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class ImportDTDContractDraftVersionCmdImpl
    extends com.ibm.commerce.command.TaskCommandImpl
    implements ImportDTDContractDraftVersionCmd
    This is the default implementation of the ImportDTDContractDraftVersionCmd task command.

    Behaviour:

      Imports a draft contract from a specified XML file (WebSphere Commerce Enterprise only). The state of the contract in the XML file should be in Draft. Calling commands: ContractImportDraftVersionCmd

    Task commands called:

    AccessBeans called:

    • ContractAccessBean
    • AccountAccessBean
    • UserAccessBean
    • OrganizationAccessBean
    • MemberGroupAccessBean
    • ParticipantAccessBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      com.ibm.commerce.datatype.TypedProperty getResponseProperties()
      Returns the responseProperties
      void performExecute()
      Executes the business logic of this command implementation.
      void setContractXMLFileName(java.lang.String newContractXMLFileName)
      Sets the contract XML file name.
      void setUrl(java.lang.String astrUrl)
      Sets the redirection URL to be called when the command completes successfully.
      void setXMLEntityPath(java.lang.String path)
      Sets the XML entity path.
      void validateParameters()
      This is where parameter checking is done.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand

        accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
      • Methods inherited from interface com.ibm.commerce.command.CacheableECCommand

        execute
      • Methods inherited from interface com.ibm.commerce.command.ECCommand

        checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getResources, getStoreId, getUser, getUserId, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
    • 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

      • ImportDTDContractDraftVersionCmdImpl

        public ImportDTDContractDraftVersionCmdImpl()
    • Method Detail

      • getResponseProperties

        public com.ibm.commerce.datatype.TypedProperty getResponseProperties()
        Returns the responseProperties
        Specified by:
        getResponseProperties in interface ImportDTDContractDraftVersionCmd
        Returns:
        responseProperties the response properties which contains the new created contract id
      • performExecute

        public void performExecute()
                            throws com.ibm.commerce.exception.ECException
        Executes the business logic of this command implementation.
        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
        See Also:
        importContractNLDesc(Element), AbstractECTargetableCommand.performExecute()
      • setContractXMLFileName

        public void setContractXMLFileName(java.lang.String newContractXMLFileName)
        Sets the contract XML file name.
        Specified by:
        setContractXMLFileName in interface ImportDTDContractDraftVersionCmd
        Parameters:
        newContractXMLFileName - the name of the contract XML file
      • setUrl

        public void setUrl(java.lang.String astrUrl)
        Sets the redirection URL to be called when the command completes successfully.
        Specified by:
        setUrl in interface ImportDTDContractDraftVersionCmd
        Parameters:
        astrUrl - the redirection URL string
      • setXMLEntityPath

        public void setXMLEntityPath(java.lang.String path)
        Sets the XML entity path.
        Specified by:
        setXMLEntityPath in interface ImportDTDContractDraftVersionCmd
        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
        This is where parameter checking is done. This method does the following checks 1. if the file and the DTD file can be found 2. if the XML file is valid 3. if the contract is in right state for this command. The contract should be either in Approved or Active state
        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_FILE_NOT_FOUND if the XML file or DTD file cannot be found. Raised with message _ERR_PARSE_XML_FILE if an error occurred when the XML parser parses the XML file. Raised with message _ERR_GENRIC_PARSE_XML_FILE if an IO error occurred. Raised with message _ERR_WRONG_CONTRACT_STATE if the contract is not in Draft state. Raised with message _ERR_VERSION_NUMBER_FORMAT if the contract version number format is incorrect. It should be numerical. Raised with message _ERR_MISSING_CONTRACT_NAME if the contract name is empty string in the XML file. Raised with message _ERR_MISSING_CONTRACT_NAME if the account name is provided but not the AcocuntOwner element in the XML file. Raised with message _ERR_WRONG_ACCOUNT_OWNER_INFO if an error occurred when retrieving the account owner id. Raised with message _ERR_ACCOUNT_DOES_NOT_EXIST if an error occurred when retrieving the account based the account name and account owner id. Raised with message _ERR_WRONG_CONTRACT_OWNER_MEMBER_INFO if an error occurred when retrieving the contract owner id. Raised with message _ERR_DUPLICATED_CONTRACT_NAME if there is a contract existed with the same name, owner, and origin. Raised with message _ERR_CONTRACT_REFERENCE_NUMBER_NOT_REQUIRED if the contract referenceNumber attribute is provided in the XML file for Contract element.
        See Also:
        AbstractECTargetableCommand.validateParameters()