How to generate List of all ProjectAreas with Plain Java API
Hi everyone,
I am total Newbie to RTC. I would like to know how to generate a list (String array, ...) of names of all ProjectAreas registered in a repository. I am Using the RTC Eclipse Client with Plain Java API on RTC 3.0. I am working on client side.
If anybody could help me, I would be very thankful.
Cheers,
Marco
I am total Newbie to RTC. I would like to know how to generate a list (String array, ...) of names of all ProjectAreas registered in a repository. I am Using the RTC Eclipse Client with Plain Java API on RTC 3.0. I am working on client side.
If anybody could help me, I would be very thankful.
Cheers,
Marco
2 answers
Not sure if you are still looking for it.
IProjectAreaHandle matchingProjectArea = null; IItemType itemType= IProjectArea.ITEM_TYPE; IDynamicQueryModel model= itemType.getQueryModel(); IItemQuery query= IItemQuery.FACTORY.newInstance((IItemQueryModel) model); ItemQueryIterator<IProjectAreaHandle> iterator= new ItemQueryIterator<IProjectAreaHandle>(getAuditableCommon(), query); List <IProjectAreaHandle> projectAreas = iterator.toList(monitor); for (IProjectAreaHandle pa : projectAreas){ IProjectArea projectArea = (IProjectArea) repo.itemManager().fetchCompleteItem(pa, IItemManager.DEFAULT, monitor);
String projectAreaName = projectArea.getName();
// Keep adding project area name to a list. }