Class AbstractQuoteCartStatusHandler
java.lang.Object
com.broadleafcommerce.cartoperation.service.status.AbstractCartStatusChangeHandler
com.broadleafcommerce.cartoperation.service.status.quote.AbstractQuoteCartStatusHandler
- All Implemented Interfaces:
CartStatusHandler
- Direct Known Subclasses:
QuoteAssignedStatusHandler,QuoteCanceledStatusHandler,QuoteDraftingStatusHandler,QuoteEditingStatusHandler,QuoteExpiredStatusHandler,QuotePublishedStatusHandler,QuoteQuoteRequestedStatusHandler,QuoteRejectedStatusHandler,QuoteSubmittedStatusHandler
The
AbstractCartStatusChangeHandler to handle DefaultCartTypes.QUOTE carts.-
Field Summary
Fields inherited from class com.broadleafcommerce.cartoperation.service.status.AbstractCartStatusChangeHandler
INACCESSIBLE_CART_STATUS, USER_AUTHENTICATION_FAILED -
Constructor Summary
ConstructorsConstructorDescriptionAbstractQuoteCartStatusHandler(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, QuoteAuthUtils quoteAuthUtils, com.broadleafcommerce.cart.client.properties.QuoteProperties properties) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCartActionAuditUserInfo(com.broadleafcommerce.cart.client.domain.CartActionAudit cartActionAudit, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Hook point to populate fields related to user info in theCartActionAudit.booleancanHandle(@NonNull ChangeCartStatusRequest changeStatusRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if this handler can handle the status change.protected com.broadleafcommerce.cart.client.properties.QuotePropertiesprotected QuoteAuthUtilsprotected booleanisAssignedToThisQuote(@NonNull CartStatusValidationRequest statusValidationRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the user performing the request is the one assigned as a sales rep to this quote.protected booleanisAssignedToThisQuote(@NonNull ChangeCartStatusRequest changeStatusRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the user performing the request is the one assigned as a sales rep to this quote.protected booleanisConvertingToQuote(@NonNull ChangeCartStatusRequest changeStatusRequest, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the givenChangeCartStatusRequestis converting aDefaultCartTypes.STANDARDcart into aDefaultCartTypes.QUOTE.Methods inherited from class com.broadleafcommerce.cartoperation.service.status.AbstractCartStatusChangeHandler
buildCartActionAuditToCreate, canBeReadByUser, canBeTransitionedToByUser, canBeUpdatedByUser, getAuthenticationUtils, getCartActionType, getPolicyUtils, getStatusToHandle, getTypeFactory, getValidOriginatingStatuses, isCartOwner, isCartOwner, postProcessStatusChange, process, processStatusChange, setPolicyUtils, validateOriginatingStatus, validateStatusIsReadableByUser, validateStatusIsUpdatableByUser, validateStatusTransition, validateTransitionRules
-
Constructor Details
-
AbstractQuoteCartStatusHandler
public AbstractQuoteCartStatusHandler(com.broadleafcommerce.resource.security.utils.service.AuthenticationUtils authenticationUtils, com.broadleafcommerce.common.extension.TypeFactory typeFactory, QuoteAuthUtils quoteAuthUtils, com.broadleafcommerce.cart.client.properties.QuoteProperties properties)
-
-
Method Details
-
canHandle
public boolean canHandle(@NonNull @NonNull ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CartStatusHandlerDetermines if this handler can handle the status change.- Specified by:
canHandlein interfaceCartStatusHandler- Overrides:
canHandlein classAbstractCartStatusChangeHandler- Parameters:
changeStatusRequest- theChangeCartStatusRequestto facilitate the cart status changecontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- true if this handler can handle the status change, otherwise false
-
addCartActionAuditUserInfo
public void addCartActionAuditUserInfo(com.broadleafcommerce.cart.client.domain.CartActionAudit cartActionAudit, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from class:AbstractCartStatusChangeHandlerHook point to populate fields related to user info in theCartActionAudit.- Overrides:
addCartActionAuditUserInfoin classAbstractCartStatusChangeHandler- Parameters:
cartActionAudit- the cart action auditcontextInfo- context information surrounding sandboxing and multitenant state
-
isConvertingToQuote
protected boolean isConvertingToQuote(@NonNull @NonNull ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the givenChangeCartStatusRequestis converting aDefaultCartTypes.STANDARDcart into aDefaultCartTypes.QUOTE.- Parameters:
changeStatusRequest- theChangeCartStatusRequestfor the cart status changecontextInfo- context information surrounding sandboxing and multitenant state- Returns:
- true if the given request is converting a standard cart into a quote, otherwise false
-
isAssignedToThisQuote
protected boolean isAssignedToThisQuote(@NonNull @NonNull CartStatusValidationRequest statusValidationRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the user performing the request is the one assigned as a sales rep to this quote.- Parameters:
statusValidationRequest- theCartStatusValidationRequestfor the quote request.contextInfo- context information surrounding sandboxing and multitenant state.- Returns:
- true if the current user is the assigned sales rep on this quote, false otherwise.
-
isAssignedToThisQuote
protected boolean isAssignedToThisQuote(@NonNull @NonNull ChangeCartStatusRequest changeStatusRequest, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Determines if the user performing the request is the one assigned as a sales rep to this quote.- Parameters:
changeStatusRequest- theChangeCartStatusRequestfor the quote request.contextInfo- context information surrounding sandboxing and multitenant state.- Returns:
- true if the current user is the assigned sales rep on this quote, false otherwise.
-
getQuoteAuthUtils
-
getProperties
protected com.broadleafcommerce.cart.client.properties.QuoteProperties getProperties()
-