|
||||||||||
| 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 | |
|---|---|
java.util.Date |
getActiveEndDate()
Gets the active end date. |
java.util.Date |
getActiveStartDate()
Gets the active start date. |
java.util.List<Category> |
getAllChildCategories()
Gets the child categories. |
java.util.List<Category> |
getAllParentCategories()
Retrieve all parent categories |
java.util.List<Product> |
getAllProducts()
Retrieve all the Product instances associated with this
category. |
java.lang.String |
getCategoryImage(java.lang.String imageKey)
Deprecated. replaced by getCategoryMedia() |
java.util.Map<java.lang.String,java.lang.String> |
getCategoryImages()
Deprecated. replaced by getCategoryMedia() |
java.util.Map<java.lang.String,Media> |
getCategoryMedia()
Gets the category media map. |
java.util.List<Category> |
getChildCategories()
Gets the child categories. |
java.util.Map<java.lang.String,java.util.List<java.lang.Long>> |
getChildCategoryURLMap()
Gets the child category url map. |
Category |
getDefaultParentCategory()
Gets the default parent category. |
java.lang.String |
getDescription()
Gets the description. |
java.lang.String |
getDisplayTemplate()
Gets the display template. |
java.util.List<FeaturedProduct> |
getFeaturedProducts()
Gets the featured products. |
java.lang.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. |
java.lang.Long |
getId()
Gets the primary key. |
java.lang.String |
getLongDescription()
Gets the long description. |
java.lang.String |
getName()
Gets the name. |
java.lang.String |
getUrl()
Gets the url. |
java.lang.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(java.util.Date activeEndDate)
Sets the active end date. |
void |
setActiveStartDate(java.util.Date activeStartDate)
Sets the active start date. |
void |
setAllChildCategories(java.util.List<Category> childCategories)
Sets the list of child categories (active and inactive) |
void |
setAllParentCategories(java.util.List<Category> allParentCategories)
Sets the list of parent categories |
void |
setAllProducts(java.util.List<Product> allProducts)
Set all the Product instances associated with this
category. |
void |
setCategoryImages(java.util.Map<java.lang.String,java.lang.String> categoryImages)
Deprecated. replaced by setCategoryMedia(java.util.Map) |
void |
setCategoryMedia(java.util.Map<java.lang.String,Media> categoryMedia)
Sets the category media. |
void |
setChildCategories(java.util.List<Category> childCategories)
Sets the all child categories. |
void |
setChildCategoryURLMap(java.util.Map<java.lang.String,java.util.List<java.lang.Long>> childCategoryURLMap)
Included to support the HydratedCacheJPAListener |
void |
setDefaultParentCategory(Category defaultParentCategory)
Sets the default parent category. |
void |
setDescription(java.lang.String description)
Sets the description. |
void |
setDisplayTemplate(java.lang.String displayTemplate)
Sets the display template. |
void |
setFeaturedProducts(java.util.List<FeaturedProduct> featuredProducts)
Sets the featured products. |
void |
setId(java.lang.Long id)
Sets the primary key. |
void |
setLongDescription(java.lang.String longDescription)
Sets the long description. |
void |
setName(java.lang.String name)
Sets the name. |
void |
setUrl(java.lang.String url)
Sets the url. |
void |
setUrlKey(java.lang.String urlKey)
Sets the url key. |
| Method Detail |
|---|
@Nullable java.lang.Long getId()
void setId(@Nullable
java.lang.Long id)
id - the new primary key@Nonnull java.lang.String getName()
void setName(@Nonnull
java.lang.String name)
name - the new name@Nullable Category getDefaultParentCategory()
void setDefaultParentCategory(@Nullable
Category defaultParentCategory)
defaultParentCategory - the new default parent category@Nonnull java.util.List<Category> getAllParentCategories()
void setAllParentCategories(@Nonnull
java.util.List<Category> allParentCategories)
allParentCategories - the list of parent categories@Nullable java.lang.String getUrl()
"redirect:"+currentCategory.getUrl();
from a controller.
void setUrl(@Nullable
java.lang.String url)
"redirect:"+currentCategory.getUrl();
from a controller.
url - the new url for the presentation layer component for this category@Nullable java.lang.String getUrlKey()
@Nullable java.lang.String getGeneratedUrl()
void setUrlKey(@Nullable
java.lang.String urlKey)
urlKey - the new url key for this category to appear in the SEO url@Nullable java.lang.String getDescription()
void setDescription(@Nullable
java.lang.String description)
description - the new description@Nullable java.util.Date getActiveStartDate()
void setActiveStartDate(@Nullable
java.util.Date activeStartDate)
activeStartDate - the new active start date@Nullable java.util.Date getActiveEndDate()
void setActiveEndDate(@Nullable
java.util.Date activeEndDate)
activeEndDate - the new active end dateboolean isActive()
@Nullable java.lang.String getDisplayTemplate()
view = categoryTemplatePrefix + currentCategory.getDisplayTemplate();
void setDisplayTemplate(@Nullable
java.lang.String displayTemplate)
view = categoryTemplatePrefix + currentCategory.getDisplayTemplate();
displayTemplate - the new display template@Nonnull java.util.Map<java.lang.String,java.util.List<java.lang.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
java.util.Map<java.lang.String,java.util.List<java.lang.Long>> childCategoryURLMap)
HydratedCacheJPAListener
childCategoryURLMap - HydratedSetup@Nonnull java.util.List<Category> getAllChildCategories()
boolean hasAllChildCategories()
void setAllChildCategories(@Nonnull
java.util.List<Category> childCategories)
childCategories - the list of child categories@Nonnull java.util.List<Category> getChildCategories()
boolean hasChildCategories()
void setChildCategories(@Nonnull
java.util.List<Category> childCategories)
childCategories - the list of active child categories.@Deprecated @Nonnull java.util.Map<java.lang.String,java.lang.String> getCategoryImages()
getCategoryMedia()
@Deprecated
@Nullable
java.lang.String getCategoryImage(@Nonnull
java.lang.String imageKey)
getCategoryMedia()
imageKey - the image key
@Deprecated
void setCategoryImages(@Nonnull
java.util.Map<java.lang.String,java.lang.String> categoryImages)
setCategoryMedia(java.util.Map)
categoryImages - the category images@Nonnull java.util.Map<java.lang.String,Media> getCategoryMedia()
Media instance stores information about the
media itself (image url, etc...)
void setCategoryMedia(@Nonnull
java.util.Map<java.lang.String,Media> categoryMedia)
Media instance stores information about the
media itself (image url, etc...)
categoryMedia - the category media@Nullable java.lang.String getLongDescription()
void setLongDescription(@Nullable
java.lang.String longDescription)
longDescription - the new long description@Nonnull java.util.List<FeaturedProduct> getFeaturedProducts()
void setFeaturedProducts(@Nonnull
java.util.List<FeaturedProduct> featuredProducts)
featuredProducts - the featured products@Nonnull java.util.List<Product> getAllProducts()
Product instances associated with this
category.
void setAllProducts(@Nonnull
java.util.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 | |||||||||