Class AdvancedOfferPromotionMessageServiceImpl

java.lang.Object
com.broadleafcommerce.advancedoffer.service.promotionmessage.AdvancedOfferPromotionMessageServiceImpl
All Implemented Interfaces:
AdvancedOfferPromotionMessageService

@Service("blAdvancedOfferPromotionMessageService") public class AdvancedOfferPromotionMessageServiceImpl extends Object implements AdvancedOfferPromotionMessageService
Author:
Chris Kittrell (ckittrell)
  • Field Details

  • Constructor Details

    • AdvancedOfferPromotionMessageServiceImpl

      public AdvancedOfferPromotionMessageServiceImpl()
  • Method Details

    • findActivePromotionMessagesForProduct

      public Map<String,List<org.broadleafcommerce.core.promotionMessage.dto.PromotionMessageDTO>> findActivePromotionMessagesForProduct(org.broadleafcommerce.core.catalog.domain.Product product)
      Description copied from interface: AdvancedOfferPromotionMessageService
      Gathers the set of active PromotionMessages for the given Product.
      Specified by:
      findActivePromotionMessagesForProduct in interface AdvancedOfferPromotionMessageService
      Returns:
      the set of active PromotionMessages for the given Product
    • findActivePromotionMessagesForOrderItem

      public List<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage> findActivePromotionMessagesForOrderItem(org.broadleafcommerce.core.order.domain.OrderItem orderItem)
      Description copied from interface: AdvancedOfferPromotionMessageService
      Gathers the set of active PromotionMessages for the given OrderItem.
      Specified by:
      findActivePromotionMessagesForOrderItem in interface AdvancedOfferPromotionMessageService
      Returns:
      the set of active PromotionMessages for the given OrderItem
    • findActiveOffersWithPromotionMessages

      public List<org.broadleafcommerce.core.offer.domain.Offer> findActiveOffersWithPromotionMessages()
      Description copied from interface: AdvancedOfferPromotionMessageService
      Gathers a list of AdvancedOffers that have PromotionMessages.

      Out of box, this method maintains cached results for 10 minutes. AdvancedOfferPromotionMessageService.filterOutInactiveOffersByDateAndTime(List) is intended to provide an opportunity to filter the results of that method if you require precise control of the active start/end dates. Alternatively, you could override AdvancedOfferPromotionMessageDao.getCurrentDateResolution() to modify the cache entry's effective range.

      Specified by:
      findActiveOffersWithPromotionMessages in interface AdvancedOfferPromotionMessageService
      Returns:
      a list of AdvancedOffers that have PromotionMessages
    • filterOutInactiveOffersByDateAndTime

      public List<org.broadleafcommerce.core.offer.domain.Offer> filterOutInactiveOffersByDateAndTime(List<org.broadleafcommerce.core.offer.domain.Offer> offers)
      This method is intended to provide an opportunity to filter the results of AdvancedOfferPromotionMessageService.findActiveOffersWithPromotionMessages() if you require precise control of the Offer's active start/end dates. Out of box, that method maintains cached results for 10 minutes, so results may become inaccurate in that time frame. Alternatively, you could override AdvancedOfferPromotionMessageDao.getCurrentDateResolution() to modify the cache entry's effective range.
      Specified by:
      filterOutInactiveOffersByDateAndTime in interface AdvancedOfferPromotionMessageService
    • findApplicableOfferTargetAndQualifierMessages

      protected Set<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage> findApplicableOfferTargetAndQualifierMessages(org.broadleafcommerce.core.catalog.domain.Product product, org.broadleafcommerce.core.offer.domain.Offer offer)
    • findApplicablePromotionMessagesByType

      protected Set<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage> findApplicablePromotionMessagesByType(org.broadleafcommerce.core.catalog.domain.Product product, org.broadleafcommerce.core.offer.domain.Offer offer, org.broadleafcommerce.core.offer.domain.OfferItemCriteria criteria, org.broadleafcommerce.core.promotionMessage.domain.type.PromotionMessageType promotionMessageType)
    • productPassesMatchRule

      protected boolean productPassesMatchRule(org.broadleafcommerce.core.catalog.domain.Product product, String matchRule)
    • buildRuleParams

      protected Map<String,Object> buildRuleParams(org.broadleafcommerce.core.catalog.domain.Product product)
    • buildDiscreteOrderItemFromProduct

      protected org.broadleafcommerce.core.order.domain.DiscreteOrderItem buildDiscreteOrderItemFromProduct(org.broadleafcommerce.core.catalog.domain.Product product)
    • isOfferTarget

      protected boolean isOfferTarget(org.broadleafcommerce.core.order.domain.OrderItem orderItem)
    • gatherOfferTargetMessages

      protected List<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage> gatherOfferTargetMessages(org.broadleafcommerce.core.order.domain.OrderItem orderItem)
    • isOfferQualifier

      protected boolean isOfferQualifier(org.broadleafcommerce.core.order.domain.OrderItem orderItem)
    • gatherOfferQualifierMessages

      protected List<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage> gatherOfferQualifierMessages(org.broadleafcommerce.core.order.domain.OrderItem orderItem)
    • gatherCartOfferMessagesByType

      protected List<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage> gatherCartOfferMessagesByType(org.broadleafcommerce.core.offer.domain.Offer offer, org.broadleafcommerce.core.promotionMessage.domain.type.PromotionMessageType messageType)