Class PreviewCustomerSegmentProcessor

java.lang.Object
org.broadleafcommerce.common.web.AbstractBroadleafWebRequestProcessor
com.broadleafcommerce.customersegment.site.security.PreviewCustomerSegmentProcessor
All Implemented Interfaces:
org.broadleafcommerce.common.web.BroadleafWebRequestProcessor

@Component("blPreviewCustomerSegmentProcessor") @ConditionalOnBroadleafModule(ENTERPRISE) public class PreviewCustomerSegmentProcessor extends org.broadleafcommerce.common.web.AbstractBroadleafWebRequestProcessor
This request processor is responsible for extracting any preview segment ids from the request, looking up the customer segments for those ids, and then storing the segments on the BroadleafRequestContext. By default, this processor utilizes session storage for persisting preview segment ids across subsequent requests. This functionality can be easily overridden by extending this class and overriding the bean for this processor.
Author:
Nick Crum ncrum
See Also:
  • Field Details

    • PREVIEW_SEGMENT_PARAMETER_NAME

      public static final String PREVIEW_SEGMENT_PARAMETER_NAME
      See Also:
    • CLEAR_PREVIEW_SEGMENT_PARAMETER_NAME

      public static final String CLEAR_PREVIEW_SEGMENT_PARAMETER_NAME
      See Also:
    • CLEAR_SANDBOX_PARAMETER_NAME

      public static final String CLEAR_SANDBOX_PARAMETER_NAME
      See Also:
    • customerSegmentService

      protected final CustomerSegmentService customerSegmentService
    • crossAppAuthService

      protected org.broadleafcommerce.common.crossapp.service.CrossAppAuthService crossAppAuthService
  • Constructor Details

    • PreviewCustomerSegmentProcessor

      public PreviewCustomerSegmentProcessor()
  • Method Details

    • setCrossAppAuthService

      @Autowired(required=false) public void setCrossAppAuthService(org.broadleafcommerce.common.crossapp.service.CrossAppAuthService crossAppAuthService)
    • process

      public void process(org.springframework.web.context.request.WebRequest webRequest)
    • isAuthorizedToPreviewSegments

      protected boolean isAuthorizedToPreviewSegments(org.springframework.web.context.request.WebRequest webRequest)
      If you are cross-app authenticated and you are not a CSR, then you can preview segments.
    • shouldClearPreviewSegments

      protected boolean shouldClearPreviewSegments(org.springframework.web.context.request.WebRequest webRequest)
    • clearPreviewSegmentsFromStorage

      protected void clearPreviewSegmentsFromStorage(org.springframework.web.context.request.WebRequest webRequest)
    • extractSegmentIdsFromRequest

      protected List<Long> extractSegmentIdsFromRequest(org.springframework.web.context.request.WebRequest webRequest)
    • extractSegmentIdsFromStorage

      protected List<Long> extractSegmentIdsFromStorage(org.springframework.web.context.request.WebRequest webRequest)
    • storeSegmentIds

      protected void storeSegmentIds(org.springframework.web.context.request.WebRequest webRequest, List<Long> previewSegmentIds)