Is it possible to change the hierarchy of categories in ibm rtc. ? Or atleast change the parent of the categories.?
2 answers
// connect to the category manager
CategoriesManager catManager = CategoriesManager.createInstance(auditableClient, iprojectAreaHandle,
null);
// get the parent node
CategoryTreeNode parent = catManager.getRoot();
// create a child
CategoryTreeNode childCat = parent.createChild("child_cat_name");
CategoriesManager catManager = CategoriesManager.createInstance(auditableClient, iprojectAreaHandle,
null);
// get the parent node
CategoryTreeNode parent = catManager.getRoot();
// create a child
CategoryTreeNode childCat = parent.createChild("child_cat_name");
public static void MoveICategory(ITeamRepository teamRepository, IProjectArea projectArea, IAuditableClient auditableClient, ICategoryHandle newParentCategoryHandle, ICategoryHandle childCategoryHandle){
CategoriesManager catManager = null;
CategoryTreeNode newParent = null;
CategoryTreeNode childCategoryTreeNode = null;
try {
catManager = CategoriesManager.createInstance(auditableClient, (IProjectAreaHandle) projectArea.getItemHandle(), null);
newParent = catManager.findNode(newParentCategoryHandle);
childCategoryTreeNode = catManager.findNode(childCategoryHandle);
childCategoryTreeNode.moveTo(newParent);
catManager.save(null);
} catch (TeamRepositoryException e) {
e.printStackTrace();
}
}