Interface ProductDetailsContextContributor
- All Superinterfaces:
org.springframework.core.Ordered
- All Known Implementing Classes:
ItemChoiceHierarchyProductContextContributor
,RelatedCategoriesProductContextContributor
,RelatedDataDrivenEnumsProductContextContributor
,RelatedProductAssetsProductContextContributor
,RelatedProductsProductContextContributor
,RelatedProductTagsProductContextContributor
,RelatedPromoProductsProductContextContributor
,RelatedVariantsProductContextContributor
public interface ProductDetailsContextContributor
extends org.springframework.core.Ordered
Services implementing this interface are responsible for contributing a specific subset of
information to a
ProductDetailsContext
based on a ProductDetailsRequest
such as
the related category, product, and variants in order to retrieve all related entities in bulk
operations rather than piece-meal for performance reasons. It is desirable for implementations of
this class to be as narrow as possible in the breadth of their contributions to improve
extensibility, reusability, testability, and readability.
Contributors should handle all the DB queries necessary for gathering all the related entities
while consolidation (such as merging product assets onto related products) should be handled by
ProductDetailsContextConsolidators
as consolidators
will run after all contributors.
- Author:
- Nathan Moore (nathandmoore)
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Method Summary
Modifier and TypeMethodDescription<T extends ProductDetailsContext>
Collection<T>contribute
(Collection<T> productDetailsContexts, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Contributes to the suppliedProductDetailsContext
.Methods inherited from interface org.springframework.core.Ordered
getOrder
-
Method Details
-
contribute
<T extends ProductDetailsContext> Collection<T> contribute(Collection<T> productDetailsContexts, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Contributes to the suppliedProductDetailsContext
. This should not mutate the inputted context, but return a new one with the new contributions.- Parameters:
productDetailsContexts
- The contexts to which to contributecontextInfo
- context information surrounding sandboxing/multitenant state- Returns:
- A version of the supplied
ProductDetailsContext
with the new contributions.
-