Class RelatedProductAssetsProductContextContributor

java.lang.Object
com.broadleafcommerce.catalog.service.product.commerce.context.contributor.RelatedProductAssetsProductContextContributor
All Implemented Interfaces:
ProductDetailsContextContributor, org.springframework.core.Ordered

public class RelatedProductAssetsProductContextContributor extends Object implements ProductDetailsContextContributor
Contributes all of the related ProductAssets to the ProductDetailsContext.

This should be run after RelatedProductsProductContextContributor to allow us to gather all the assets at once.

Author:
Nathan Moore (nathandmoore)
  • Field Details

  • Constructor Details

    • RelatedProductAssetsProductContextContributor

      public RelatedProductAssetsProductContextContributor(ProductAssetService<ProductAsset> productAssetService)
  • Method Details

    • getOrder

      public int getOrder()
      Specified by:
      getOrder in interface org.springframework.core.Ordered
    • contribute

      public <T extends ProductDetailsContext> Collection<T> contribute(@NonNull @NonNull Collection<T> productDetailsContexts, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: ProductDetailsContextContributor
      Contributes to the supplied ProductDetailsContext. This should not mutate the inputted context, but return a new one with the new contributions.
      Specified by:
      contribute in interface ProductDetailsContextContributor
      Parameters:
      productDetailsContexts - The contexts to which to contribute
      contextInfo - context information surrounding sandboxing/multitenant state
      Returns:
      A version of the supplied ProductDetailsContext with the new contributions.
    • getProductAssetService

      protected ProductAssetService<ProductAsset> getProductAssetService()