Class AllAssetsProductConsolidationContributor
java.lang.Object
com.broadleafcommerce.catalog.service.product.consolidation.ContextualProductConsolidationContributor<ProductAsset>
com.broadleafcommerce.catalog.service.product.consolidation.AllAssetsProductConsolidationContributor
- All Implemented Interfaces:
ProductConsolidationContributor
public class AllAssetsProductConsolidationContributor
extends ContextualProductConsolidationContributor<ProductAsset>
Consolidates all
ProductAsset
instances associated with a product onto each product.-
Field Summary
Fields inherited from class com.broadleafcommerce.catalog.service.product.consolidation.ContextualProductConsolidationContributor
IGNORE_ARCHIVED_FILTER, typeFactory
-
Constructor Summary
ConstructorDescriptionAllAssetsProductConsolidationContributor
(ProductAssetService<ProductAsset> productAssetSvc, com.broadleafcommerce.common.extension.TypeFactory typeFactory) -
Method Summary
Modifier and TypeMethodDescriptionprotected List<ProductAsset>
getObjectsToConsolidate
(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Retrieve the full list of domain objects of this type to be consolidated into the products.protected ProductAssetService<ProductAsset>
protected Function<ProductAsset,
String> idGetter()
Defines the function which retrieves the contextId of the domain object in order to recognize it in different contexts.protected Function<ProductAsset,
String> Defines the function which retrieves the Product ID from the domain object to consolidate, in order to group it with the appropriate product for processing.protected BiConsumer<ConsolidatedProduct,
List<ProductAsset>> setter()
Defines the function which should be used to set the domain objects on the consolidated product.boolean
shouldConsolidate
(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Determines whether this contributor should be executed based on the given parameters and context.Methods inherited from class com.broadleafcommerce.catalog.service.product.consolidation.ContextualProductConsolidationContributor
consolidateProducts, consolidateRelations, contextCompositeKey, contextCompositeKey, contextStatesMatch, createOverrideProductForContext, findImplicitMatches, getCloneMapper, getInheritanceLevel, getMostSpecificCatalogId, getProductConsolidationRequest, getRsqlParser, getTypeFactory, ignoreArchived, isInheriting, setListValue, setSingleValue
-
Constructor Details
-
AllAssetsProductConsolidationContributor
public AllAssetsProductConsolidationContributor(ProductAssetService<ProductAsset> productAssetSvc, com.broadleafcommerce.common.extension.TypeFactory typeFactory)
-
-
Method Details
-
shouldConsolidate
public boolean shouldConsolidate(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from interface:ProductConsolidationContributor
Determines whether this contributor should be executed based on the given parameters and context.Returns true by default.
- Parameters:
productIds
- the IDs of the products to consolidateproducts
- the product in all explicit context statesinheritanceLines
- the catalog inheritance lines top-down from all of the productscontext
- context information surrounding sandboxing/multitenant state
-
getObjectsToConsolidate
protected List<ProductAsset> getObjectsToConsolidate(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context) Description copied from class:ContextualProductConsolidationContributor
Retrieve the full list of domain objects of this type to be consolidated into the products.- Specified by:
getObjectsToConsolidate
in classContextualProductConsolidationContributor<ProductAsset>
- Parameters:
productIds
- the IDs of the products to consolidateproducts
- the products in all explicit context statesinheritanceLines
- the catalog inheritance lines top-down from all of the productscontext
- context information surrounding sandboxing/multitenant state- Returns:
- all domain objects of this type to consolidate into the products
-
setter
Description copied from class:ContextualProductConsolidationContributor
Defines the function which should be used to set the domain objects on the consolidated product.- Specified by:
setter
in classContextualProductConsolidationContributor<ProductAsset>
- Returns:
- function to set domain objects on the consolidated product
-
productIdGetter
Description copied from class:ContextualProductConsolidationContributor
Defines the function which retrieves the Product ID from the domain object to consolidate, in order to group it with the appropriate product for processing.- Specified by:
productIdGetter
in classContextualProductConsolidationContributor<ProductAsset>
- Returns:
- function to retrieve Product ID of the domain object
-
idGetter
Description copied from class:ContextualProductConsolidationContributor
Defines the function which retrieves the contextId of the domain object in order to recognize it in different contexts.- Specified by:
idGetter
in classContextualProductConsolidationContributor<ProductAsset>
- Returns:
- function to retrieve contextId of the domain object
-
getProductAssetSvc
-