Class MarketingMessagesEndpoint

java.lang.Object
com.broadleafcommerce.promotion.offer.web.endpoint.MarketingMessagesEndpoint

@FrameworkRestController @FrameworkMapping @DataRouteByExample(MarketingMessage.class) public class MarketingMessagesEndpoint extends Object
MarketingMessage is a subresource of Offer, so most of these endpoints fall under the same base URL as OffersEndpoint.
Author:
Nathan Moore (nathanmoore)., Samarth Dhruva (samarthd)
  • Field Details

  • Constructor Details

    • MarketingMessagesEndpoint

      public MarketingMessagesEndpoint(MarketingMessageService<MarketingMessage> marketingMessageService, OfferService<Offer> offerService, com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> translationEntityService)
  • Method Details

    • readAllMessages

      @FrameworkGetMapping("/marketing-messages") @Policy(permissionRoots="OFFER") public org.springframework.data.domain.Page<MarketingMessage> readAllMessages(@RequestParam(value="offerIds",required=false) List<String> offerIds, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters)
      Reads all of the active MarketingMessages with options for paging and filtering by Offer.id.
      Parameters:
      offerIds - List of Offer IDs by which to filter
      contextInfo - context information related to multitenancy. Often used to validate visibility and mutability of persistence operations for a catalog.
      page - Pageable for limiting the result set
      Returns:
      All of the active MarketingMessages
    • readAllMessagesForOffer

      @FrameworkGetMapping("/offers/{offerId}/marketing-messages") @Policy(permissionRoots="OFFER") public org.springframework.data.domain.Page<MarketingMessage> readAllMessagesForOffer(@PathVariable("offerId") String offerId, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo, @PageableDefault(size=50) org.springframework.data.domain.Pageable page, cz.jirutka.rsql.parser.ast.Node filters)
    • readMessageById

      @FrameworkGetMapping("/offers/{offerId}/marketing-messages/{id}") @Policy(permissionRoots="OFFER") public MarketingMessage readMessageById(@PathVariable("offerId") String offerId, @PathVariable("id") String messageId, @ContextOperation(READ) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • createMessage

      @FrameworkPostMapping("/offers/{offerId}/marketing-messages") @Policy(permissionRoots="OFFER") public MarketingMessage createMessage(@PathVariable("offerId") String offerid, @RequestBody MarketingMessage marketingMessage, @ContextOperation(CREATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • updateMessage

      @FrameworkPatchMapping("/offers/{offerId}/marketing-messages/{id}") @Policy(permissionRoots="OFFER") public MarketingMessage updateMessage(@PathVariable("offerId") String offerId, @PathVariable("id") String messageId, @RequestBody MarketingMessage marketingMessage, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • replaceMessage

      @FrameworkPutMapping("/offers/{offerId}/marketing-messages/{id}") @Policy(permissionRoots="OFFER") public MarketingMessage replaceMessage(@PathVariable("offerId") String offerId, @PathVariable("id") String messageId, @RequestBody MarketingMessage marketingMessage, @ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • replaceAllMarketingMessageTranslations

      @FrameworkPutMapping(value="/offers/{offerId}/marketing-messages/{id}/translations/{locale}", consumes="application/json") @Policy(permissionRoots="OFFER") public com.broadleafcommerce.translation.service.dto.TranslationsPayload replaceAllMarketingMessageTranslations(@ContextOperation(UPDATE) com.broadleafcommerce.data.tracking.core.context.ContextInfo context, @PathVariable("offerId") String offerId, @PathVariable("id") String messageId, @PathVariable("locale") Locale locale, @RequestBody com.broadleafcommerce.translation.service.dto.TranslationsPayload translationRequest)
    • deleteMessage

      @FrameworkDeleteMapping("/offers/{offerId}/marketing-messages/{id}") @Policy(permissionRoots="OFFER") public void deleteMessage(@PathVariable("offerId") String offerId, @PathVariable("id") String messageId, @ContextOperation(DELETE) com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • assertOfferExistsAndReturn

      protected Offer assertOfferExistsAndReturn(String offerContextId, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
    • assertParentOfferOfMessageIsCorrect

      protected void assertParentOfferOfMessageIsCorrect(String expectedParentOfferId, MarketingMessage message)
    • getMarketingMessageService

      protected MarketingMessageService<MarketingMessage> getMarketingMessageService()
    • getOfferService

      protected OfferService<Offer> getOfferService()
    • getTranslationEntityService

      protected com.broadleafcommerce.translation.service.TranslationEntityService<com.broadleafcommerce.translation.domain.Translation> getTranslationEntityService()