com.elasticpath.domain.catalog
Interface Category

All Superinterfaces:
BranchNode, java.lang.Comparable, Entity, EpDomain, ObjectWithLocaleDependantFields, Persistence, java.io.Serializable
All Known Implementing Classes:
CategoryImpl

public interface Category
extends java.lang.Comparable, Entity, ObjectWithLocaleDependantFields, BranchNode

A Category represents a collection of related Products. A Category is likely to have one or more products in it.


Method Summary
 void addChild(Category category)
          Add the given category as a child.
 AttributeValueGroup getAttributeValueGroup()
          Get the attribute value group.
 java.util.Set getAvailableChildren()
          Get the available children categories.
 CategoryType getCategoryType()
          Returns the category type.
 java.util.Set getChildren()
          Get the children categories.
 java.lang.String getCode()
          Returns the category code.
 java.util.Date getEndDate()
          Get the end date.
 boolean getHasSubCategories()
          Return the flag to indicate whether this category has subCategories or not.
 java.util.Date getLastModifiedDate()
          Returns the date when the category was last modified.
 java.util.Map getLocaleDependantFieldsMap()
          Gets the all LocaleDependantFields as a map.
 int getOrdering()
          Get the ordering number.
 Category getParent()
          Get the parent category of this category.
 java.util.List getPathAsList()
          Returns the category path as a List.
 java.lang.String getSeoUrl(java.util.Locale locale, int pageNumber)
          Returns the SEO URL, E.g.
 java.lang.String getSeoUrlWithoutSuffix(java.util.Locale locale)
          Returns the SEO URL without suffix, E.g.
 java.util.Date getStartDate()
          Get the start date that this category will become available to customers.
 java.lang.String getTemplate()
          Get the display template name of this category.
 java.lang.String getTemplateWithFallBack(java.lang.String defaultTemplate)
          Get the display template name of this category.
 java.util.Set getTopSellers()
          Returns the top sellers for this category.
 boolean isAvailable()
          Returns true if the category is available.
 boolean isHidden()
          Returns true if the product should not be displayed (e.g.
 void removeChild(Category category)
          Remove the given category from the children list.
 void setAttributeValueGroup(AttributeValueGroup attributeValueGroup)
          Set the attribute value group.
 void setCategoryType(CategoryType categoryType)
          Set the CategoryType.
 void setCode(java.lang.String code)
          Sets the category code.
 void setEndDate(java.util.Date endDate)
          Set the end date.
 void setHidden(boolean hidden)
          Set to true if the product should not be displayed.
 void setLastModifiedDate(java.util.Date lastModifiedDate)
          Set the date when the category was last modified.
 void setOrdering(int ordering)
          Set the ordering number.
 void setParent(Category category)
          Set the parent cateogry.
 void setParentOneWay(Category newParent)
          Set the parent cateogry.
 void setStartDate(java.util.Date startDate)
          Set the start date that this category will become valid.
 void setTopSellers(java.util.Set topSellers)
          Sets the top sellers for this category.
 
Methods inherited from interface com.elasticpath.domain.Entity
getGuid, setGuid
 
Methods inherited from interface com.elasticpath.domain.Persistence
executeBeforePersistAction, getUidPk, isPersistent, setDefaultValues, setUidPk
 
Methods inherited from interface com.elasticpath.domain.EpDomain
getElasticPath, setElasticPath
 
Methods inherited from interface com.elasticpath.domain.catalog.ObjectWithLocaleDependantFields
addOrUpdateLocaleDependantFields, getDisplayName, getLocaleDependantFields, getLocaleDependantFieldsWithoutFallBack, setLocaleDependantFieldsMap
 
Methods inherited from interface com.elasticpath.domain.catalogview.BranchNode
getLevel, getPath
 

Method Detail

addChild

void addChild(Category category)
Add the given category as a child.

Parameters:
category - the category to be added as a child

getAttributeValueGroup

AttributeValueGroup getAttributeValueGroup()
Get the attribute value group.

Returns:
the domain model's AttributeValueGroup

getAvailableChildren

java.util.Set getAvailableChildren()
Get the available children categories.

Returns:
the available children categories as a set

getCategoryType

CategoryType getCategoryType()
Returns the category type.

Returns:
the category type

getChildren

java.util.Set getChildren()
Get the children categories.

Returns:
the children categories as a set

getCode

java.lang.String getCode()
Returns the category code.

Returns:
the category code

getEndDate

java.util.Date getEndDate()
Get the end date. After the end date, the category will change to unavailable to customers.

Returns:
the end date

getHasSubCategories

boolean getHasSubCategories()
Return the flag to indicate whether this category has subCategories or not.

Returns:
the flag to indicate whether this category has subCategories or not.

getLastModifiedDate

java.util.Date getLastModifiedDate()
Returns the date when the category was last modified.

Returns:
the date when the category was last modified

getLocaleDependantFieldsMap

java.util.Map getLocaleDependantFieldsMap()
Gets the all LocaleDependantFields as a map.

Specified by:
getLocaleDependantFieldsMap in interface ObjectWithLocaleDependantFields
Returns:
the LocaleDependantFields map

getOrdering

int getOrdering()
Get the ordering number.

Returns:
the ordering number

getParent

Category getParent()
Get the parent category of this category. Returns null if this category doesn't have a parent.

Returns:
the parent category(or null no parent)

getPathAsList

java.util.List getPathAsList()
Returns the category path as a List. The root category will be the first.

Returns:
the category path as a List.

getSeoUrl

java.lang.String getSeoUrl(java.util.Locale locale,
                           int pageNumber)
Returns the SEO URL, E.g. cars/bwm/convertibles/cat-356-all.html.

Parameters:
locale - the locale
pageNumber - the page number
Returns:
the SEO URL

getSeoUrlWithoutSuffix

java.lang.String getSeoUrlWithoutSuffix(java.util.Locale locale)
Returns the SEO URL without suffix, E.g. cars/bwm/convertibles .

Parameters:
locale - the locale
Returns:
the SEO URL without suffix

getStartDate

java.util.Date getStartDate()
Get the start date that this category will become available to customers.

Returns:
the start date

getTemplate

java.lang.String getTemplate()
Get the display template name of this category.

Returns:
the template

getTemplateWithFallBack

java.lang.String getTemplateWithFallBack(java.lang.String defaultTemplate)
Get the display template name of this category.

Parameters:
defaultTemplate - the default template name
Returns:
the template name if it is defined for this category, otherwise the given default template name

getTopSellers

java.util.Set getTopSellers()
Returns the top sellers for this category.

Returns:
top sellers for this category

isAvailable

boolean isAvailable()
Returns true if the category is available.

Returns:
true if the category is available.

isHidden

boolean isHidden()
Returns true if the product should not be displayed (e.g. in its category or as a search result).

Returns:
true if the product should not be displayed

removeChild

void removeChild(Category category)
Remove the given category from the children list.

Parameters:
category - the category to be removed

setAttributeValueGroup

void setAttributeValueGroup(AttributeValueGroup attributeValueGroup)
Set the attribute value group.

Parameters:
attributeValueGroup - the AttributeValueGroup

setCategoryType

void setCategoryType(CategoryType categoryType)
Set the CategoryType.

Parameters:
categoryType - the CategoryType

setCode

void setCode(java.lang.String code)
Sets the category code.

Parameters:
code - the category code

setEndDate

void setEndDate(java.util.Date endDate)
Set the end date.

Parameters:
endDate - the end date

setHidden

void setHidden(boolean hidden)
Set to true if the product should not be displayed.

Parameters:
hidden - true if the product should not be displayed

setLastModifiedDate

void setLastModifiedDate(java.util.Date lastModifiedDate)
Set the date when the category was last modified.

Parameters:
lastModifiedDate - the date when the category was last modified

setOrdering

void setOrdering(int ordering)
Set the ordering number.

Parameters:
ordering - the ordering number

setParent

void setParent(Category category)
Set the parent cateogry. This method maintains the bidirectional relationships between the parent category and this category. So it will so add this category to the given category's children collectin.

Parameters:
category - the parent category

setParentOneWay

void setParentOneWay(Category newParent)
Set the parent cateogry. Notice: this method doesn't maintains the bidirectional relationships between the parent category and this category. It won't add this category to the given parent catgory's children collectin. This method can be used in some special circumstance to get better performance, like import. Generally, you shouldn't use the given parent category any more after this method get called because its children is no consistent any more.

Parameters:
newParent - the new parent category

setStartDate

void setStartDate(java.util.Date startDate)
Set the start date that this category will become valid.

Parameters:
startDate - the start date

setTopSellers

void setTopSellers(java.util.Set topSellers)
Sets the top sellers for this category.

Parameters:
topSellers - the top sellers for this category