com.ibm.commerce.marketing.facade.server.metadata

Class MarketingMetadata



  • public class MarketingMetadata
    extends ComponentMetadata
    This class provides the marketing metadata for the data service layer and common utility methods.
    • Field Detail

      • STRING_LENGTH_64

        public static final int STRING_LENGTH_64
        Constant representing the string length 64
        See Also:
        Constant Field Values
      • STRING_LENGTH_254

        public static final int STRING_LENGTH_254
        Constant representing the string length 254
        See Also:
        Constant Field Values
      • STRING_LENGTH_256

        public static final int STRING_LENGTH_256
        Constant representing the string length 256
        See Also:
        Constant Field Values
      • STRING_LENGTH_1024

        public static final int STRING_LENGTH_1024
        Constant representing the string length 1024
        See Also:
        Constant Field Values
      • STRING_LENGTH_30

        public static final int STRING_LENGTH_30
        Constant representing the string length 30
        See Also:
        Constant Field Values
      • STRING_LENGTH_4000

        public static final int STRING_LENGTH_4000
        Constant representing the string length 4000
        See Also:
        Constant Field Values
      • COMPONENT_NAME

        public static final java.lang.String COMPONENT_NAME
        Marketing component name
        See Also:
        Constant Field Values
      • MARKETING_STORE_RELATIONSHIP

        public static final java.lang.String MARKETING_STORE_RELATIONSHIP
        Marketing component store relationship path
        See Also:
        Constant Field Values
      • CATALOG_STORE_RELATIONSHIP

        public static final java.lang.String CATALOG_STORE_RELATIONSHIP
        Catalog component store relationship path
        See Also:
        Constant Field Values
      • MARKETING_CONFIG_SECTION

        public static final java.lang.String MARKETING_CONFIG_SECTION
        Constant for the configuration section in the marketing administration configuration file
        See Also:
        Constant Field Values
      • PERSONALIZATION_ID_NOT_ENABLED

        public static final java.lang.String PERSONALIZATION_ID_NOT_ENABLED
        Constant for the personalization ID when the personalization ID feature is not enabled
        See Also:
        Constant Field Values
      • ACTIVITY_FORMAT_ENUMERATION

        public static final java.lang.String ACTIVITY_FORMAT_ENUMERATION
        Constant for the activity format value mapping
        See Also:
        Constant Field Values
      • ACTIVITY_TEMPLATE_FORMAT_ENUMERATION

        public static final java.lang.String ACTIVITY_TEMPLATE_FORMAT_ENUMERATION
        Constant for the activity template format value mapping
        See Also:
        Constant Field Values
      • ACTIVITY_EXPERIMENT_FORMAT_ENUMERATION

        public static final java.lang.String ACTIVITY_EXPERIMENT_FORMAT_ENUMERATION
        Constant for the activity experiment format value mapping
        See Also:
        Constant Field Values
      • CAMPAIGN_ELEMENT_ENUMERATION

        public static final java.lang.String CAMPAIGN_ELEMENT_ENUMERATION
        Constant for the campaign element format value mapping
        See Also:
        Constant Field Values
      • MARKETING_STATE_FORMAT_ENUMERATION

        public static final java.lang.String MARKETING_STATE_FORMAT_ENUMERATION
        Constant for the marketing state value mapping
        See Also:
        Constant Field Values
      • MARKETING_CONTENT_FORMAT_ENUMERATION

        public static final java.lang.String MARKETING_CONTENT_FORMAT_ENUMERATION
        Constant for the marketing content format value mapping
        See Also:
        Constant Field Values
      • MARKETING_EMAIL_TEMPLATE_STATUS_ENUMERATION

        public static final java.lang.String MARKETING_EMAIL_TEMPLATE_STATUS_ENUMERATION
        Constant for the marketing email template status value mapping
        See Also:
        Constant Field Values
      • MARKETING_EMAIL_TEMPLATE_BODY_FORMAT_ENUMERATION

        public static final java.lang.String MARKETING_EMAIL_TEMPLATE_BODY_FORMAT_ENUMERATION
        Constant for the marketing email template status body type mapping
        See Also:
        Constant Field Values
      • MARKETING_SPOT_SUPPORTED_TYPE_ENUMERATION

        public static final java.lang.String MARKETING_SPOT_SUPPORTED_TYPE_ENUMERATION
        Constant for the marketing spot supported type mapping
        See Also:
        Constant Field Values
    • Constructor Detail

      • MarketingMetadata

        public MarketingMetadata()
    • Method Detail

      • getEPackageName

        public java.lang.String getEPackageName()
        This method gets the marketing physical SDO EPackage name.
        Specified by:
        getEPackageName in class ComponentMetadata
        Returns:
        This method returns the marketing physical SDO EPackage name.
      • getRootEClass

        public org.eclipse.emf.ecore.EClass getRootEClass()
        This method gets the root class.
        Overrides:
        getRootEClass in class ComponentMetadata
        Returns:
        This method returns the root class.
      • getMemberAndStoreContextParameters

        public static java.lang.StringBuffer getMemberAndStoreContextParameters()
        This method gets the member ID and store ID parameters from the business context.
        Returns:
        This method returns a string with name value pairs with the information from the current business contexts.
      • getPersonalizationContextParameter

        public static java.lang.StringBuffer getPersonalizationContextParameter(java.lang.StringBuffer triggerParameters)
        This method gets the personalization ID parameter from the business context. The method getPersonalizationId in the class MarketingServicesTaskCmd is called to allow a customization to set the appropriate personalization ID. If that method returns null, then the personalization ID is retrieved from the business context.
        Parameters:
        triggerParameters - The trigger parameters passed in the service call. Custom information added to the trigger parameters can be used to determine the appropriate personalization ID.
        Returns:
        This method returns a string with name value pairs with the information from the current business contexts. The return data will include a leading ampersand.
      • getContextParameters

        public static java.lang.StringBuffer getContextParameters()
        This method gets the parameters from the business context. The parameters include the user ID, the store ID, and the personalization ID.
        Returns:
        This method returns a string with name value pairs with the information from the current business contexts.
      • getExpressionParameters

        public static java.lang.String getExpressionParameters(ActionExpression actionExpression)
        This method gets the trigger parameter string from the service call expression.
        Parameters:
        actionExpression - The action expression passed in the service call.
        Returns:
        This method returns the trigger parameter string from the service call expression.
      • getStoreId

        public static java.lang.Integer getStoreId()
        This method gets the store ID from the base context.
        Returns:
        This method returns the store ID from the base context.
      • getUserId

        public static java.lang.Long getUserId()
        This method gets the user ID from the base context.
        Returns:
        This method returns the user ID from the base context.
      • getPersonalizationId

        public static java.lang.String getPersonalizationId()
        This method gets the personalization ID from the audit context.
        Returns:
        This method returns the personalization ID from the audit context.
      • getLocale

        public static java.util.Locale getLocale()
        This method gets the locale from the globalization context.
        Returns:
        This method returns the locale from the globalization context.
      • getLanguageId

        public static java.lang.Integer getLanguageId()
        This method gets the language ID from the globalization context.
        Returns:
        This method returns the language ID from the globalization context.
      • isPreviewContext

        public static boolean isPreviewContext()
        This method gets if the service is running under a preview context. In this situations, we do not want to get trigger listeners from the cache.
        Returns:
        This method returns true if there is a preview context, otherwise it returns false.
      • getContentContextWriteSchemaName

        public static java.lang.String getContentContextWriteSchemaName()
        This method gets the workspace write schema name if the service is running under a content (workspace) context.
        Returns:
        This method returns the workspace write schema name if the service is running under a content (workspace) context, otherwise it returns null.
      • isContentContext

        public static boolean isContentContext()
        This method gets if the service is running under a content (workspace) context. In this situations, we do not want to get trigger listeners from the cache, nor put active activities in the cache.
        Returns:
        This method returns true if there is a content context, otherwise it returns false.
      • getPreviewContextInventory

        public static java.lang.Integer getPreviewContextInventory()
        This method gets the setting of the inventory behavior in the preview context. In can return one of the following values:
        • 0 - actual inventory in the database must be used in preview mode
        • 1 - inventory constraints must evaluate to true in preview mode
        • -1 - inventory constraints must evaluate to false in preview mode
        If there is no preview context, then a value of 0 is returned.
        Returns:
        This method returns the inventory setting in the preview context.
      • getCurrentTime

        public static java.sql.Timestamp getCurrentTime()
        This method gets the current date and time of the executing system as a timestamp value. If there is a preview context, the time is retrieved from the preview context. A customization may implement MarketingServicesTaskCmd.adjustServerTime to return a different time based on the store.
        Returns:
        This method returns the current date and time.
      • getCurrentTime

        public static java.sql.Timestamp getCurrentTime(Activity activity)
        This method gets the current date and time of the executing system as a timestamp value. If there is a preview context, the time is retrieved from the preview context. A customization may implement MarketingServicesTaskCmd.adjustServerTime to return a different time based on the store and implement MarketingServicesTaskCmd.getTime to return a different time based on the activity.
        Parameters:
        activity - The marketing activity.
        Returns:
        This method returns the current date and time.
      • adjustServerTime

        public static java.sql.Timestamp adjustServerTime(java.sql.Timestamp time)
        This method is called by the marketing services when it needs to check the current time against the start and end times of an activity to determine if the activity is currently applicable. The current server or preview time is passed to this method, and this method can adjust the time if necessary. For example, if you know that the server is in one time zone, and the web store is in a different time zone, this method could adjust the time based on the offset between the server's time zone and the store's time zone. This method calls the method adjustServerTime on the class MarketingServicesTaskCmd.
        Parameters:
        time - The current server or preview time.
        Returns:
        The time to use when comparing to the activity start and end time. If the time does not need to be adjusted, then return the time passed to this method. The default implementation of this method returns the time passed into this method.
      • adjustServerTime

        public static java.sql.Timestamp adjustServerTime(java.sql.Timestamp time,
                                                          Activity activity)
        This method is called by the marketing services when it needs to check the current time against the start and end times of an activity to determine if the activity is currently applicable. The current server or preview time is passed to this method, and this method can adjust the time if necessary. For example, if you know that the server is in one time zone, and the web store is in a different time zone, this method could adjust the time based on the offset between the server's time zone and the store's time zone. If you do not want the check to be against the current time, for example, if you want the check to be against the order delivery date, then this method could return the applicable time. This method first calls the method getTime on the class MarketingServicesTaskCmd if an activity is passed into this method. Then this method calls the method adjustServerTime on the class MarketingServicesTaskCmd.
        Parameters:
        time - The current server or preview time.
        activity - The marketing activity.
        Returns:
        The time to use when comparing to the activity start and end time. If the time does not need to be adjusted, then return the time passed to this method. The default implementation of this method returns the time passed into this method.
      • getTimestamp

        public static java.sql.Timestamp getTimestamp()
        This method gets the current date and time as a timestamp value. It ignores any preview context, and does not use any fancy caching setup.
        Returns:
        This method returns the current date and time.
      • getDataServiceFacade

        public static DataServiceFacade getDataServiceFacade()
        This method returns the data service facade to use for interaction with the persistence layer.
        Returns:
        This method returns the data service facade to use for interaction with the persistence layer.
      • invalidStringLength

        public static boolean invalidStringLength(java.lang.String str,
                                                  int maxLength)
        This method checks if the specified string exceed the maximum length that can be stored in the database. The maximum length is specified in the number of bytes.
        Parameters:
        str - The string to check.
        maxLength - The maximum length of the string specified in the number of bytes.
        Returns:
        This method returns true if the string length exceeds the maximum number of bytes, otherwise it will return false.