Listing archived categories using java client api?
One answer
Hi Again,
Following method did it for me.
public void listAllCategories(String projectAreaName)
throws TeamRepositoryException {
//Project Area
IProjectArea projectArea = getProjectArea(projectAreaName);
//Auditable client
IAuditableClient auditableClient = (IAuditableClient) repo
.getClientLibrary(IAuditableClient.class);
//List of all existing categories. This will include all the visible, access restricted and archived categories.
//In other words, every other category which was created.
List<ICategoryHandle> allCategoryHandles = CategoriesHelper
.findExistingCategories(auditableClient, projectArea, monitor);
for (ICategoryHandle iCategoryHandle : allCategoryHandles) {
System.out.println(iCategoryHandle.getItemId());
}
}
I'm printing only the itemId of ICategoryHandle. If you want to get the corresponding item. Please go through following link.
https://jazz.net/forum/questions/124752/how-to-get-object-from-handle-using-rtc-java-api
Following method did it for me.
public void listAllCategories(String projectAreaName)
throws TeamRepositoryException {
//Project Area
IProjectArea projectArea = getProjectArea(projectAreaName);
//Auditable client
IAuditableClient auditableClient = (IAuditableClient) repo
.getClientLibrary(IAuditableClient.class);
//List of all existing categories. This will include all the visible, access restricted and archived categories.
//In other words, every other category which was created.
List<ICategoryHandle> allCategoryHandles = CategoriesHelper
.findExistingCategories(auditableClient, projectArea, monitor);
for (ICategoryHandle iCategoryHandle : allCategoryHandles) {
System.out.println(iCategoryHandle.getItemId());
}
}
I'm printing only the itemId of ICategoryHandle. If you want to get the corresponding item. Please go through following link.
https://jazz.net/forum/questions/124752/how-to-get-object-from-handle-using-rtc-java-api