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 and Description |
---|
OrderFacadeClient()
The default constructor of the class.
|
OrderFacadeClient(BusinessContextType businessContext, javax.security.auth.callback.CallbackHandler callbackHandler)
This method constructs an object by business context and call back handler.
|
Modifier and Type | Method and Description |
---|---|
java.util.Map | addConfigurationToCart(java.util.Map parameters)
This method adds a configuration of dynamic kit to shopping cart based on the enumerated parameters.
|
RespondOrderDataAreaType | addDynamicKitOrderItem(OrderType order, OrderItemType[] orderItems)
This method adds dynamic kit order items.
|
java.util.Map | addOrderItem(java.util.Map parameters)
This method adds an order item based on the enumerated parameters.
|
java.util.Map | addPreConfigurationToCart(java.util.Map parameters)
This method adds a pre-configuration of dynamic kit to shopping cart based on the enumerated parameters.
|
protected OrderItemType[] | buildDynamicKitOrderItem(java.util.Map parameters, java.lang.String actionName)
This method builds the order item objects for dynamic kits
|
protected OrderType | buildOrderStatus(java.util.Map parameters)
This method builds an order noun based on order status information in the passed map.
|
java.util.Map | cancelScheduledOrder(java.util.Map parameters)
This method cancels a scheduled order based on the enumerated parameters.
|
java.util.Map | changeReceipt(java.util.Map parameters)
This method populates parameters to a string array from the input then updates receipt information to order.
|
java.util.Map | deleteOrderItem(java.util.Map parameters)
This method deletes order items based on the enumerated parameters.
|
java.util.Map | findReceiptByOrderId(java.util.Map parameters)
This method find receipt information of the order based on the enumerated parameters.
|
protected int | getMaxShoppingCartSize()
This method returns the maximum count of order items that a shopping cart can contain.
|
protected java.lang.String[] | resovleParameterWithEnumerationGrp(java.util.HashMap paraTable, int count)
This method populates parameters to a string array from the input HashMap.
|
protected java.lang.String | retrieveKeyFromEnumerationKey(java.lang.String enumerationKey)
This method retrieves the original key from the enumerated key.
|
java.util.Map | scheduleOrder(java.util.Map parameters)
This method creates a scheduled order based on the enumerated parameters.
|
java.util.Map | updateConfigurationInCart(java.util.Map parameters)
This method updates configuration of a dynamic kit in shopping cart based on the enumerated parameters.
|
RespondOrderDataAreaType | updateDynamicKitOrderItem(OrderType order, OrderItemType[] orderItems)
This method updates dynamic kit order items.
|
java.util.Map | updateOrderGiftInfo(java.util.Map parameters)
This method updates the gift information of the order based on the enumerated parameters.
|
java.util.Map | updateOrderItem(java.util.Map parameters)
This method updates multiple order items of an order based on the enumerated parameters.
|
java.util.Map | updateOrderShippingInfo(java.util.Map parameters)
This method updates the shipping information of the order based on the enumerated parameters.
|
java.util.Map | updateOrderStatus(java.util.Map parameters)
This methods updates the Order status.
|
public OrderFacadeClient()
public OrderFacadeClient(BusinessContextType businessContext, javax.security.auth.callback.CallbackHandler callbackHandler)
public java.util.Map addOrderItem(java.util.Map parameters) throws OrderException
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");
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. 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.
public java.util.Map updateOrderItem(java.util.Map parameters) throws OrderException
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");
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.
public java.util.Map deleteOrderItem(java.util.Map parameters) throws OrderException
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");
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.
public java.util.Map updateOrderShippingInfo(java.util.Map parameters) throws OrderException
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");
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.
public java.util.Map updateOrderGiftInfo(java.util.Map parameters) throws OrderException
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");
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.
protected java.lang.String[] resovleParameterWithEnumerationGrp(java.util.HashMap paraTable, int count) throws OrderException
protected java.lang.String retrieveKeyFromEnumerationKey(java.lang.String enumerationKey)
protected OrderType buildOrderStatus(java.util.Map parameters)
public java.util.Map updateOrderStatus(java.util.Map parameters) throws OrderException
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);
public java.util.Map scheduleOrder(java.util.Map parameters) throws OrderException
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");
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.
public java.util.Map cancelScheduledOrder(java.util.Map parameters) throws OrderException
Map parameters = new HashMap(); parameters.put("orderId_0",new String[]{"10001"}); Map response = client.cancelScheduledOrder(parameters); String[] outorderId = (String[]) response.get("orderId");
orderId : The order ID to be canceled.
public java.util.Map changeReceipt(java.util.Map parameters) throws OrderException
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");
public java.util.Map findReceiptByOrderId(java.util.Map parameters) throws OrderException
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);
orderId : The order ID to be updated.
protected int getMaxShoppingCartSize()
public java.util.Map addPreConfigurationToCart(java.util.Map parameters) throws OrderException
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");
quantity: The quantity of the dynamic kit to be added. catEntryId: The catalog entry ID of the dynamic kit to be added.
public java.util.Map addConfigurationToCart(java.util.Map parameters) throws OrderException
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");
ConfigXML: The configuration XML of the dynamic kit to be added.
public java.util.Map updateConfigurationInCart(java.util.Map parameters) throws OrderException
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");
orderItemId: Id of the order item to be updated ConfigXML: The new configuration XML of the dynamic kit.
public RespondOrderDataAreaType addDynamicKitOrderItem(OrderType order, OrderItemType[] orderItems) throws OrderException
public RespondOrderDataAreaType updateDynamicKitOrderItem(OrderType order, OrderItemType[] orderItems) throws OrderException
protected OrderItemType[] buildDynamicKitOrderItem(java.util.Map parameters, java.lang.String actionName) throws OrderException