Class BreadcrumbsCategoryDetailsContributor

java.lang.Object
com.broadleafcommerce.catalog.service.category.commerce.contributor.BreadcrumbsCategoryDetailsContributor
All Implemented Interfaces:
CategoryDetailsContributor, org.springframework.core.Ordered

public class BreadcrumbsCategoryDetailsContributor extends Object implements CategoryDetailsContributor
This contributor is responsible for the CategoryDetails' breadcrumbs.
Author:
Nathan Moore (nathandmoore)
  • Field Details

  • Constructor Details

    • BreadcrumbsCategoryDetailsContributor

      public BreadcrumbsCategoryDetailsContributor(CategoryService<Category> categoryService, CategoryAncestryHydrationService categoryAncestryHydrationService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, @Nullable com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager)
  • Method Details

    • getOrder

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

      public CategoryDetails contribute(@NonNull @NonNull CategoryDetails categoryDetails, @NonNull @NonNull CategoryDetailsContext categoryDetailsContext, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Description copied from interface: CategoryDetailsContributor
      Contributes to the supplied CategoryDetails. This should not mutate the inputted details, but return a new one with the new contributions.
      Specified by:
      contribute in interface CategoryDetailsContributor
      Parameters:
      categoryDetails - The details to which to contribute
      categoryDetailsContext - The context containing information that may be important for contributors.
      contextInfo - context information surrounding sandboxing/multitenant state
      Returns:
      An version of the supplied CategoryDetails with the new contributions.
    • createCrumbForSelf

      protected final Breadcrumb createCrumbForSelf(CategoryDetails category)
    • createCrumbForAncestor

      protected final Breadcrumb createCrumbForAncestor(Category ancestor)
    • getWithAncestors

      protected CategoryAncestorList getWithAncestors(Category category, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo)
      Given a category, finds its ancestors in the data store.

      If there was an error fetching its ancestors, an error will be logged and the result will have an empty CategoryAncestorList.ancestors.

      Parameters:
      category - the category whose ancestors should be found. Should be a fully populated instance as would be found from the data store.
      contextInfo - context information surrounding sandboxing and multitenant state
      Returns:
      the given category and its ancestors
    • getCategoryService

      protected CategoryService<Category> getCategoryService()
    • getCategoryAncestryHydrationService

      protected CategoryAncestryHydrationService getCategoryAncestryHydrationService()
    • getTypeFactory

      protected com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
    • getCacheStateManager

      @Nullable protected com.broadleafcommerce.common.extension.cache.CacheStateManager getCacheStateManager()
    • setCacheByBreadcrumbContributionKeyGen

      @Autowired @Qualifier("catalogCacheByBreadcrumbContribution") public void setCacheByBreadcrumbContributionKeyGen(@Nullable com.broadleafcommerce.common.extension.cache.key.ContextKeyGen cacheByBreadcrumbContributionKeyGen)
      See Also:
    • getCacheByBreadcrumbContributionKeyGen

      @Nullable protected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen getCacheByBreadcrumbContributionKeyGen()
      See Also: