com.ibm.commerce.account.util

Class AccountCmdUtil

  • java.lang.Object
    • com.ibm.commerce.account.util.AccountCmdUtil


  • public class AccountCmdUtil
    extends java.lang.Object
    Reserved for IBM internal use. The following AccessBeans are used in this default implementation: TradingDescriptionAccessBean, ParticipantAccessBean, AccountAccessBean, TradingAgreementAccessBean, StoreEntityAccessBean, MemberAccessBean, TermConditionDescriptionAccessBean, UserAccessBean, OrganizationAccessBean, MemberGroupAccessBean, LanguageAccessBean
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CLASSNAME
      The name of this class.
      static java.lang.String COPYRIGHT
      IBM copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      AccountCmdUtil() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void accountAttachmentSet(java.lang.Long argTradingId, org.w3c.dom.Element argAttachmentElement, java.lang.Long argOwnerId, java.lang.String argUsageId)
      Adds an attachment to the attachment table if the attachment does not exist yet, and create a relationship between the specified trading agreement and the attachment.
      static void accountAttachmentSet(java.lang.Long argTradingId, java.lang.Long argOwnerId, java.lang.String usageId, java.lang.String uri, java.lang.String mimeType, java.lang.String mimeTypeEncoding)
      Adds an attachment to the attachment table if the attachment does not exist yet, and create a relationship between the specified trading agreement and the attachment.
      static void accountDescriptionSet(org.w3c.dom.Element argAccountDescElement, java.lang.Long argAccountId, java.sql.Timestamp currentTime)
      Adds or updates the business account description.
      static void addParticipants(org.w3c.dom.NodeList argParticipants, java.lang.Long argTradingId, java.lang.Long argTCId, java.sql.Timestamp currentTime)
      Adds a participant to either trading agreement or terms and conditions
      static void checkAccountHolderAndBuyers(java.lang.Long anAccountId)
      Checks the account holder and buyer participants.
      static void checkAccountLastUpdated(java.lang.String accountId, java.lang.String lastUpdatedTime, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools)
      Checks the last updated time.
      static void checkAccountParticipants(java.lang.Long anAccountId, org.w3c.dom.NodeList aParticipants, boolean bUpdateAccount)
      Checks the business account participants (This method is for DTD based xml instance).
      static void checkXSDBasedAccountParticipants(java.lang.Long anAccountId, org.w3c.dom.NodeList aParticipants, boolean bUpdateAccount)
      Checks the business account participants (This method is for XSD based xml instance).
      static java.lang.Long createNewAccount(org.w3c.dom.Element argAccount, java.sql.Timestamp currentTime)
      Creates the business account based on the given account Element object (This method is for DTD based xml instance).
      static java.lang.Long getAccountOwnerIdFromAccountElement(org.w3c.dom.Element aelmAccount)
      Returns the business account owner ID (This method is for DTD based xml instance).
      static java.lang.Long getAccountOwnerIdFromXSDAccountElement(org.w3c.dom.Element accountUniqueKeyElm)
      Returns the account owner id.
      static java.lang.Integer getAccountParticipantRole(java.lang.String prty)
      Gets the participant role of a participant based on the given participant role string.
      static java.lang.String getAccountParticipantRoleInString(java.lang.Integer index)
      Get the participant role of a participant based on the given participant role.
      static java.lang.Integer getAccountState(com.ibm.commerce.payment.objects.AccountAccessBean abAccount)
      Gets the state of the business account.
      static java.lang.Integer getAccountState(java.lang.Long accountId)
      Gets the state of the specified business account.
      static java.lang.Integer getAccountState(java.lang.String state)
      Gets the state of the business account based on the given business account state string.
      static java.lang.String getAccountStateInString(java.lang.Integer index)
      Gets the state of the business account based on the given business account state integer.
      static java.lang.String getMemberType(org.w3c.dom.Element aelmParticipant)
      Returns the member type of the given participant (This method is for DTD based xml instance).
      static int getNumberOfParticipants(java.lang.Long anAccountId, java.lang.Integer anRole)
      Returns the number of the participants in the given business account which has the specified role type.
      static java.lang.String getParticipantMemberType(org.w3c.dom.Element aelmParticipant)
      Returns the member type of the given participant (This method is for XSD based xml instance).
      static java.lang.Integer getStoreIdFromAccountElement(org.w3c.dom.Element aelmAccount)
      Returns the ID of the store which business account belongs to (This method is for DTD based xml instance).
      static java.lang.Integer getStoreIdFromXSDBasedAccountElement(org.w3c.dom.Element aelmAccount)
      Returns the ID of the store which business account belongs to (This method is for DTD based xml instance).
      static org.w3c.dom.Document getXMLDocumentObjectFromFile(java.lang.String xmlFileName)
      Gets the xml Document object based on the specified xml instance file name (This method is for DTD based xml instance).
      static org.w3c.dom.Document getXMLDocumentObjectFromReader(java.io.Reader reader)
      Gets the xml Document object based on the specified Reader object (This method is for DTD based xml instance).
      static boolean isDescendant(java.lang.Long anDescendantId, java.lang.Long anAncestorId)
      Checks if the first member ID is the descendant of the second member ID.
      static boolean isMemberGroup(java.lang.Long anMemberId)
      Checks if the given member ID is a member group
      static java.lang.Long saveAccount(org.w3c.dom.Element argAccount, java.sql.Timestamp currentTime, boolean actionFlag)
      Saves the business account (This method is for XSD based xml instance).
      static void setAccountState(com.ibm.commerce.payment.objects.AccountAccessBean abAccount, java.lang.Integer state)
      Sets the state of the specified business account to the given state.
      static void setAccountState(java.lang.Long accountId, java.lang.Integer state)
      Sets the state of the specified business account to the given state.
      static void tcDescriptionSet(org.w3c.dom.Element argTCElement, java.lang.Long argTCId)
      Sets term and condition description.
      static java.lang.Long updateAccount(org.w3c.dom.Element argAccount, java.sql.Timestamp currentTime)
      Updates the business account based on the given account Element object (This method is for DTD based xml instance).
      static void validateAccount(java.lang.Long accountId, java.lang.Integer targetStoreId)
      Validate the business account.
      static void validateAccount(java.lang.Long accountId, java.lang.Integer targetStoreId, java.lang.String returnView, com.ibm.commerce.datatype.TypedProperty respProps)
      Validate the business account.
      static com.ibm.commerce.datatype.TypedProperty validateAccountAttributes(org.w3c.dom.Element accountElement, com.ibm.commerce.datatype.TypedProperty responseProperties, java.lang.String returnViewForTools, java.lang.String actionFlag)
      Validates the attributes and some of the child elements of the account element.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • CLASSNAME

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

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

      • AccountCmdUtil

        public AccountCmdUtil()
    • Method Detail

      • accountAttachmentSet

        public static void accountAttachmentSet(java.lang.Long argTradingId,
                                                org.w3c.dom.Element argAttachmentElement,
                                                java.lang.Long argOwnerId,
                                                java.lang.String argUsageId)
                                         throws javax.ejb.RemoveException
        Adds an attachment to the attachment table if the attachment does not exist yet, and create a relationship between the specified trading agreement and the attachment.
        Parameters:
        argAttachmentElement - the attachment Element object
        argTradingId - the ID of the trading agreement
        argOwnerId - the ID of the owner of the attachment
        argUsageId - the ID of the usage of the attachment
        Throws:
        javax.ejb.RemoveException
      • accountAttachmentSet

        public static void accountAttachmentSet(java.lang.Long argTradingId,
                                                java.lang.Long argOwnerId,
                                                java.lang.String usageId,
                                                java.lang.String uri,
                                                java.lang.String mimeType,
                                                java.lang.String mimeTypeEncoding)
        Adds an attachment to the attachment table if the attachment does not exist yet, and create a relationship between the specified trading agreement and the attachment.
        Parameters:
        argTradingId - id of the trading agreement
        argOwnerId - the id of the attachment's owner
        argUsageId - the id of the attachment usage
        uri - the attachment uri
        mimeType - the mime type of the attachment
        mimeTypeEncoding - the mime type encoding of the attachment
      • accountDescriptionSet

        public static void accountDescriptionSet(org.w3c.dom.Element argAccountDescElement,
                                                 java.lang.Long argAccountId,
                                                 java.sql.Timestamp currentTime)
                                          throws com.ibm.commerce.exception.ECApplicationException
        Adds or updates the business account description.
        Parameters:
        argAccountDescElement - the business account description Element object
        argAccountId - the ID of the business account
        currentTime - The Timestamp object represents the current time.
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_NUMBER_FORMAT_EXCEPTION if the language ID which provided in the description Element cannot converted the language ID to an Integer object
      • addParticipants

        public static void addParticipants(org.w3c.dom.NodeList argParticipants,
                                           java.lang.Long argTradingId,
                                           java.lang.Long argTCId,
                                           java.sql.Timestamp currentTime)
                                    throws com.ibm.commerce.contract.helper.TermCondCreateException,
                                           javax.ejb.RemoveException,
                                           com.ibm.commerce.exception.ECException
        Adds a participant to either trading agreement or terms and conditions
        Parameters:
        argParticipants - the list of the participant object
        argTradingId - the trading agreement ID
        argTCId - the term and condition ID
        currentTime - the Timestamp object of the current time
        Throws:
        javax.ejb.RemoveException
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_ACCOUNT_RESOLVE_PARTICIPANT_MEMBER_ID if the member ID of the participant cannot be resolved. Raised with message _ERR_TERM_CONDITION_PARTICIPANT_ROLE if the role of a term and condition participant is not "Buyer".
        com.ibm.commerce.contract.helper.TermCondCreateException
        com.ibm.commerce.exception.ECException
      • checkAccountHolderAndBuyers

        public static void checkAccountHolderAndBuyers(java.lang.Long anAccountId)
                                                throws com.ibm.commerce.exception.ECException
        Checks the account holder and buyer participants. This method checks the following: 1. the occurence of the AccountHolder participant 2. if the member ID of the AccountHolder is null 3. if the Buyer participants are the same or descendant of the AccountHolder participant 4. if the IDs of the Buyer participant are null 5. if the memeber type of a Buyer participant
        Parameters:
        anAccountId - the ID of the business account
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_ACCOUNT_PARTICIPANT_INVALID_MULTIPLICITY if there is no or more than one AccountHolder participant in the business account. Raised with message _ERR_ACCOUNT_PARTICIPANT_GENERIC_ERROR if the one of the cases 2, 3, 4, 5 happened.
      • checkAccountLastUpdated

        public static void checkAccountLastUpdated(java.lang.String accountId,
                                                   java.lang.String lastUpdatedTime,
                                                   com.ibm.commerce.datatype.TypedProperty responseProperties,
                                                   java.lang.String returnViewForTools)
                                            throws com.ibm.commerce.exception.ECApplicationException
        Checks the last updated time.
        Parameters:
        accountId - the ID of the business account
        lastUpdatedTime - The user provided last updated time of a trading agreement.
        responseProperties - the response property object
        returnViewForTools - the return view name for tools GUI
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_TRADING_HAS_BEEN_CHANGED if the utime and the lastUpdatedTims are not the same.
      • checkAccountParticipants

        public static void checkAccountParticipants(java.lang.Long anAccountId,
                                                    org.w3c.dom.NodeList aParticipants,
                                                    boolean bUpdateAccount)
                                             throws com.ibm.commerce.exception.ECException
        Checks the business account participants (This method is for DTD based xml instance). This method checks 1. the occurrence of a specific type of participant. In the default implementation the rules as the following: a. one and only one AccountHolder participant b. one and only one Seller participant c. one and only one BuyerContact participant 2. the memeber type of the participant. In the default implementation the rules are a. for AccountHolder and Seller participant, the member type of the participant has to be Organization. b. for SellerContact participant, the member type of the participant cannot be a member group c. for BuyerContact participant, the member type of the participant has to be User.
        Parameters:
        anAccountId - the ID of the business account
        aParticipant - the list of the participant Node element
        bUpdateAccount - the flag to indicate the action; true - updating; false - creating
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_ACCOUNT_PARTICIPANT_INVALID_MEMBER_TYPE if the member type of the participant is incorrect. Raised with message _ERR_ACCOUNT_PARTICIPANT_INVALID_MULTIPLICITY if the occurrence of a specific role of participant is incorrect.
      • checkXSDBasedAccountParticipants

        public static void checkXSDBasedAccountParticipants(java.lang.Long anAccountId,
                                                            org.w3c.dom.NodeList aParticipants,
                                                            boolean bUpdateAccount)
                                                     throws com.ibm.commerce.exception.ECException
        Checks the business account participants (This method is for XSD based xml instance). This method checks 1. the occurrence of a specific type of participant. In the default implementation the rules as the following: a. one and only one AccountHolder participant b. one and only one Seller participant c. one and only one BuyerContact participant 2. the memeber type of the participant. In the default implementation the rules are a. for AccountHolder and Seller participant, the member type of the participant has to be Organization. b. for SellerContact participant, the member type of the participant cannot be a member group c. for BuyerContact participant, the member type of the participant has to be User.
        Parameters:
        anAccountId - the ID of the business account
        aParticipant - the list of the participant Node element
        bUpdateAccount - the flag to indicate the action; true - updating; false - creating
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_ACCOUNT_PARTICIPANT_INVALID_MEMBER_TYPE if the member type of the participant is incorrect. Raised with message _ERR_ACCOUNT_PARTICIPANT_INVALID_MULTIPLICITY if the occurrence of a specific role of participant is incorrect.
      • createNewAccount

        public static java.lang.Long createNewAccount(org.w3c.dom.Element argAccount,
                                                      java.sql.Timestamp currentTime)
                                               throws com.ibm.commerce.contract.helper.TermCondCreateException,
                                                      com.ibm.commerce.exception.ECApplicationException,
                                                      java.sql.SQLException
        Creates the business account based on the given account Element object (This method is for DTD based xml instance).
        Parameters:
        argAccount - the business account Element object.
        currentTime - The Timestamp object represents the current time.
        Returns:
        the ID of the new created business account
        Throws:
        java.sql.SQLException
        com.ibm.commerce.exception.ECApplicationException
        com.ibm.commerce.contract.helper.TermCondCreateException
        See Also:
        getAccountOwnerIdFromAccountElement(Element aelmAccount), com.ibm.commerce.contract.util.ContractCmdUtil.getTimeFromElement(Element anElement, String tag, Timestamp time), getStoreIdFromAccountElement(Element aelmAccount), com.ibm.commerce.contract.util.ContractCmdUtil.getIntegerFromTrueOrFalse(String str), getAccountState(String state)
      • getAccountOwnerIdFromAccountElement

        public static java.lang.Long getAccountOwnerIdFromAccountElement(org.w3c.dom.Element aelmAccount)
                                                                  throws com.ibm.commerce.contract.helper.TermCondCreateException,
                                                                         com.ibm.commerce.exception.ECApplicationException
        Returns the business account owner ID (This method is for DTD based xml instance).
        Parameters:
        the - account Element object
        Returns:
        the ID of the business account owner
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_ACCOUNT_RESOLVE_OWNER_ID if the account owner ID cannot be resolved based on the information provided by the element object.
        com.ibm.commerce.contract.helper.TermCondCreateException
        See Also:
        ContractUtil.getMemberId(Element argMemberElement)
      • getAccountOwnerIdFromXSDAccountElement

        public static java.lang.Long getAccountOwnerIdFromXSDAccountElement(org.w3c.dom.Element accountUniqueKeyElm)
                                                                     throws com.ibm.commerce.contract.helper.TermCondCreateException,
                                                                            com.ibm.commerce.exception.ECApplicationException
        Returns the account owner id.
        Parameters:
        accountUniqueKeyElm - the account unique key Element object
        Returns:
        the ID of business account owner
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with the message _ERR_RETRIEVE_MEMBER_GROUP_ID if the membergroup id cannot be retrived. Raised with the message _ERR_RETRIEVE_USER_ID if the user id cannot be retrived.. Raised with the message _ERR_RETRIEVE_ORG_ID if the orgination id cannot be retrived.
        com.ibm.commerce.contract.helper.TermCondCreateException
        See Also:
        ContractUtil.getXSDMemberId(Element argElement)
      • getAccountParticipantRole

        public static java.lang.Integer getAccountParticipantRole(java.lang.String prty)
        Gets the participant role of a participant based on the given participant role string.
        Parameters:
        prty - the participant role type in String object
        Returns:
        the participant role type in Integer object
      • getAccountParticipantRoleInString

        public static java.lang.String getAccountParticipantRoleInString(java.lang.Integer index)
        Get the participant role of a participant based on the given participant role.
        Parameters:
        index - the participant role type in Integer object
        Returns:
        the pariticipant role type in String object
      • getAccountState

        public static java.lang.Integer getAccountState(com.ibm.commerce.payment.objects.AccountAccessBean abAccount)
        Gets the state of the business account.
        Parameters:
        abAccount - the AccountAccessBean of the business account
        Returns:
        the state of the business account
      • getAccountState

        public static java.lang.Integer getAccountState(java.lang.Long accountId)
        Gets the state of the specified business account.
        Parameters:
        accountId - the ID of the business account
        Returns:
        the state of the business account
      • getAccountState

        public static java.lang.Integer getAccountState(java.lang.String state)
        Gets the state of the business account based on the given business account state string.
        Parameters:
        the - business account state string
        Returns:
        the state of the business account in Integer object
      • getAccountStateInString

        public static java.lang.String getAccountStateInString(java.lang.Integer index)
        Gets the state of the business account based on the given business account state integer.
        Parameters:
        index - the state of the business account
        Returns:
        the state of the business account in String object
      • getMemberType

        public static java.lang.String getMemberType(org.w3c.dom.Element aelmParticipant)
                                              throws com.ibm.commerce.exception.ECException
        Returns the member type of the given participant (This method is for DTD based xml instance).
        Parameters:
        aelmParticipant - the participant Element object
        Returns:
        the member type of the participant
        Throws:
        com.ibm.commerce.exception.ECException
      • getNumberOfParticipants

        public static int getNumberOfParticipants(java.lang.Long anAccountId,
                                                  java.lang.Integer anRole)
                                           throws com.ibm.commerce.exception.ECException
        Returns the number of the participants in the given business account which has the specified role type.
        Parameters:
        anAccountId - the ID of the business account
        anRole - the role of the participant
        Returns:
        the number of the participant which has the role anRole in the given business account
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_FINDER_EXCEPTION if the FinderException occurred. Raised with message _ERR_NAMING_EXCEPTION if the NamingException occurred. Raised with message _ERR_REMOTE_EXCEPTION if the RemoteException occurred.
      • getParticipantMemberType

        public static java.lang.String getParticipantMemberType(org.w3c.dom.Element aelmParticipant)
        Returns the member type of the given participant (This method is for XSD based xml instance).
        Parameters:
        aelmParticipant - the participant Element object
        Returns:
        the member type of the participant
      • getStoreIdFromAccountElement

        public static java.lang.Integer getStoreIdFromAccountElement(org.w3c.dom.Element aelmAccount)
                                                              throws com.ibm.commerce.contract.helper.TermCondCreateException,
                                                                     com.ibm.commerce.exception.ECApplicationException
        Returns the ID of the store which business account belongs to (This method is for DTD based xml instance).
        Parameters:
        aelmAccount - the business account Element object
        Returns:
        the ID of the store
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_ACCOUNT_RESOLVE_STORE_OWNER_ID if the store owner ID cannot be resolved. Raised with message _ERR_ACCOUNT_RESOLVE_STORE_ID if the store ID cannot be resolved.
        com.ibm.commerce.contract.helper.TermCondCreateException
      • getStoreIdFromXSDBasedAccountElement

        public static java.lang.Integer getStoreIdFromXSDBasedAccountElement(org.w3c.dom.Element aelmAccount)
                                                                      throws com.ibm.commerce.contract.helper.TermCondCreateException,
                                                                             com.ibm.commerce.exception.ECApplicationException
        Returns the ID of the store which business account belongs to (This method is for DTD based xml instance).
        Parameters:
        aelmAccount - the business account Element object
        Returns:
        the ID of the store
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_ACCOUNT_RESOLVE_STORE_OWNER_ID if the store owner ID cannot be resolved. Raised with message _ERR_ACCOUNT_RESOLVE_STORE_ID if the store ID cannot be resolved.
        com.ibm.commerce.contract.helper.TermCondCreateException
      • getXMLDocumentObjectFromFile

        public static org.w3c.dom.Document getXMLDocumentObjectFromFile(java.lang.String xmlFileName)
                                                                 throws org.xml.sax.SAXParseException,
                                                                        java.io.FileNotFoundException,
                                                                        org.xml.sax.SAXException,
                                                                        java.io.IOException
        Gets the xml Document object based on the specified xml instance file name (This method is for DTD based xml instance).
        Parameters:
        xmlFileName - the name of the xml instance file
        Returns:
        the xml Document of the xml instance
        Throws:
        java.io.FileNotFoundException
        java.io.IOException
        org.xml.sax.SAXParseException
        org.xml.sax.SAXException
        See Also:
        ContractCmdUtil.getXMLDocumentObjectFromFile(String xmlFileName)
      • getXMLDocumentObjectFromReader

        public static org.w3c.dom.Document getXMLDocumentObjectFromReader(java.io.Reader reader)
                                                                   throws org.xml.sax.SAXException,
                                                                          java.io.IOException
        Gets the xml Document object based on the specified Reader object (This method is for DTD based xml instance).
        Parameters:
        reader - The Readed object includes the xml instance.
        Returns:
        the xml Document of the xml instance
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        See Also:
        ContractCmdUtil.getXMLDocumentObjectFromReader(Reader reader)
      • isDescendant

        public static boolean isDescendant(java.lang.Long anDescendantId,
                                           java.lang.Long anAncestorId)
                                    throws com.ibm.commerce.exception.ECException
        Checks if the first member ID is the descendant of the second member ID.
        Parameters:
        anDescendantId - the ID of the descendant
        anAncestorId - the ID of the ancestor
        Returns:
        true - the anDescendantId is the descendant of the anAncestorId; false otherwise
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_FINDER_EXCEPTION if the FinderException occurred. Raised with message _ERR_NAMING_EXCEPTION if the NamingException occurred. Raised with message _ERR_REMOTE_EXCEPTION if the RemoteException occurred.
      • isMemberGroup

        public static boolean isMemberGroup(java.lang.Long anMemberId)
                                     throws com.ibm.commerce.exception.ECException
        Checks if the given member ID is a member group
        Parameters:
        anMemberId - the ID of the member to be checked
        Returns:
        ture if the type of the member is a member group; false otherwise.
        Throws:
        com.ibm.commerce.exception.ECException - Raised with message _ERR_FINDER_EXCEPTION if the FinderException occurred. Raised with message _ERR_NAMING_EXCEPTION if the NamingException occurred. Raised with message _ERR_REMOTE_EXCEPTION if the RemoteException occurred. Raised with message _ERR_CREATE_EXCEPTION if the CreateException occurred.
      • saveAccount

        public static java.lang.Long saveAccount(org.w3c.dom.Element argAccount,
                                                 java.sql.Timestamp currentTime,
                                                 boolean actionFlag)
                                          throws com.ibm.commerce.contract.helper.TermCondCreateException,
                                                 com.ibm.commerce.exception.ECApplicationException,
                                                 java.sql.SQLException
        Saves the business account (This method is for XSD based xml instance). If the actionFlag is set to true, a new account will be created, otherwise the specified business account will be updated.
        Parameters:
        argAccount - the business account Element object
        currentTime - The Timestamp object represents the current time.
        actionFlag - the flag which indicates the action; true if it is creating; false updating.
        Returns:
        the ID of the business account
        Throws:
        java.sql.SQLException
        com.ibm.commerce.exception.ECApplicationException
        com.ibm.commerce.contract.helper.TermCondCreateException
        See Also:
        getAccountOwnerIdFromXSDAccountElement(Element accountUniqueKeyElm), com.ibm.commerce.contract.util.ContractCmdUtil.getTimeFromXSDElement(Element anElement, String tag, Timestamp time), getStoreIdFromXSDBasedAccountElement(Element aelmAccount), com.ibm.commerce.contract.util.ContractCmdUtil.getIntegerFromTrueOrFalse(String str), getAccountState(String state)
      • setAccountState

        public static void setAccountState(com.ibm.commerce.payment.objects.AccountAccessBean abAccount,
                                           java.lang.Integer state)
        Sets the state of the specified business account to the given state.
        Parameters:
        abAccount - the AccountAccessBean object of the specified business account
        state - the state of the business account to be
      • setAccountState

        public static void setAccountState(java.lang.Long accountId,
                                           java.lang.Integer state)
        Sets the state of the specified business account to the given state.
        Parameters:
        accountId - the ID of the business account
        state - the state of the business account to be
      • tcDescriptionSet

        public static void tcDescriptionSet(org.w3c.dom.Element argTCElement,
                                            java.lang.Long argTCId)
                                     throws com.ibm.commerce.exception.ECApplicationException
        Sets term and condition description.
        Parameters:
        tcDescElement - the term and condition description Element object
        argTCId - the term and condition ID
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_NUMBER_FORMAT_EXCEPTION if the language ID of the description cannot be resolved.
      • updateAccount

        public static java.lang.Long updateAccount(org.w3c.dom.Element argAccount,
                                                   java.sql.Timestamp currentTime)
                                            throws com.ibm.commerce.exception.ECException,
                                                   com.ibm.commerce.contract.helper.TermCondCreateException
        Updates the business account based on the given account Element object (This method is for DTD based xml instance).
        Parameters:
        argAccount - the business account Element object.
        currentTime - The Timestamp object represents the current time.
        Returns:
        the ID of the new created business account
        Throws:
        java.sql.SQLException
        com.ibm.commerce.exception.ECApplicationException
        com.ibm.commerce.exception.ECException
        com.ibm.commerce.contract.helper.TermCondCreateException
        See Also:
        getAccountOwnerIdFromAccountElement(Element aelmAccount), com.ibm.commerce.contract.util.ContractCmdUtil.getTimeFromElement(Element anElement, String tag, Timestamp time), getStoreIdFromAccountElement(Element aelmAccount), com.ibm.commerce.contract.util.ContractCmdUtil.getIntegerFromTrueOrFalse(String str), getAccountState(String state)
      • validateAccount

        public static void validateAccount(java.lang.Long accountId,
                                           java.lang.Integer targetStoreId)
                                    throws com.ibm.commerce.exception.ECApplicationException
        Validate the business account. The default implementation is empty.
        Parameters:
        accountId - the ID of the business account
        targetStoreId - the store ID
        Throws:
        com.ibm.commerce.exception.ECApplicationException
      • validateAccount

        public static void validateAccount(java.lang.Long accountId,
                                           java.lang.Integer targetStoreId,
                                           java.lang.String returnView,
                                           com.ibm.commerce.datatype.TypedProperty respProps)
                                    throws com.ibm.commerce.exception.ECApplicationException
        Validate the business account. The default implementation is empty.
        Parameters:
        accountId - the ID of the business account
        targetStoreId - the store ID
        returnView - the return view for the tools GUI
        respProps - the response properties
        Throws:
        com.ibm.commerce.exception.ECApplicationException
      • validateAccountAttributes

        public static com.ibm.commerce.datatype.TypedProperty validateAccountAttributes(org.w3c.dom.Element accountElement,
                                                                                        com.ibm.commerce.datatype.TypedProperty responseProperties,
                                                                                        java.lang.String returnViewForTools,
                                                                                        java.lang.String actionFlag)
                                                                                 throws com.ibm.commerce.exception.ECApplicationException
        Validates the attributes and some of the child elements of the account element.
        Parameters:
        accountElement - the account Element object
        responseProperties - the response properties
        returnViewForTools - the return view for tools GUI
        actionFlag - the action of calling command (AccountSave or AccountImport)
        Returns:
        an TypedProerty object, for creating NVP action (true), onwerId; For updating, action(false), accoountId
        Throws:
        com.ibm.commerce.exception.ECApplicationException - Raised with message _ERR_MISSING_ACCOUNT_NAME if the name of the account is missing or empty. Raised with message _ERR_ACCOUNT_REFERENCE_NUMBER_NOT_REQUIRED if the referenceNumber is provided for account importing Raised with message _ERR_DUPLICATED_ACCOUNT_NAME if there are some accounts existed which have the same name and owner ID. Raised with message _ERR_ACCOUNT_UPDATE if the account with same name and owner cannot be found in updating case.