com.ibm.commerce.contract.util

Class ContractTCFactory

  • java.lang.Object
    • com.ibm.commerce.contract.util.ContractTCFactory


  • public class ContractTCFactory
    extends java.lang.Object
    This is a utility class for terms and conditions related process.
    • Field Summary

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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.Long createNewTC(java.lang.Long argTradingId, org.w3c.dom.Element argTCElement)
      Creates a new term and condition into the specified trading agreement.
      static java.lang.String getTCAccessBeanClassName(org.w3c.dom.Element argTCElement)
      Gets the AccessBean class name of a term and condition based on the given term condition Element object.
      static java.lang.String getTCAccessBeanClassName(java.lang.String argTCSubType)
      Gets the AccessBean class name of a term and condition on the given term condition sub-type.
      static void processTC(java.lang.Long argTradingId, org.w3c.dom.Element argTCElement, java.sql.Timestamp currentTime)
      Creates or updates a term and condition.
      static java.lang.Long processTC(java.lang.Long argTradingId, org.w3c.dom.Element argTCElement, java.sql.Timestamp currentTime, boolean isCreate)
      Creates or updates a term and condition.
      static void updateTC(java.lang.String argTCId, org.w3c.dom.Element argTCElement)
      Updates a term and condition.
      • 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 command.
        See Also:
        Constant Field Values
      • COPYRIGHT

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

      • createNewTC

        public static java.lang.Long createNewTC(java.lang.Long argTradingId,
                                                 org.w3c.dom.Element argTCElement)
                                          throws com.ibm.commerce.exception.ECApplicationException,
                                                 javax.naming.NamingException,
                                                 java.rmi.RemoteException,
                                                 javax.ejb.CreateException,
                                                 javax.ejb.RemoveException,
                                                 java.sql.SQLException,
                                                 java.lang.Exception
        Creates a new term and condition into the specified trading agreement.
        Parameters:
        argTradingId - the trading agreement ID
        argTCElement - the term and condtion Element object
        Returns:
        the ID of the new created term and condition
        Throws:
        java.rmi.RemoteException.
        javax.naming.NamingException.
        javax.ejb.CreateException.
        javax.ejb.FinderException.
        javax.ejb.RemoveException.
        java.sql.SQLException.
        com.ibm.commerce.exception.ECApplicationException. - Raised with message _ERR_RETRIEVE_STORE_ID if the store id cannot be retrived 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 retrived 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.
        java.lang.Exception - any other exceptions
        com.ibm.commerce.exception.ECApplicationException
        javax.naming.NamingException
        java.rmi.RemoteException
        javax.ejb.CreateException
        javax.ejb.RemoveException
        java.sql.SQLException
      • getTCAccessBeanClassName

        public static java.lang.String getTCAccessBeanClassName(org.w3c.dom.Element argTCElement)
                                                         throws javax.naming.NamingException,
                                                                java.rmi.RemoteException,
                                                                javax.ejb.CreateException,
                                                                java.sql.SQLException
        Gets the AccessBean class name of a term and condition based on the given term condition Element object.
        Parameters:
        argTCElement - the term and condition Element object which includes the term and condition information
        Returns:
        the class name of the AccessBean
        Throws:
        javax.naming.NamingException.
        javax.ejb.CreateException.
        javax.ejb.FinderException.
        java.sql.SQLException.
        javax.naming.NamingException
        java.rmi.RemoteException
        javax.ejb.CreateException
        java.sql.SQLException
      • getTCAccessBeanClassName

        public static java.lang.String getTCAccessBeanClassName(java.lang.String argTCSubType)
                                                         throws javax.naming.NamingException,
                                                                java.sql.SQLException
        Gets the AccessBean class name of a term and condition on the given term condition sub-type.
        Parameters:
        argTCSubType - the term and condition sub-type
        Returns:
        the class name of the AccessBean
        Throws:
        javax.naming.NamingException.
        javax.ejb.CreateException.
        javax.ejb.FinderException.
        java.sql.SQLException.
        javax.naming.NamingException
        java.sql.SQLException
      • processTC

        public static void processTC(java.lang.Long argTradingId,
                                     org.w3c.dom.Element argTCElement,
                                     java.sql.Timestamp currentTime)
                              throws javax.ejb.CreateException,
                                     javax.naming.NamingException,
                                     java.rmi.RemoteException,
                                     com.ibm.commerce.exception.ECException,
                                     javax.ejb.RemoveException,
                                     java.sql.SQLException
        Creates or updates a term and condition. It is used by DTD.
        Parameters:
        argTCElement - the term and condition Element object
        argTradingId - the trading agreement ID which the term and condition will be added to
        currentTime - the Timestamp object for current time
        Throws:
        java.rmi.RemoteException.
        javax.naming.NamingException.
        javax.ejb.CreateException.
        javax.ejb.FinderException.
        javax.ejb.RemoveException.
        java.sql.SQLException.
        com.ibm.commerce.exception.ECException.
        javax.ejb.CreateException
        javax.naming.NamingException
        java.rmi.RemoteException
        com.ibm.commerce.exception.ECException
        javax.ejb.RemoveException
        java.sql.SQLException
        See Also:
        createNewTC(Long argTradingId, org.w3c.dom.Element argTCElement), updateTC(String argTCId, org.w3c.dom.Element argTCElement), ContractCmdUtil.tcDescriptionSet(argTCElement, argTCId)
      • processTC

        public static java.lang.Long processTC(java.lang.Long argTradingId,
                                               org.w3c.dom.Element argTCElement,
                                               java.sql.Timestamp currentTime,
                                               boolean isCreate)
                                        throws javax.ejb.CreateException,
                                               javax.naming.NamingException,
                                               java.rmi.RemoteException,
                                               com.ibm.commerce.exception.ECException,
                                               javax.ejb.RemoveException,
                                               java.sql.SQLException
        Creates or updates a term and condition. It is used by XSD based contract xml.
        Parameters:
        argTCElement - the term and condition Element object
        argTradingId - the trading agreement ID which the term and condition will be added to
        currentTime - the Timestamp object for current time
        isCreate - the flag to indicate the action. true - create, false - update
        Returns:
        the ID of the term and condtion
        Throws:
        java.rmi.RemoteException.
        javax.naming.NamingException.
        javax.ejb.CreateException.
        javax.ejb.FinderException.
        javax.ejb.RemoveException.
        java.sql.SQLException.
        com.ibm.commerce.exception.ECException.
        javax.ejb.CreateException
        javax.naming.NamingException
        java.rmi.RemoteException
        com.ibm.commerce.exception.ECException
        javax.ejb.RemoveException
        java.sql.SQLException
        See Also:
        createNewTC(Long argTradingId, org.w3c.dom.Element argTCElement), updateTC(String argTCId, org.w3c.dom.Element argTCElement), ContractCmdUtil.TermConditionDescriptionSet(tcDescElement, tcId, currentTime), ContractCmdUtil.addParticipants(tcParticipants, null, tcId, currentTime)
      • updateTC

        public static void updateTC(java.lang.String argTCId,
                                    org.w3c.dom.Element argTCElement)
                             throws javax.ejb.CreateException,
                                    javax.naming.NamingException,
                                    java.rmi.RemoteException,
                                    javax.ejb.RemoveException,
                                    com.ibm.commerce.exception.ECApplicationException
        Updates a term and condition.
        Parameters:
        argTCId - the ID of the term and condition
        argTCElement - the term and condition Element object
        Throws:
        java.rmi.RemoteException.
        javax.ejb.CreateException.
        javax.ejb.FinderException.
        javax.naming.NamingException.
        javax.ejb.RemoveException
        com.ibm.commerce.exception.ECApplicationException. - Raised with message _ERR_RETRIEVE_STORE_ID if the store id cannot be retrived 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 retrived 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.
        javax.ejb.CreateException
        javax.naming.NamingException
        java.rmi.RemoteException
        com.ibm.commerce.exception.ECApplicationException