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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected org.broadleafcommerce.core.order.domain.DiscreteOrderItembuildDiscreteOrderItemFromProduct(org.broadleafcommerce.core.catalog.domain.Product product) buildRuleParams(org.broadleafcommerce.core.catalog.domain.Product product) 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 ofAdvancedOfferPromotionMessageService.findActiveOffersWithPromotionMessages()if you require precise control of the Offer's active start/end dates.List<org.broadleafcommerce.core.offer.domain.Offer>Gathers a list ofAdvancedOffers that havePromotionMessages.List<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage>findActivePromotionMessagesForOrderItem(org.broadleafcommerce.core.order.domain.OrderItem orderItem) Gathers the set of activePromotionMessages for the givenOrderItem.findActivePromotionMessagesForProduct(org.broadleafcommerce.core.catalog.domain.Product product) Gathers the set of activePromotionMessages for the givenProduct.protected Set<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage>findApplicableOfferTargetAndQualifierMessages(org.broadleafcommerce.core.catalog.domain.Product product, org.broadleafcommerce.core.offer.domain.Offer offer) 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) protected List<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage>gatherCartOfferMessagesByType(org.broadleafcommerce.core.offer.domain.Offer offer, org.broadleafcommerce.core.promotionMessage.domain.type.PromotionMessageType messageType) protected List<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage>gatherOfferQualifierMessages(org.broadleafcommerce.core.order.domain.OrderItem orderItem) protected List<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage>gatherOfferTargetMessages(org.broadleafcommerce.core.order.domain.OrderItem orderItem) protected booleanisOfferQualifier(org.broadleafcommerce.core.order.domain.OrderItem orderItem) protected booleanisOfferTarget(org.broadleafcommerce.core.order.domain.OrderItem orderItem) protected booleanproductPassesMatchRule(org.broadleafcommerce.core.catalog.domain.Product product, String matchRule)
-
Field Details
-
advancedOfferPromotionMessageDao
-
-
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:AdvancedOfferPromotionMessageServiceGathers the set of activePromotionMessages for the givenProduct.- Specified by:
findActivePromotionMessagesForProductin interfaceAdvancedOfferPromotionMessageService- Returns:
- the set of active
PromotionMessages for the givenProduct
-
findActivePromotionMessagesForOrderItem
public List<org.broadleafcommerce.core.promotionMessage.domain.PromotionMessage> findActivePromotionMessagesForOrderItem(org.broadleafcommerce.core.order.domain.OrderItem orderItem) Description copied from interface:AdvancedOfferPromotionMessageServiceGathers the set of activePromotionMessages for the givenOrderItem.- Specified by:
findActivePromotionMessagesForOrderItemin interfaceAdvancedOfferPromotionMessageService- Returns:
- the set of active
PromotionMessages for the givenOrderItem
-
findActiveOffersWithPromotionMessages
Description copied from interface:AdvancedOfferPromotionMessageServiceGathers a list ofAdvancedOffers that havePromotionMessages.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 overrideAdvancedOfferPromotionMessageDao.getCurrentDateResolution()to modify the cache entry's effective range.- Specified by:
findActiveOffersWithPromotionMessagesin interfaceAdvancedOfferPromotionMessageService- Returns:
- a list of
AdvancedOffers that havePromotionMessages
-
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 ofAdvancedOfferPromotionMessageService.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 overrideAdvancedOfferPromotionMessageDao.getCurrentDateResolution()to modify the cache entry's effective range.- Specified by:
filterOutInactiveOffersByDateAndTimein interfaceAdvancedOfferPromotionMessageService
-
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
-
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)
-