RTC java API: How to get component Visibility using RTC Java API
Hi All,
I am able to get the Owned By of the component but struggling to get the Visibility of the component . Any help would greatly appreciated.
Here is the code i used for getting OwnedBy value:
private static String getComponentOwner(ITeamRepository teamRepository, IWorkspaceConnection workspace, IComponent component) throws TeamRepositoryException{
String componenetOwnerName = null;
IScmService scmService = (IScmService) ((TeamRepository) teamRepository).getServiceInterface(IScmService.class);
ComponentHandle c = (ComponentHandle)component;
ComponentOwnerHandle componentOwnerH = scmService.getComponentOwnerRecord(c);
ComponentOwner componentOwner1 = (ComponentOwner) teamRepository.itemManager().fetchCompleteItem(componentOwnerH, IItemManager.DEFAULT, null);
IAuditableHandle au = (IAuditableHandle)componentOwner1.getOwner();
IAuditable ic = (IAuditable)teamRepository.itemManager().fetchCompleteItem(au, IItemManager.DEFAULT, null);
if(ic instanceof ITeamArea || ic instanceof ITeamAreaHandle)
{
ITeamAreaHandle areaHandle= (ITeamAreaHandle) ic;
ITeamArea area =(ITeamArea) teamRepository.itemManager().fetchCompleteItem(areaHandle, IItemManager.DEFAULT, null);
componenetOwnerName = area.getName();
}else if(ic instanceof IContributorHandle)
{
IContributorHandle areaHandle= (IContributorHandle) ic;
IContributor area =(IContributor) teamRepository.itemManager().fetchCompleteItem(areaHandle, IItemManager.DEFAULT, null);
componenetOwnerName = area.getName();
}
else if(ic instanceof IProjectArea){
IProjectAreaHandle projectHandle = (IProjectAreaHandle)ic;
IProjectArea area =(IProjectArea) teamRepository.itemManager().fetchCompleteItem(projectHandle, IItemManager.DEFAULT, null);
componenetOwnerName = area.getName();
}
return componenetOwnerName;
}