Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

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;

                }


0 votes


Be the first one to answer this question!

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 10,948

Question asked: Nov 15 '16, 12:47 a.m.

Question was seen: 1,879 times

Last updated: Nov 16 '16, 5:52 a.m.

Confirmation Cancel Confirm