Interface CommerceCategoryService
-
- All Known Implementing Classes:
DefaultCommerceCategoryService
public interface CommerceCategoryServiceThe 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 CategoryModelgetCategoryForCode(java.lang.String code)Retrieves theCategoryModelwith 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 theCategoryModelwith 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 specifiedcodeandcatalogVersionwas found.java.lang.IllegalArgumentException- if parametercodeisnull.
-
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 parametercategoryisnull.
-
-