@Entity public class CategoryImpl extends Object implements Category, Status, AdminMainEntity, Locatable, TemplatePathContainer
| Modifier and Type | Class and Description |
|---|---|
static class |
CategoryImpl.Presentation |
MAIN_ENTITY_NAME_PROPERTY| Constructor and Description |
|---|
CategoryImpl() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
List<Long> |
createChildCategoryIds() |
Map<String,List<Long>> |
createChildCategoryURLMap() |
<G extends Category> |
createOrRetrieveCopyInstance(MultiTenantCopyContext context) |
boolean |
equals(Object obj) |
Date |
getActiveEndDate()
Gets the active end date.
|
List<Product> |
getActiveProducts()
Deprecated.
|
List<CategoryProductXref> |
getActiveProductXrefs() |
Date |
getActiveStartDate()
Gets the active start date.
|
List<Category> |
getAllChildCategories()
Deprecated.
|
List<CategoryXref> |
getAllChildCategoryXrefs() |
List<Category> |
getAllParentCategories()
Deprecated.
|
List<CategoryXref> |
getAllParentCategoryXrefs()
Retrieve all the xref entities linking this category to parent categories
|
List<Product> |
getAllProducts()
Deprecated.
|
List<CategoryProductXref> |
getAllProductXrefs() |
Character |
getArchived() |
CategoryAttribute |
getCategoryAttributeByName(String name)
Convenience method to get a
CategoryAttribute by name |
List<CategoryAttribute> |
getCategoryAttributes()
Gets the attributes for this
Category. |
Map<String,CategoryAttribute> |
getCategoryAttributesMap()
Gets the attributes for this
Category. |
Map<String,Media> |
getCategoryMedia()
Deprecated.
|
Map<String,CategoryMediaXref> |
getCategoryMediaXref()
Gets the category media map.
|
List<Category> |
getChildCategories()
Deprecated.
|
List<Long> |
getChildCategoryIds()
Gets the child category ids.
|
Map<String,List<Long>> |
getChildCategoryURLMap()
Deprecated.
|
List<CategoryXref> |
getChildCategoryXrefs() |
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<CategorySearchFacet> |
getCumulativeSearchFacets(Set<Category> categoryHierarchy)
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()
Deprecated.
|
String |
getDescription()
Gets the description.
|
String |
getDisplayTemplate()
Gets the display template.
|
List<CategoryExcludedSearchFacet> |
getExcludedSearchFacets()
Gets the excluded SearchFacets
|
String |
getExternalId()
Intended to hold any unique identifier not tied to the Broadleaf Database Sequence Identifier.
|
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()
Used to determine availability for all of the products/skus in this category
|
String |
getLocation() |
String |
getLongDescription()
Gets the long description.
|
String |
getMainEntityName() |
Map<String,CategoryAttribute> |
getMappedCategoryAttributes()
Convenience method to return the
CategoryAttributes for the Category in an easily-consumable
form |
String |
getName()
Gets the name.
|
Boolean |
getOverrideGeneratedUrl() |
Category |
getParentCategory()
Return the category that is the parent of this category - if applicable
|
List<CategorySearchFacet> |
getSearchFacets()
Returns all of the SearchFacets that are directly associated with this Category
|
String |
getTaxCode()
Returns the tax code of 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)
Deprecated.
|
void |
setAllChildCategoryXrefs(List<CategoryXref> childCategories) |
void |
setAllParentCategories(List<Category> allParentCategories)
Deprecated.
|
void |
setAllParentCategoryXrefs(List<CategoryXref> allParentCategories)
Set all the xref entities linking this product to parent categories
|
void |
setAllProducts(List<Product> allProducts)
Deprecated.
|
void |
setAllProductXrefs(List<CategoryProductXref> allProducts) |
void |
setArchived(Character archived) |
void |
setCategoryAttributes(List<CategoryAttribute> categoryAttributes)
Sets the attributes for this
Category. |
void |
setCategoryAttributesMap(Map<String,CategoryAttribute> categoryAttributes) |
void |
setCategoryMedia(Map<String,Media> categoryMedia)
Deprecated.
|
void |
setCategoryMediaXref(Map<String,CategoryMediaXref> categoryMediaXref)
Sets the category media.
|
void |
setChildCategories(List<Category> childCategories)
Deprecated.
|
void |
setChildCategoryIds(List<Long> childCategoryIds)
Sets the all child category ids.
|
void |
setChildCategoryURLMap(Map<String,List<Long>> childCategoryURLMap)
Deprecated.
|
void |
setChildCategoryXrefs(List<CategoryXref> childCategories) |
void |
setCrossSaleProducts(List<RelatedProduct> crossSaleProducts)
Sets the cross sale products that are related to this category.
|
void |
setDefaultParentCategory(Category defaultParentCategory)
Deprecated.
|
void |
setDescription(String description)
Sets the description.
|
void |
setDisplayTemplate(String displayTemplate)
Sets the display template.
|
void |
setExcludedSearchFacets(List<CategoryExcludedSearchFacet> excludedSearchFacets)
Sets the SearchFacets that should not be rendered by this Category.
|
void |
setExternalId(String externalId)
Sets a unique external ID
|
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 |
setOverrideGeneratedUrl(Boolean overrideGeneratedUrl)
Sets the flag for whether or not the URL should not be generated in the admin
|
void |
setParentCategory(Category category)
Set the parent category of this category
|
void |
setSearchFacets(List<CategorySearchFacet> searchFacets)
Sets the SearchFacets that are directly associated with this Category
|
void |
setTaxCode(String taxCode)
Sets the tax code of 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.
|
protected Long id
protected String name
protected String url
protected Boolean overrideGeneratedUrl
protected String externalId
protected String urlKey
protected String description
protected String taxCode
protected Date activeStartDate
protected Date activeEndDate
protected String displayTemplate
protected String longDescription
@Deprecated protected Category defaultParentCategory
protected List<CategoryXref> allChildCategoryXrefs
protected List<CategoryXref> allParentCategoryXrefs
protected List<CategoryProductXref> allProductXrefs
protected Map<String,CategoryMediaXref> categoryMedia
protected List<FeaturedProduct> featuredProducts
protected List<RelatedProduct> crossSaleProducts
protected List<RelatedProduct> upSaleProducts
protected List<CategorySearchFacet> searchFacets
protected List<CategoryExcludedSearchFacet> excludedSearchFacets
protected Map<String,CategoryAttribute> categoryAttributes
protected String inventoryType
protected String fulfillmentType
protected ArchiveStatus archiveStatus
@Deprecated protected Map<String,List<Long>> childCategoryURLMap
protected List<CategoryXref> childCategoryXrefs
protected List<FeaturedProduct> filteredFeaturedProducts
protected List<RelatedProduct> filteredCrossSales
protected List<RelatedProduct> filteredUpSales
protected static Comparator<CategorySearchFacet> facetPositionComparator
protected static Comparator sequenceComparator
public String getUrl()
Category"redirect:"+currentCategory.getUrl();
from a controller.public void setUrl(String url)
Category"redirect:"+currentCategory.getUrl();
from a controller.public Boolean getOverrideGeneratedUrl()
getOverrideGeneratedUrl in interface Categorypublic void setOverrideGeneratedUrl(Boolean overrideGeneratedUrl)
CategorysetOverrideGeneratedUrl in interface Categorypublic String getUrlKey()
Categorypublic String getGeneratedUrl()
CategorygetGeneratedUrl in interface Categorypublic void setUrlKey(String urlKey)
Categorypublic String getDescription()
CategorygetDescription in interface Categorypublic void setDescription(String description)
CategorysetDescription in interface Categorydescription - the new descriptionpublic Date getActiveStartDate()
CategorygetActiveStartDate in interface Categorypublic void setActiveStartDate(Date activeStartDate)
CategorysetActiveStartDate in interface CategoryactiveStartDate - the new active start datepublic Date getActiveEndDate()
CategorygetActiveEndDate in interface Categorypublic void setActiveEndDate(Date activeEndDate)
CategorysetActiveEndDate in interface CategoryactiveEndDate - the new active end datepublic boolean isActive()
Categorypublic String getDisplayTemplate()
Categoryview = categoryTemplatePrefix + currentCategory.getDisplayTemplate();getDisplayTemplate in interface TemplatePathContainergetDisplayTemplate in interface Categorypublic void setDisplayTemplate(String displayTemplate)
Categoryview = categoryTemplatePrefix + currentCategory.getDisplayTemplate();setDisplayTemplate in interface CategorydisplayTemplate - the new display templatepublic String getLongDescription()
CategorygetLongDescription in interface Categorypublic void setLongDescription(String longDescription)
CategorysetLongDescription in interface CategorylongDescription - the new long description@Deprecated public Category getDefaultParentCategory()
CategoryCategory.getParentCategory() by default, unless the "use.legacy.default.category.mode" property is set to
true in the implementation's property file. If set to true, this method will use legacy behavior,
which is to return the deprecated defaultParentCategory field.getDefaultParentCategory in interface Category@Deprecated public void setDefaultParentCategory(Category defaultParentCategory)
CategoryCategory.setParentCategory(Category) by default, unless the "use.legacy.default.category.mode" property is set to
true in the implementation's property file. If set to true, this method will use legacy behavior,
which is to set the deprecated defaultParentCategory field.setDefaultParentCategory in interface CategorydefaultParentCategory - the new default parent categorypublic Category getParentCategory()
CategorygetParentCategory in interface Categorypublic void setParentCategory(Category category)
CategorysetParentCategory in interface Categorypublic List<CategoryXref> getAllChildCategoryXrefs()
getAllChildCategoryXrefs in interface Categorypublic List<CategoryXref> getChildCategoryXrefs()
getChildCategoryXrefs in interface Categorypublic void setChildCategoryXrefs(List<CategoryXref> childCategories)
setChildCategoryXrefs in interface Categorypublic void setAllChildCategoryXrefs(List<CategoryXref> childCategories)
setAllChildCategoryXrefs in interface Category@Deprecated public List<Category> getAllChildCategories()
CategorygetAllChildCategories in interface Categorypublic boolean hasAllChildCategories()
CategoryhasAllChildCategories in interface Category@Deprecated public void setAllChildCategories(List<Category> childCategories)
CategorysetAllChildCategories in interface CategorychildCategories - the list of child categories@Deprecated public List<Category> getChildCategories()
CategorygetChildCategories in interface Categorypublic boolean hasChildCategories()
CategoryhasChildCategories in interface Category@Deprecated public void setChildCategories(List<Category> childCategories)
CategorysetChildCategories in interface CategorychildCategories - the list of active child categories.public List<Long> getChildCategoryIds()
CategorygetChildCategoryIds in interface Categorypublic void setChildCategoryIds(List<Long> childCategoryIds)
CategorysetChildCategoryIds in interface CategorychildCategoryIds - the list of active child category ids.@Deprecated public 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 is inefficient, so its use is highly discouraged.getChildCategoryURLMap in interface Category@Deprecated public void setChildCategoryURLMap(Map<String,List<Long>> childCategoryURLMap)
CategorysetChildCategoryURLMap in interface Categorypublic List<Category> buildFullCategoryHierarchy(List<Category> currentHierarchy)
CategorybuildFullCategoryHierarchy in interface Categorypublic List<Category> buildCategoryHierarchy(List<Category> currentHierarchy)
CategorybuildCategoryHierarchy in interface Categorypublic List<CategoryXref> getAllParentCategoryXrefs()
CategorygetAllParentCategoryXrefs in interface Categorypublic void setAllParentCategoryXrefs(List<CategoryXref> allParentCategories)
CategorysetAllParentCategoryXrefs in interface Category@Deprecated public List<Category> getAllParentCategories()
CategorygetAllParentCategories in interface Category@Deprecated public void setAllParentCategories(List<Category> allParentCategories)
CategorysetAllParentCategories in interface CategoryallParentCategories - the list of parent categoriespublic List<FeaturedProduct> getFeaturedProducts()
CategorygetFeaturedProducts in interface Categorypublic void setFeaturedProducts(List<FeaturedProduct> featuredProducts)
CategorysetFeaturedProducts in interface CategoryfeaturedProducts - the featured productspublic List<RelatedProduct> getCrossSaleProducts()
CategorygetCrossSaleProducts in interface Categorypublic void setCrossSaleProducts(List<RelatedProduct> crossSaleProducts)
CategorysetCrossSaleProducts in interface CategoryCategory.getCrossSaleProducts()public List<RelatedProduct> getUpSaleProducts()
CategorygetUpSaleProducts in interface Categorypublic List<RelatedProduct> getCumulativeCrossSaleProducts()
CategorygetCumulativeCrossSaleProducts in interface Categorypublic List<RelatedProduct> getCumulativeUpSaleProducts()
CategorygetCumulativeUpSaleProducts in interface Categorypublic List<FeaturedProduct> getCumulativeFeaturedProducts()
CategorygetCumulativeFeaturedProducts in interface Categorypublic void setUpSaleProducts(List<RelatedProduct> upSaleProducts)
CategorysetUpSaleProducts in interface CategoryCategory.getUpSaleProducts()public List<CategoryProductXref> getActiveProductXrefs()
getActiveProductXrefs in interface Categorypublic List<CategoryProductXref> getAllProductXrefs()
getAllProductXrefs in interface Categorypublic void setAllProductXrefs(List<CategoryProductXref> allProducts)
setAllProductXrefs in interface Category@Deprecated 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()}@Deprecated 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 Category@Deprecated public 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()
CategorygetSearchFacets in interface Categorypublic void setSearchFacets(List<CategorySearchFacet> searchFacets)
CategorysetSearchFacets in interface Categorypublic List<CategoryExcludedSearchFacet> getExcludedSearchFacets()
CategorygetExcludedSearchFacets in interface Categorypublic void setExcludedSearchFacets(List<CategoryExcludedSearchFacet> excludedSearchFacets)
CategorysetExcludedSearchFacets in interface Categorypublic InventoryType getInventoryType()
CategorygetInventoryType in interface CategoryInventoryType for this categorypublic void setInventoryType(InventoryType inventoryType)
CategorysetInventoryType in interface CategoryinventoryType - the InventoryType for this categorypublic FulfillmentType getFulfillmentType()
CategorygetFulfillmentType in interface Categorypublic void setFulfillmentType(FulfillmentType fulfillmentType)
CategorysetFulfillmentType 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 List<CategorySearchFacet> getCumulativeSearchFacets(Set<Category> categoryHierarchy)
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.
Takes a Set of the categories that have been traversed in order to protect from circular dependencies.getCumulativeSearchFacets in interface Category@Deprecated public Map<String,Media> getCategoryMedia()
CategoryMedia instance stores information about the
media itself (image url, etc...)getCategoryMedia in interface Category@Deprecated public void setCategoryMedia(Map<String,Media> categoryMedia)
CategoryMedia instance stores information about the
media itself (image url, etc...)setCategoryMedia in interface CategorycategoryMedia - the category mediapublic Map<String,CategoryMediaXref> getCategoryMediaXref()
CategoryMedia instance stores information about the
media itself (image url, etc...)getCategoryMediaXref in interface Categorypublic void setCategoryMediaXref(Map<String,CategoryMediaXref> categoryMediaXref)
CategoryMedia instance stores information about the
media itself (image url, etc...)setCategoryMediaXref in interface Categorypublic Map<String,CategoryAttribute> getCategoryAttributesMap()
CategoryCategory. In smaller sites, using these attributes might be preferred to
extending the domain object itself.getCategoryAttributesMap in interface Category#getMappedCategoryAttributes()}public void setCategoryAttributesMap(Map<String,CategoryAttribute> categoryAttributes)
setCategoryAttributesMap in interface Categorypublic 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 namegetCategoryAttributeByName in interface Category#getCategoryAttributes()}, {@link #getMappedCategoryAttributes()}public Map<String,CategoryAttribute> getMappedCategoryAttributes()
CategoryCategoryAttributes for the Category in an easily-consumable
formgetMappedCategoryAttributes in interface Categorypublic Character getArchived()
getArchived in interface Statuspublic void setArchived(Character archived)
setArchived in interface Statuspublic <G extends Category> CreateResponse<G> createOrRetrieveCopyInstance(MultiTenantCopyContext context) throws CloneNotSupportedException
createOrRetrieveCopyInstance in interface MultiTenantCloneable<Category>CloneNotSupportedExceptionpublic String getMainEntityName()
getMainEntityName in interface AdminMainEntitypublic String getTaxCode()
CategorygetTaxCode in interface Categorypublic void setTaxCode(String taxCode)
CategorysetTaxCode in interface Categorypublic String getLocation()
getLocation in interface Locatablepublic String getExternalId()
CategorygetExternalId in interface Categorypublic void setExternalId(String externalId)
CategorysetExternalId in interface CategoryCopyright © 2017. All rights reserved.