Class CategoryBreadcrumbServiceExtensionHandler
java.lang.Object
org.broadleafcommerce.core.web.breadcrumbs.AbstractBreadcrumbServiceExtensionHandler
org.broadleafcommerce.core.web.breadcrumbs.CategoryBreadcrumbServiceExtensionHandler
- All Implemented Interfaces:
BreadcrumbServiceExtensionHandler,ExtensionHandler
@Service("blCategoryBreadcrumbServiceExtensionHandler")
public class CategoryBreadcrumbServiceExtensionHandler
extends AbstractBreadcrumbServiceExtensionHandler
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CatalogServiceprotected BreadcrumbServiceExtensionManagerFields inherited from class org.broadleafcommerce.core.web.breadcrumbs.AbstractBreadcrumbServiceExtensionHandler
enabled, priority -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddParentCrumbs(List<BreadcrumbDTO> parentCrumbs, Category category, String url, Map<String, String[]> params) Add the parent crumb for the passed in category.protected BreadcrumbDTOHook for overrides, some implementations may want to build a crumb related to category filtering.protected BreadcrumbDTOprotected CategorydetermineFirstCategory(String testUrl, Map<String, String[]> params, ExtensionResultHolder<List<BreadcrumbDTO>> holder) protected CategorygetCategoryFromCategoryAttribute(BroadleafRequestContext brc, String testUrl, Map<String, String[]> params) This indicates that we are on a category pageprotected CategorygetCategoryFromUrl(BroadleafRequestContext brc, String requestUrl, Map<String, String[]> params) intImplementations must provide a priority for this extension handler as the order determines the breadcrumb order.protected CategorygetMatchingCategoryFromProduct(BroadleafRequestContext brc, String testUrl, Map<String, String[]> params) This is an efficient test that checks to see if the requestURI matches the product URI.protected StringgetNameForCategoryLink(Category category) voidinit()modifyBreadcrumbList(String url, Map<String, String[]> params, ExtensionResultHolder<List<BreadcrumbDTO>> holder) Methods inherited from class org.broadleafcommerce.core.web.breadcrumbs.AbstractBreadcrumbServiceExtensionHandler
buildLink, getPriority, isEnabled, setEnabled, setPriority
-
Field Details
-
catalogService
-
extensionManager
-
-
Constructor Details
-
CategoryBreadcrumbServiceExtensionHandler
public CategoryBreadcrumbServiceExtensionHandler()
-
-
Method Details
-
init
@PostConstruct public void init() -
modifyBreadcrumbList
public ExtensionResultStatusType modifyBreadcrumbList(String url, Map<String, String[]> params, ExtensionResultHolder<List<BreadcrumbDTO>> holder) - Specified by:
modifyBreadcrumbListin interfaceBreadcrumbServiceExtensionHandler- Overrides:
modifyBreadcrumbListin classAbstractBreadcrumbServiceExtensionHandler
-
buildCrumbForCategory
-
addParentCrumbs
protected void addParentCrumbs(List<BreadcrumbDTO> parentCrumbs, Category category, String url, Map<String, String[]> params) Add the parent crumb for the passed in category. Recursively call to find all parents.- Parameters:
parentCrumbs-category-url-params-
-
buildCategorySearchCrumb
protected BreadcrumbDTO buildCategorySearchCrumb(Category category, String url, Map<String, String[]> params) Hook for overrides, some implementations may want to build a crumb related to category filtering.Out of box does nothing here.
- Parameters:
category-url-params-- Returns:
-
getNameForCategoryLink
-
determineFirstCategory
protected Category determineFirstCategory(String testUrl, Map<String, String[]> params, ExtensionResultHolder<List<BreadcrumbDTO>> holder) -
getMatchingCategoryFromProduct
protected Category getMatchingCategoryFromProduct(BroadleafRequestContext brc, String testUrl, Map<String, String[]> params) This is an efficient test that checks to see if the requestURI matches the product URI. This works well for sites whose category urls prefix their product urls.- Parameters:
brc-testUrl-params-- Returns:
-
getCategoryFromCategoryAttribute
protected Category getCategoryFromCategoryAttribute(BroadleafRequestContext brc, String testUrl, Map<String, String[]> params) This indicates that we are on a category page- Parameters:
brc-testUrl-params-- Returns:
-
getCategoryFromUrl
-
getDefaultPriority
public int getDefaultPriority()Description copied from class:AbstractBreadcrumbServiceExtensionHandlerImplementations must provide a priority for this extension handler as the order determines the breadcrumb order.- Specified by:
getDefaultPriorityin classAbstractBreadcrumbServiceExtensionHandler- Returns:
-