com.ibm.commerce.integration.sterling.oms.util

Class SterlingOMSAPIHelper

  • java.lang.Object
    • com.ibm.commerce.integration.sterling.oms.util.SterlingOMSAPIHelper


  • public class SterlingOMSAPIHelper
    extends java.lang.Object
    This class gets Sterling integration settings and use com.ibm.commerce.integration.sterling.SterlingClientHelper to call sterling API.
    • Constructor Summary

      Constructors 
      Constructor and Description
      SterlingOMSAPIHelper(java.lang.String storeId)
      Constructor
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      org.apache.commons.json.JSONObject callScAPI_Json(java.util.Map paraMap, java.lang.String apiName)
      This method calls sterling API, and return output as JSON object.
      java.lang.String callScAPI_Str(java.util.Map paraMap, java.lang.String apiName)
      This method calls sterling API, and return output as JSON string.
      org.w3c.dom.Document callScAPI(java.util.Map paraMap, java.lang.String apiName)
      This method calls sterling API, and return output as type of org.w3c.dom.Document.
      org.w3c.dom.Document composeInputForGetCompleteOrderDetails(java.util.Map paraMap)
      This method constructs the input XML for calling sterling API getCompleteOrderDetails.
      org.w3c.dom.Document composeInputForGetOrderLineDetails(java.util.Map paraMap)
      This method constructs the input XML for calling sterling API getOrderLineDetails.
      static java.lang.String convertDocumentToString(org.w3c.dom.Document xmlDocument, boolean isWithIndent)
      This method converts a Document into a String.
      void createScClientHelperInstance(java.lang.String apiName)
      This method gets an instance of com.ibm.commerce.integration.sterling.oms.SterlingClientHelper.
      void createScClientHelperInstanceForService()
      This method gets an instance of com.ibm.commerce.integration.sterling.oms.SterlingClientHelper.
      org.w3c.dom.Document getCompleteOrderDetails(org.w3c.dom.Document input)
      This method calls the Sterling getCompleteOrderDetails API and returns the response.
      org.w3c.dom.Document getDataByService(org.w3c.dom.Document input, java.lang.String serviceName)
      This method calls the Sterling getCompleteOrderDetails API and returns the response.
      static java.util.Map<java.lang.String,com.ibm.commerce.catalog.facade.datatypes.CatalogEntryViewType> getItemAndCatentryMap()
      Gets the map for PartNumber and CatalogEntryView.
      org.w3c.dom.Document getOrderLineDetails(org.w3c.dom.Document input)
      This method calls the Sterling getOrderLineDetails API and returns the response.
      static void setItemAndCatentryMap(java.util.Map<java.lang.String,com.ibm.commerce.catalog.facade.datatypes.CatalogEntryViewType> inMap)
      Sets the map for PartNumber and CatalogEntryView.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • COPYRIGHT

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

        public static final java.lang.String API_NAME_GET_COMPLETE_ORDER_DETAILS
        The name for Sterling OMS getCompleteOrderDetails API
        See Also:
        Constant Field Values
      • API_NAME_GET_ORDER_LINE_DETAILS

        public static final java.lang.String API_NAME_GET_ORDER_LINE_DETAILS
        The name for Sterling OMS getOrderLineDetails API
        See Also:
        Constant Field Values
      • SERVICE_NAME_GET_COMPLETE_ORDER_DETAILS

        public static final java.lang.String SERVICE_NAME_GET_COMPLETE_ORDER_DETAILS
        The service name for Sterling OMS getCompleteOrderDetails API
        See Also:
        Constant Field Values
      • SERVICE_NAME_GET_ORDER_LINE_DETAILS

        public static final java.lang.String SERVICE_NAME_GET_ORDER_LINE_DETAILS
        The service name for Sterling OMS getOrderLineDetails API
        See Also:
        Constant Field Values
      • COMPONENT_NAME

        public static final java.lang.String COMPONENT_NAME
        The component name for Order
        See Also:
        Constant Field Values
    • Constructor Detail

      • SterlingOMSAPIHelper

        public SterlingOMSAPIHelper(java.lang.String storeId)
                             throws ECSystemException
        Constructor
        Parameters:
        storeId - The store ID. Can't be null or empty.
        Throws:
        ECSystemException
    • Method Detail

      • setItemAndCatentryMap

        public static void setItemAndCatentryMap(java.util.Map<java.lang.String,com.ibm.commerce.catalog.facade.datatypes.CatalogEntryViewType> inMap)
        Sets the map for PartNumber and CatalogEntryView.
        Parameters:
        inMap -
      • getItemAndCatentryMap

        public static java.util.Map<java.lang.String,com.ibm.commerce.catalog.facade.datatypes.CatalogEntryViewType> getItemAndCatentryMap()
        Gets the map for PartNumber and CatalogEntryView.
        Returns:
      • createScClientHelperInstance

        public void createScClientHelperInstance(java.lang.String apiName)
                                          throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        This method gets an instance of com.ibm.commerce.integration.sterling.oms.SterlingClientHelper.
        Parameters:
        apiName - The name of sterling API to be called. Can't be null or empty.
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
      • createScClientHelperInstanceForService

        public void createScClientHelperInstanceForService()
                                                    throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        This method gets an instance of com.ibm.commerce.integration.sterling.oms.SterlingClientHelper.
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
      • callScAPI

        public org.w3c.dom.Document callScAPI(java.util.Map paraMap,
                                              java.lang.String apiName)
                                       throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException,
                                              ECException
        This method calls sterling API, and return output as type of org.w3c.dom.Document.
        Parameters:
        paraMap - The map contains input parameters. Can't be null.
        apiName - The API name to be called. Can't be null or empty.
        Returns:
        The output XML of calling sterling API.
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        ECException
      • getCompleteOrderDetails

        public org.w3c.dom.Document getCompleteOrderDetails(org.w3c.dom.Document input)
                                                     throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        This method calls the Sterling getCompleteOrderDetails API and returns the response.
        createScClientHelperInstance(String apiName) must be invoked before calling this method.
        This method is for AuthorizationOnlyApiServlet call.
        Parameters:
        input - The input XML of sterling API getCompleteOrderDetails. Can't be null.
        Returns:
        The output XML of calling sterling API getCompleteOrderDetails.
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
      • getDataByService

        public org.w3c.dom.Document getDataByService(org.w3c.dom.Document input,
                                                     java.lang.String serviceName)
                                              throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        This method calls the Sterling getCompleteOrderDetails API and returns the response.
        createScClientHelperInstance(String apiName) must be invoked before calling this method.
        This method is for AuthorizationOnlyApiServlet call.
        Parameters:
        input - The input XML of sterling API getCompleteOrderDetails. Can't be null.
        serviceName - The service name that will be called.
        Returns:
        The output XML of calling sterling API getCompleteOrderDetails.
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
      • getOrderLineDetails

        public org.w3c.dom.Document getOrderLineDetails(org.w3c.dom.Document input)
                                                 throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        This method calls the Sterling getOrderLineDetails API and returns the response.
        createScClientHelperInstance(String apiName) must be invoked before calling this method.
        This method is for AuthorizationOnlyApiServlet call.
        Parameters:
        input - The input XML of sterling API getOrderLineDetails. Can't be null.
        Returns:
        The output XML of calling sterling API getOrderLineDetails.
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
      • composeInputForGetCompleteOrderDetails

        public org.w3c.dom.Document composeInputForGetCompleteOrderDetails(java.util.Map paraMap)
                                                                    throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        This method constructs the input XML for calling sterling API getCompleteOrderDetails.
        Parameters:
        paraMap - The map contains input parameters. Can't be null.
        Returns:
        The input XML for sterling API getCompleteOrderDetails.
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
      • composeInputForGetOrderLineDetails

        public org.w3c.dom.Document composeInputForGetOrderLineDetails(java.util.Map paraMap)
                                                                throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        This method constructs the input XML for calling sterling API getOrderLineDetails.
        Parameters:
        paraMap - The map contains input parameters. Can't be null.
        Returns:
        The input XML for sterling API getOrderLineDetails.
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
      • callScAPI_Str

        public java.lang.String callScAPI_Str(java.util.Map paraMap,
                                              java.lang.String apiName)
                                       throws com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException,
                                              ECException
        This method calls sterling API, and return output as JSON string.
        Parameters:
        paraMap - The map contains input parameters. Can't be null.
        apiName - The API name to be called. Can't be null or empty.
        Returns:
        The output of calling sterling API in the format of JSON string.
        Throws:
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        ECException
      • callScAPI_Json

        public org.apache.commons.json.JSONObject callScAPI_Json(java.util.Map paraMap,
                                                                 java.lang.String apiName)
                                                          throws ECException,
                                                                 com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
        This method calls sterling API, and return output as JSON object.
        Parameters:
        paraMap - The map contains input parameters. Can't be null.
        apiName - The API name to be called. Can't be null or empty.
        Returns:
        The output of calling sterling API in the format of JSON object.
        Throws:
        ECException
        com.ibm.commerce.foundation.internal.common.exception.FoundationApplicationException
      • convertDocumentToString

        public static java.lang.String convertDocumentToString(org.w3c.dom.Document xmlDocument,
                                                               boolean isWithIndent)
        This method converts a Document into a String.
        Parameters:
        xmlDocument - The document to convert into a String. Can't be null.
        isWithIndent - A flag to indicate whether indent is included in the output string.
        Returns:
        The string representation of the input Document.