com.ibm.commerce.tools.campaigns

Class CampaignRuntimeUtil

  • java.lang.Object
    • com.ibm.commerce.tools.campaigns.CampaignRuntimeUtil


  • public class CampaignRuntimeUtil
    extends java.lang.Object
    This class provides some utility methods that are used by marketing campaign run time. These utility methods include e-Marketing Spot result filtering, and randomizing the result entries.
    • Constructor Summary

      Constructors 
      Constructor and Description
      CampaignRuntimeUtil()
      Constructor for this utility class.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean checkCatalogEntryEntitlement(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
      Checks whether the given catalog entry is entitled to the contracts for which the current user is eligible.
      boolean checkCatalogEntryEntitlement(java.lang.Long catalogEntryId)
      Checks whether the given catalog entry is entitled to the contracts for which the current user is eligible.
      boolean checkCatalogEntryInCatalog(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
      Checks whether the given catalog entry is contained in the catalog that the customer is currently viewing.
      boolean checkCatalogEntryInventoryLevel(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
      Checks whether the given catalog entry is satisfied the required inventory level.
      boolean checkCatalogEntryNotExistInShopcart(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
      Checks whether the given catalog entry exists in the current shopping cart.
      boolean checkCatalogEntryNotExpired(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
      Checks whether the given catalog entry has expired, according to its end date.
      boolean checkCatalogEntryNotMarkForDelete(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
      Checks whether the given catalog entry is marked for delete.
      boolean checkCatalogEntryPublishStatus(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
      Checks whether the given catalog entry is allowed to display, based on its publish flag.
      int checkCatalogEntryRelation(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catalogEntryDataBean1, com.ibm.commerce.catalog.beans.CatalogEntryDataBean catalogEntryDataBean2)
      Checks whether the two given catalog entries are related.
      boolean checkCatalogGroupEntitlement(com.ibm.commerce.catalog.beans.CategoryDataBean catgroup)
      Checks whether the given catalog group is entitled to the contracts for which the current user is eligible.
      boolean checkCatalogGroupEntitlement(java.lang.Long catalogGroupId)
      Checks whether the given catalog group is entitled to the contracts for which the current user is eligible.
      boolean checkCatalogGroupInCatalog(com.ibm.commerce.catalog.beans.CategoryDataBean catgroup)
      Checks whether the given catalog group is contained in the catalog that the customer is currently viewing.
      boolean checkCatalogGroupNotMarkForDelete(com.ibm.commerce.catalog.beans.CategoryDataBean catgroup)
      Checks whether the given catalog group is marked for delete.
      boolean checkCatalogGroupPublishStatus(com.ibm.commerce.catalog.beans.CategoryDataBean catgroup)
      Checks whether the given catalog group is allowed to display, based on its publish flag.
      boolean checkPromotionContentEntitlement(CollateralDataBean collateral)
      Checks whether the promotion content that is assigned to the given collateral is entitled to the contracts for which the current user is eligible.
      static java.lang.String generateEMarketingSpotInvocationKey(java.lang.String emsName, int maxAssociateCatalogEntries, int maxCatalogEntries, int maxCategories, int maxCollateral)
      Creates a String that can be used to uniquely identify an eMarketingSpot configuration
      com.ibm.commerce.command.CommandContext getCommandContext()
      Gets the current command context that is used to retrieve the runtime attributes like the store ID and the member ID.
      java.lang.Long getCurrentCatalogId()
      Gets the ID of the catalog that the customer is currently viewing.
      int getMaximumNumberOfAssociateCatalogEntries()
      Gets the maximum number of associated catalog entries that can be displayed in an e-Marketing Spot.
      int getMaximumNumberOfCatalogEntries()
      Gets the maximum number of catalog entries can be displayed in an e-Marketing Spot.
      int getMaximumNumberOfCategories()
      Gets the maximum number of categories can be displayed in an e-Marketing Spot.
      int getMaximumNumberOfCollateral()
      Gets the maximum number of ad copies can be displayed in an e-Marketing Spot.
      java.util.Vector getResultFilter()
      Gets the list of flags that will be used to determine the result filtering to be performed.
      int getResultOrder()
      Gets the flag that will be used to determine the result ordering logic to be performed.
      com.ibm.commerce.order.objects.OrderItemAccessBean[] getShoppingCartOrderItemAccessBeans()
      Gets the list of order item objects that represent items currently in the shopping cart.
      com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] getTradingAgreementAccessBeans()
      Gets the list of trading agreement objects that are used to check product and category entitlement.
      java.util.Vector performArrayRandomization(java.util.Vector resultEntries, java.lang.Object[] initiativeOrderArray, boolean isRandomizingOrder)
      The performArrayRandomization method sorts the entries in the array using the given priority.
      boolean performAssociateCatalogEntryFiltering(EMarketingSpot.AssociateCatalogEntry associateCatalogEntry)
      Checks whether the given associated catalog entry object satisfies all of the filtering criteria.
      boolean performCatalogEntryFiltering(EMarketingSpot.CatalogEntry catalogEntry)
      Checks whether the given catalog entry object satisfies all of the filtering criteria.
      boolean performCategoryFiltering(EMarketingSpot.Category category)
      Checks whether the given category object satisfies all of the filtering criteria.
      boolean performCollateralFiltering(EMarketingSpot.Collateral collateral)
      Checks whether the given collateral object satisfies all of the filtering criteria.
      java.util.Vector performResultOrdering(java.util.Vector resultEntries, java.lang.Object[] initiativeOrderArray)
      This method orders the e-Marketing Spot result array based on the ordering logic indicated in the resultOrder flag.
      void setCommandContext(com.ibm.commerce.command.CommandContext newCommandContext)
      Sets the current command context used to retrieve the runtime attributes like the store ID and the member ID.
      void setCurrentCatalogId(java.lang.Long newCurrentCatalogId)
      Sets the ID of the catalog that the customer is currently viewing.
      void setMaximumNumberOfAssociateCatalogEntries(int newMaximumNumberOfAssociateCatalogEntries)
      Sets the maximum number of associated catalog entries that can be displayed in an e-Marketing Spot.
      void setMaximumNumberOfCatalogEntries(int newMaximumNumberOfCatalogEntries)
      Sets the maximum number of catalog entries that can be displayed in an e-Marketing Spot.
      void setMaximumNumberOfCategories(int newMaximumNumberOfCategories)
      Sets the maximum number of categories that can be displayed in an e-Marketing Spot.
      void setMaximumNumberOfCollateral(int newMaximumNumberOfCollateral)
      Sets the maximum number of ad copies that can be displayed in an e-Marketing Spot.
      void setResultFilter(java.util.Vector newResultFilter)
      Sets the list of flags that will be used to determine the result filtering to be performed.
      void setResultOrder(int newResultOrder)
      Sets the flag that will be used to determine the result ordering logic to be performed.
      void setShoppingCartOrderItemAccessBeans(com.ibm.commerce.order.objects.OrderItemAccessBean[] newShoppingCartOrderItemAccessBeans)
      Sets the list of order item objects that represent items currently in the shopping cart.
      void setTradingAgreementAccessBeans(com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] newTradingAgreementAccessBeans)
      Sets the list of trading agreement objects that are used to check product and category entitlement.
      java.util.Vector sortArrayByRank(java.util.Vector sourceArray)
      The sortArrayByRank method sorts the entries in the array using the given ranks.
      Step 1: Sort all ranks in reverse order.
      Step 2: Calculate order with weight.
      Step 3: Determine which index in the array wins this round by comparing the index with the results of Random.nextInt, which uses the sum of all percentages as the bound.
      Step 4: Repeat step 3 until the size of the array with waiting entries is 0.
      Step 5: Re-sort the previous sorted array using the randomize result.
      Step 6: Remove unnecessary elements from the target array.
      • Methods inherited from class java.lang.Object

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

      • ALL_FILTERS

        public static final int ALL_FILTERS
        Constant for result filter type: All filters.
        See Also:
        Constant Field Values
      • ASSOCIATE_CATENTRY_ALLOW_TO_DISPLAY

        public static final int ASSOCIATE_CATENTRY_ALLOW_TO_DISPLAY
        Constant for result filter type: Associated catalog entry is allowed to display.
        See Also:
        Constant Field Values
      • ASSOCIATE_CATENTRY_ENTITLED_IN_CONTRACT

        public static final int ASSOCIATE_CATENTRY_ENTITLED_IN_CONTRACT
        Constant for result filter type: Associated catalog entry included in contract entitlement.
        See Also:
        Constant Field Values
      • ASSOCIATE_CATENTRY_EXIST_IN_SHOPCART

        public static final int ASSOCIATE_CATENTRY_EXIST_IN_SHOPCART
        Constant for result filter type: Associated catalog entry already exists in the current shopping cart.
        See Also:
        Constant Field Values
      • ASSOCIATE_CATENTRY_IN_CURRENT_CATALOG

        public static final int ASSOCIATE_CATENTRY_IN_CURRENT_CATALOG
        Constant for result filter type: Associated catalog entry within the current catalog.
        See Also:
        Constant Field Values
      • ASSOCIATE_CATENTRY_NOT_EXPIRED

        public static final int ASSOCIATE_CATENTRY_NOT_EXPIRED
        Constant for result filter type: Associated catalog entry has not expired.
        See Also:
        Constant Field Values
      • ASSOCIATE_CATENTRY_NOT_MARK_FOR_DELETE

        public static final int ASSOCIATE_CATENTRY_NOT_MARK_FOR_DELETE
        Constant for result filter type: Associated catalog entry is not marked for delete.
        See Also:
        Constant Field Values
      • ASSOCIATE_CATENTRY_WITH_INVENTORY

        public static final int ASSOCIATE_CATENTRY_WITH_INVENTORY
        Constant for result filter type: Associated catalog entry satisfies the inventory level requirement.
        See Also:
        Constant Field Values
      • CATEGORY_ALLOW_TO_DISPLAY

        public static final int CATEGORY_ALLOW_TO_DISPLAY
        Constant for result filter type: Category is allowed to display.
        See Also:
        Constant Field Values
      • CATEGORY_ENTITLED_IN_CONTRACT

        public static final int CATEGORY_ENTITLED_IN_CONTRACT
        Constant for result filter type: Category included in contract entitlement.
        See Also:
        Constant Field Values
      • CATEGORY_IN_CURRENT_CATALOG

        public static final int CATEGORY_IN_CURRENT_CATALOG
        Constant for result filter type: Category within the current catalog.
        See Also:
        Constant Field Values
      • CATEGORY_NOT_MARK_FOR_DELETE

        public static final int CATEGORY_NOT_MARK_FOR_DELETE
        Constant for result filter type: Category is not marked for delete.
        See Also:
        Constant Field Values
      • CATENTRY_ALLOW_TO_DISPLAY

        public static final int CATENTRY_ALLOW_TO_DISPLAY
        Constant for result filter type: Catalog entry is allowed to display.
        See Also:
        Constant Field Values
      • CATENTRY_ENTITLED_IN_CONTRACT

        public static final int CATENTRY_ENTITLED_IN_CONTRACT
        Constant for result filter type: Catalog entry included in contract entitlement.
        See Also:
        Constant Field Values
      • CATENTRY_EXIST_IN_SHOPCART

        public static final int CATENTRY_EXIST_IN_SHOPCART
        Constant for result filter type: Catalog entry already exists in the current shopping cart.
        See Also:
        Constant Field Values
      • CATENTRY_IN_CURRENT_CATALOG

        public static final int CATENTRY_IN_CURRENT_CATALOG
        Constant for result filter type: Catalog entry within the current catalog.
        See Also:
        Constant Field Values
      • CATENTRY_NO_DUPLICATE

        public static final int CATENTRY_NO_DUPLICATE
        Constant for result filter type: No multiple catalog items for the same product.
        See Also:
        Constant Field Values
      • CATENTRY_NOT_EXPIRED

        public static final int CATENTRY_NOT_EXPIRED
        Constant for result filter type: Catalog entry has not expired.
        See Also:
        Constant Field Values
      • CATENTRY_NOT_MARK_FOR_DELETE

        public static final int CATENTRY_NOT_MARK_FOR_DELETE
        Constant for result filter type: Catalog entry is not marked for delete.
        See Also:
        Constant Field Values
      • CATENTRY_WITH_INVENTORY

        public static final int CATENTRY_WITH_INVENTORY
        Constant for result filter type: Catalog entry satisfies the inventory level requirement.
        See Also:
        Constant Field Values
      • COPYRIGHT

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

        public static final int ESPOT_RESULT_ORDER_ORIGINAL
        Constant for result order type: Order of result is the same as the order of selecting the content when the campaign Web activity was created.
        See Also:
        Constant Field Values
      • ESPOT_RESULT_ORDER_RANDOM

        public static final int ESPOT_RESULT_ORDER_RANDOM
        Constant for result order type: Order of result is randomized.
        See Also:
        Constant Field Values
      • PROMOTION_CONTENT_ENTITLED_IN_CONTRACT

        public static final int PROMOTION_CONTENT_ENTITLED_IN_CONTRACT
        Constant for result filter type: Promotion content included in contract entitlement.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CampaignRuntimeUtil

        public CampaignRuntimeUtil()
        Constructor for this utility class.
    • Method Detail

      • checkCatalogEntryEntitlement

        public boolean checkCatalogEntryEntitlement(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
        Checks whether the given catalog entry is entitled to the contracts for which the current user is eligible.
        Parameters:
        catentry - The catalog entry to be evaluated.
        Returns:
        True if the given catalog entry is entitled to the contracts for which the current user is eligible; false otherwise.
      • checkCatalogEntryEntitlement

        public boolean checkCatalogEntryEntitlement(java.lang.Long catalogEntryId)
        Checks whether the given catalog entry is entitled to the contracts for which the current user is eligible.
        Parameters:
        catalogEntryId - ID of the catalog entry to be evaluated.
        Returns:
        True if the given catalog entry is entitled to the contracts for which the current user is eligible; false otherwise.
      • checkCatalogEntryInCatalog

        public boolean checkCatalogEntryInCatalog(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
        Checks whether the given catalog entry is contained in the catalog that the customer is currently viewing.
        Parameters:
        catentry - The catalog entry to be evaluated.
        Returns:
        True if the given catalog entry is contained in the catalog that the customer is currently viewing; false otherwise.
      • checkCatalogEntryInventoryLevel

        public boolean checkCatalogEntryInventoryLevel(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
        Checks whether the given catalog entry is satisfied the required inventory level.
        Parameters:
        catentry - The catalog entry to be evaluated.
        Returns:
        True if the given catalog entry satisfies the required inventory level; false otherwise.
      • checkCatalogEntryNotExistInShopcart

        public boolean checkCatalogEntryNotExistInShopcart(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
        Checks whether the given catalog entry exists in the current shopping cart.
        Parameters:
        catentry - The catalog entry to be evaluated.
        Returns:
        True if the given catalog entry does not exist in the current shopping cart; false otherwise.
      • checkCatalogEntryNotExpired

        public boolean checkCatalogEntryNotExpired(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
        Checks whether the given catalog entry has expired, according to its end date.
        Parameters:
        catentry - The catalog entry to be evaluated.
        Returns:
        True if the given catalog entry has expired; false otherwise.
      • checkCatalogEntryNotMarkForDelete

        public boolean checkCatalogEntryNotMarkForDelete(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
        Checks whether the given catalog entry is marked for delete.
        Parameters:
        catentry - The catalog entry to be evaluated.
        Returns:
        True if the given catalog entry is not marked for delete; false otherwise.
      • checkCatalogEntryPublishStatus

        public boolean checkCatalogEntryPublishStatus(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catentry)
        Checks whether the given catalog entry is allowed to display, based on its publish flag.
        Parameters:
        catentry - The catalog entry to be evaluated.
        Returns:
        True if the given catalog entry is allowed to display; false otherwise.
      • checkCatalogEntryRelation

        public int checkCatalogEntryRelation(com.ibm.commerce.catalog.beans.CatalogEntryDataBean catalogEntryDataBean1,
                                             com.ibm.commerce.catalog.beans.CatalogEntryDataBean catalogEntryDataBean2)
        Checks whether the two given catalog entries are related. The possible relationships that are checked by this method: product to item, item to product, and item to item.
        Parameters:
        catalogEntryDataBean1 - The first catalog entry to be evaluated, represented by CatalogEntryDataBean.
        catalogEntryDataBean2 - The second catalog entry to be evaluated, represented by CatalogEntryDataBean.
        Returns:
        The value 0 if the two entries are the same.
        The value 1 if the first entry is the parent product of the second entry, which is an item.
        The value 2 if the second entry is the parent product of the first entry, which is an item.
        The value 3 if the two entries, which are items, belong to the same product.
        The value -1 if the two entries are unrelated.
      • checkCatalogGroupEntitlement

        public boolean checkCatalogGroupEntitlement(com.ibm.commerce.catalog.beans.CategoryDataBean catgroup)
        Checks whether the given catalog group is entitled to the contracts for which the current user is eligible.
        Parameters:
        catgroup - The catalog group to be evaluated.
        Returns:
        True if the given catalog group is entitled to the contracts for which the current user is eligible; false otherwise.
      • checkCatalogGroupEntitlement

        public boolean checkCatalogGroupEntitlement(java.lang.Long catalogGroupId)
        Checks whether the given catalog group is entitled to the contracts for which the current user is eligible.
        Parameters:
        catalogGroupId - ID of the catalog group to be evaluated.
        Returns:
        True if the given catalog group is entitled to the contracts for which the current user is eligible; false otherwise.
      • checkCatalogGroupInCatalog

        public boolean checkCatalogGroupInCatalog(com.ibm.commerce.catalog.beans.CategoryDataBean catgroup)
        Checks whether the given catalog group is contained in the catalog that the customer is currently viewing.
        Parameters:
        catgroup - The catalog group to be evaluated.
        Returns:
        True if the given catalog group is contained in the catalog that the customer is currently viewing; false otherwise.
      • checkCatalogGroupNotMarkForDelete

        public boolean checkCatalogGroupNotMarkForDelete(com.ibm.commerce.catalog.beans.CategoryDataBean catgroup)
        Checks whether the given catalog group is marked for delete.
        Parameters:
        catgroup - The catalog group to be evaluated.
        Returns:
        True if the given catalog group is not marked for delete; false otherwise.
      • checkCatalogGroupPublishStatus

        public boolean checkCatalogGroupPublishStatus(com.ibm.commerce.catalog.beans.CategoryDataBean catgroup)
        Checks whether the given catalog group is allowed to display, based on its publish flag.
        Parameters:
        catgroup - The catalog group to be evaluated.
        Returns:
        True if the given catalog group is allowed to display; false otherwise.
      • checkPromotionContentEntitlement

        public boolean checkPromotionContentEntitlement(CollateralDataBean collateral)
        Checks whether the promotion content that is assigned to the given collateral is entitled to the contracts for which the current user is eligible.
        Parameters:
        collateral - The collateral to be evaluated.
        Returns:
        True if the promotion content that is assigned to the given collateral is entitled to the contracts for which the current user is eligible; false otherwise.
      • generateEMarketingSpotInvocationKey

        public static final java.lang.String generateEMarketingSpotInvocationKey(java.lang.String emsName,
                                                                                 int maxAssociateCatalogEntries,
                                                                                 int maxCatalogEntries,
                                                                                 int maxCategories,
                                                                                 int maxCollateral)
        Creates a String that can be used to uniquely identify an eMarketingSpot configuration
        Parameters:
        emsName - the name of the eMarketingSpot.
        maxAssociateCatalogEntries - the maximum number of associated catalog entries the eMarketingSpot is set to display.
        maxCatalogEntries - the maximum number of catalog entries the eMarketingSpot is set to display.
        maxCategories - the maximum number of categories the eMarketingSpot is set to display.
        maxCollateral - the maximum number of collateral the eMarketingSpot is set to display.
        Returns:
        a String that uniquely identifies the configuration.
      • getCommandContext

        public com.ibm.commerce.command.CommandContext getCommandContext()
        Gets the current command context that is used to retrieve the runtime attributes like the store ID and the member ID.
        Returns:
        The current command context.
      • getCurrentCatalogId

        public java.lang.Long getCurrentCatalogId()
        Gets the ID of the catalog that the customer is currently viewing. If this is not set, then the system assumes that the master catalog of the current store is in use.
        Returns:
        The ID of the catalog that the shopper is currently viewing.
      • getMaximumNumberOfAssociateCatalogEntries

        public int getMaximumNumberOfAssociateCatalogEntries()
        Gets the maximum number of associated catalog entries that can be displayed in an e-Marketing Spot.
        Returns:
        The maximum number of associated catalog entries can be displayed in an e-Marketing Spot.
      • getMaximumNumberOfCatalogEntries

        public int getMaximumNumberOfCatalogEntries()
        Gets the maximum number of catalog entries can be displayed in an e-Marketing Spot.
        Returns:
        The maximum number of catalog entries can be displayed in an e-Marketing Spot.
      • getMaximumNumberOfCategories

        public int getMaximumNumberOfCategories()
        Gets the maximum number of categories can be displayed in an e-Marketing Spot.
        Returns:
        The maximum number of categories can be displayed in an e-Marketing Spot.
      • getMaximumNumberOfCollateral

        public int getMaximumNumberOfCollateral()
        Gets the maximum number of ad copies can be displayed in an e-Marketing Spot.
        Returns:
        The maximum number of ad copies can be displayed in an e-Marketing Spot.
      • getResultFilter

        public java.util.Vector getResultFilter()
        Gets the list of flags that will be used to determine the result filtering to be performed.
        Returns:
        The list of flags that will be used to determine the result filtering to be performed.
      • getResultOrder

        public int getResultOrder()
        Gets the flag that will be used to determine the result ordering logic to be performed.
        Returns:
        The flag that will be used to determine the result ordering logic to be performed.
      • getShoppingCartOrderItemAccessBeans

        public com.ibm.commerce.order.objects.OrderItemAccessBean[] getShoppingCartOrderItemAccessBeans()
        Gets the list of order item objects that represent items currently in the shopping cart.
        Returns:
        The list of order item objects that represent items currently in the shopping cart.
      • getTradingAgreementAccessBeans

        public com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] getTradingAgreementAccessBeans()
        Gets the list of trading agreement objects that are used to check product and category entitlement.
        Returns:
        The list of trading agreement objects that are used to check product and category entitlement.
      • performArrayRandomization

        public java.util.Vector performArrayRandomization(java.util.Vector resultEntries,
                                                          java.lang.Object[] initiativeOrderArray,
                                                          boolean isRandomizingOrder)
        The performArrayRandomization method sorts the entries in the array using the given priority.
        Parameters:
        resultEntries - The original array of result entries that needs to be randomized.
        initiativeOrderArray - Order of web activities based on their priorities.
        isRandomizingOrder - True if the order of the array is randomized; false otherwise.
        Returns:
        The randomized array.
      • performAssociateCatalogEntryFiltering

        public boolean performAssociateCatalogEntryFiltering(EMarketingSpot.AssociateCatalogEntry associateCatalogEntry)
        Checks whether the given associated catalog entry object satisfies all of the filtering criteria.
        Parameters:
        associateCatalogEntry - Associated catalog entry object to be evaluated, in the form of a com.ibm.commerce.marketing.beans.EMarketingSpot.AssociateCatalogEntry object.
        Returns:
        True if the given object satisfies all of the filtering criteria; false otherwise.
      • performCatalogEntryFiltering

        public boolean performCatalogEntryFiltering(EMarketingSpot.CatalogEntry catalogEntry)
        Checks whether the given catalog entry object satisfies all of the filtering criteria.
        Parameters:
        catalogEntry - Catalog entry object to be evaluated, in the form of a com.ibm.commerce.marketing.beans.EMarketingSpot.CatalogEntry object.
        Returns:
        True if the given object satisfies all the filtering criteria; false otherwise.
      • performCategoryFiltering

        public boolean performCategoryFiltering(EMarketingSpot.Category category)
        Checks whether the given category object satisfies all of the filtering criteria.
        Parameters:
        category - Category object to be evaluated, in the form of a com.ibm.commerce.marketing.beans.EMarketingSpot.Category object.
        Returns:
        True if the given object satisfies all the filtering criteria; false otherwise.
      • performCollateralFiltering

        public boolean performCollateralFiltering(EMarketingSpot.Collateral collateral)
        Checks whether the given collateral object satisfies all of the filtering criteria.
        Parameters:
        collateral - Collateral object to be evaluated, in the form of a com.ibm.commerce.marketing.beans.EMarketingSpot.Collateral object.
        Returns:
        True if the given object satisfies all the filtering criteria; false otherwise.
      • performResultOrdering

        public java.util.Vector performResultOrdering(java.util.Vector resultEntries,
                                                      java.lang.Object[] initiativeOrderArray)
        This method orders the e-Marketing Spot result array based on the ordering logic indicated in the resultOrder flag.
        Parameters:
        resultEntries - The original array of result entries that needs to be re-ordered.
        initiativeOrderArray - Order of Web activities based on their priorities.
        Returns:
        The re-ordered array.
      • setCommandContext

        public void setCommandContext(com.ibm.commerce.command.CommandContext newCommandContext)
        Sets the current command context used to retrieve the runtime attributes like the store ID and the member ID.
        Parameters:
        newCommandContext - The current command context.
      • setCurrentCatalogId

        public void setCurrentCatalogId(java.lang.Long newCurrentCatalogId)
        Sets the ID of the catalog that the customer is currently viewing. If this is not set, then the system assumes that the master catalog of the current store is in use.
        Parameters:
        newCurrentCatalogId - The ID of the catalog that the customer is currently viewing.
      • setMaximumNumberOfAssociateCatalogEntries

        public void setMaximumNumberOfAssociateCatalogEntries(int newMaximumNumberOfAssociateCatalogEntries)
        Sets the maximum number of associated catalog entries that can be displayed in an e-Marketing Spot.
        Parameters:
        newMaximumNumberOfAssociateCatalogEntries - The maximum number of associated catalog entries that can be displayed in an e-Marketing Spot.
      • setMaximumNumberOfCatalogEntries

        public void setMaximumNumberOfCatalogEntries(int newMaximumNumberOfCatalogEntries)
        Sets the maximum number of catalog entries that can be displayed in an e-Marketing Spot.
        Parameters:
        newMaximumNumberOfCatalogEntries - The maximum number of catalog entries can be displayed in an e-Marketing Spot.
      • setMaximumNumberOfCategories

        public void setMaximumNumberOfCategories(int newMaximumNumberOfCategories)
        Sets the maximum number of categories that can be displayed in an e-Marketing Spot.
        Parameters:
        newMaximumNumberOfCategories - The maximum number of categories that can be displayed in an e-Marketing Spot.
      • setMaximumNumberOfCollateral

        public void setMaximumNumberOfCollateral(int newMaximumNumberOfCollateral)
        Sets the maximum number of ad copies that can be displayed in an e-Marketing Spot.
        Parameters:
        newMaximumNumberOfCollateral - The maximum number of ad copies that can be displayed in an e-Marketing Spot.
      • setResultFilter

        public void setResultFilter(java.util.Vector newResultFilter)
        Sets the list of flags that will be used to determine the result filtering to be performed.
        Parameters:
        newResultFilter - The list of flags that will be used to determine the result filtering to be performed.
      • setResultOrder

        public void setResultOrder(int newResultOrder)
        Sets the flag that will be used to determine the result ordering logic to be performed.
        Parameters:
        newResultOrder - The flag that will be used to determine the result ordering logic to be performed.
      • setShoppingCartOrderItemAccessBeans

        public void setShoppingCartOrderItemAccessBeans(com.ibm.commerce.order.objects.OrderItemAccessBean[] newShoppingCartOrderItemAccessBeans)
        Sets the list of order item objects that represent items currently in the shopping cart.
        Parameters:
        newShoppingCartOrderItemAccessBeans - The list of order item objects that represent items currently in the shopping cart.
      • setTradingAgreementAccessBeans

        public void setTradingAgreementAccessBeans(com.ibm.commerce.contract.objects.TradingAgreementAccessBean[] newTradingAgreementAccessBeans)
        Sets the list of trading agreement objects that are used to check product and category entitlement.
        Parameters:
        newTradingAgreementAccessBeans - The list of trading agreement objects that are used to check product and category entitlement.
      • sortArrayByRank

        public java.util.Vector sortArrayByRank(java.util.Vector sourceArray)
        The sortArrayByRank method sorts the entries in the array using the given ranks.
        Step 1: Sort all ranks in reverse order.
        Step 2: Calculate order with weight.
        Step 3: Determine which index in the array wins this round by comparing the index with the results of Random.nextInt, which uses the sum of all percentages as the bound.
        Step 4: Repeat step 3 until the size of the array with waiting entries is 0.
        Step 5: Re-sort the previous sorted array using the randomize result.
        Step 6: Remove unnecessary elements from the target array.
        Parameters:
        sourceArray - The original array that needs to be sorted.
        Returns:
        The sorted array ordered according to the rank.