com.ibm.commerce.account.commands

Class AccountExportCmdImpl

  • java.lang.Object
  • All Implemented Interfaces:
    AccountExportCmd, com.ibm.commerce.command.AccCommand, com.ibm.commerce.command.ControllerCommand, com.ibm.commerce.command.ECCommand, com.ibm.commerce.command.ECTargetableCommand, com.ibm.commerce.security.Protectable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command


    public class AccountExportCmdImpl
    extends TradingAgreementExportBaseCmdImpl
    implements AccountExportCmd
    This is the default implementation of the AccountExportCmd controller command.

    Input parameters:

    Name Description
    accountId The account IDs to be exported. It is mandatory.
    fileName The file name of the exporting xml file. It is mandatory.
    langId The language ID. It is mandatory.
    xsdName xsd file name when exporting a contract. It is mandatory.
    URL the url which contract is exported to. It is mandatory.
    xmlFileEncoding the xml file encoding. It is optional.
    tagName the tag name of the contract. It is optional.

    Output parameters:

    None.

    Behaviour:

    Exports the specified contract with specified language id to an xml file based on the specified encoding (WebSphere Commerce Enterprise only).

    Task commands called:

    None.

    Access Beans used:

    • TradingAgreementAccessBean
    • AccountAccessBean
    • AttachmentAccessBean
    • LanguageAccessBean
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      com.ibm.commerce.accesscontrol.AccessVector getResources()
      Gets the access vector accessed by this command.
      java.lang.String getUrl()
      Gets the redirection url to be called when the command completes successfully.
      void performExecute()
      Executes the business logic of this command implementation.
      void setAccountId(java.lang.Long accountId)
      Sets the ID of the business account to be exported.
      void setExportAllData(boolean wantsAll)
      Sets the exporting all data flag.
      void setFileName(java.lang.String astrFileName)
      Sets the xml file which the business account will be exported to.
      void setLangId(java.lang.Integer anLangId)
      Sets language ID.
      void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
      Sets the request properties.
      void setUrl(java.lang.String astrUrl)
      Sets the redirection url to be called when the command completes successfully.
      void setXMLFileEncoding(java.lang.String encoding)
      Sets the encoding.
      void setXSDFileName(java.lang.String xsdName)
      Sets the xsd file name.
      void validateParameters()
      Extracts and validates the input parameters of this command implementation.
      • 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 full name of this class.
        See Also:
        Constant Field Values
      • COPYRIGHT

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

      • AccountExportCmdImpl

        public AccountExportCmdImpl()
    • Method Detail

      • 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 AccountAccessBean of the business account to be exported.

        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()
      • getUrl

        public java.lang.String getUrl()
        Gets the redirection url to be called when the command completes successfully.
        Returns:
        The redirect url string.
      • 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 - Raised with message _ERR_UNSUPPORTED_ENCODING whenever an unsupported encode is found. Raised with message _ERR_IO_EXCEPTION whenever an IO problem occurred. Raised with message _ERR_EXPORT_CONTRACT if a problem occurred, but this command cannot determine the reason. Raised with message _ERR_CONTRACT_CMD_EXEC whenever one of the following exceptions occurs: javax.ejb.FinderException, javax.ejb.CreateException, java.rmi.RemoteException, and javax.naming.NamingException.
        See Also:
        AbstractECTargetableCommand.performExecute()
      • setAccountId

        public void setAccountId(java.lang.Long accountId)
        Sets the ID of the business account to be exported.
        Specified by:
        setAccountId in interface AccountExportCmd
        Parameters:
        accountId - the ID of the business account.
      • setExportAllData

        public void setExportAllData(boolean wantsAll)
        Sets the exporting all data flag.
        Specified by:
        setExportAllData in interface AccountExportCmd
        Parameters:
        wantsAll - the flag to indicate if all the data will be exported. If the flag is set to true, the contract ID, term and condition IDs, time created, and the last updated time will be exported. otherwise, the information will not be exported.
      • setFileName

        public void setFileName(java.lang.String astrFileName)
        Sets the xml file which the business account will be exported to.
        Specified by:
        setFileName in interface AccountExportCmd
        Parameters:
        astrFileName - the name of the xml file
      • setLangId

        public void setLangId(java.lang.Integer anLangId)
        Sets language ID.
        Specified by:
        setLangId in interface AccountExportCmd
        Parameters:
        anLangId - the language ID
      • setRequestProperties

        public void setRequestProperties(com.ibm.commerce.datatype.TypedProperty aRequestProperties)
                                  throws com.ibm.commerce.exception.ECApplicationException
        Sets the request properties.
        Specified by:
        setRequestProperties in interface com.ibm.commerce.command.ControllerCommand
        Overrides:
        setRequestProperties in class com.ibm.commerce.command.ControllerCommandImpl
        Parameters:
        aRequestProperties - the request properties The mandatory name-value pairs are contractId, fileName, langId, xsdName, URL. The optional name-value parameters are xmlFileEncoding, all, tagName. If the xmlFileEncoding is not provided, the default value will be UTF-8. The default value for name "all" is set to true. That means the ids, create time, update time will be exported to the specified xml file. If the tagName is not provided, when a contract is exported, the tag name of the contract will based on the default implementation. For example, a referral contract, the tag will be ReferralContract.
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_MISSING_CMD_PARAMETER when any one of the required url parameters is missing. The required parameters are contractId, langId, fileName, URL, and xsdName. Raised with message InvalidParameterValueException whenever either the contradId or langId parameter has the bad format.
        See Also:
        ControllerCommand.setRequestProperties(TypedProperty)
      • 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 AccountExportCmd
        Parameters:
        astrUrl - the redirection url string
      • setXMLFileEncoding

        public void setXMLFileEncoding(java.lang.String encoding)
        Sets the encoding.
        Specified by:
        setXMLFileEncoding in interface AccountExportCmd
        Parameters:
        encoding - the encoding string
      • setXSDFileName

        public void setXSDFileName(java.lang.String xsdName)
        Sets the xsd file name.
        Specified by:
        setXSDFileName in interface AccountExportCmd
        Parameters:
        xsdName - The name of the xsd files which the contract xml should against for.
      • validateParameters

        public void validateParameters()
                                throws com.ibm.commerce.exception.ECException
        Extracts and validates the input parameters of this command implementation. Validates the contract to check if it is in right state for the exporting process.
        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 specified contract cannot be found. Raised with message _ERR_WRONG_CONTRACT_STATE if the contract is in one of the following state: EC_STATE_DEPLOY_FAILED, EC_STATE_DEPLOY_IN_PROGRESS.
        See Also:
        com.ibm.commerce.command.AbstractECTargetableCommand#validateParameters()