com.elasticpath.domain.catalogview
Interface CatalogViewRequest

All Superinterfaces:
EpDomain, java.io.Serializable, Transient
All Known Subinterfaces:
BrowsingRequest, SearchRequest
All Known Implementing Classes:
AbstractCatalogViewRequestImpl, BrowsingRequestImpl, SearchRequestImpl

public interface CatalogViewRequest
extends Transient

Represents a search request.


Nested Class Summary
static interface CatalogViewRequest.FilterQueryString
          Represent a simple bean which aggregate query strings for a filter.
 
Method Summary
 CatalogViewRequest addFilter(Filter filter)
          Creates and returns a more specific search request by adding the given filter.
 int compare(CatalogViewRequest searchRequest)
          Compares this search requet with the given search request.
 java.util.List filterProducts(CatalogViewRequest previousSearchRequest, java.util.List products)
          Filter the given products list and returns the filtered products.
 long getCategoryUid()
          Returns the category uid specified in the catalog view request.
 java.util.Currency getCurrency()
          Returns the currency.
 java.lang.String getFilterIds()
          Returns a String of the list of Filter.
 java.util.List getFilterQueryStrings()
          Composes and returns a list of FilterQueryStrings for all filters specified the search request.
 java.util.List getFilters()
          Returns the list of Filter specified in the search request.
 java.util.Locale getLocale()
          Returns the locale.
 int getMaxReturnNumber()
          Returns the maximum return number specified in the search request.
 java.lang.String getQueryString()
          Returns the query string.
 Sorter getSorter()
          Returns the sorter specified in the search request.
 SorterFactory getSorterFactory()
          Get the sorter factoy SorterFactory.
 void setCategoryUid(long categoryUid)
          Sets the category uid.
 void setCurrency(java.util.Currency currency)
          Sets the currency.
 void setFiltersIdStr(java.lang.String filtersIdStr)
          Sets the filters identifier strings.
 void setLocale(java.util.Locale locale)
          Sets the locale.
 void setMaxReturnNumber(int maxReturnNumber)
          Sets the maximum return number.
 void setSorterIdStr(java.lang.String sorterIdStr)
          Sets the sorter identifier string.
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Method Detail

addFilter

CatalogViewRequest addFilter(Filter filter)
Creates and returns a more specific search request by adding the given filter.

Parameters:
filter - the search filter to add
Returns:
a more specific search request

compare

int compare(CatalogViewRequest searchRequest)
            throws CatalogViewRequestUnmatchException
Compares this search requet with the given search request.

Parameters:
searchRequest - the search request to compare
Returns:
0 if this search requet and the given search request has same key words and filters.

1 if this search requet and the given search request has same key words, but has more filters.

-1 if this search requet and the given search request has same key words, but has unmatching filters.

Throws:
CatalogViewRequestUnmatchException - when this search requet and the given search request have different key words

filterProducts

java.util.List filterProducts(CatalogViewRequest previousSearchRequest,
                              java.util.List products)
Filter the given products list and returns the filtered products. If you give a previous SearchRequest which has already being applied to the given products, we won't do the filterings again for those filters also in previous SearchRequest.

Parameters:
previousSearchRequest - previous search request
products - the products to filter
Returns:
the filtered products

getCategoryUid

long getCategoryUid()
Returns the category uid specified in the catalog view request.

Returns:
the category uid

getCurrency

java.util.Currency getCurrency()
Returns the currency.

Returns:
the curreny

getFilterIds

java.lang.String getFilterIds()
Returns a String of the list of Filter.

Returns:
a String of the list of Filter

getFilterQueryStrings

java.util.List getFilterQueryStrings()
Composes and returns a list of FilterQueryStrings for all filters specified the search request.

Returns:
a list of FilterQueryStrings

getFilters

java.util.List getFilters()
Returns the list of Filter specified in the search request.

Returns:
the list of Filter

getLocale

java.util.Locale getLocale()
Returns the locale.

Returns:
the locale

getMaxReturnNumber

int getMaxReturnNumber()
Returns the maximum return number specified in the search request.

Returns:
the maximum return number

getQueryString

java.lang.String getQueryString()
Returns the query string.

Returns:
the query string.

getSorter

Sorter getSorter()
Returns the sorter specified in the search request.

Returns:
the sorter

getSorterFactory

SorterFactory getSorterFactory()
Get the sorter factoy SorterFactory.

Returns:
the sorter factoy

setCategoryUid

void setCategoryUid(long categoryUid)
                    throws EpCatalogViewRequestBindException
Sets the category uid.

Parameters:
categoryUid - the category uid to set
Throws:
EpCatalogViewRequestBindException - in case the given category uid is invalid

setCurrency

void setCurrency(java.util.Currency currency)
Sets the currency.

Parameters:
currency - the currency to set

setFiltersIdStr

void setFiltersIdStr(java.lang.String filtersIdStr)
                     throws EpCatalogViewRequestBindException
Sets the filters identifier strings.

Parameters:
filtersIdStr - the filters identifier strings
Throws:
EpCatalogViewRequestBindException - in case the given filters identifier strings are invalid

setLocale

void setLocale(java.util.Locale locale)
Sets the locale.

Parameters:
locale - the locale to set

setMaxReturnNumber

void setMaxReturnNumber(int maxReturnNumber)
Sets the maximum return number.

Parameters:
maxReturnNumber - the page number to set

setSorterIdStr

void setSorterIdStr(java.lang.String sorterIdStr)
                    throws EpCatalogViewRequestBindException
Sets the sorter identifier string.

Parameters:
sorterIdStr - the sorter identifier string.
Throws:
EpCatalogViewRequestBindException - in case the given sorter identifier is invalid