com.ibm.commerce.marketing.dialog.util

Class MarketingUtilClient

  • java.lang.Object
    • com.ibm.commerce.marketing.dialog.util.MarketingUtilClient
  • Direct Known Subclasses:
    MarketingUtil


    public class MarketingUtilClient
    extends java.lang.Object
    This class provides utility methods to manage the trigger parameters string, and other common shared functions. This class contains constants used by the marketing facade and the marketing runtime.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static java.lang.String createTriggerParametersString(java.lang.String userId, java.lang.Integer storeId, java.lang.String personalizationId)
      This method creates a string representation of the trigger parameters.
      static java.lang.String createTriggerParametersString(java.lang.String emsName, java.lang.String commandName, java.lang.String queryString, java.lang.String referralURL, java.lang.String customInformation)
      This method creates a string representation of the trigger parameters.
      static java.util.Map getTriggerParameters(java.lang.String queryString)
      This method extracts the request parameters from a query string and converts it to a Map object.
      static java.util.Map getTriggerParametersMap(java.lang.String queryString, boolean decodeValue)
      This method extracts the request parameters from a query string and converts it to a Map object.
      static java.lang.String getTriggerParametersString(java.util.Map triggerParameterMap, boolean maskValues)
      This method extracts the request parameters from a Map object and converts it to a String object.
      static void traceTriggerParameters(java.util.Map triggerParameters)
      This method will log the trigger parameters to the trace file.
      static void traceTriggerParameters(java.lang.String triggerParameters)
      This method will log the trigger parameters to the trace file.
      • Methods inherited from class java.lang.Object

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

      • TRIGGER_PARAM_PERSONALIZATION_ID

        public static final java.lang.String TRIGGER_PARAM_PERSONALIZATION_ID
        Constant for the parameter for the user's personalization ID. This is used in the trigger parameters string. It usually is determined by the marketing services, but it can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_MEMBER_ID

        public static final java.lang.String TRIGGER_PARAM_MEMBER_ID
        Constant for the parameter for the user's member ID. This is used in the trigger parameters string. It is determined by the marketing services.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_EMS_NAME

        public static final java.lang.String TRIGGER_PARAM_EMS_NAME
        Constant for the parameter for the EMarketingSpot ID. This is used in the trigger parameters string. It needs to be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_EMS_USAGE

        public static final java.lang.String TRIGGER_PARAM_EMS_USAGE
        Constant for the parameter for the EMarketingSpot usage type. This is used in the trigger parameters string. It is an optiona parameter for the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_STORE_ID

        public static final java.lang.String TRIGGER_PARAM_STORE_ID
        Constant for the parameter for the store ID. This is used in the trigger parameters string. It is determined by the marketing services.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_REQUEST_COMMAND

        public static final java.lang.String TRIGGER_PARAM_REQUEST_COMMAND
        Constant for the parameter for the current request command information. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_REQUEST_PARAMETERS

        public static final java.lang.String TRIGGER_PARAM_REQUEST_PARAMETERS
        Constant for the parameter for the current request parameter information. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_REFERRAL_URL

        public static final java.lang.String TRIGGER_PARAM_REFERRAL_URL
        Constant for the parameter for the current request's referral url. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_DEVICE_CLASS

        public static final java.lang.String TRIGGER_PARAM_DEVICE_CLASS
        Constant for the parameter to specify a device classification. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_CURRENT_CATALOG

        public static final java.lang.String TRIGGER_PARAM_CURRENT_CATALOG
        Constant for the parameter for the current catalog. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_CURRENT_CATEGORY

        public static final java.lang.String TRIGGER_PARAM_CURRENT_CATEGORY
        Constant for the parameter for the current category. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_CURRENT_PRODUCT

        public static final java.lang.String TRIGGER_PARAM_CURRENT_PRODUCT
        Constant for the parameter for the current product. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_NUMBER_CATEGORIES_TO_DISPLAY

        public static final java.lang.String TRIGGER_PARAM_NUMBER_CATEGORIES_TO_DISPLAY
        Constant for the parameter for the number of categories to display in an e-Marketing Spot. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_NUMBER_PRODUCTS_TO_DISPLAY

        public static final java.lang.String TRIGGER_PARAM_NUMBER_PRODUCTS_TO_DISPLAY
        Constant for the parameter for the number of products to display in an e-Marketing Spot. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_NUMBER_CONTENT_TO_DISPLAY

        public static final java.lang.String TRIGGER_PARAM_NUMBER_CONTENT_TO_DISPLAY
        Constant for the parameter for the number of marketing content to display in an e-Marketing Spot. This is used in the trigger parameters string. It can be passed in the Get MarketingSpotData service call.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_LIKE_MINDS_ENGINE_TYPE

        public static final java.lang.String TRIGGER_PARAM_LIKE_MINDS_ENGINE_TYPE
        Constant for the LikeMinds engine type.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_LIKE_MINDS_SORT_ORDER

        public static final java.lang.String TRIGGER_PARAM_LIKE_MINDS_SORT_ORDER
        Constant for the LikeMinds sort order.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_LIKE_MINDS_ALLOW_DEFAULT

        public static final java.lang.String TRIGGER_PARAM_LIKE_MINDS_ALLOW_DEFAULT
        Constant if the LikeMinds default recommendation is allowed.
        See Also:
        Constant Field Values
      • TRIGGER_PARAM_LIKE_MINDS_BASE_ITEMS

        public static final java.lang.String TRIGGER_PARAM_LIKE_MINDS_BASE_ITEMS
        Constant for the LikeMinds base items.
        See Also:
        Constant Field Values
      • NAME_VALUE_EQUALS

        public static final java.lang.String NAME_VALUE_EQUALS
        Constant for a name value pair.
        See Also:
        Constant Field Values
      • NEXT_TRIGGER_PARAMETER

        public static final java.lang.String NEXT_TRIGGER_PARAMETER
        Constant for separating name value pairs.
        See Also:
        Constant Field Values
      • UTF8_ENCODING

        public static final java.lang.String UTF8_ENCODING
        Constant for UTF-8 encoding.
        See Also:
        Constant Field Values
      • COMMA

        public static final java.lang.String COMMA
        Constant representing the separator of data tokens.
        See Also:
        Constant Field Values
      • EMPTY_STRING

        public static final java.lang.String EMPTY_STRING
        Constant representing an empty string.
        See Also:
        Constant Field Values
      • DASH

        public static final java.lang.String DASH
        Constant representing a dash.
        See Also:
        Constant Field Values
      • SLASH

        public static final java.lang.String SLASH
        Constant representing a slash.
        See Also:
        Constant Field Values
      • QUOTE

        public static final java.lang.String QUOTE
        Constant representing a quote.
        See Also:
        Constant Field Values
      • MULTIPLE_PARAMETERS

        public static final java.lang.String MULTIPLE_PARAMETERS
        Constant for the prefix of the parameter name created when a request has multiple values for an individual parameter
        See Also:
        Constant Field Values
      • NUMERIC_EXPRESSION

        public static final java.lang.String NUMERIC_EXPRESSION
        Constant to specify the expression to determine if a string is representing a valid numeric.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MarketingUtilClient

        public MarketingUtilClient()
    • Method Detail

      • createTriggerParametersString

        public static java.lang.String createTriggerParametersString(java.lang.String emsName,
                                                                     java.lang.String commandName,
                                                                     java.lang.String queryString,
                                                                     java.lang.String referralURL,
                                                                     java.lang.String customInformation)
        This method creates a string representation of the trigger parameters. These parameters are passed to the marketing runtime and campaign element commands.
        Parameters:
        emsName - The name of the EMarketingSpot the customer is viewing.
        commandName - The requested command.
        queryString - The query string on the URL.
        referralURL - The referral URL of this request.
        customInformation - The custom information to include in the user identifier xml.
        Returns:
        The string representation of the trigger parameters.
      • createTriggerParametersString

        public static java.lang.String createTriggerParametersString(java.lang.String userId,
                                                                     java.lang.Integer storeId,
                                                                     java.lang.String personalizationId)
        This method creates a string representation of the trigger parameters. These parameters are passed to the marketing runtime and campaign element commands.
        Parameters:
        userId - The member ID of the customer.
        storeId - The store ID.
        personalizationId - The personalization ID of the customer.
        Returns:
        The string representation of the trigger parameters.
      • traceTriggerParameters

        public static void traceTriggerParameters(java.lang.String triggerParameters)
        This method will log the trigger parameters to the trace file. It will mask any sensitive parameters that are in the parameters.
        Parameters:
        triggerParameters - The trigger parameters to log in the trace file.
      • traceTriggerParameters

        public static void traceTriggerParameters(java.util.Map triggerParameters)
        This method will log the trigger parameters to the trace file. It will mask any sensitive parameters that are in the parameters.
        Parameters:
        triggerParameters - The trigger parameters to log in the trace file.
      • getTriggerParameters

        public static java.util.Map getTriggerParameters(java.lang.String queryString)
        This method extracts the request parameters from a query string and converts it to a Map object. It is assumed that each parameter is not encoded. This method calls the method getTriggerParametersMap with the parameter decodeValue set to true.
        Parameters:
        queryString - The query string from which to get the parameters.
        Returns:
        A Map representing the query string parameters.
      • getTriggerParametersMap

        public static java.util.Map getTriggerParametersMap(java.lang.String queryString,
                                                            boolean decodeValue)
        This method extracts the request parameters from a query string and converts it to a Map object.
        Parameters:
        queryString - The query string from which to get the parameters.
        decodeValue - Should the value be decoded as it is directly from a url. Once the entry point to the marketing services should specify that the parameters need to be decoded.
        Returns:
        A Map representing the query string parameters.
      • getTriggerParametersString

        public static java.lang.String getTriggerParametersString(java.util.Map triggerParameterMap,
                                                                  boolean maskValues)
        This method extracts the request parameters from a Map object and converts it to a String object.
        Parameters:
        triggerParameterMap - The map from which to get the parameters.
        maskValues - Should the values be masked to avoid writing secure data to the database or log.
        Returns:
        A String representing the trigger parameters.