com.ibm.commerce.utf.commands

Class RFQCreateCmdImpl

    • Field Detail

      • COPYRIGHT

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

      • RFQCreateCmdImpl

        public RFQCreateCmdImpl()
    • Method Detail

      • reset

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

        public void createBasicOffering()
                                 throws ECException
        Calls the CreateRFQBasicInfoCmd task command to create RFQ information.
        Throws:
        ECException
      • createItem

        public java.lang.Long createItem(java.lang.String itemname,
                                         java.lang.String shortdesc,
                                         java.lang.Long productid)
                                  throws ECException
        Calls the CreateRFQItemCmd task command to create a new item in the catalog.
        Parameters:
        itemname - The name of the item.
        shortdesc - A brief description of the item.
        productid - The identifier of the product which will be the parent catalog entry for this new item.
        Returns:
        The Long
        Throws:
        ECException
      • createRFQCatentryRel

        public void createRFQCatentryRel(java.lang.Long catentryId,
                                         java.math.BigDecimal price,
                                         java.lang.Double quantity,
                                         java.lang.String currency,
                                         java.lang.String qtyunit,
                                         java.lang.Double priceAdjust,
                                         java.lang.Long orderItemId,
                                         java.lang.Integer negotiationType,
                                         java.lang.Long customfield1,
                                         java.lang.Integer customfield2,
                                         java.lang.String customfield3,
                                         java.lang.String customfield4)
                                  throws ECException
        Calls the CreateRFQCatentryRel task command to create the association between an item and the RFQ .
        Parameters:
        catentryId - The identifier of the item.
        price - The price of the item as specified by the buyer who created the RFQ.
        quantity - The quantity of the item requested by the buyer.
        currency - The currency specified by the buyer.
        quantityUnit - An optional unit of measure for the quantity.
        priceAdjust - The percentage price of the item specified by the buyer who created the RFQ.
        orderItemId - The identifier of the order item.
        negotiationType - The negotiation type of the item specified by the buyer who created the RFQ.
        Throws:
        ECException
      • determineCatentryType

        public java.lang.String determineCatentryType(java.lang.Long catentryId)
                                               throws ECException
        Determines the type of a given catalog entry.
        Parameters:
        catentryId - The catalog entry identifier.
        Returns:
        The String Catentry Type
        Throws:
        ECException
      • doAcknowledgment

        public void doAcknowledgment()
                              throws ECException
        Composes and sends out the response to the browser
        Throws:
        ECException
      • getOriginalProducts

        public java.util.Vector getOriginalProducts()
        Returns a vector of identifiers of catalog entries that the RFQ buyer had picked.
        Returns:
        A vector of catalog entry identifiers.
      • performExecute

        public void performExecute()
                            throws ECException
        Creates the RFQ.
        This method does the following:
        1. Creates basic RFQ information by calling the createBasicOffering method.
        2. Keeps a backup of the list of products/items selected by the buyer in a vector.
        3. Creates associations between the RFQ and its items.
        4. Creates product attributes by calling the processProductAttributes method.
        5. Creates RFQ-level and product-level freeform comments by calling the processComments method.
        6. Calls the doAcknowledgment method to send back the response.
        Specified by:
        performExecute in interface ECCommand
        Specified by:
        performExecute in interface com.ibm.websphere.command.TargetableCommand
        Overrides:
        performExecute in class AbstractECTargetableCommand
        Throws:
        ECException
        See Also:
        ECCommand#performExecute()
      • processComments

        public void processComments()
                             throws ECException
        Processes freeform comments for the RFQ and each item in the RFQ.
        This method does the following:
        1. If the TC list is not empty, calls the CreateOrderCommentsTCCmd task command to create RFQ level freeform comments as terms and conditions of the type "OrderComments".
        2. If the list of product comments is not empty,calls the CreateOrderItemPAttributeTCCmd task command to create item level freeform comments as terms and conditions of the type "OrderItemPAttribute".

        Throws:
        ECException
      • processProductAttributes

        public void processProductAttributes()
                                      throws ECException
        Processes standard and personalized attributes for each item in the RFQ.
        This method does the following:
        1. Determines if the list of items for this RFQ is empty. If yes, returns without any action.
        2. If there is a list of items for this RFQ, does the following for each item in the RFQ:
          • Retrieves all the attributes specified for each item.For each attribute does the following:
            • Gets the value of the "userdefined" flag.
            • If "userdefined" is 0 and the buyer had originally chosen a product for which an item has been created under the covers, adds the attribute to a "standardAttr" vector.
            • If "userdefined" is 0 and the buyer had originally chosen an item, ignores the attribute.
            • If "userdefined" is 1, adds the attribute to a "personalizedAttr" vector.
          • If the "standardAttr" is not empty, call CreateRFQItemAttributeCmd task command to create one standard attribute for each vector element.
          • If the "personalizedAttr" is not empty, call CreateOrderItemPAttributeTCCmd task command to create one personalized attribute for each vector element.

        Throws:
        ECException
      • setOriginalProducts

        public void setOriginalProducts(java.util.Vector OriginalProducts)
        Sets a member variable to the incoming vector of catalog entry IDs. The catalog entry IDs correspond to the products or item selected by the RFQ buyer for this RFQ.
        Parameters:
        newNewItems - A vector of catalog entries.
      • updateCatentryIdInAllVectors

        public void updateCatentryIdInAllVectors(java.lang.Long originalProductId,
                                                 java.lang.Long itemId)
                                          throws ECException
        Replaces the occurrence of the first parameter originalProductId with the second parameter itemId in three lists : the product list, the product comments list and the product attributes list.
        When the buyer selects a product and associates it with the RFQ, it causes an item to be created under the covers. Every occurrence of the original product has to now be replaced by this new item. This method goes through all the incoming information that reference the product ID selected by the buyer and replaces them with the new item ID.
        Parameters:
        originalProductId - The ID of the product selected by the buyer.
        itemId - The ID of the new item that was created under the covers.
        Throws:
        ECException
      • validateParameters

        public void validateParameters()
                                throws ECException
        Checks for validity of incoming parameters.
        This method does the following:
        1. Calls the initParameters method to store the incoming request parameters in member variables .
        2. Checks if the specified RFQ start date & time are not in the past.
        3. Checks if the specified RFQ end date & time are not in the past.
        4. Checks if the specified RFQ end date & time are later than the specified RFQ start date and time.
        Specified by:
        validateParameters in interface ECCommand
        Overrides:
        validateParameters in class AbstractECTargetableCommand
        Throws:
        ECException
        See Also:
        ECCommand#validateParameters()