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 Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringprotected org.broadleafcommerce.common.crossapp.service.CrossAppAuthServiceprotected final CustomerSegmentServicestatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidclearPreviewSegmentsFromStorage(org.springframework.web.context.request.WebRequest webRequest) extractSegmentIdsFromRequest(org.springframework.web.context.request.WebRequest webRequest) extractSegmentIdsFromStorage(org.springframework.web.context.request.WebRequest webRequest) protected booleanisAuthorizedToPreviewSegments(org.springframework.web.context.request.WebRequest webRequest) If you are cross-app authenticated and you are not a CSR, then you can preview segments.voidprocess(org.springframework.web.context.request.WebRequest webRequest) voidsetCrossAppAuthService(org.broadleafcommerce.common.crossapp.service.CrossAppAuthService crossAppAuthService) protected booleanshouldClearPreviewSegments(org.springframework.web.context.request.WebRequest webRequest) protected voidstoreSegmentIds(org.springframework.web.context.request.WebRequest webRequest, List<Long> previewSegmentIds) Methods inherited from class org.broadleafcommerce.common.web.AbstractBroadleafWebRequestProcessor
postProcess
-
Field Details
-
PREVIEW_SEGMENT_PARAMETER_NAME
- See Also:
-
CLEAR_PREVIEW_SEGMENT_PARAMETER_NAME
- See Also:
-
CLEAR_SANDBOX_PARAMETER_NAME
- See Also:
-
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
-
extractSegmentIdsFromStorage
-
storeSegmentIds
-