Interface ProductConsolidationContributor

All Known Implementing Classes:
AllAssetsProductConsolidationContributor, CategoryProductConsolidationContributor, ContextualProductConsolidationContributor, DataDrivenEnumConsolidationContributor, ItemChoiceAvailabilityConsolidationContributor, OptionTemplateProductConsolidationContributor, PrimaryAssetProductConsolidationContributor, ProductTagConsolidationContributor, TranslationProductConsolidationContributor, VariantProductConsolidationContributor

public interface ProductConsolidationContributor
Populates extra data into the ConsolidatedProduct.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    consolidateProducts(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
    Consolidate products with their related domain and translations.
    default 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.
  • Method Details

    • shouldConsolidate

      default 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.

      Returns true by default.

      Parameters:
      productIds - the IDs of the products to consolidate
      products - the product in all explicit context states
      inheritanceLines - the catalog inheritance lines top-down from all of the products
      context - context information surrounding sandboxing/multitenant state
      Since:
      2.1.1, 2.0.2
    • consolidateProducts

      void consolidateProducts(Set<String> productIds, List<ConsolidatedProduct> products, com.broadleafcommerce.data.tracking.core.tenant.domain.InheritanceLines inheritanceLines, com.broadleafcommerce.data.tracking.core.context.ContextInfo context)
      Consolidate products with their related domain and translations. This includes both hydrating Product fields and combining external references like CategoryProduct. Any catalog or sandbox overrides made to external references for non-overridden products will generate new placeholder products to store those overrides.
      Parameters:
      productIds - the IDs of the products to consolidate
      products - the product in all explicit context states
      inheritanceLines - the catalog inheritance lines top-down from all of the products
      context - context information surrounding sandboxing/multitenant state