public interface CategoryMgrIf
Modifier and Type | Method and Description |
---|---|
Category[] |
getCategoriesForCatalogId(java.lang.String catalogId,
int languageId)
Return an array of categories for the catalogId passed.
|
Category[] |
getCategoriesFromIds(java.util.ArrayList<java.lang.Integer> catIdList,
int languageId)
Return an array of categories for the ids passed in through the catIdList parameter.
|
Category[] |
getCategoriesPerManufacturer(int manufacturerId,
int languageId)
Returns an array of leaf Category objects for the given manufacturer.
|
Category[] |
getCategoriesPerProduct(int productId,
int languageId)
Returns an array of Category objects that the product belongs to.
|
Category |
getCategory(int categoryId,
int languageId) |
Category[] |
getCategoryTree(int languageId,
boolean getNumProducts)
Returns an array of top level categories each of which includes an array of child categories
etc.
|
Category[] |
getCategoryTreeWithOptions(CategoryTreeOptionsIf options)
Returns a category tree structure consisting of an array of top level categories, each of
which may contain an array of child categories.
|
int[] |
getChildren(int categoryId)
Returns an array of categoryId describing the children of the given category.
|
int[] |
getParents(int categoryId)
Returns an array of categoryId describing the given category and its parents.
|
Category[] getCategoryTree(int languageId, boolean getNumProducts) throws java.lang.Exception
Each Category class contains a field that describes how many products exist for that
category. This field is not set in the static tree and we calculate it each time on demand
since it only involves one database query and the product information is a lot more dynamic
than that of the categories. We only calculate it if getNumProducts
is set.
If you do not set numberOfProducts
to true beware that the category tree
returned will be a reference to the static category tree object and not a clone. This is only
relevant when using the POJO KKEng engine.
languageId
- the languageIdgetNumProducts
- the getNumProductsjava.lang.Exception
- an unexpected exceptionCategory[] getCategoryTreeWithOptions(CategoryTreeOptionsIf options) throws java.lang.Exception
The name of the category is language dependent and will be returned in the language defined
by the languageId
parameter of the CategoryTreeObject.
Each Category class contains a numberOfProducts
field that describes how many
products exist for that category. It is only calculated if the getNumProducts
input parameter of the CategoryTreeOptions object is set to true. For performance reasons
this parameter should be set to false if numberOfProducts
is not required.
If the CategoryTreeOptions object has its returnClonedTree attribute set to true a cloned version of the category tree will be returned.
options
- Category tree options object.java.lang.Exception
- an unexpected exceptionCategory[] getCategoriesPerManufacturer(int manufacturerId, int languageId) throws java.lang.Exception
manufacturerId
- the manufacturerIdlanguageId
- the languageIdjava.lang.Exception
- an unexpected exceptionint[] getChildren(int categoryId) throws java.lang.Exception
categoryId
- the categoryIdjava.lang.Exception
- an unexpected exceptionint[] getParents(int categoryId) throws java.lang.Exception
categoryId
- the categoryIdjava.lang.Exception
- an unexpected exceptionCategory getCategory(int categoryId, int languageId) throws java.lang.Exception
categoryId
- the categoryIdlanguageId
- the languageIdjava.lang.Exception
- an unexpected exceptionCategory[] getCategoriesPerProduct(int productId, int languageId) throws java.lang.Exception
productId
- the productIdlanguageId
- the languageIdjava.lang.Exception
- an unexpected exceptionCategory[] getCategoriesFromIds(java.util.ArrayList<java.lang.Integer> catIdList, int languageId) throws java.lang.Exception
catIdList
- An array list containing ids of categorieslanguageId
- the languageIdjava.lang.Exception
- an unexpected exceptionCategory[] getCategoriesForCatalogId(java.lang.String catalogId, int languageId) throws java.lang.Exception
catalogId
- catalog IdlanguageId
- language Idjava.lang.Exception
- an unexpected exceptionCopyright © 2018 DS Data Systems UK Ltd.