com.elasticpath.domain.catalogview.browsing.impl
Class BrowsingRequestImpl

java.lang.Object
  extended by com.elasticpath.domain.impl.AbstractEpDomainImpl
      extended by com.elasticpath.domain.impl.AbstractTransientImpl
          extended by com.elasticpath.domain.catalogview.impl.AbstractCatalogViewRequestImpl
              extended by com.elasticpath.domain.catalogview.browsing.impl.BrowsingRequestImpl
All Implemented Interfaces:
BrowsingRequest, CatalogViewRequest, EpDomain, Transient, java.io.Serializable

public class BrowsingRequestImpl
extends AbstractCatalogViewRequestImpl
implements BrowsingRequest

Represents a default implementation of SearchRequest.

See Also:
Serialized Form

Nested Class Summary
static class BrowsingRequestImpl.FilterSeoUrlImpl
          Represent a simple bean which aggregate query strings for a filter.
 
Nested classes/interfaces inherited from class com.elasticpath.domain.catalogview.impl.AbstractCatalogViewRequestImpl
AbstractCatalogViewRequestImpl.FilterQueryStringImpl
 
Nested classes/interfaces inherited from interface com.elasticpath.domain.catalogview.browsing.BrowsingRequest
BrowsingRequest.FilterSeoUrl
 
Nested classes/interfaces inherited from interface com.elasticpath.domain.catalogview.CatalogViewRequest
CatalogViewRequest.FilterQueryString
 
Field Summary
static long serialVersionUID
          Serial version id.
 
Constructor Summary
BrowsingRequestImpl()
           
 
Method Summary
 CatalogViewRequest addFilter(Filter filter)
          Creates and returns a more specific search request by adding the given filter.
 int compare(CatalogViewRequest browsingRequest)
          Compares this search requet with the given search request.
 java.util.List getFilterSeoUrls(Category category)
          Composes and returns a list of FilterSeoUrls for all filters specified in this browsing request based on the given category.
 java.lang.String getQueryString()
          Returns the query string.
 java.lang.String getSeoUrl(Category category)
          Returns the SEO(Search Engine Optimized) url based on the given category.
 java.lang.String getSeoUrl(Category category, int pageNumber)
          Returns the SEO(Search Engine Optimized) url based on the given category and page number.
 java.lang.String getTitle(Category category)
          Composes and returns a title for the browsing page.
 
Methods inherited from class com.elasticpath.domain.catalogview.impl.AbstractCatalogViewRequestImpl
filterProducts, getCategoryUid, getCurrency, getFilterIds, getFilterQueryStrings, getFilters, getLocale, getMaxReturnNumber, getSorter, getSorterFactory, setCategoryUid, setCurrency, setFilterFactory, setFiltersIdStr, setLocale, setMaxReturnNumber, setSorterFactory, setSorterIdStr
 
Methods inherited from class com.elasticpath.domain.impl.AbstractEpDomainImpl
getElasticPath, setElasticPath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.elasticpath.domain.catalogview.CatalogViewRequest
filterProducts, getCategoryUid, getCurrency, getFilterIds, getFilterQueryStrings, getFilters, getLocale, getMaxReturnNumber, getSorter, getSorterFactory, setCategoryUid, setCurrency, setFiltersIdStr, setLocale, setMaxReturnNumber, setSorterIdStr
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 

Field Detail

serialVersionUID

public static final long serialVersionUID
Serial version id.

See Also:
Constant Field Values
Constructor Detail

BrowsingRequestImpl

public BrowsingRequestImpl()
Method Detail

addFilter

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

Specified by:
addFilter in interface CatalogViewRequest
Parameters:
filter - the search filter to add
Returns:
a more specific search request

compare

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

Specified by:
compare in interface CatalogViewRequest
Parameters:
browsingRequest - the search request to compare
Returns:
0 if this search request and the given search request has same key words and filters.

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

-1 if this search request 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

getFilterSeoUrls

public java.util.List getFilterSeoUrls(Category category)
Composes and returns a list of FilterSeoUrls for all filters specified in this browsing request based on the given category. Notice that the uidPk of the given category must match the one in the browsing request.

Specified by:
getFilterSeoUrls in interface BrowsingRequest
Parameters:
category - the category
Returns:
a list of FilterSeoUrls

getQueryString

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

Specified by:
getQueryString in interface CatalogViewRequest
Returns:
the query string.

getSeoUrl

public java.lang.String getSeoUrl(Category category)
Returns the SEO(Search Engine Optimized) url based on the given category. Notice that the uidPk of the given category must match the one in the browsing request.

Specified by:
getSeoUrl in interface BrowsingRequest
Parameters:
category - the category
Returns:
the SEO(Search Engine Optimized) url

getSeoUrl

public java.lang.String getSeoUrl(Category category,
                                  int pageNumber)
Returns the SEO(Search Engine Optimized) url based on the given category and page number. Notice that the uidPk of the given category must match the one in the browsing request.

Specified by:
getSeoUrl in interface BrowsingRequest
Parameters:
category - the category
pageNumber - the page number
Returns:
the SEO(Search Engine Optimized) url

getTitle

public java.lang.String getTitle(Category category)
Composes and returns a title for the browsing page. A title will follow this structure:
Brand Name in the correct langauge, only if it exists
Category SEO Title in the correct langauge
Price Filter with currency symbol, only show the lowest applied filter
e.g. Kodak - Digital Cameras - $120 - $140
e.g. Digital Cameras - $200 - $400
e.g. Digital Cameras

Specified by:
getTitle in interface BrowsingRequest
Parameters:
category - the category
Returns:
a title for the browsing page