|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Category
Implementations of this interface are used to hold data about a Category. A category is a group of products.
You should implement this class if you want to make significant changes to how the
Category is persisted. If you just want to add additional fields then you should extend CategoryImpl.
CategoryImpl}| Method Summary | |
|---|---|
List<Category> |
buildCategoryHierarchy(List<Category> currentHierarchy)
Build category hierarchy by walking the default category tree up to the root category. |
List<Category> |
buildFullCategoryHierarchy(List<Category> currentHierarchy)
Build the full category hierarchy by walking up the default category tree and the all parent category tree. |
Date |
getActiveEndDate()
Gets the active end date. |
List<Product> |
getActiveProducts()
Convenience method to retrieve all of this Category's Products filtered by
active. |
Date |
getActiveStartDate()
Gets the active start date. |
List<Category> |
getAllChildCategories()
Gets the child categories. |
List<Category> |
getAllParentCategories()
Retrieve all parent categories |
List<Product> |
getAllProducts()
Retrieve all the Product instances associated with this
category. |
CategoryAttribute |
getCategoryAttributeByName(String name)
Convenience method to get a CategoryAttribute by name |
List<CategoryAttribute> |
getCategoryAttributes()
Gets the attributes for this Category. |
String |
getCategoryImage(String imageKey)
Deprecated. replaced by getCategoryMedia() |
Map<String,String> |
getCategoryImages()
Deprecated. replaced by getCategoryMedia() |
Map<String,Media> |
getCategoryMedia()
Gets the category media map. |
List<Category> |
getChildCategories()
Gets the child categories. |
Map<String,List<Long>> |
getChildCategoryURLMap()
Gets the child category url map. |
List<RelatedProduct> |
getCrossSaleProducts()
Returns a list of cross sale products that are related to this category. |
List<RelatedProduct> |
getCumulativeCrossSaleProducts()
Returns a list of the cross sale products in this category as well as all cross sale products in all parent categories of this category. |
List<FeaturedProduct> |
getCumulativeFeaturedProducts()
Returns a list of the featured products in this category as well as all featured products in all parent categories of this category. |
List<CategorySearchFacet> |
getCumulativeSearchFacets()
Returns a list of CategorySearchFacets that takes into consideration the search facets for this Category, the search facets for all parent categories, and the search facets that should be excluded from this Category. |
List<RelatedProduct> |
getCumulativeUpSaleProducts()
Returns a list of the upsale products in this category as well as all upsale products in all parent categories of this category. |
Category |
getDefaultParentCategory()
Gets the default parent category. |
String |
getDescription()
Gets the description. |
String |
getDisplayTemplate()
Gets the display template. |
List<SearchFacet> |
getExcludedSearchFacets()
Gets the excluded SearchFacets |
List<FeaturedProduct> |
getFeaturedProducts()
Gets the featured products. |
String |
getGeneratedUrl()
Creates the SEO url starting from this category and recursing up the hierarchy of default parent categories until the topmost category is reached. |
Long |
getId()
Gets the primary key. |
String |
getLongDescription()
Gets the long description. |
Map<String,CategoryAttribute> |
getMappedCategoryAttributes()
Convenience method to return the CategoryAttributes for the Category in an easily-consumable
form |
String |
getName()
Gets the name. |
List<CategorySearchFacet> |
getSearchFacets()
Returns all of the SearchFacets that are directly associated with this Category |
List<RelatedProduct> |
getUpSaleProducts()
Returns a list of cross sale products that are related to this category. |
String |
getUrl()
Gets the url. |
String |
getUrlKey()
Gets the url key. |
boolean |
hasAllChildCategories()
Checks for child categories. |
boolean |
hasChildCategories()
Checks for child categories. |
boolean |
isActive()
Checks if is active. |
void |
setActiveEndDate(Date activeEndDate)
Sets the active end date. |
void |
setActiveStartDate(Date activeStartDate)
Sets the active start date. |
void |
setAllChildCategories(List<Category> childCategories)
Sets the list of child categories (active and inactive) |
void |
setAllParentCategories(List<Category> allParentCategories)
Sets the list of parent categories |
void |
setAllProducts(List<Product> allProducts)
Set all the Product instances associated with this
category. |
void |
setCategoryAttributes(List<CategoryAttribute> categoryAttributes)
Sets the attributes for this Category. |
void |
setCategoryImages(Map<String,String> categoryImages)
Deprecated. replaced by setCategoryMedia(java.util.Map) |
void |
setCategoryMedia(Map<String,Media> categoryMedia)
Sets the category media. |
void |
setChildCategories(List<Category> childCategories)
Sets the all child categories. |
void |
setChildCategoryURLMap(Map<String,List<Long>> childCategoryURLMap)
Included to support the HydratedCacheJPAListener |
void |
setCrossSaleProducts(List<RelatedProduct> crossSaleProducts)
Sets the cross sale products that are related to this category. |
void |
setDefaultParentCategory(Category defaultParentCategory)
Sets the default parent category. |
void |
setDescription(String description)
Sets the description. |
void |
setDisplayTemplate(String displayTemplate)
Sets the display template. |
void |
setExcludedSearchFacets(List<SearchFacet> excludedSearchFacets)
Sets the SearchFacets that should not be rendered by this Category. |
void |
setFeaturedProducts(List<FeaturedProduct> featuredProducts)
Sets the featured products. |
void |
setId(Long id)
Sets the primary key. |
void |
setLongDescription(String longDescription)
Sets the long description. |
void |
setName(String name)
Sets the name. |
void |
setSearchFacets(List<CategorySearchFacet> searchFacets)
Sets the SearchFacets that are directly associated with this Category |
void |
setUpSaleProducts(List<RelatedProduct> upSaleProducts)
Sets the upsale products that are related to this category. |
void |
setUrl(String url)
Sets the url. |
void |
setUrlKey(String urlKey)
Sets the url key. |
| Method Detail |
|---|
@Nullable Long getId()
void setId(@Nullable
Long id)
id - the new primary key@Nonnull String getName()
void setName(@Nonnull
String name)
name - the new name@Nullable Category getDefaultParentCategory()
void setDefaultParentCategory(@Nullable
Category defaultParentCategory)
defaultParentCategory - the new default parent category@Nonnull List<Category> getAllParentCategories()
void setAllParentCategories(@Nonnull
List<Category> allParentCategories)
allParentCategories - the list of parent categories@Nullable String getUrl()
"redirect:"+currentCategory.getUrl();
from a controller.
void setUrl(@Nullable
String url)
"redirect:"+currentCategory.getUrl();
from a controller.
url - the new url for the presentation layer component for this category@Nullable String getUrlKey()
@Nullable String getGeneratedUrl()
void setUrlKey(@Nullable
String urlKey)
urlKey - the new url key for this category to appear in the SEO url@Nullable String getDescription()
void setDescription(@Nullable
String description)
description - the new description@Nullable Date getActiveStartDate()
void setActiveStartDate(@Nullable
Date activeStartDate)
activeStartDate - the new active start date@Nullable Date getActiveEndDate()
void setActiveEndDate(@Nullable
Date activeEndDate)
activeEndDate - the new active end dateboolean isActive()
@Nullable String getDisplayTemplate()
view = categoryTemplatePrefix + currentCategory.getDisplayTemplate();
void setDisplayTemplate(@Nullable
String displayTemplate)
view = categoryTemplatePrefix + currentCategory.getDisplayTemplate();
displayTemplate - the new display template@Nonnull Map<String,List<Long>> getChildCategoryURLMap()
getGeneratedUrl() values
for this category and all of its child categories. By calling get on this map using the
generated url for a given category, you will receive the list of immediate child categories.
This lifecycle for this map is maintained via the HydratedCacheJPAListener. This listener
keeps this map in a separate cache from the normal Hibernate level 2 cache, but will honor
cache region settings for this entity, resulting in this map being evicted from its cache
when this entity is removed from the Hibernate level 2 cache.
HydratedSetup
void setChildCategoryURLMap(@Nonnull
Map<String,List<Long>> childCategoryURLMap)
HydratedCacheJPAListener
childCategoryURLMap - HydratedSetup@Nonnull List<Category> getAllChildCategories()
boolean hasAllChildCategories()
void setAllChildCategories(@Nonnull
List<Category> childCategories)
childCategories - the list of child categories@Nonnull List<Category> getChildCategories()
boolean hasChildCategories()
void setChildCategories(@Nonnull
List<Category> childCategories)
childCategories - the list of active child categories.@Deprecated @Nonnull Map<String,String> getCategoryImages()
getCategoryMedia()
@Deprecated
@Nullable
String getCategoryImage(@Nonnull
String imageKey)
getCategoryMedia()
imageKey - the image key
@Deprecated
void setCategoryImages(@Nonnull
Map<String,String> categoryImages)
setCategoryMedia(java.util.Map)
categoryImages - the category images@Nonnull Map<String,Media> getCategoryMedia()
Media instance stores information about the
media itself (image url, etc...)
void setCategoryMedia(@Nonnull
Map<String,Media> categoryMedia)
Media instance stores information about the
media itself (image url, etc...)
categoryMedia - the category media@Nullable String getLongDescription()
void setLongDescription(@Nullable
String longDescription)
longDescription - the new long description@Nonnull List<FeaturedProduct> getFeaturedProducts()
void setFeaturedProducts(@Nonnull
List<FeaturedProduct> featuredProducts)
featuredProducts - the featured productsList<Product> getActiveProducts()
Category's Products filtered by
active. If you want all of the Products (whether inactive or not) consider using
getAllProducts().
Products for this CategoryProduct#isActive()}@Nonnull List<Product> getAllProducts()
Product instances associated with this
category.
Products are active or not. If
you need this functionality, use getActiveProducts()
void setAllProducts(@Nonnull
List<Product> allProducts)
Product instances associated with this
category.
allProducts - the list of products to associate with this categoryList<RelatedProduct> getCrossSaleProducts()
void setCrossSaleProducts(List<RelatedProduct> crossSaleProducts)
crossSaleProducts - getCrossSaleProducts()List<RelatedProduct> getUpSaleProducts()
void setUpSaleProducts(List<RelatedProduct> upSaleProducts)
upSaleProducts - getUpSaleProducts()List<RelatedProduct> getCumulativeCrossSaleProducts()
List<RelatedProduct> getCumulativeUpSaleProducts()
List<FeaturedProduct> getCumulativeFeaturedProducts()
List<CategorySearchFacet> getSearchFacets()
void setSearchFacets(List<CategorySearchFacet> searchFacets)
searchFacets - void setExcludedSearchFacets(List<SearchFacet> excludedSearchFacets)
excludedSearchFacets - List<SearchFacet> getExcludedSearchFacets()
List<CategorySearchFacet> getCumulativeSearchFacets()
CategorySearchFacet#getPosition()
method for each category level. That is, the facets on this Category will be ordered by their position
relative to each other with the ordered parent facets after that, etc.
List<Category> buildCategoryHierarchy(List<Category> currentHierarchy)
currentHierarchy -
List<Category> buildFullCategoryHierarchy(List<Category> currentHierarchy)
currentHierarchy -
List<CategoryAttribute> getCategoryAttributes()
Category. In smaller sites, using these attributes might be preferred to
extending the domain object itself.
#getMappedCategoryAttributes()}void setCategoryAttributes(List<CategoryAttribute> categoryAttributes)
Category. In smaller sites, using these attributes might be preferred to
extending the domain object and creating a new table to store custom properties.
CategoryAttribute getCategoryAttributeByName(String name)
CategoryAttribute by name
name -
#getCategoryAttributes()}, {@link #getMappedCategoryAttributes()}Map<String,CategoryAttribute> getMappedCategoryAttributes()
CategoryAttributes for the Category in an easily-consumable
form
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||