com.ibm.commerce.utf.commands

Class CreateOrderItemPAttributeTCCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CreateOrderItemPAttributeTCCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable


    public class CreateOrderItemPAttributeTCCmdImpl
    extends TaskCommandImpl
    implements CreateOrderItemPAttributeTCCmd
    Creates terms and conditions of type "OrderItemPAttribute".

    This command can be used to convert personalization attributes specified for each item. During the course of a negotiation, it enters Terms and Conditions associated with a trading agreement. When an order results from this trading agreement, these OrderItemPAttribute TCs will appear as personalized attributes for each order item.

    Behaviour

    The command loops through the list of personalized attributes and does the following for each attribute:

    1. Composes an XML element for an OrderItemPAttributeTC that conforms to the Trading DTD.
    2. Creates the OrderItemPAttribute Term and Condition object using the XML element and the supplied trading agreement ID.

    Exception conditions

    • If the trading agreement ID is not provided.
    • If the catalog entry ID is not provided.
    • If the list of personalization attributes is not provided.
    This is the default implementation of the CreateOrderItemPAttributeTCCmd. This command uses the following AccessBeans:
    See Also:
    Serialized Form
    • Field Detail

      • COPYRIGHT

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

        public java.lang.Long catentryId
        Catentry ID.
      • tradingId

        public java.lang.Long tradingId
        Trading ID.
      • attributeInfo

        public java.util.Vector attributeInfo
        Attribute if vector.
    • Constructor Detail

      • CreateOrderItemPAttributeTCCmdImpl

        public CreateOrderItemPAttributeTCCmdImpl()
        Default constructor.
    • Method Detail

      • reset

        public void reset()
        Reset the command.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
        Overrides:
        reset in class AbstractECTargetableCommand
      • getAttributeInfo

        public java.util.Vector getAttributeInfo()
        Retrieves the list of personalized attributes.
        Returns:
        The list of personalized attributes.
      • getCatentryId

        public java.lang.Long getCatentryId()
        Retrieves the catalog entry ID.
        Returns:
        The catalog entry ID.
      • getTradingId

        public java.lang.Long getTradingId()
        Retrieves the trading agreement ID.
        Returns:
        The trading agreement ID.
      • performExecute

        public void performExecute()
                            throws ECException
        Creates one OrderItemPAttribute TC for every incoming personalization attribute. This method does the following for every personalization attribute:
        • Determines if a value has been provided.
        • Creates an association between the catalog entry and the personalization attribute, if one does not already exist.
        • Composes an XML element for the OrderItempAttribute TC that conforms to the Trading DTD.
        • Creates the OrderItemPAttribute TC.

        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECApplicationException - If no value was provided for a personalization attribute.
        If an application error occurs while creating the TC.
        ECSystemException - If a system error occurs while creating the TC.
        ECException
        See Also:
        ECCommand#performExecute()
      • setAttributeInfo

        public void setAttributeInfo(java.util.Vector newAttributeInfo)
        Stores the list of personalization attributes that need to be converted into terms and conditions.
        Specified by:
        setAttributeInfo in interface CreateOrderItemPAttributeTCCmd
        Parameters:
        newAttrInfo - The list of personalization attributes.
      • setCatentryId

        public void setCatentryId(java.lang.Long newCatentryId)
        Stores the incoming catalog entry ID.
        Specified by:
        setCatentryId in interface CreateOrderItemPAttributeTCCmd
        Parameters:
        newCatentryid - The ID of the catalog entry.
      • setTradingId

        public void setTradingId(java.lang.Long newTradingId)
        Stores the incoming trading agreement ID.
        Specified by:
        setTradingId in interface CreateOrderItemPAttributeTCCmd
        Parameters:
        newTradingId - The ID of the trading agreement.
      • validateParameters

        public void validateParameters()
                                throws ECException
        This method does the following:
        1. Verifies that a trading agreement ID has been provided and exists.
        2. Verifies that a catalog entry ID has been provided.
        3. Verifies that a list of personalized attributes has been provided for the catalog entry.

        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECApplicationException -
        • If the trading agreement ID has not been provided.
        • If no trading agreement with the given ID exists.
        • If the catalog entry ID has not been provided.
        • If the list of personalized attributes has not been provided.
        ECException
        See Also:
        ECCommand#validateParameters()