com.ibm.commerce.order.facade.client

Class OrderFacadeClient

  • Direct Known Subclasses:
    DOMOrderFacadeClient


    public class OrderFacadeClient
    extends CommonOrderFacadeClient

    This class provides common methods that the order facade can use. This class also provides a set of convenient Java APIs to represent particular order operations. This set of Java APIs also includes APIs for Web-based requests to transform the name-value pair request into the appropriate request documents.

    • Constructor Detail

      • OrderFacadeClient

        public OrderFacadeClient()
        The default constructor of the class.
      • OrderFacadeClient

        public OrderFacadeClient(BusinessContextType businessContext,
                                 javax.security.auth.callback.CallbackHandler callbackHandler)
        This method constructs an object by business context and call back handler.
        Parameters:
        businessContext - the business context.
        callbackHandler - the call back handler.
    • Method Detail

      • addOrderItem

        public java.util.Map addOrderItem(java.util.Map parameters)
                                   throws OrderException
        This method adds an order item based on the enumerated parameters. It calls the CommonOrderFacadeClient#addOrderItem(Map) method to add the order items.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
                        parameters.put("quantity_0", new String[] { "3" });
                        parameters.put("catEntryId_0", new String[] { "10002"});
                        parameters.put("externalId_0", new String[] { "1000" });
                        parameters.put("giftMessage_0", new String[] { "Happy Birthday" });
              parameters.put("quantity_1", new String[] { "4" });
                        parameters.put("catEntryId_1", new String[] { "10003");
                        parameters.put("externalId_1", new String[] { "1001" });
                        parameters.put("giftMessage_1", new String[] { "A Wedding Gift" });
                        parameters.put("contractId", new String[] { "10001"});
                        parameters.put("UOM", new String[] { "C62" });
                parameters.put("attrName_0_0", new String[]{"10238"});
                        parameters.put("attrName_0_1", new String[]{"10239"});
                        parameters.put("attrName_0_2", new String[]{"10240"});
                        parameters.put("attrName_1_0", new String[]{"10235"});
                        parameters.put("attrName_1_1", new String[]{"10236"});
                        parameters.put("attrName_1_2", new String[]{"10237"});
              parameters.put("attrValue_0_0", new String[]{"Red"});
              parameters.put("attrValue_0_1", new String[]{"1"});
              parameters.put("attrValue_0_2", new String[]{"Dinner plate only"});
              parameters.put("attrValue_1_0", new String[]{"Red"});
              parameters.put("attrValue_1_1", new String[]{"1"});
              parameters.put("attrValue_1_2", new String[]{"5-piece setting"});
              
                    Map response = client.addOrderItem(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
                        String[] outOrderItemId = (String[]) response.get("orderItemId");
         
        Overrides:
        addOrderItem in class CommonOrderFacadeClient
        Parameters:
        parameters - The map that contains the orderId, quantity, catEntryId, contractId, UOM, externalId and giftMessage. The last two parameters, externalId and giftMessage are related with gift list. They should be put into the map when the order item is a gift which is purchased by the gift giver.
                    orderId : The order ID of the order to which the order item will be added; 
                              if no order ID is provided, the current pending order 
                                is used. Abbreviations can be used: '.' stands for current pending order,
                                '**' means to create a new order. 
                    quantity: The quantity of the added product. 
                    catEntryId: The catalog entry ID of the added product. 
                    contractId : The contract ID of the contract on which the order item addition is based.
                    UOM: The unit of measure of the order item.
                    externalId: The external gift list id.
                    giftMessage: The gift message along with the gift.
         
        Returns:
        The map that contains the orderId and orderItemId.
        orderId : The order ID to which the order item will be added.
        orderItemId: The order item ID to add.
        Throws:
        OrderException
      • updateOrderItem

        public java.util.Map updateOrderItem(java.util.Map parameters)
                                      throws OrderException
        This method updates multiple order items of an order based on the enumerated parameters. It calls the CommonOrderFacadeClient#updateOrderItem(Map) method to update the order items.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
                        parameters.put("quantity_0",new String[]{"30"});
                        parameters.put("orderItemId_0",new String[]{"10001");
                        parameters.put("shipToRegistrant_0", new String[]{"1"};
              parameters.put("quantity_1",new String[]{"40"});
                        parameters.put("orderItemId_1",new String[]{"10002");
              parameters.put("shipToRegistrant_1", new String[]{"1"};
                        parameters.put("contractId",new String[]{"10001"});
                        parameters.put("UOM",new String[]{"C62"});
              parameters.put("allocate", new String[] {"*aig,*ubg"});
              parameters.put("backorder", new String[] {"***"});
                        Map response = client.updateOrderItem(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
                        String[] outOrderItemId = (String[]) response.get("orderItemId");
         
        Overrides:
        updateOrderItem in class CommonOrderFacadeClient
        Parameters:
        parameters - The map that contains the quantity, orderId, orderItemId, contractId, UOM and shipToRegistrant .
                    orderId : An optional parameter which is the order ID that contains the updated order items. 
                    quantity: The quantity of the updated product. 
                    orderItemId: The order item ID to be updated. 
                    contractId: The contract ID of the contract on which the order item update is based. 
                    UOM: The unit of measure of the order item.
                    shipToRegistrant: A parameter indicating to ship the gift to register or shopper.
         
        Returns:
        The Map that contains the orderId and orderItemId.
        orderId : The order ID that contains the updated order items.
        orderItemId: The order item ID to update.
        Throws:
        OrderException
      • deleteOrderItem

        public java.util.Map deleteOrderItem(java.util.Map parameters)
                                      throws OrderException
        This method deletes order items based on the enumerated parameters. It calls the CommonOrderFacadeClient#deleteOrderItem(Map) method to delete the order items.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
                        parameters.put("orderItemId_0", new String[] { "10002" });
              parameters.put("orderItemId_1", new String[] { "10003" });
                        Map response = client.deleteOrderItem(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
         
        Overrides:
        deleteOrderItem in class CommonOrderFacadeClient
        Parameters:
        parameters - The map that contains the orderId and orderItemId.
                    orderId : An optional parameter that contains the order ID of the order from which the order item will be deleted.
                    orderItemId: The order item ID to delete.
         
        Returns:
        The Map that contains the orderId. orderId : The order ID from which the order item will be deleted.
        Throws:
        OrderException
      • updateOrderShippingInfo

        public java.util.Map updateOrderShippingInfo(java.util.Map parameters)
                                              throws OrderException
        This method updates the shipping information of the order based on the enumerated parameters. It calls the CommonOrderFacadeClient#updateOrderShippingInfo(Map) method to update the shipping information.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
                        parameters.put("ShipAsComplete",new String[]{"N"});
                        parameters.put("orderId",new String[]{"10001"});
                        parameters.put("requestedShipDate",new String[]{"2006-12-24T03:32:34.953Z"});
                        parameters.put("shipModeId_0",new String[]{"10001"});
              parameters.put("shipModeId_1",new String[]{"10002"});
                        parameters.put("addressId",new String[]{"11301"});
                        parameters.put("shipInstructions",new String[]{"hello"});
                        parameters.put("orderItemId_0",new String[]{"120001"});
              parameters.put("orderItemId_1",new String[]{"120002"});
              parameters.put("shipToRegistrant_0", new String[]{"1"};
              parameters.put("shipToRegistrant_1", new String[]{"1"};
              parameters.put("allocate", new String[] {"*aig,*ubg"});
              parameters.put("backorder", new String[] {"***"});
                        Map response = client.updateOrderShippingInfo(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
                        String[] outOrderItemId = (String[]) response.get("orderItemId");
         
        Overrides:
        updateOrderShippingInfo in class CommonOrderFacadeClient
        Parameters:
        parameters - The map that contains the following keys: ShipAsComplete, orderId, orderItemId, requestedShipDate, shipModeId, isExpedited, addressId, shipInstructions, tieShipCode, shipToRegistrant.
                    orderId : The order ID to be updated. 
                    orderItemId: The order item ID to be updated. 
                    ShipAsComplete: The flag to specify whether the order is shipped as complete. 
                    requestedShipDate : The requested ship date of the order item.
                    shipModeId: The ship mode ID.
                    isExpedited: The value to specify whether the ship information is expedited. 
                    addressId: The address ID.
                    shipInstructions: The ship instructions of the order.
                    tieShipCode: The tie ship code.
                    shipToRegistrant: A parameter indicating to ship the gift to register or shopper.
         
        Returns:
        The map that contains the orderId, and orderItemId.
        orderId : The order ID on which the ship information update is based.
        orderItemId: The updated order item ID.
        Throws:
        OrderException
      • updateOrderGiftInfo

        public java.util.Map updateOrderGiftInfo(java.util.Map parameters)
                                          throws OrderException
        This method updates the gift information of the order based on the enumerated parameters. The gift information for the order is specific for Gift Registry when the order is made by the gift sender to purchase gifts. It applies to all the gift items inside the order. It calls the CommonOrderFacadeClient#updateOrderShippingInfo(Map) method to update the gift information.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();     
                        parameters.put("orderId",new String[]{"10001"});
              parameters.put("giftMessage", new String[]{"Happy Birthday"};
              parameters.put("shipToRegistrant", new String[]{"1"};
                        Map response = client.updateOrderGiftInfo(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
                        String[] outOrderItemId = (String[]) response.get("orderItemId");
         
        Overrides:
        updateOrderGiftInfo in class CommonOrderFacadeClient
        Parameters:
        parameters - The map that contains the following keys: orderId, giftMessage, shipToRegistrant.
                    orderId : The order ID to be updated. 
                    giftMessage: A parameter indicating a gift message along with the gift.
                    shipToRegistrant: A parameter indicating to ship the gift to register or shopper.
         
        Returns:
        The map that contains the orderId, and orderItemId.
        orderId : The order ID on which the ship information update is based.
        orderItemId: The updated order item ID.
        Throws:
        OrderException
      • updateOrderStatus

        public java.util.Map updateOrderStatus(java.util.Map parameters)
                                        throws OrderException
        This methods updates the Order status. It transforms the specified parameter input into a request document to perform SyncOrder with an action of Update.
        The following sample code demonstrates how to compose the parameter map:
         Map mapOrderStatus = new HashMap();
         
         mapOrderStatus.put("orderId", orderId);
         mapOrderStatus.put("merchantOrderNumber", "MO001");
         mapOrderStatus.put("currency", "USD"); 
         mapOrderStatus.put("priceTotal", "100"); 
         mapOrderStatus.put("shippingTotal", "10");
         mapOrderStatus.put("taxTotal", "8");
         mapOrderStatus.put("shippingTaxTotal", "0.8");
         mapOrderStatus.put("orderStatus", "G"); 
         mapOrderStatus.put("comment", "Commet1"); 
         mapOrderStatus.put("placeDateTime", "2008-06-01T15:30:11.656Z"); 
         mapOrderStatus.put("lastUpdateTime", "2008-06-18T15:30:11.656Z"); 
         mapOrderStatus.put("sequenceNumber", "10");
         mapOrderStatus.put("requestShipDateTime", "2008-06-20 15:30:11.656");
         mapOrderStatus.put("shipCondtion", "SC");
         mapOrderStatus.put("shippingModeFlag", "O");
         
         Vector vecOrderItems = new Vector(orderItemIdOut.length);
         
         for(int i=0; i<orderItemIdOut.length; i++) { 
         Map mapOrderItemStatus = new HashMap(); 
         mapOrderItemStatus.put("orderItemId", orderItemIdOut[i]);
         mapOrderItemStatus.put("merchantItemNumber", "MOI00"+i);
         mapOrderItemStatus.put("partNumber", "FULO-0101");
         mapOrderItemStatus.put("quantityRequested", "9");
         mapOrderItemStatus.put("itemComment", "ItemComment"+i);
         mapOrderItemStatus.put("orderItemStatus", "G");
         mapOrderItemStatus.put("actualShipDateTime", "2008-06-05T15:30:11.656Z");
         mapOrderItemStatus.put("unitPrice", "1.20");
         mapOrderItemStatus.put("currency", "USD");
         mapOrderItemStatus.put("priceTotal", "58");
         mapOrderItemStatus.put("shippingTotal", "6");
         mapOrderItemStatus.put("taxTotal", "5");
         mapOrderItemStatus.put("shippingTaxTotal", "0.8");
         mapOrderItemStatus.put("requestShipDateTime", "2008-06-06T15:30:11.656Z");
         
         vecOrderItems.add(mapOrderItemStatus); }
         
         mapOrderStatus.put("itemsVector", vecOrderItems);
         
         
        Parameters:
        parameters - The parameters to format into the SyncOrder document.
        Returns:
        A map that contains the response parameters.
        Throws:
        OrderException - if an exception occurs.
      • scheduleOrder

        public java.util.Map scheduleOrder(java.util.Map parameters)
                                    throws OrderException
        This method creates a scheduled order based on the enumerated parameters. It calls the CommonOrderFacadeClient#scheduleOrder(Map) method to create the schedule order.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
                        parameters.put("orderId_0",new String[]{"10001"});
                        parameters.put("strStartDate_0",new String[]{"2006-12-24T03:32:34.953Z"});
              parameters.put("interval_0",new String[]{"10"});
                        Map response = client.scheduleOrder(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
         
        Overrides:
        scheduleOrder in class CommonOrderFacadeClient
        Parameters:
        parameters - The map that contains the following keys: orderId, strStartDate, interval.
                    orderId : The order ID to be updated. 
                    strStartDate: The startDate when this order will be placed. 
                    interval: At which time interval this order will be repeated placed. 
                                        The unit is second.
         
        Returns:
        The map that contains the orderId.
        orderId : The first scheduled order Id.
        Throws:
        OrderException
      • cancelScheduledOrder

        public java.util.Map cancelScheduledOrder(java.util.Map parameters)
                                           throws OrderException
        This method cancels a scheduled order based on the enumerated parameters. It calls the CommonOrderFacadeClient#cancelScheduledOrder(Map) method to cancel the schedule order.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
                        parameters.put("orderId_0",new String[]{"10001"});
                        Map response = client.cancelScheduledOrder(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
         
        Overrides:
        cancelScheduledOrder in class CommonOrderFacadeClient
        Parameters:
        parameters - The map that contains the following keys: orderId.
                    orderId : The order ID to be canceled.
         
        Returns:
        The map that contains the orderId.
        orderId : The canceled schedule order Id.
        Throws:
        OrderException
      • changeReceipt

        public java.util.Map changeReceipt(java.util.Map parameters)
                                    throws OrderException
        This method populates parameters to a string array from the input then updates receipt information to order.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
                        parameters.put("orderId",new String[]{"10001"});
                        parameters.put(OrderFacadeConstants.RECEIPT_TYPE,new String[]{"Company"});
                        parameters.put(OrderFacadeConstants.RECEIPT_TITLE,new String[]{"ABC Company"});
                        parameters.put(OrderFacadeConstants.RECEIPT_CONTENT,new String[]{"furniture"});
                        parameters.put(OrderFacadeConstants.RECEIPT_INSTRUCTION,new String[]{"One receipt for each item."});
                        parameters.put(OrderFacadeConstants.RECEIPT_ADDRESS_ID,new String[]{"10003"});
                        Map response = client.changeReceipt(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
         
        Parameters:
        parameters - The map that contains the one keys :
      • OrderFacadeConstants.ORDER_ID : the order Id. It is mandatory field.
      • OrderFacadeConstants.RECEIPT_ACTION : the action. It is mandatory field.
             OrderFacadeConstants.RECEIPT_ACTION_DISCARD for discard.
             OrderFacadeConstants.RECEIPT_ACTION_CHANGE for change.
      • OrderFacadeConstants.RECEIPT_TYPE : the receipt type. It is optional field.
      • OrderFacadeConstants.RECEIPT_TITLE : the receipt title. It is optional field.
      • OrderFacadeConstants.RECEIPT_CONTENT : the receipt content. It is optional field.
      • OrderFacadeConstants.RECEIPT_INSTRUCTION : the receipt instruction. It is optional field.
      • OrderFacadeConstants.RECEIPT_ADDRESS_ID : the receipt shipping address Id. It is optional field.
      • OrderFacadeConstants.RECEIPT_FIELD1 : the receipt extra field 1. It is optional field.
      • OrderFacadeConstants.RECEIPT_FIELD2 : the receipt extra field 2. It is optional field.
      • OrderFacadeConstants.RECEIPT_FIELD3 : the receipt extra field 3. It is optional field.
      • Returns:
        The map that contains
        orderId : The updated order Id.
        Throws:
        OrderException
      • findReceiptByOrderId

        public java.util.Map findReceiptByOrderId(java.util.Map parameters)
                                           throws OrderException
        This method find receipt information of the order based on the enumerated parameters.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
                        parameters.put("orderId",new String[]{"10001"});
                        Map response = client.findReceiptByOrderId(parameters);
                        String[] receiptType = (String[]) response.get(OrderReceiptConstants.RECEIPT_TYPE);
                        String[] receiptTitle = (String[]) response.get(OrderReceiptConstants.RECEIPT_TITLE);
                        String[] receiptContent = (String[]) response.get(OrderReceiptConstants.RECEIPT_CONTENT);
         
        Parameters:
        parameters - The map that contains the one keys :
                    orderId : The order ID to be updated.
         
        Returns:
        The map may contain
      • OrderReceiptConstants#RECEIPT_TYPE : the receipt type.
      • OrderReceiptConstants#RECEIPT_TITLE : the receipt title.
      • OrderReceiptConstants#RECEIPT_CONTENT : the receipt content.
      • OrderReceiptConstants#RECEIPT_INSTRUCTION : the receipt instruction.
      • OrderReceiptConstants#RECEIPT_ADDRESS_ID : the receipt shipping address Id.
      • OrderReceiptConstants#RECEIPT_FIELD1 : the receipt extra field 1.
      • OrderReceiptConstants#RECEIPT_FIELD2 : the receipt extra field 2.
      • OrderReceiptConstants#RECEIPT_FIELD3 : the receipt extra field 3.
      • Throws:
        OrderException
      • addPreConfigurationToCart

        public java.util.Map addPreConfigurationToCart(java.util.Map parameters)
                                                throws OrderException
        This method adds a pre-configuration of dynamic kit to shopping cart based on the enumerated parameters.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
              parameters.put("quantity_1", "3");
                        parameters.put("catEntryId_1", "2000001");
              
                    Map response = client.addPreConfigurationToCart(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
                        String[] outOrderItemId = (String[]) response.get("orderItemId");
         
        Parameters:
        parameters - The map that contains quantity and catEntryId
                    quantity: The quantity of the dynamic kit to be added. 
                    catEntryId: The catalog entry ID of the dynamic kit to be added. 
                    
        Returns:
        The map that contains the orderId and orderItemId.
        Throws:
        OrderException
      • addConfigurationToCart

        public java.util.Map addConfigurationToCart(java.util.Map parameters)
                                             throws OrderException
        This method adds a configuration of dynamic kit to shopping cart based on the enumerated parameters.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
              parameters.put("ConfigXML_1", configurationXML);
              
                    Map response = client.addConfigurationToCart(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
                        String[] outOrderItemId = (String[]) response.get("orderItemId");
         
        Parameters:
        parameters - The map that contains configurationXML
                    ConfigXML: The configuration XML of the dynamic kit to be added. 
                    
        Returns:
        The map that contains the orderId and orderItemId.
        Throws:
        OrderException
      • updateConfigurationInCart

        public java.util.Map updateConfigurationInCart(java.util.Map parameters)
                                                throws OrderException
        This method updates configuration of a dynamic kit in shopping cart based on the enumerated parameters.
        The following sample code demonstrates how to use the API:
                        Map parameters = new HashMap();
              parameters.put("orderItemId_1", orderItemId);
              parameters.put("ConfigXML_1", configurationXML);
              
                    Map response = client.updateConfigurationInCart(parameters);
                        String[] outorderId = (String[]) response.get("orderId");
                        String[] outOrderItemId = (String[]) response.get("orderItemId");
         
        Parameters:
        parameters - The map that contains orderItemId and configurationXML
                    orderItemId: Id of the order item to be updated
                    ConfigXML: The new configuration XML of the dynamic kit. 
                    
        Returns:
        The map that contains the orderId and orderItemId.
        Throws:
        OrderException
      • addDynamicKitOrderItem

        public RespondOrderDataAreaType addDynamicKitOrderItem(OrderType order,
                                                               OrderItemType[] orderItems)
                                                        throws OrderException
        This method adds dynamic kit order items.
        Parameters:
        order - The order to which the order items are added.
        orderItems - An array of order items to be added.
        Returns:
        The RespondOrderDataAreaType that contains the order Id and order item IDs.
        Throws:
        OrderException
      • updateDynamicKitOrderItem

        public RespondOrderDataAreaType updateDynamicKitOrderItem(OrderType order,
                                                                  OrderItemType[] orderItems)
                                                           throws OrderException
        This method updates dynamic kit order items.
        Parameters:
        order - The order in which the order items are updated.
        orderItems - An array of order items to be updated.
        Returns:
        The RespondOrderDataAreaType that contains the order Id and order item IDs.
        Throws:
        OrderException