org.broadleafcommerce.core.web.service
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
 ProductSearchCriteria buildSearchCriteria(javax.servlet.http.HttpServletRequest request, List<SearchFacetDTO> availableFacets)
          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 ProductSearchCriteria object to be used by the ProductSearchService.
 String getUrlKey(SearchFacetResultDTO result)
          Gets the url abbreviation associated with a given SearchFacetResultDTO.
 String getValue(SearchFacetResultDTO result)
          Gets the value of the given SearchFacetResultDTO.
 boolean isActive(SearchFacetResultDTO result, javax.servlet.http.HttpServletRequest request)
          Returns whether or not the SearchFacetResultDTO's key/value pair is present in the servlet request
 void setActiveFacetResults(List<SearchFacetDTO> facets, javax.servlet.http.HttpServletRequest request)
          Sets the "active" boolean on a given SearchFacetResultDTO as determined by the current request
 

Method Detail

buildSearchCriteria

ProductSearchCriteria buildSearchCriteria(javax.servlet.http.HttpServletRequest request,
                                          List<SearchFacetDTO> availableFacets)
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 ProductSearchCriteria object to be used by the ProductSearchService. It will perform translations from query string parameters to the ProductSearchCriteria.

Parameters:
request -
availableFacets -
Returns:
the ProductSearchCriteria

setActiveFacetResults

void setActiveFacetResults(List<SearchFacetDTO> facets,
                           javax.servlet.http.HttpServletRequest request)
Sets the "active" boolean on a given SearchFacetResultDTO as determined by the current request

Parameters:
facets -
request -

isActive

boolean isActive(SearchFacetResultDTO result,
                 javax.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(SearchFacetResultDTO result)
Gets the url abbreviation associated with a given SearchFacetResultDTO.

Parameters:
result -
Returns:
the key associated with a SearchFacetResultDTO

getValue

String getValue(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[:]" if the value was empty.

Parameters:
result -
Returns:
the value of the SearchFacetResultDTO


Copyright © 2013. All Rights Reserved.