org.broadleafcommerce.core.web.service
Class SearchFacetDTOServiceImpl

java.lang.Object
  extended by org.broadleafcommerce.core.web.service.SearchFacetDTOServiceImpl
All Implemented Interfaces:
SearchFacetDTOService

@Service(value="blSearchFacetDTOService")
public class SearchFacetDTOServiceImpl
extends Object
implements SearchFacetDTOService


Field Summary
protected  Integer defaultPageSize
           
protected  Integer maxPageSize
           
 
Constructor Summary
SearchFacetDTOServiceImpl()
           
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

defaultPageSize

@Value(value="${web.defaultPageSize}")
protected Integer defaultPageSize

maxPageSize

@Value(value="${web.maxPageSize}")
protected Integer maxPageSize
Constructor Detail

SearchFacetDTOServiceImpl

public SearchFacetDTOServiceImpl()
Method Detail

buildSearchCriteria

public ProductSearchCriteria buildSearchCriteria(javax.servlet.http.HttpServletRequest request,
                                                 List<SearchFacetDTO> availableFacets)
Description copied from interface: SearchFacetDTOService
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.

Specified by:
buildSearchCriteria in interface SearchFacetDTOService
Returns:
the ProductSearchCriteria

setActiveFacetResults

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

Specified by:
setActiveFacetResults in interface SearchFacetDTOService

isActive

public boolean isActive(SearchFacetResultDTO result,
                        javax.servlet.http.HttpServletRequest request)
Description copied from interface: SearchFacetDTOService
Returns whether or not the SearchFacetResultDTO's key/value pair is present in the servlet request

Specified by:
isActive in interface SearchFacetDTOService
Returns:
if the result is active

getUrlKey

public String getUrlKey(SearchFacetResultDTO result)
Description copied from interface: SearchFacetDTOService
Gets the url abbreviation associated with a given SearchFacetResultDTO.

Specified by:
getUrlKey in interface SearchFacetDTOService
Returns:
the key associated with a SearchFacetResultDTO

getValue

public String getValue(SearchFacetResultDTO result)
Description copied from interface: SearchFacetDTOService
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.

Specified by:
getValue in interface SearchFacetDTOService
Returns:
the value of the SearchFacetResultDTO


Copyright © 2013. All Rights Reserved.