Class CategoryBreadcrumbServiceExtensionHandler

java.lang.Object
org.broadleafcommerce.core.web.breadcrumbs.AbstractBreadcrumbServiceExtensionHandler
org.broadleafcommerce.core.web.breadcrumbs.CategoryBreadcrumbServiceExtensionHandler
All Implemented Interfaces:
org.broadleafcommerce.common.breadcrumbs.service.BreadcrumbServiceExtensionHandler, org.broadleafcommerce.common.extension.ExtensionHandler

@Service("blCategoryBreadcrumbServiceExtensionHandler") public class CategoryBreadcrumbServiceExtensionHandler extends AbstractBreadcrumbServiceExtensionHandler
  • Field Details

    • catalogService

      protected org.broadleafcommerce.core.catalog.service.CatalogService catalogService
    • extensionManager

      protected org.broadleafcommerce.common.breadcrumbs.service.BreadcrumbServiceExtensionManager extensionManager
  • Constructor Details

    • CategoryBreadcrumbServiceExtensionHandler

      public CategoryBreadcrumbServiceExtensionHandler()
  • Method Details

    • init

      @PostConstruct public void init()
    • modifyBreadcrumbList

      public org.broadleafcommerce.common.extension.ExtensionResultStatusType modifyBreadcrumbList(String url, Map<String,String[]> params, org.broadleafcommerce.common.extension.ExtensionResultHolder<List<org.broadleafcommerce.common.breadcrumbs.dto.BreadcrumbDTO>> holder)
      Specified by:
      modifyBreadcrumbList in interface org.broadleafcommerce.common.breadcrumbs.service.BreadcrumbServiceExtensionHandler
      Overrides:
      modifyBreadcrumbList in class AbstractBreadcrumbServiceExtensionHandler
    • buildCrumbForCategory

      protected org.broadleafcommerce.common.breadcrumbs.dto.BreadcrumbDTO buildCrumbForCategory(org.broadleafcommerce.core.catalog.domain.Category category, String url, Map<String,String[]> params)
    • addParentCrumbs

      protected void addParentCrumbs(List<org.broadleafcommerce.common.breadcrumbs.dto.BreadcrumbDTO> parentCrumbs, org.broadleafcommerce.core.catalog.domain.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 org.broadleafcommerce.common.breadcrumbs.dto.BreadcrumbDTO buildCategorySearchCrumb(org.broadleafcommerce.core.catalog.domain.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

      protected String getNameForCategoryLink(org.broadleafcommerce.core.catalog.domain.Category category)
    • determineFirstCategory

      protected org.broadleafcommerce.core.catalog.domain.Category determineFirstCategory(String testUrl, Map<String,String[]> params, org.broadleafcommerce.common.extension.ExtensionResultHolder<List<org.broadleafcommerce.common.breadcrumbs.dto.BreadcrumbDTO>> holder)
    • getMatchingCategoryFromProduct

      protected org.broadleafcommerce.core.catalog.domain.Category getMatchingCategoryFromProduct(org.broadleafcommerce.common.web.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 org.broadleafcommerce.core.catalog.domain.Category getCategoryFromCategoryAttribute(org.broadleafcommerce.common.web.BroadleafRequestContext brc, String testUrl, Map<String,String[]> params)
      This indicates that we are on a category page
      Parameters:
      brc -
      testUrl -
      params -
      Returns:
    • getCategoryFromUrl

      protected org.broadleafcommerce.core.catalog.domain.Category getCategoryFromUrl(org.broadleafcommerce.common.web.BroadleafRequestContext brc, String requestUrl, Map<String,String[]> params)
    • getDefaultPriority

      public int getDefaultPriority()
      Description copied from class: AbstractBreadcrumbServiceExtensionHandler
      Implementations must provide a priority for this extension handler as the order determines the breadcrumb order.
      Specified by:
      getDefaultPriority in class AbstractBreadcrumbServiceExtensionHandler
      Returns: