com.ibm.commerce.rest.bod.helpers

Class BODActionHelper

  • java.lang.Object
    • com.ibm.commerce.rest.bod.helpers.BODActionHelper


  • public class BODActionHelper
    extends java.lang.Object
    This class provides helper methods for BOD transformation.
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String COPYRIGHT
      IBM Copyright notice field.
    • Constructor Summary

      Constructors 
      Constructor and Description
      BODActionHelper() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void checkError(commonj.sdo.DataObject dataArea, java.lang.String noun)
      Check error and throw AbstractBusinessObjectDocumentException
      static BusinessObjectDocumentType createBusinessObjectDocument(java.util.Map<java.lang.String,java.lang.Object> requestMap, java.lang.String resourceName, java.lang.String urlParamGrpName, java.lang.String verb, java.lang.String actionCode)
      Create a Business Object Document based on requestMap and BOD mapping configuration.
      static java.util.Map<java.lang.String,java.lang.String[]> transformRequestMap(java.util.Map<java.lang.String,java.lang.Object> requestMap, java.lang.String prefix)
      This recursive method transforms the structured request Map to a flattened map so that we can easily compare with URLParameter mappings.
      • 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
    • Constructor Detail

      • BODActionHelper

        public BODActionHelper()
    • Method Detail

      • createBusinessObjectDocument

        public static BusinessObjectDocumentType createBusinessObjectDocument(java.util.Map<java.lang.String,java.lang.Object> requestMap,
                                                                              java.lang.String resourceName,
                                                                              java.lang.String urlParamGrpName,
                                                                              java.lang.String verb,
                                                                              java.lang.String actionCode)
                                                                       throws java.lang.Exception
        Create a Business Object Document based on requestMap and BOD mapping configuration.
        Parameters:
        requestMap - Request map
        resourceName - Resource name
        urlParamGrpName - URLParameterGroup name
        verb - Verb
        actionCode - Action code
        Returns:
        BusinessObjectDocument
        Throws:
        java.lang.Exception - Throw an exception is something is wrong
      • transformRequestMap

        public static java.util.Map<java.lang.String,java.lang.String[]> transformRequestMap(java.util.Map<java.lang.String,java.lang.Object> requestMap,
                                                                                             java.lang.String prefix)
        This recursive method transforms the structured request Map to a flattened map so that we can easily compare with URLParameter mappings.
        Parameters:
        requestMap - The JSON Map from REST Services request
        prefix - The prefix used to build flattened map.
        Returns:
        A java.util.Map object that represents the request. The key is a String (e.g., orderItem.0/itemAttributes.0) and the value is String[].