com.ibm.commerce.pagelayout.facade.server.helpers

Class MarketingHelper

  • java.lang.Object
    • com.ibm.commerce.pagelayout.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 Summary

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

      Constructors 
      Constructor and Description
      MarketingHelper() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static void activateActivity(java.lang.String activityId)
      This method activates a Marketing Activity.
      static void addEMarketingSpotToActivity(java.lang.String activityId, java.lang.String spotId)
      This methods adds an e-Marketing Spot to the View E-Marketing Spot element in an activity.
      static boolean checkForExistingMarketingContentDescription(java.lang.String contentId, java.lang.Integer langId)
      Checks if a Marketing Content Description already exists for the content's language.
      static java.lang.String createEMarketingSpotNameForWidget(java.lang.String widgetIdentifier, java.lang.String widgetId)
      Returns the generated E-Marketing Spot name of a widget according to widget identifier and widget unique id.
      static java.lang.String createMarketingContent(java.lang.String name, java.lang.String text, java.lang.String url, java.lang.Integer storeId, java.lang.Integer langId, boolean displayable)
      This method creates a new marketing content.
      static void createMarketingContentDescription(java.lang.String contentId, java.lang.String text, java.lang.Integer langId)
      This method creates a new Marketing Content Description for the specified content and language.
      static java.lang.String createMarketingContentImageMapArea(java.lang.String contentId, java.lang.Integer langId, com.ibm.commerce.marketing.facade.datatypes.AreaShapeEnumerationType shape, java.lang.String coordinates, java.lang.String url, java.lang.String title, double sequence, java.util.Map<java.lang.String,java.lang.String> otherProperties)
      This method creates a new image map area for the specified marketing content.
      static java.lang.String createMarketingContentNameForWidget(java.lang.String widgetId)
      Returns the generated marketing content name for a widget according to widget identifier and widget unique id.
      static java.lang.String createMarketingContentWithImageMap(java.lang.String name, java.lang.Integer storeId, java.lang.Integer langId, boolean displayable)
      This method creates a new marketing content with image map.
      static java.lang.String createMarketingSpot(java.lang.String name, java.lang.Integer storeId, boolean displayable)
      This method creates a new e-Marketing spot.
      static java.lang.String createMarketingSpotDefaultContent(java.lang.String spotId, java.lang.String contentType, java.lang.String contentId, java.lang.String sequence, java.lang.Integer storeId)
      This method creates a new marketing default content.
      static java.lang.String createMarketingSpotDefaultTitle(java.lang.String spotId, java.lang.String contentId, java.lang.Integer storeId)
      This method creates a new marketing default title.
      static void deactivateActivity(java.lang.String activityId)
      This method deactivates a Marketing Activity.
      static void deleteActivity(java.util.List<java.lang.String> activityIdList)
      This method deletes a list of existing marketing activities.
      static void deleteAllMarketingContentForEspot(java.lang.String spotId)
      This method deletes all MarketingContent associated with an Espot.
      static void deleteMarketingContent(java.lang.String contentId)
      This method deletes an existing marketing content.
      static void deleteMarketingContentImageMapArea(java.lang.String contentId, java.lang.String imageMapAreaId)
      This method delete an existing image map area for the specified marketing content.
      static void deleteMarketingSpot(java.util.List<java.lang.String> emspotIdList)
      This method deletes a list of existing e-Marketing spots.
      static void deleteMarketingSpot(java.lang.String emspotId)
      This method deletes an existing e-Marketing spot.
      static void deleteMarketingSpotDefaultContent(java.lang.String dmemspotdef_id, java.lang.String spotId, java.lang.String contentId, java.lang.Integer storeId)
      This method deletes marketing default content.
      static java.util.List<ActivityType> getActivityForEMarketingSpot(java.lang.String spotId)
      This methods gets the activities for a given e-marketing spot.
      static java.lang.String getActivityForEMarketingSpotInAllRelatedStores(java.lang.String spotId, java.lang.Integer storeId)
      This methods gets the first found activity for an e-marketing spot.
      static MarketingContentType getMarketingContent(java.lang.String contentId, java.lang.Integer[] langIds)
      This method returns the marketing content noun according to the specified content id.
      static java.lang.String getMarketingContentText(java.lang.String contentId, java.lang.String languageId)
      This method returns the text of the marketing content according to the specified content id and language id.
      static java.lang.String getMarketingSpotDefaultContent(java.lang.String spotId, java.lang.Integer storeId)
      This method returns the first default content id of a e-Marketing spot in the specified store.
      static java.util.List<java.lang.String> getMarketingSpotDefaultContents(java.lang.String spotId, java.lang.Integer storeId)
      This method returns list of default content id of a e-Marketing spot in the specified store.
      static java.lang.String getMarketingSpotDefaultTitle(java.lang.String spotId, java.lang.Integer storeId)
      This method returns the default title of the marketing spot in specified store.
      static void removeActivityForEMarketingSpot(java.util.List<ActivityType> activities, java.lang.String eSpotId)
      This method will remove a list of activities from an e-Marketing spot.
      static void removeEMarketingSpotFromActivity(java.lang.String activityId, java.lang.String spotId)
      This methods removes an e-Marketing Spot from the View E-Marketing Spot element in an activity.
      static void updateMarketingContent(java.lang.String contentId, java.lang.String text, java.lang.String url, java.lang.Integer langId)
      This method updates an existing marketing content.
      static java.lang.String updateMarketingContentImageMapArea(java.lang.String contentId, java.lang.String imageMapAreaId, java.lang.Integer langId, com.ibm.commerce.marketing.facade.datatypes.AreaShapeEnumerationType shape, java.lang.String coordinates, java.lang.String url, java.lang.String title, double sequence, java.util.Map<java.lang.String,java.lang.String> otherProperties)
      This method updates an existing image map area for the specified marketing content.
      static java.lang.String updateMarketingSpotDefaultContent(java.lang.String dmemspotdef_id, java.lang.String spotId, java.lang.String contentType, java.lang.String contentId, java.lang.String sequence, java.lang.Integer storeId)
      This method updates existing marketing default content.
      • 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
        The IBM copyright field.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MarketingHelper

        public MarketingHelper()
    • Method Detail

      • createEMarketingSpotNameForWidget

        public static java.lang.String createEMarketingSpotNameForWidget(java.lang.String widgetIdentifier,
                                                                         java.lang.String widgetId)
        Returns the generated E-Marketing Spot name of a widget according to widget identifier and widget unique id.
        Parameters:
        widgetIdentifier - The identifier of the widget
        widgetId - The unique id of the widget
        Returns:
        The generated name of the E-Marketing Spot.
      • createMarketingContentNameForWidget

        public static java.lang.String createMarketingContentNameForWidget(java.lang.String widgetId)
        Returns the generated marketing content name for a widget according to widget identifier and widget unique id.
        Parameters:
        widgetId - The unique id of the widget
        Returns:
        The generated name of the E-Marketing Spot.
      • 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
      • deleteMarketingSpot

        public static void deleteMarketingSpot(java.lang.String emspotId)
                                        throws MarketingSpotException
        This method deletes an existing e-Marketing spot.
        Parameters:
        emspotId - The unique id of the e-Marketing Spot to delete.
        Throws:
        MarketingSpotException
      • deleteMarketingSpot

        public static void deleteMarketingSpot(java.util.List<java.lang.String> emspotIdList)
                                        throws MarketingSpotException
        This method deletes a list of existing e-Marketing spots.
        Parameters:
        emspotIdList - The list of unique id of the e-Marketing Spots to delete.
        Throws:
        MarketingSpotException
      • 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
      • createMarketingContent

        public static java.lang.String createMarketingContent(java.lang.String name,
                                                              java.lang.String text,
                                                              java.lang.String url,
                                                              java.lang.Integer storeId,
                                                              java.lang.Integer langId,
                                                              boolean displayable)
                                                       throws MarketingContentException
        This method creates a new marketing content.
        Parameters:
        name - The name of the marketing content to create.
        text - The marketing content text.
        url - The marketing content URL.
        storeId - The ID of the store in which to create the marketing content.
        langId - The ID of the language in which to create the marketing content description.
        displayable - True if this Content should be displayed in the Marketing tool. False otherwise.
        Returns:
        This method returns the ID of the created marketing content. If the marketing content cannot be created, then null is returned.
        Throws:
        MarketingContentException
      • deleteMarketingContent

        public static void deleteMarketingContent(java.lang.String contentId)
                                           throws MarketingContentException
        This method deletes an existing marketing content.
        Parameters:
        contentId - The unique id of the marketing content to delete.
        Throws:
        MarketingContentException
      • createMarketingContentWithImageMap

        public static java.lang.String createMarketingContentWithImageMap(java.lang.String name,
                                                                          java.lang.Integer storeId,
                                                                          java.lang.Integer langId,
                                                                          boolean displayable)
                                                                   throws MarketingContentException
        This method creates a new marketing content with image map.
        Parameters:
        name - The name of the marketing content to create.
        storeId - The ID of the store in which to create the marketing content.
        langId - The ID of the language in which to create the marketing content description.
        displayable - True if this Content should be displayed in the Marketing tool. False otherwise.
        Returns:
        This method returns the ID of the created marketing content. If the marketing content cannot be created, then null is returned.
        Throws:
        MarketingContentException
      • createMarketingContentImageMapArea

        public static java.lang.String createMarketingContentImageMapArea(java.lang.String contentId,
                                                                          java.lang.Integer langId,
                                                                          com.ibm.commerce.marketing.facade.datatypes.AreaShapeEnumerationType shape,
                                                                          java.lang.String coordinates,
                                                                          java.lang.String url,
                                                                          java.lang.String title,
                                                                          double sequence,
                                                                          java.util.Map<java.lang.String,java.lang.String> otherProperties)
                                                                   throws MarketingContentException
        This method creates a new image map area for the specified marketing content.
        Parameters:
        contentId - The ID of the marketing content to update.
        langId - The ID of the language in which to create the image map area.
        shape - The shape of the image map area.
        coordinates - The coordinates of the image map area.
        url - The link of the image map area.
        title - The title of the image map area.
        sequence - The sequence of the image map area.
        otherProperties - A map contain the name and value of other properties, like "target", "alt", "field1" to "field5".
        Returns:
        the unique id of the image map area created.
        Throws:
        MarketingContentException - Exception is thrown when there is problem calling Marketing service to create image map area.
      • updateMarketingContentImageMapArea

        public static java.lang.String updateMarketingContentImageMapArea(java.lang.String contentId,
                                                                          java.lang.String imageMapAreaId,
                                                                          java.lang.Integer langId,
                                                                          com.ibm.commerce.marketing.facade.datatypes.AreaShapeEnumerationType shape,
                                                                          java.lang.String coordinates,
                                                                          java.lang.String url,
                                                                          java.lang.String title,
                                                                          double sequence,
                                                                          java.util.Map<java.lang.String,java.lang.String> otherProperties)
                                                                   throws MarketingContentException
        This method updates an existing image map area for the specified marketing content.
        Parameters:
        contentId - The ID of the marketing content to update.
        imageMapAreaId - The unique id of the image map area to update
        langId - The ID of the language in which to create the image map area.
        shape - The shape of the image map area.
        coordinates - The coordinates of the image map area.
        url - The link of the image map area.
        title - The title of the image map area.
        sequence - The sequence of the image map area.
        otherProperties - A map contain the name and value of other properties, like "target", "alt", "field1" to "field5".
        Returns:
        The unique id of the image map area.
        Throws:
        MarketingContentException - Exception is thrown when there is problem calling Marketing service to create image map area.
      • deleteMarketingContentImageMapArea

        public static void deleteMarketingContentImageMapArea(java.lang.String contentId,
                                                              java.lang.String imageMapAreaId)
                                                       throws MarketingContentException
        This method delete an existing image map area for the specified marketing content.
        Parameters:
        contentId - The ID of the marketing content to update.
        imageMapAreaId - The unique id of the image map area to delete.
        Throws:
        MarketingContentException - Exception is thrown when there is problem calling Marketing service to delete image map area.
      • updateMarketingContent

        public static void updateMarketingContent(java.lang.String contentId,
                                                  java.lang.String text,
                                                  java.lang.String url,
                                                  java.lang.Integer langId)
                                           throws MarketingContentException
        This method updates an existing marketing content.
        Parameters:
        contentId - The ID of the marketing content to update.
        text - The marketing content text.
        url - The marketing content URL.
        langId - The ID of the language in which to update the marketing content description.
        Throws:
        MarketingContentException
      • createMarketingSpotDefaultContent

        public static java.lang.String createMarketingSpotDefaultContent(java.lang.String spotId,
                                                                         java.lang.String contentType,
                                                                         java.lang.String contentId,
                                                                         java.lang.String sequence,
                                                                         java.lang.Integer storeId)
                                                                  throws MarketingSpotException
        This method creates a new marketing default content.
        Parameters:
        spotId - The ID of the e-Marketing Spot for which to assign the default content.
        contentType - The type of the default content.
        contentId - The ID of the content.
        sequence - The sequence number of the content.
        storeId - The ID of the store in which to associate the content.
        Returns:
        This method returns the ID of the created marketing default content relationship. If the marketing default content relationship cannot be created, then null is returned.
        Throws:
        MarketingSpotException - An error will be thrown if there was a problem creating the default marketing content.
      • updateMarketingSpotDefaultContent

        public static java.lang.String updateMarketingSpotDefaultContent(java.lang.String dmemspotdef_id,
                                                                         java.lang.String spotId,
                                                                         java.lang.String contentType,
                                                                         java.lang.String contentId,
                                                                         java.lang.String sequence,
                                                                         java.lang.Integer storeId)
                                                                  throws MarketingSpotException
        This method updates existing marketing default content.
        Parameters:
        dmemspotdef_id - The unique ID of the default content to update. (DMEMSPOTDEF_ID)
        spotId - The ID of the e-Marketing Spot for which to assign the default content.
        contentType - The type of the default content.
        contentId - The ID of the content.
        sequence - The sequence number of the content.
        storeId - The ID of the store in which to associate the content.
        Returns:
        This method returns the ID of the created marketing default content relationship.
        Throws:
        MarketingSpotException - An error will be thrown if there was a problem updating the default marketing content.
      • deleteMarketingSpotDefaultContent

        public static void deleteMarketingSpotDefaultContent(java.lang.String dmemspotdef_id,
                                                             java.lang.String spotId,
                                                             java.lang.String contentId,
                                                             java.lang.Integer storeId)
                                                      throws MarketingSpotException
        This method deletes marketing default content.
        Parameters:
        dmemspotdef_id - The unique ID of the default content to update. (DMEMSPOTDEF_ID)
        spotId - The ID of the e-Marketing Spot for which to assign the default content.
        contentId - The ID of the content.
        storeId - The ID of the store in which to associate the content.
        Throws:
        MarketingSpotException - An error will be thrown if there was a problem deleting the default marketing content.
      • createMarketingSpotDefaultTitle

        public static java.lang.String createMarketingSpotDefaultTitle(java.lang.String spotId,
                                                                       java.lang.String contentId,
                                                                       java.lang.Integer storeId)
                                                                throws MarketingSpotException
        This method creates a new marketing default title.
        Parameters:
        spotId - The ID of the marketing spot for which to assign the default title.
        contentId - The ID of the content to use as the title.
        storeId - The ID of the store in which to associate the content as the title.
        Returns:
        This method returns the ID of the created marketing default title relationship. If the marketing default title relationship cannot be created, then null is returned.
        Throws:
        MarketingSpotException
      • getMarketingSpotDefaultTitle

        public static java.lang.String getMarketingSpotDefaultTitle(java.lang.String spotId,
                                                                    java.lang.Integer storeId)
        This method returns the default title of the marketing spot in specified store.
        Parameters:
        spotId - The unique id of the marketing spot.
        storeId - The store id.
        Returns:
        The default title of the marketing spot.
      • getMarketingSpotDefaultContents

        public static java.util.List<java.lang.String> getMarketingSpotDefaultContents(java.lang.String spotId,
                                                                                       java.lang.Integer storeId)
        This method returns list of default content id of a e-Marketing spot in the specified store.
        Parameters:
        spotId - The e-Marketing spot id.
        storeId - The store id.
        Returns:
        list of default content ids.
      • getMarketingSpotDefaultContent

        public static java.lang.String getMarketingSpotDefaultContent(java.lang.String spotId,
                                                                      java.lang.Integer storeId)
        This method returns the first default content id of a e-Marketing spot in the specified store.
        Parameters:
        spotId - The e-Marketing spot id.
        storeId - The store id.
        Returns:
        The first default content id.
      • getMarketingContentText

        public static java.lang.String getMarketingContentText(java.lang.String contentId,
                                                               java.lang.String languageId)
        This method returns the text of the marketing content according to the specified content id and language id.
        Parameters:
        contentId - The content id.
        languageId - The language id.
        Returns:
        The marketing content text.
      • getMarketingContent

        public static MarketingContentType getMarketingContent(java.lang.String contentId,
                                                               java.lang.Integer[] langIds)
        This method returns the marketing content noun according to the specified content id.
        Parameters:
        contentId - The unique id of the content.
        langIds - The requested language ids
        Returns:
        The marketing content noun.
      • 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
      • deleteAllMarketingContentForEspot

        public static void deleteAllMarketingContentForEspot(java.lang.String spotId)
                                                      throws MarketingContentException
        This method deletes all MarketingContent associated with an Espot.
        Parameters:
        spotId - The unique id of the e-Marketing Spot to delete associated content from.
        Throws:
        MarketingContentException
      • createMarketingContentDescription

        public static void createMarketingContentDescription(java.lang.String contentId,
                                                             java.lang.String text,
                                                             java.lang.Integer langId)
                                                      throws MarketingContentException
        This method creates a new Marketing Content Description for the specified content and language.
        Parameters:
        contentId - The marketing content id.
        text - The marketing content text.
        langId - The ID of the language in which to create the marketing content description.
        Throws:
        MarketingContentException
      • checkForExistingMarketingContentDescription

        public static boolean checkForExistingMarketingContentDescription(java.lang.String contentId,
                                                                          java.lang.Integer langId)
                                                                   throws DataMediatorException,
                                                                          java.lang.NumberFormatException
        Checks if a Marketing Content Description already exists for the content's language.
        Parameters:
        contentId - The id of the Marketing Content to check
        langId - The ID of the language in which to check for the marketing content description
        Returns:
        true if a marketing content description already exists for the language, false otherwise
        Throws:
        DataMediatorException
        java.lang.NumberFormatException
      • addEMarketingSpotToActivity

        public static void addEMarketingSpotToActivity(java.lang.String activityId,
                                                       java.lang.String spotId)
                                                throws ActivityException
        This methods adds an e-Marketing Spot to the View E-Marketing Spot element in an activity. The activity is left in the same state (active or inactive) as it was in before this method was called.
        Parameters:
        activityId - The activity ID.
        spotId - The e-Marketing Spot ID.
        Throws:
        ActivityException
      • removeEMarketingSpotFromActivity

        public static void removeEMarketingSpotFromActivity(java.lang.String activityId,
                                                            java.lang.String spotId)
                                                     throws ActivityException
        This methods removes an e-Marketing Spot from the View E-Marketing Spot element in an activity. If the e-Marketing Spot being removed is the last one associated with the activity, then the activity will be deactivated. Otherwise, the activity is left in the same state (active or inactive) as it was in before this method was called.
        Parameters:
        activityId - The activity ID.
        spotId - The e-Marketing Spot ID.
        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
      • removeActivityForEMarketingSpot

        public static void removeActivityForEMarketingSpot(java.util.List<ActivityType> activities,
                                                           java.lang.String eSpotId)
                                                    throws ActivityException

        This method will remove a list of activities from an e-Marketing spot.

        Parameters:
        activities - The list of activities.
        eSpotId - The e-Marketing spot ID.
        Throws:
        ActivityException - An exception will be thrown if there was a problem removing the e-Marketing spot from the activity.
      • getActivityForEMarketingSpotInAllRelatedStores

        public static java.lang.String getActivityForEMarketingSpotInAllRelatedStores(java.lang.String spotId,
                                                                                      java.lang.Integer storeId)

        This methods gets the first found activity for an e-marketing spot. This method searches all children and parent stores of the passed in storeId.

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

        Parameters:
        spotId - The e-Marketing Spot ID.
        storeId - The unique store ID of the store to search.
        Returns:
        The activity internal identifier.