com.bea.alcs.domain.catalogview.impl
Class MultiStoreSeoUrlBuilderImpl

java.lang.Object
  extended by com.bea.alcs.domain.catalogview.impl.MultiStoreSeoUrlBuilderImpl
All Implemented Interfaces:
SeoUrlBuilder

public class MultiStoreSeoUrlBuilderImpl
extends java.lang.Object
implements SeoUrlBuilder

Multi store SEO URL builder. Defines the URL depending on the specified store. As part of the initialization setStore(Store) must be called.


Constructor Summary
MultiStoreSeoUrlBuilderImpl()
           
 
Method Summary
 java.lang.String categorySeoUrl(Category category, java.util.Locale locale, int pageNumber)
          Returns the seo url for the specified category, e.g.
 java.lang.String filterSeoUrl(java.util.Locale locale, java.util.List<Filter<?>> filters, SortBy sortType, SortOrder sortOrder, int pageNumber)
          Create an seo url that will use the specified locale and sorter objects during the URL construction and add all the specified filters (in the order provided).
 java.lang.String productSeoUrl(Product product, java.util.Locale locale)
          Returns the seo url of the given locale in the product's default category.
 java.lang.String productSeoUrl(Product product, java.util.Locale locale, Category category)
          Returns the seo url of the given locale following the given category.
 void setSeoUrlBuilderDelegate(SeoUrlBuilder seoUrlBuilder)
          Sets the SEO URL builder delegate.
 void setStore(Store store)
          Sets the store.
 java.lang.String sitemapSeoUrl(Category category, Brand brand, java.util.Locale locale, int pageNumber)
          Returns the localized seo url for this sitemap result corresponding to the desired page number.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MultiStoreSeoUrlBuilderImpl

public MultiStoreSeoUrlBuilderImpl()
Method Detail

setSeoUrlBuilderDelegate

public void setSeoUrlBuilderDelegate(SeoUrlBuilder seoUrlBuilder)
Sets the SEO URL builder delegate.

Parameters:
seoUrlBuilder - the builder implementation

categorySeoUrl

public java.lang.String categorySeoUrl(Category category,
                                       java.util.Locale locale,
                                       int pageNumber)
Returns the seo url for the specified category, e.g. cars/bwm/convertibles/cat-356-all.html.

Specified by:
categorySeoUrl in interface SeoUrlBuilder
Parameters:
category - the category to get the url for.
locale - the locale the url fragments should be in.
pageNumber - the page number
Returns:
the seo url for the category.

filterSeoUrl

public java.lang.String filterSeoUrl(java.util.Locale locale,
                                     java.util.List<Filter<?>> filters,
                                     SortBy sortType,
                                     SortOrder sortOrder,
                                     int pageNumber)
Create an seo url that will use the specified locale and sorter objects during the URL construction and add all the specified filters (in the order provided).

Specified by:
filterSeoUrl in interface SeoUrlBuilder
Parameters:
locale - the locale the url fragments should be in.
filters - the filters to build seo url for.
sortType - the type of sorting to perform
sortOrder - the order of the sorting
pageNumber - the page number to include in the url. This is ignored if it is less than zero.
Returns:
the seo url for the filters specified

productSeoUrl

public java.lang.String productSeoUrl(Product product,
                                      java.util.Locale locale)
Returns the seo url of the given locale in the product's default category.

Specified by:
productSeoUrl in interface SeoUrlBuilder
Parameters:
product - the product to build the url for.
locale - the locale the url should be readable in
Returns:
the seo url for the product

productSeoUrl

public java.lang.String productSeoUrl(Product product,
                                      java.util.Locale locale,
                                      Category category)
Returns the seo url of the given locale following the given category. Since there might be multiple categories to reach a product, the category you give will be a part of the seo url generated. If you give null, the default category of the product will be used instead.

Specified by:
productSeoUrl in interface SeoUrlBuilder
Parameters:
product - the product to build the url for.
locale - the locale the url should be readable in
category - the category to reach the product, give null to use the default category.
Returns:
the seo url for the product

setStore

public void setStore(Store store)
Sets the store.

Specified by:
setStore in interface SeoUrlBuilder
Parameters:
store - the store instance

sitemapSeoUrl

public java.lang.String sitemapSeoUrl(Category category,
                                      Brand brand,
                                      java.util.Locale locale,
                                      int pageNumber)
Returns the localized seo url for this sitemap result corresponding to the desired page number.

Specified by:
sitemapSeoUrl in interface SeoUrlBuilder
Parameters:
category - the category this sitemap url is for.
brand - the brand this sitemap url is for.
locale - the locale the sitemap url fragments should be in.
pageNumber - the page number of the url.
Returns:
the seo url as a String