com.ibm.commerce.utf.commands

Class CreateRFQItemCmdImpl

  • All Implemented Interfaces:
    com.ibm.commerce.command.CacheableECCommand, ECCommand, ECTargetableCommand, TaskCommand, CreateRFQItemCmd, 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 CreateRFQItemCmdImpl
    extends TaskCommandImpl
    implements CreateRFQItemCmd
    This command creates a catalog entry for a "made-to-order" item requested via an RFQ.

    Behaviour

    1. Verifies that the mandatory parameters name , offeringId, ownerId, parentProductId are present.
    2. Generates a unique part number for the item, which is the string "RFQ" followed by the current timestamp.
    3. Creates the item object.
    4. Creates the catalog entry description object for the new item in the specified language. If a language identifier has not been provided, the language identifier from the command context will be used.
    5. Creates the catalog entry relationship between the item and the supplied parent product.

    Exception conditions

    • If the item name is not specified.
    • If the RFQ ID is not specified.
    • If the item owner is not specified.
    • If a parent Product ID is not specified.
    This is the default implementation of the CreateRFQItemCmd. 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
      • name

        public java.lang.String name
        Name.
      • offeringId

        public java.lang.Long offeringId
        Offering Id.
      • parentProductId

        public java.lang.Long parentProductId
        Parent Product Id.
      • shortDescription

        public java.lang.String shortDescription
        Short Description.
      • ownerId

        public java.lang.Long ownerId
        Owner Id.
      • itemId

        public java.lang.Long itemId
        Item Id.
      • languageId

        public java.lang.Integer languageId
        Language Id.
    • Constructor Detail

      • CreateRFQItemCmdImpl

        public CreateRFQItemCmdImpl()
        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
      • getItemId

        public java.lang.Long getItemId()
        Retrieves the ID of the newly created item.
        Specified by:
        getItemId in interface CreateRFQItemCmd
        Returns:
        The item ID.
      • getLanguageId

        public java.lang.Integer getLanguageId()
        Retrieves the language identifier.
        Returns:
        The language identifier.
      • getName

        public java.lang.String getName()
        Retrieves the name of the item.
        Returns:
        The item name.
      • getOfferingId

        public java.lang.Long getOfferingId()
        Retrieves the ID of the RFQ.
        Returns:
        The RFQ ID.
      • getOwnerId

        public java.lang.Long getOwnerId()
        Retrieves the member ID of the item owner.
        Returns:
        The item owner's member ID.
      • getParentProductId

        public java.lang.Long getParentProductId()
        Retrieves the ID of the parent product.
        Returns:
        The parent product reference number.
      • getShortDescription

        public java.lang.String getShortDescription()
        Retrieves the short description for the item.
        Returns:
        The short description.
      • performExecute

        public void performExecute()
                            throws ECException
        Creates the RFQ catalog entry relationship. This method does the following:
        1. Creates a new catalog entry for the item requested via an RFQ. The part number for this item is generated using the string "RFQ" and appending to it the current time in milliseconds.
        2. Creates a description for the new catalog entry in the specified language,
        3. Creates a catalog entry relationship between the created item and the supplied parent product.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECSystemException - If a system error occurs while creating the item.
        ECException
        See Also:
        ECCommand#performExecute()
      • setItemId

        public void setItemId(java.lang.Long newItemId)
        Stores the ID of the newly created item.
        Parameters:
        The - item ID.
      • setLanguageId

        public void setLanguageId(java.lang.Integer newLanguageId)
        Stores the language identifier.
        Specified by:
        setLanguageId in interface CreateRFQItemCmd
        Parameters:
        newLanguageId - The language identifier.
      • setName

        public void setName(java.lang.String newName)
        Stores the item name.
        Specified by:
        setName in interface CreateRFQItemCmd
        Parameters:
        newName - The name of the item.
      • setOfferingId

        public void setOfferingId(java.lang.Long newOfferingId)
        Stores the RFQ ID.
        Specified by:
        setOfferingId in interface CreateRFQItemCmd
        Parameters:
        newOfferingId - The RFQ ID.
      • setOwnerId

        public void setOwnerId(java.lang.Long newOwnerId)
        Stores the ID of the item owner.
        Specified by:
        setOwnerId in interface CreateRFQItemCmd
        Parameters:
        newOwnerId - The member ID of the item's owner.
      • setParentProductId

        public void setParentProductId(java.lang.Long newParentProductId)
        Stores the ID of the parent catalog entry under which this item has been created.
        Specified by:
        setParentProductId in interface CreateRFQItemCmd
        Parameters:
        newParentProductId - The parent product reference number.
      • setShortDescription

        public void setShortDescription(java.lang.String newShortDescription)
        Stores a brief description of the item.
        Specified by:
        setShortDescription in interface CreateRFQItemCmd
        Parameters:
        newShortDescription - The item's short description.
      • validateParameters

        public void validateParameters()
                                throws ECException
        This method does the following:
        1. Verifies that a name has been provided for the item.
        2. Verifies that the RFQ ID has been provided.
        3. Verifies that member ID has been provided for the RFQ owner.
        4. Verifies that parent product reference number has been provided.
        5. Checks if a language identifier has been specified. If not, set the languageId member variable to the language in the command context.

        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECApplicationException -
        • If the item name has not been provided.
        • If a member ID has not been provided for the item owner.
        • If a parent product ID has not been provided.
        ECException
        See Also:
        ECCommand#validateParameters()