com.ibm.commerce.catalog.facade.server.helpers

Class MarketingHelper

  • java.lang.Object
    • com.ibm.commerce.catalog.facade.server.helpers.MarketingHelper


  • public class MarketingHelper
    extends java.lang.Object
    This class has some convenient methods that are used to access marketing component.
    • Field Detail

      • COPYRIGHT

        public static final java.lang.String COPYRIGHT
        The IBM copyright field.
        See Also:
        Constant Field Values
      • CATEGORY_RULE_SPOT_PREFIX

        public static final java.lang.String CATEGORY_RULE_SPOT_PREFIX
        The prefix used for the generated marketing spot name for a rule for a category.
        See Also:
        Constant Field Values
      • DYNAMIC_SALES_CATEGORY_ACTIVITY_NAME_PREFIX

        public static final java.lang.String DYNAMIC_SALES_CATEGORY_ACTIVITY_NAME_PREFIX
        Prefix for the activity name generated for a dynamic sales category.
        See Also:
        Constant Field Values
      • UNDERSCORE

        public static final java.lang.String UNDERSCORE
        Constant representing underscore.
        See Also:
        Constant Field Values
      • WEB_ACTIVITY_INACTIVE

        public static final java.lang.String WEB_ACTIVITY_INACTIVE
        Constant representing the activity state 'Inactive'.
        See Also:
        Constant Field Values
      • WEB_ACTIVITY_FORMAT_WEB

        public static final java.lang.String WEB_ACTIVITY_FORMAT_WEB
        Constant representing the activity format 'Web'.
        See Also:
        Constant Field Values
      • MKTING_ACTION_NAME_DYN_MERCH

        public static final java.lang.String MKTING_ACTION_NAME_DYN_MERCH
        Constant representing the marketing action name used in dynamic merchandising, 'displayProductStandardSearchCombined'.
        See Also:
        Constant Field Values
      • CAMPAIGN_ELEMENT_TEMPLATE_IDENTIFIER_NAME_SEARCHACTIONFILTER

        public static final java.lang.String CAMPAIGN_ELEMENT_TEMPLATE_IDENTIFIER_NAME_SEARCHACTIONFILTER
        Constant representing the type of campaign element used as a search filter.
        See Also:
        Constant Field Values
      • CAMPAIGN_ELEMENT_TEMPLATE_IDENTIFIER_NAME_SEARCHACTIONORDERBY

        public static final java.lang.String CAMPAIGN_ELEMENT_TEMPLATE_IDENTIFIER_NAME_SEARCHACTIONORDERBY
        Constant representing the type of campaign element used as a search ordering field.
        See Also:
        Constant Field Values
      • CAMPAIGN_ELEMENT_TEMPLATE_IDENTIFIER_NAME_SEARCHACTIONINCLUSION

        public static final java.lang.String CAMPAIGN_ELEMENT_TEMPLATE_IDENTIFIER_NAME_SEARCHACTIONINCLUSION
        Constant representing the type of campaign element used as a search rule inclusion.
        See Also:
        Constant Field Values
      • CAMPAIGN_ELEMENT_FORMAT_DATA

        public static final java.lang.String CAMPAIGN_ELEMENT_FORMAT_DATA
        Constant representing the format 'Data' of a campaign element.
        See Also:
        Constant Field Values
      • PRODUCT_SEARCH_ACTION_ELEMENT_NAME

        public static final java.lang.String PRODUCT_SEARCH_ACTION_ELEMENT_NAME
        Constant representing the campaign element name for the 'displayProductStandardSearchCombined' action.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MarketingHelper

        public MarketingHelper()
    • Method Detail

      • createMarketingSpot

        public static java.lang.String createMarketingSpot(java.lang.String name,
                                                           java.lang.Integer storeId,
                                                           boolean displayable)
                                                    throws MarketingSpotException
        This method creates a new e-Marketing spot.
        Parameters:
        name - The name of the e-Marketing Spot to create.
        storeId - The ID of the store in which to create the e-Marketing Spot.
        displayable - True if this eMarketing Spot should be displayed in the Marketing tool. False otherwise.
        Returns:
        This method returns the ID of the created e-Marketing Spot. If the e-Marketing Spot cannot be created, then null is returned.
        Throws:
        MarketingSpotException
      • createActivity

        public static void createActivity(java.util.List<ActivityType> activityList)
                                   throws ActivityException
        This method creates a given list of Activities. This method also creates the Campaign Elements present in the given list of Activities. This method delegates the operation to the Marketing Component through Web Service call using the Marketing Facade Client instance.
        Parameters:
        activityList - the given list of Activities.
        Throws:
        ActivityException - if any exception occurs while creating the Activities.
      • createCampaignElement

        public static ActivityType createCampaignElement(java.lang.String activityId,
                                                         CampaignElementType campaignElement)
                                                  throws ActivityException
        This method creates a campaign element given an activity ID.
        Parameters:
        activityId - The activity ID.
        campaignElement - The campaign element being created.
        Returns:
        ActivityType The respose returned from the web service call to create a campaign element.
        Throws:
        ActivityException - if any exception occurs while creating the campaign element.
      • activateActivity

        public static void activateActivity(java.lang.String activityId)
                                     throws ActivityException
        This method activates a Marketing Activity.
        Parameters:
        activityId - The activity Id.
        Throws:
        ActivityException
      • deactivateActivity

        public static void deactivateActivity(java.lang.String activityId)
                                       throws ActivityException
        This method deactivates a Marketing Activity.
        Parameters:
        activityId - The activity Id.
        Throws:
        ActivityException
      • deleteActivity

        public static void deleteActivity(java.util.List<java.lang.String> activityIdList)
                                   throws ActivityException
        This method deletes a list of existing marketing activities.
        Parameters:
        activityIdList - The list of unique id of the marketing activities to delete.
        Throws:
        ActivityException
      • getActivityForEMarketingSpot

        public static java.util.List<ActivityType> getActivityForEMarketingSpot(java.lang.String spotId)
                                                                         throws ActivityException

        This methods gets the activities for a given e-marketing spot.

        If there is more than one, only the first activity ID will be returned.

        Parameters:
        spotId - The e-Marketing Spot ID.
        Returns:
        The list of activities associated to this e-marketing spot.
        Throws:
        ActivityException
      • removeElementFromActivity

        public static void removeElementFromActivity(java.lang.String activityId,
                                                     java.lang.String elementUniqueId)
                                              throws ActivityException

        This method will remove a campaign element from a web activity.

        Parameters:
        activityId - The activity identifier.
        elementUniqueId - The unique id of the element.
        Throws:
        ActivityException - An exception will be thrown if there was a problem removing the element.
      • generateActivityNameForDynamicSalesCategory

        public static java.lang.String generateActivityNameForDynamicSalesCategory(java.lang.String catgroupId)

        This method will generate an activity name for a dynamic sales category web activity.

        Parameters:
        catgroupId - The category ID.
        Returns:
        A generated name for the web activity.
      • getActivityByID

        public static ActivityType getActivityByID(java.lang.String activityId)
                                            throws ActivityException

        This method gets the activity given the activity ID.

        Parameters:
        activityId - The activity ID.
        Returns:
        ActivityType The activity object.
        Throws:
        ActivityException
      • updateElement

        public static void updateElement(java.lang.String activityId,
                                         CampaignElementType campaignElement)
                                  throws ActivityException

        This method will update a campaign element for a web activity.

        Parameters:
        activityId - The activity identifier.
        campaignElement - The campaign element.
        Throws:
        ActivityException - An exception will be thrown if there was a problem updating the element.
      • createRuleForCategory

        public static void createRuleForCategory(java.lang.Long catgroupId,
                                                 CatalogGroupType catalogGroupType,
                                                 com.ibm.commerce.catalog.facade.datatypes.RuleType ruleType,
                                                 CatalogGroup aPhysicalEntity,
                                                 com.ibm.commerce.catalog.facade.server.entity.datatypes.Catgrprule catgroupRule)
                                          throws CatalogApplicationException

        This method will generate a rule for a category.

        Parameters:
        catgroupId - The catalog group internal identifier.
        catalogGroupType - The catalog group logical object from the request.
        ruleType - The rule logical object noun part from the request.
        aPhysicalEntity - The catalog group physical entity.
        catgroupRule - The catalog group rule physical entity.
        Throws:
        CatalogApplicationException - An error will be thrown if there was a problem creating the rule for the category.