org.broadleafcommerce.core.catalog.domain
Class CategoryImpl

java.lang.Object
  extended by org.broadleafcommerce.core.catalog.domain.CategoryImpl
All Implemented Interfaces:
java.io.Serializable, Category

@Entity
public class CategoryImpl
extends java.lang.Object
implements Category

The Class CategoryImpl is the default implementation of Category. A category is a group of products.

If you want to add fields specific to your implementation of BroadLeafCommerce you should extend this class and add your fields. If you need to make significant changes to the CategoryImpl then you should implement your own version of Category.

This implementation uses a Hibernate implementation of JPA configured through annotations. The Entity references the following tables: BLC_CATEGORY, BLC_CATEGORY_XREF, BLC_CATEGORY_IMAGE

Author:
btaylor
See Also:
Category}, Serialized Form

Field Summary
protected  java.util.Date activeEndDate
          The active end date.
protected  java.util.Date activeStartDate
          The active start date.
protected  java.util.List<Category> allChildCategories
          The all child categories.
protected  java.util.List<Category> allParentCategories
          The all parent categories.
protected  java.util.List<Product> allProducts
          The all parent categories.
protected  java.util.Map<java.lang.String,java.lang.String> categoryImages
          Deprecated. 
protected  java.util.Map<java.lang.String,Media> categoryMedia
           
protected  java.util.List<Category> childCategories
           
protected  java.util.Map<java.lang.String,java.util.List<Category>> childCategoryURLMap
           
protected  Category defaultParentCategory
          The default parent category.
protected  java.lang.String description
          The description.
protected  java.lang.String displayTemplate
          The display template.
protected  java.util.List<FeaturedProduct> featuredProducts
           
protected  java.lang.Long id
          The id.
protected  java.lang.String longDescription
          The long description.
protected  java.lang.String name
          The name.
protected  java.lang.String url
          The url.
protected  java.lang.String urlKey
          The url key.
 
Constructor Summary
CategoryImpl()
           
 
Method Summary
 java.util.Map<java.lang.String,java.util.List<Category>> createChildCategoryURLMap()
           
 boolean equals(java.lang.Object obj)
           
 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()
           
 java.util.List<Product> getAllProducts()
           
 java.lang.String getCategoryImage(java.lang.String imageKey)
          Deprecated. 
 java.util.Map<java.lang.String,java.lang.String> getCategoryImages()
          Deprecated. 
 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<Category>> 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()
          Gets the generated url.
 java.lang.Long getId()
          Gets the id.
 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.
 int hashCode()
           
 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 all child categories.
 void setAllParentCategories(java.util.List<Category> allParentCategories)
           
 void setAllProducts(java.util.List<Product> allProducts)
           
 void setCategoryImages(java.util.Map<java.lang.String,java.lang.String> categoryImages)
          Deprecated. 
 void setCategoryMedia(java.util.Map<java.lang.String,Media> categoryMedia)
          Sets the category images.
 void setChildCategories(java.util.List<Category> childCategories)
          Sets the all child categories.
 void setChildCategoryURLMap(java.util.Map<java.lang.String,java.util.List<Category>> cachedChildCategoryUrlMap)
           
 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 id.
 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.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

protected java.lang.Long id
The id.


name

protected java.lang.String name
The name.


url

protected java.lang.String url
The url.


urlKey

protected java.lang.String urlKey
The url key.


description

protected java.lang.String description
The description.


activeStartDate

protected java.util.Date activeStartDate
The active start date.


activeEndDate

protected java.util.Date activeEndDate
The active end date.


displayTemplate

protected java.lang.String displayTemplate
The display template.


longDescription

protected java.lang.String longDescription
The long description.


childCategoryURLMap

protected java.util.Map<java.lang.String,java.util.List<Category>> childCategoryURLMap

childCategories

protected java.util.List<Category> childCategories

defaultParentCategory

protected Category defaultParentCategory
The default parent category.


allChildCategories

protected java.util.List<Category> allChildCategories
The all child categories.


allParentCategories

protected java.util.List<Category> allParentCategories
The all parent categories.


allProducts

protected java.util.List<Product> allProducts
The all parent categories.


categoryImages

@Deprecated
protected java.util.Map<java.lang.String,java.lang.String> categoryImages
Deprecated. 
The category images.


categoryMedia

protected java.util.Map<java.lang.String,Media> categoryMedia

featuredProducts

protected java.util.List<FeaturedProduct> featuredProducts
Constructor Detail

CategoryImpl

public CategoryImpl()
Method Detail

getId

public java.lang.Long getId()
Description copied from interface: Category
Gets the id.

Specified by:
getId in interface Category
Returns:
the id

setId

public void setId(java.lang.Long id)
Description copied from interface: Category
Sets the id.

Specified by:
setId in interface Category
Parameters:
id - the new id

getName

public java.lang.String getName()
Description copied from interface: Category
Gets the name.

Specified by:
getName in interface Category
Returns:
the name

setName

public void setName(java.lang.String name)
Description copied from interface: Category
Sets the name.

Specified by:
setName in interface Category
Parameters:
name - the new name

getUrl

public java.lang.String getUrl()
Description copied from interface: Category
Gets the url.

Specified by:
getUrl in interface Category
Returns:
the url

setUrl

public void setUrl(java.lang.String url)
Description copied from interface: Category
Sets the url.

Specified by:
setUrl in interface Category
Parameters:
url - the new url

getUrlKey

public java.lang.String getUrlKey()
Description copied from interface: Category
Gets the url key.

Specified by:
getUrlKey in interface Category
Returns:
the url key

getGeneratedUrl

public java.lang.String getGeneratedUrl()
Description copied from interface: Category
Gets the generated url.

Specified by:
getGeneratedUrl in interface Category
Returns:
the generated url

setUrlKey

public void setUrlKey(java.lang.String urlKey)
Description copied from interface: Category
Sets the url key.

Specified by:
setUrlKey in interface Category
Parameters:
urlKey - the new url key

getDescription

public java.lang.String getDescription()
Description copied from interface: Category
Gets the description.

Specified by:
getDescription in interface Category
Returns:
the description

setDescription

public void setDescription(java.lang.String description)
Description copied from interface: Category
Sets the description.

Specified by:
setDescription in interface Category
Parameters:
description - the new description

getActiveStartDate

public java.util.Date getActiveStartDate()
Description copied from interface: Category
Gets the active start date.

Specified by:
getActiveStartDate in interface Category
Returns:
the active start date

setActiveStartDate

public void setActiveStartDate(java.util.Date activeStartDate)
Description copied from interface: Category
Sets the active start date.

Specified by:
setActiveStartDate in interface Category
Parameters:
activeStartDate - the new active start date

getActiveEndDate

public java.util.Date getActiveEndDate()
Description copied from interface: Category
Gets the active end date.

Specified by:
getActiveEndDate in interface Category
Returns:
the active end date

setActiveEndDate

public void setActiveEndDate(java.util.Date activeEndDate)
Description copied from interface: Category
Sets the active end date.

Specified by:
setActiveEndDate in interface Category
Parameters:
activeEndDate - the new active end date

isActive

public boolean isActive()
Description copied from interface: Category
Checks if is active.

Specified by:
isActive in interface Category
Returns:
true, if is active

getDisplayTemplate

public java.lang.String getDisplayTemplate()
Description copied from interface: Category
Gets the display template.

Specified by:
getDisplayTemplate in interface Category
Returns:
the display template

setDisplayTemplate

public void setDisplayTemplate(java.lang.String displayTemplate)
Description copied from interface: Category
Sets the display template.

Specified by:
setDisplayTemplate in interface Category
Parameters:
displayTemplate - the new display template

getLongDescription

public java.lang.String getLongDescription()
Description copied from interface: Category
Gets the long description.

Specified by:
getLongDescription in interface Category
Returns:
the long description

setLongDescription

public void setLongDescription(java.lang.String longDescription)
Description copied from interface: Category
Sets the long description.

Specified by:
setLongDescription in interface Category
Parameters:
longDescription - the new long description

getDefaultParentCategory

public Category getDefaultParentCategory()
Description copied from interface: Category
Gets the default parent category.

Specified by:
getDefaultParentCategory in interface Category
Returns:
the default parent category

setDefaultParentCategory

public void setDefaultParentCategory(Category defaultParentCategory)
Description copied from interface: Category
Sets the default parent category.

Specified by:
setDefaultParentCategory in interface Category
Parameters:
defaultParentCategory - the new default parent category

getAllChildCategories

public java.util.List<Category> getAllChildCategories()
Gets the child categories.

Specified by:
getAllChildCategories in interface Category
Returns:
the child categories

hasAllChildCategories

public boolean hasAllChildCategories()
Checks for child categories.

Specified by:
hasAllChildCategories in interface Category
Returns:
true, if successful

setAllChildCategories

public void setAllChildCategories(java.util.List<Category> childCategories)
Sets the all child categories.

Specified by:
setAllChildCategories in interface Category
Parameters:
allChildCategories - the new all child categories

getChildCategories

public java.util.List<Category> getChildCategories()
Description copied from interface: Category
Gets the child categories.

Specified by:
getChildCategories in interface Category
Returns:
the child categories

hasChildCategories

public boolean hasChildCategories()
Description copied from interface: Category
Checks for child categories.

Specified by:
hasChildCategories in interface Category
Returns:
true, if successful

setChildCategories

public void setChildCategories(java.util.List<Category> childCategories)
Description copied from interface: Category
Sets the all child categories.

Specified by:
setChildCategories in interface Category

getCategoryImages

@Deprecated
public java.util.Map<java.lang.String,java.lang.String> getCategoryImages()
Deprecated. 

Description copied from interface: Category
Gets the category images.

Specified by:
getCategoryImages in interface Category
Returns:
the category images

getCategoryImage

@Deprecated
public java.lang.String getCategoryImage(java.lang.String imageKey)
Deprecated. 

Description copied from interface: Category
Gets the category image.

Specified by:
getCategoryImage in interface Category
Parameters:
imageKey - the image key
Returns:
the category image

setCategoryImages

@Deprecated
public void setCategoryImages(java.util.Map<java.lang.String,java.lang.String> categoryImages)
Deprecated. 

Description copied from interface: Category
Sets the category images.

Specified by:
setCategoryImages in interface Category
Parameters:
categoryImages - the category images

getChildCategoryURLMap

public java.util.Map<java.lang.String,java.util.List<Category>> getChildCategoryURLMap()
Description copied from interface: Category
Gets the child category url map.

Specified by:
getChildCategoryURLMap in interface Category
Returns:
the child category url map

setChildCategoryURLMap

public void setChildCategoryURLMap(java.util.Map<java.lang.String,java.util.List<Category>> cachedChildCategoryUrlMap)
Specified by:
setChildCategoryURLMap in interface Category

createChildCategoryURLMap

public java.util.Map<java.lang.String,java.util.List<Category>> createChildCategoryURLMap()

getAllParentCategories

public java.util.List<Category> getAllParentCategories()
Specified by:
getAllParentCategories in interface Category

setAllParentCategories

public void setAllParentCategories(java.util.List<Category> allParentCategories)
Specified by:
setAllParentCategories in interface Category

getFeaturedProducts

public java.util.List<FeaturedProduct> getFeaturedProducts()
Description copied from interface: Category
Gets the featured products.

Specified by:
getFeaturedProducts in interface Category
Returns:
the featured products

setFeaturedProducts

public void setFeaturedProducts(java.util.List<FeaturedProduct> featuredProducts)
Description copied from interface: Category
Sets the featured products.

Specified by:
setFeaturedProducts in interface Category
Parameters:
featuredProducts - the featured products

getAllProducts

public java.util.List<Product> getAllProducts()
Specified by:
getAllProducts in interface Category

setAllProducts

public void setAllProducts(java.util.List<Product> allProducts)
Specified by:
setAllProducts in interface Category

getCategoryMedia

public java.util.Map<java.lang.String,Media> getCategoryMedia()
Description copied from interface: Category
Gets the category media map

Specified by:
getCategoryMedia in interface Category
Returns:
the category Media

setCategoryMedia

public void setCategoryMedia(java.util.Map<java.lang.String,Media> categoryMedia)
Description copied from interface: Category
Sets the category images.

Specified by:
setCategoryMedia in interface Category
Parameters:
categoryMedia - the category media

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object


Copyright © 2011. All Rights Reserved.