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 Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCE
-
Constructor Summary
ConstructorDescriptionBreadcrumbsCategoryDetailsContributor
(CategoryService<Category> categoryService, CategoryAncestryHydrationService categoryAncestryHydrationService, com.broadleafcommerce.common.extension.TypeFactory typeFactory, com.broadleafcommerce.common.extension.cache.CacheStateManager cacheStateManager) -
Method Summary
Modifier and TypeMethodDescriptioncontribute
(@NonNull CategoryDetails categoryDetails, @NonNull CategoryDetailsContext categoryDetailsContext, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Contributes to the suppliedCategoryDetails
.protected final Breadcrumb
createCrumbForAncestor
(Category ancestor) protected final Breadcrumb
createCrumbForSelf
(CategoryDetails category) protected com.broadleafcommerce.common.extension.cache.key.ContextKeyGen
protected com.broadleafcommerce.common.extension.cache.CacheStateManager
protected CategoryAncestryHydrationService
protected CategoryService<Category>
int
getOrder()
protected com.broadleafcommerce.common.extension.TypeFactory
protected CategoryAncestorList
getWithAncestors
(Category category, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Given a category, finds its ancestors in the data store.void
setCacheByBreadcrumbContributionKeyGen
(com.broadleafcommerce.common.extension.cache.key.ContextKeyGen cacheByBreadcrumbContributionKeyGen)
-
Field Details
-
CACHE_BY_BREADCRUMB_CONTRIBUTION
- See Also:
-
DEFAULT_ORDER
public static final int DEFAULT_ORDER- See Also:
-
-
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 interfaceorg.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 suppliedCategoryDetails
. This should not mutate the inputted details, but return a new one with the new contributions.- Specified by:
contribute
in interfaceCategoryDetailsContributor
- Parameters:
categoryDetails
- The details to which to contributecategoryDetailsContext
- 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
-
createCrumbForAncestor
-
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
-
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:
-