Interface CommerceCategoryService
-
- All Known Implementing Classes:
DefaultCommerceCategoryService
public interface CommerceCategoryService
The CommerceCategoryService supports looking up categories within the current session product catalog. Other types of session catalog, i.e. content catalogs and classification catalogs are excluded.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CategoryModel
getCategoryForCode(java.lang.String code)
Retrieves theCategoryModel
with the specificcode
.java.util.Collection<java.util.List<CategoryModel>>
getPathsForCategory(CategoryModel category)
Returns all paths for thisCategoryModel
.
-
-
-
Method Detail
-
getCategoryForCode
CategoryModel getCategoryForCode(java.lang.String code)
Retrieves theCategoryModel
with the specificcode
.- Parameters:
code
- the code of the to be foundCategoryModel
- Returns:
- found
CategoryModel
- Throws:
UnknownIdentifierException
- if no category with the specified code can be found.AmbiguousIdentifierException
- if more than one category with the specifiedcode
andcatalogVersion
was found.java.lang.IllegalArgumentException
- if parametercode
isnull
.
-
getPathsForCategory
java.util.Collection<java.util.List<CategoryModel>> getPathsForCategory(CategoryModel category)
Returns all paths for thisCategoryModel
. Each path is a list of all categories in the path from root to this category.- Parameters:
category
- the (sub)CategoryModel
- Returns:
- all paths for this
CategoryModel
, or empty collection if this category has no super-categories. - Throws:
java.lang.IllegalArgumentException
- if parametercategory
isnull
.
-
-