Interface SearchFacetDTOService

All Known Implementing Classes:
SearchFacetDTOServiceImpl

public interface SearchFacetDTOService
Provides methods that facilitate interactions with SearchFacetDTOs and SearchFacetResultDTOs
Author:
Andre Azzolini (apazzolini)
  • Method Summary

    Modifier and Type
    Method
    Description
    org.broadleafcommerce.core.search.domain.SearchCriteria
    buildSearchCriteria(jakarta.servlet.http.HttpServletRequest request)
    Given a servlet request and a list of available facets for this request (could be search or category based), this method will build out a SearchCriteria object to be used by the ProductSearchService.
    getUrlKey(org.broadleafcommerce.core.search.domain.SearchFacetDTO result)
     
    getUrlKey(org.broadleafcommerce.core.search.domain.SearchFacetResultDTO result)
    Gets the url abbreviation associated with a given SearchFacetResultDTO.
    getValue(org.broadleafcommerce.core.search.domain.SearchFacetResultDTO result)
    Gets the value of the given SearchFacetResultDTO.
    boolean
    isActive(org.broadleafcommerce.core.search.domain.SearchFacetResultDTO result, jakarta.servlet.http.HttpServletRequest request)
    Returns whether or not the SearchFacetResultDTO's key/value pair is present in the servlet request
    void
    setActiveFacetResults(List<org.broadleafcommerce.core.search.domain.SearchFacetDTO> facets, jakarta.servlet.http.HttpServletRequest request)
    Sets the "active" boolean on a given SearchFacetResultDTO as determined by the current request
  • Method Details

    • buildSearchCriteria

      org.broadleafcommerce.core.search.domain.SearchCriteria buildSearchCriteria(jakarta.servlet.http.HttpServletRequest request)
      Given a servlet request and a list of available facets for this request (could be search or category based), this method will build out a SearchCriteria object to be used by the ProductSearchService. It will perform translations from query string parameters to the SearchCriteria.
      Parameters:
      request -
      Returns:
      the SearchCriteria
    • setActiveFacetResults

      void setActiveFacetResults(List<org.broadleafcommerce.core.search.domain.SearchFacetDTO> facets, jakarta.servlet.http.HttpServletRequest request)
      Sets the "active" boolean on a given SearchFacetResultDTO as determined by the current request
      Parameters:
      facets -
      request -
    • isActive

      boolean isActive(org.broadleafcommerce.core.search.domain.SearchFacetResultDTO result, jakarta.servlet.http.HttpServletRequest request)
      Returns whether or not the SearchFacetResultDTO's key/value pair is present in the servlet request
      Parameters:
      result -
      request -
      Returns:
      if the result is active
    • getUrlKey

      String getUrlKey(org.broadleafcommerce.core.search.domain.SearchFacetResultDTO result)
      Gets the url abbreviation associated with a given SearchFacetResultDTO.
      Parameters:
      result -
      Returns:
      the key associated with a SearchFacetResultDTO
    • getValue

      String getValue(org.broadleafcommerce.core.search.domain.SearchFacetResultDTO result)
      Gets the value of the given SearchFacetResultDTO. The default Broadleaf implementation will return the String value of the result if the value is not empty, or "range[<min-value>:<max-value>]" if the value was empty.
      Parameters:
      result -
      Returns:
      the value of the SearchFacetResultDTO
    • getUrlKey

      String getUrlKey(org.broadleafcommerce.core.search.domain.SearchFacetDTO result)