|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.broadleafcommerce.core.catalog.domain.CategoryImpl
@Entity public class CategoryImpl
| Constructor Summary | |
|---|---|
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. |
Map<String,List<Long>> |
createChildCategoryURLMap()
|
boolean |
equals(Object obj)
|
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. |
Character |
getArchived()
|
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. |
Map<String,String> |
getCategoryImages()
Deprecated. |
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. |
FulfillmentType |
getFulfillmentType()
Returns the default fulfillment type for skus in this category. |
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. |
InventoryType |
getInventoryType()
Returns the type of inventory for this category |
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. |
int |
hashCode()
|
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 |
setArchived(Character archived)
|
void |
setCategoryAttributes(List<CategoryAttribute> categoryAttributes)
Sets the attributes for this Category. |
void |
setCategoryImages(Map<String,String> categoryImages)
Deprecated. |
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 |
setFulfillmentType(FulfillmentType fulfillmentType)
Sets the default fulfillment type for skus in this category. |
void |
setId(Long id)
Sets the primary key. |
void |
setInventoryType(InventoryType inventoryType)
Sets the type of inventory for this category |
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Long id
protected String name
protected String url
protected String urlKey
protected String description
protected Date activeStartDate
protected Date activeEndDate
protected String displayTemplate
protected String longDescription
protected Category defaultParentCategory
protected List<Category> allChildCategories
protected List<Category> allParentCategories
protected List<Product> allProducts
@Deprecated protected Map<String,String> categoryImages
protected Map<String,Media> categoryMedia
protected List<FeaturedProduct> featuredProducts
protected List<RelatedProduct> crossSaleProducts
protected List<RelatedProduct> upSaleProducts
protected List<CategorySearchFacet> searchFacets
protected List<SearchFacet> excludedSearchFacets
protected List<CategoryAttribute> categoryAttributes
protected String inventoryType
protected String fulfillmentType
protected ArchiveStatus archiveStatus
protected Map<String,List<Long>> childCategoryURLMap
protected List<Category> childCategories
protected List<FeaturedProduct> filteredFeaturedProducts
protected List<RelatedProduct> filteredCrossSales
protected List<RelatedProduct> filteredUpSales
protected static Comparator<CategorySearchFacet> facetPositionComparator
| Constructor Detail |
|---|
public CategoryImpl()
| Method Detail |
|---|
public Long getId()
Category
getId in interface Categorypublic void setId(Long id)
Category
setId in interface Categoryid - the new primary keypublic String getName()
Category
getName in interface Categorypublic void setName(String name)
Category
setName in interface Categoryname - the new namepublic String getUrl()
Category"redirect:"+currentCategory.getUrl();
from a controller.
getUrl in interface Categorypublic void setUrl(String url)
Category"redirect:"+currentCategory.getUrl();
from a controller.
setUrl in interface Categoryurl - the new url for the presentation layer component for this categorypublic String getUrlKey()
Category
getUrlKey in interface Categorypublic String getGeneratedUrl()
Category
getGeneratedUrl in interface Categorypublic void setUrlKey(String urlKey)
Category
setUrlKey in interface CategoryurlKey - the new url key for this category to appear in the SEO urlpublic String getDescription()
Category
getDescription in interface Categorypublic void setDescription(String description)
Category
setDescription in interface Categorydescription - the new descriptionpublic Date getActiveStartDate()
Category
getActiveStartDate in interface Categorypublic void setActiveStartDate(Date activeStartDate)
Category
setActiveStartDate in interface CategoryactiveStartDate - the new active start datepublic Date getActiveEndDate()
Category
getActiveEndDate in interface Categorypublic void setActiveEndDate(Date activeEndDate)
Category
setActiveEndDate in interface CategoryactiveEndDate - the new active end datepublic boolean isActive()
Category
isActive in interface StatusisActive in interface Categorypublic String getDisplayTemplate()
Categoryview = categoryTemplatePrefix + currentCategory.getDisplayTemplate();
getDisplayTemplate in interface Categorypublic void setDisplayTemplate(String displayTemplate)
Categoryview = categoryTemplatePrefix + currentCategory.getDisplayTemplate();
setDisplayTemplate in interface CategorydisplayTemplate - the new display templatepublic String getLongDescription()
Category
getLongDescription in interface Categorypublic void setLongDescription(String longDescription)
Category
setLongDescription in interface CategorylongDescription - the new long descriptionpublic Category getDefaultParentCategory()
Category
getDefaultParentCategory in interface Categorypublic void setDefaultParentCategory(Category defaultParentCategory)
Category
setDefaultParentCategory in interface CategorydefaultParentCategory - the new default parent categorypublic List<Category> getAllChildCategories()
Category
getAllChildCategories in interface Categorypublic boolean hasAllChildCategories()
Category
hasAllChildCategories in interface Categorypublic void setAllChildCategories(List<Category> childCategories)
Category
setAllChildCategories in interface CategorychildCategories - the list of child categoriespublic List<Category> getChildCategories()
Category
getChildCategories in interface Categorypublic boolean hasChildCategories()
Category
hasChildCategories in interface Categorypublic void setChildCategories(List<Category> childCategories)
Category
setChildCategories in interface CategorychildCategories - the list of active child categories.@Deprecated public Map<String,String> getCategoryImages()
Category
getCategoryImages in interface Category@Deprecated public String getCategoryImage(String imageKey)
Category
getCategoryImage in interface CategoryimageKey - the image key
@Deprecated public void setCategoryImages(Map<String,String> categoryImages)
Category
setCategoryImages in interface CategorycategoryImages - the category imagespublic Map<String,List<Long>> getChildCategoryURLMap()
CategoryCategory.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.
getChildCategoryURLMap in interface CategoryHydratedSetuppublic Map<String,List<Long>> createChildCategoryURLMap()
public void setChildCategoryURLMap(Map<String,List<Long>> childCategoryURLMap)
CategoryHydratedCacheJPAListener
setChildCategoryURLMap in interface CategoryHydratedSetuppublic List<Category> buildFullCategoryHierarchy(List<Category> currentHierarchy)
Category
buildFullCategoryHierarchy in interface Categorypublic List<Category> buildCategoryHierarchy(List<Category> currentHierarchy)
Category
buildCategoryHierarchy in interface Categorypublic List<Category> getAllParentCategories()
Category
getAllParentCategories in interface Categorypublic void setAllParentCategories(List<Category> allParentCategories)
Category
setAllParentCategories in interface CategoryallParentCategories - the list of parent categoriespublic List<FeaturedProduct> getFeaturedProducts()
Category
getFeaturedProducts in interface Categorypublic void setFeaturedProducts(List<FeaturedProduct> featuredProducts)
Category
setFeaturedProducts in interface CategoryfeaturedProducts - the featured productspublic List<RelatedProduct> getCrossSaleProducts()
Category
getCrossSaleProducts in interface Categorypublic void setCrossSaleProducts(List<RelatedProduct> crossSaleProducts)
Category
setCrossSaleProducts in interface CategoryCategory.getCrossSaleProducts()public List<RelatedProduct> getUpSaleProducts()
Category
getUpSaleProducts in interface Categorypublic List<RelatedProduct> getCumulativeCrossSaleProducts()
Category
getCumulativeCrossSaleProducts in interface Categorypublic List<RelatedProduct> getCumulativeUpSaleProducts()
Category
getCumulativeUpSaleProducts in interface Categorypublic List<FeaturedProduct> getCumulativeFeaturedProducts()
Category
getCumulativeFeaturedProducts in interface Categorypublic void setUpSaleProducts(List<RelatedProduct> upSaleProducts)
Category
setUpSaleProducts in interface CategoryCategory.getUpSaleProducts()public List<Product> getActiveProducts()
CategoryCategory's Products filtered by
active. If you want all of the Products (whether inactive or not) consider using
Category.getAllProducts().
getActiveProducts in interface CategoryProducts for this CategoryProduct#isActive()}public List<Product> getAllProducts()
CategoryProduct instances associated with this
category.
Products are active or not. If
you need this functionality, use Category.getActiveProducts()
getAllProducts in interface Categorypublic void setAllProducts(List<Product> allProducts)
CategoryProduct instances associated with this
category.
setAllProducts in interface CategoryallProducts - the list of products to associate with this categorypublic List<CategorySearchFacet> getSearchFacets()
Category
getSearchFacets in interface Categorypublic void setSearchFacets(List<CategorySearchFacet> searchFacets)
Category
setSearchFacets in interface Categorypublic List<SearchFacet> getExcludedSearchFacets()
Category
getExcludedSearchFacets in interface Categorypublic void setExcludedSearchFacets(List<SearchFacet> excludedSearchFacets)
Category
setExcludedSearchFacets in interface Categorypublic InventoryType getInventoryType()
Category
getInventoryType in interface CategoryInventoryType for this categorypublic void setInventoryType(InventoryType inventoryType)
Category
setInventoryType in interface CategoryinventoryType - the InventoryType for this categorypublic FulfillmentType getFulfillmentType()
Category
getFulfillmentType in interface Categorypublic void setFulfillmentType(FulfillmentType fulfillmentType)
Category
setFulfillmentType in interface Categorypublic List<CategorySearchFacet> getCumulativeSearchFacets()
CategoryCategorySearchFacet#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.
getCumulativeSearchFacets in interface Categorypublic Map<String,Media> getCategoryMedia()
CategoryMedia instance stores information about the
media itself (image url, etc...)
getCategoryMedia in interface Categorypublic void setCategoryMedia(Map<String,Media> categoryMedia)
CategoryMedia instance stores information about the
media itself (image url, etc...)
setCategoryMedia in interface CategorycategoryMedia - the category mediapublic List<CategoryAttribute> getCategoryAttributes()
CategoryCategory. In smaller sites, using these attributes might be preferred to
extending the domain object itself.
getCategoryAttributes in interface Category#getMappedCategoryAttributes()}public void setCategoryAttributes(List<CategoryAttribute> categoryAttributes)
CategoryCategory. In smaller sites, using these attributes might be preferred to
extending the domain object and creating a new table to store custom properties.
setCategoryAttributes in interface Categorypublic CategoryAttribute getCategoryAttributeByName(String name)
CategoryCategoryAttribute by name
getCategoryAttributeByName in interface Category#getCategoryAttributes()}, {@link #getMappedCategoryAttributes()}public Map<String,CategoryAttribute> getMappedCategoryAttributes()
CategoryCategoryAttributes for the Category in an easily-consumable
form
getMappedCategoryAttributes in interface Categorypublic Character getArchived()
getArchived in interface Statuspublic void setArchived(Character archived)
setArchived in interface Statuspublic int hashCode()
hashCode in class Objectpublic boolean equals(Object obj)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||