|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.konakartadmin.bl.AdminBaseMgr
com.konakartadmin.bl.AdminCategoryMgr
public class AdminCategoryMgr
The AdminCategoryMgr - for Managing Category Objects for the Admin Application
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
AdminBaseMgr.StaticData |
Field Summary | |
---|---|
static int |
ATTACH_CHILDREN_TO_PARENT
Used by deleteCategoryTree |
static int |
DELETE_CHILDREN
Used by deleteCategoryTree |
protected static org.apache.commons.logging.Log |
log
the log |
Fields inherited from class com.konakartadmin.bl.AdminBaseMgr |
---|
adminEng, baseMgrMutex, baseStaticDataHM, cDataEnd, cDataStart, kkConf, kkInstanceId, mgrFactory, STORE_ID, templateBaseDir |
Constructor Summary | |
---|---|
AdminCategoryMgr(KKAdminIf eng)
Constructor |
Method Summary | |
---|---|
protected void |
deleteCatAndChildren(int categoryId)
Deletes this category plus all of the child categories plus any products that exist. |
void |
deleteCategoryTree(int categoryId,
int options)
Delete the category referenced to by categoryId. |
void |
deleteSingleCategory(int categoryId)
Delete a single category. |
boolean |
doesCategoryExist(int categoryId)
Return true if the category exists. |
void |
editCategory(AdminCategory cat)
Edit the category. |
protected void |
fillCatTreeWithProductNumbers(AdminCategory[] catTree)
Receives an array of Categories as input and compiles the numberOfProducts field for each Category |
AdminCategory[] |
getCategoriesPerProduct(int productId,
int languageId)
Returns all of the categories for the product |
AdminCategory[] |
getCategoriesPerPromotion(int promotionId,
int languageId)
Returns all of the categories for the promotion |
int[] |
getCategoriesPerTagGroup(int tagGroupId)
Return an array of Category Ids linked to the specified tag group. |
AdminCategoryToTagGroup[] |
getCategoriesToTagGroups()
Return an array of all of the AdminCategoryToTagGroup records. |
AdminCategory |
getCategory(int categoryId,
boolean getChildren,
int languageId)
|
AdminCategory |
getCategory(int categoryId,
boolean getChildren,
int languageId,
java.lang.String storeId)
|
AdminCategory[] |
getCategoryTree(int languageId,
boolean getNumProducts)
Returns an array of top level categories each of which includes an array of child categories etc. |
int[] |
getChildren(int categoryId)
Returns an array of categoryId describing the children of the given category. |
protected AdminCategory[] |
getChildren(int parentId,
int languageId)
Returns an array of child categories, children of the input parameter, parent. |
AdminMiscItem[] |
getMiscItems(AdminSearch search)
Get the MiscItems associated with the specified search criteria |
AdminMiscItem[] |
getMiscItems(int catgeoryId)
Get the MiscItems associated with the specified catgeoryId |
protected int |
getNumProductsPerCategory(int categoryId)
Returns the number of products for a leaf category by doing a direct query on the database. |
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> |
getProductIdsPerCategory()
Returns a HashMap with CategoryId as the key and Number of Products for that category as the value. |
protected AdminCategory[] |
getTopLevelCategories(int languageId)
Returns all of the top level categories which are those that have a parentId = 0. |
AdminCategory[] |
getTopLevelCategories(int languageId,
AdminDataDescriptor dataDesc)
Returns all of the top level categories which are those that have a parentId = 0. |
int |
insertCategory(AdminCategory cat)
Insert a category as a child of the parent category. |
protected void |
manageDataDescriptor(AdminDataDescriptor dataDesc,
com.konakart.bl.KKCriteria c)
Provides common code to deal with the management of the DataDescriptor. |
void |
moveCategory(int categoryId,
int newParentId)
Move this category to make it a child of the category identified by newParentId |
protected com.konakart.bl.KKCriteria |
setAllCategoryAttrs(com.konakart.bl.KKCriteria c)
|
protected com.konakart.bl.KKCriteria |
setAllCategoryAttrs(com.konakart.bl.KKCriteria c,
int languageId)
|
protected void |
setChildrenProductNumbers(AdminCategory parent,
java.util.HashMap<java.lang.Integer,java.lang.Integer> hm)
Recurses through all of the category tree setting the numberOfProducts
attribute. |
protected void |
validateCategory(AdminCategory cat)
Used to validate a category before editing or inserting |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static org.apache.commons.logging.Log log
public static final int DELETE_CHILDREN
public static final int ATTACH_CHILDREN_TO_PARENT
Constructor Detail |
---|
public AdminCategoryMgr(KKAdminIf eng) throws java.lang.Exception
eng
- KKAdmin engine
java.lang.Exception
Method Detail |
---|
public AdminCategory[] getCategoryTree(int languageId, boolean getNumProducts) throws java.lang.Exception
getNumProducts
is set to true.
getCategoryTree
in interface AdminCategoryMgrIf
languageId
- getNumProducts
-
java.lang.Exception
protected AdminCategory[] getTopLevelCategories(int languageId) throws java.lang.Exception
languageId
-
java.lang.Exception
public AdminCategory[] getTopLevelCategories(int languageId, AdminDataDescriptor dataDesc) throws java.lang.Exception
getTopLevelCategories
in interface AdminCategoryMgrIf
languageId
- dataDesc
-
java.lang.Exception
public AdminMiscItem[] getMiscItems(int catgeoryId) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException, java.lang.Exception
catgeoryId
-
java.lang.Exception
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException
public AdminMiscItem[] getMiscItems(AdminSearch search) throws org.apache.torque.TorqueException, KKAdminException, com.workingdogs.village.DataSetException, java.lang.Exception
search
-
java.lang.Exception
com.workingdogs.village.DataSetException
KKAdminException
org.apache.torque.TorqueException
protected AdminCategory[] getChildren(int parentId, int languageId) throws KKAdminException, java.lang.Exception
parentId
- languageId
-
java.lang.Exception
KKAdminException
public int[] getChildren(int categoryId) throws java.lang.Exception
getChildren
in interface AdminCategoryMgrIf
categoryId
-
java.lang.Exception
protected void deleteCatAndChildren(int categoryId) throws java.lang.Exception
categoryId
-
java.lang.Exception
protected java.util.HashMap<java.lang.Integer,java.lang.Integer> getProductIdsPerCategory() throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
protected int getNumProductsPerCategory(int categoryId) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
categoryId
-
org.apache.torque.TorqueException
com.workingdogs.village.DataSetException
KKAdminException
protected void fillCatTreeWithProductNumbers(AdminCategory[] catTree) throws org.apache.torque.TorqueException, com.workingdogs.village.DataSetException, KKAdminException
catTree
-
com.workingdogs.village.DataSetException
org.apache.torque.TorqueException
KKAdminException
protected void setChildrenProductNumbers(AdminCategory parent, java.util.HashMap<java.lang.Integer,java.lang.Integer> hm) throws com.workingdogs.village.DataSetException
numberOfProducts
attribute.
parent
- The parent category.hm
-
com.workingdogs.village.DataSetException
public AdminCategory getCategory(int categoryId, boolean getChildren, int languageId) throws java.lang.Exception
getCategory
in interface AdminCategoryMgrIf
categoryId
- getChildren
- If true we get all of the children. Children don't have an array of descriptions.languageId
- Needed to determine the language Id of the children
java.lang.Exception
public AdminCategory getCategory(int categoryId, boolean getChildren, int languageId, java.lang.String storeId) throws java.lang.Exception
getCategory
in interface AdminCategoryMgrIf
categoryId
- getChildren
- If true we get all of the children. Children don't have an array of descriptions.languageId
- Needed to determine the language Id of the childrenstoreId
- The store id
java.lang.Exception
public boolean doesCategoryExist(int categoryId) throws org.apache.torque.TorqueException, KKAdminException
doesCategoryExist
in interface AdminCategoryMgrIf
categoryId
-
org.apache.torque.TorqueException
KKAdminException
public int insertCategory(AdminCategory cat) throws java.lang.Exception
insertCategory
in interface AdminCategoryMgrIf
cat
-
java.lang.Exception
public void editCategory(AdminCategory cat) throws java.lang.Exception
editCategory
in interface AdminCategoryMgrIf
cat
-
java.lang.Exception
protected void validateCategory(AdminCategory cat) throws java.lang.Exception
cat
-
java.lang.Exception
public void deleteCategoryTree(int categoryId, int options) throws java.lang.Exception
deleteCategoryTree
in interface AdminCategoryMgrIf
categoryId
- options
-
java.lang.Exception
public void deleteSingleCategory(int categoryId) throws java.lang.Exception
deleteSingleCategory
in interface AdminCategoryMgrIf
categoryId
-
java.lang.Exception
public void moveCategory(int categoryId, int newParentId) throws java.lang.Exception
moveCategory
in interface AdminCategoryMgrIf
categoryId
- newParentId
-
java.lang.Exception
public AdminCategory[] getCategoriesPerPromotion(int promotionId, int languageId) throws java.lang.Exception
getCategoriesPerPromotion
in interface AdminCategoryMgrIf
promotionId
- languageId
-
java.lang.Exception
public AdminCategory[] getCategoriesPerProduct(int productId, int languageId) throws java.lang.Exception
getCategoriesPerProduct
in interface AdminCategoryMgrIf
productId
- languageId
-
java.lang.Exception
protected com.konakart.bl.KKCriteria setAllCategoryAttrs(com.konakart.bl.KKCriteria c, int languageId)
c
- languageId
-
protected com.konakart.bl.KKCriteria setAllCategoryAttrs(com.konakart.bl.KKCriteria c)
c
-
protected void manageDataDescriptor(AdminDataDescriptor dataDesc, com.konakart.bl.KKCriteria c)
dataDesc
- c
- public int[] getCategoriesPerTagGroup(int tagGroupId) throws java.lang.Exception
getCategoriesPerTagGroup
in interface AdminCategoryMgrIf
tagGroupId
- The id of the tag Group
java.lang.Exception
public AdminCategoryToTagGroup[] getCategoriesToTagGroups() throws java.lang.Exception
getCategoriesToTagGroups
in interface AdminCategoryMgrIf
java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |