|
||||||||||
| 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 | |
|---|---|
Date |
getActiveEndDate()
Gets the active end date. |
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. |
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. |
Category |
getDefaultParentCategory()
Gets the default parent category. |
String |
getDescription()
Gets the description. |
String |
getDisplayTemplate()
Gets the display template. |
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. |
String |
getName()
Gets the name. |
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 |
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 |
setDefaultParentCategory(Category defaultParentCategory)
Sets the default parent category. |
void |
setDescription(String description)
Sets the description. |
void |
setDisplayTemplate(String displayTemplate)
Sets the display template. |
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 |
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 products@Nonnull List<Product> getAllProducts()
Product instances associated with this
category.
void setAllProducts(@Nonnull
List<Product> allProducts)
Product instances associated with this
category.
allProducts - the list of products to associate with this category
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||