How to get all project areas not only the user's project areas but also other projects for a special user without password using RTC plain Java api?
3 answers
I do not know thew APIs to do these two tasks.
Comments
Thank you very much, the API about to find all the projects that are Public access can use APIs as follows:
-
Find out all project areas with IProcessItemService processItemService = (IProcessItemService)repository.getClientLibrary(IProcessItemService.class); List list = processItemService.findAllProjectAreas(processItemService.ALL_PROPERTIES, null);
-
For every element in the list is project area object, use projectArea.isInternalPublic() can tell that weather it is public access
One more question, how to get all members about the Team Area Hierarchy for the projectArea?
Comments
That is explained in the last section before the summary in said post.
The code actually got published at JazzHub in the Jazz In Flight Project in the class :
com.ibm.js.team.admin.automation/src/com/ibm/js/team/admin/automation/AnalyzeProjectArea.java recently.
Do you mean "Only Analyze the Process Areas of One User"? But this only can find out project areas which members contain the special user. The result is same as to log on RTC web server to view "My projects" label, I need to find out projects in "Manage All Projects" label that the user can access, which including public projects.
I need to find out all projects that the user have read access, just like he/she logged on to RTC web server then navigate to "Manage All Projects" label, all projects presented to him/her. I think "all projects" should contain:
- public projects which access control is "Everyone"
- projects whose members and administrators contain the user
- projects whose access list contain the user
-
projects whose team area of members and administrators contain the user
I want to know if there any RTC java api to realize the function.
I have not looked at that. You would have to look how the read access is configured and who has access.
I would start looking att the code snippet below. That API was easy enough to find just looking at IProjectArea:
IReadAccessListHandle accessListHandle=projectArea.getReadAccessList(); IReadAccessList accessList = (IReadAccessList) teamRepository.itemManager() .fetchCompleteItem(accessListHandle, IItemManager.REFRESH, null); IContributorHandle[] readAccess = accessList.getContributors();
Comments
This might be only for the access control list part of the configuration. You would probably also look if the project itself is readable for everyone, no one, members of the project area hierarchy, Members of the hierarchy and the access list and use the API described in the post to find if the user you are looking for is part of it.
Yes, you are right. And I also use the method projectArea.getReadAccessList() you mentioned to get its uses in access list.
I don't know, but I would not expect it to be available. As you can see from the Web UI, it shows you the teams you are member - using the API described in my blog. If you want to know all projects the user can read, you would have to look into all the others and see if there is a read restriction that excludes the user.
1 vote
Thank you very much, I will look for it...