It's all about the answers!

Ask a question

RTC 6.0: how to get workSpace owned/created by user in Plan Java API


Jayshri Burde (2817) | asked Feb 01 '17, 6:55 a.m.

 Hi All ,

I am able to get list of all the work spaces but i need filter out for all the work spaces owned/created by perticular/current user. Any help would greatly appreciated. 

Accepted answer


permanent link
Jayshri Burde (2817) | answered Feb 24 '17, 5:47 a.m.
  Hey I got the answer. Here is the code for getting workspaces for exact owner.It might help someone :)
                     //Set the criteria for workspace
IWorkspaceSearchCriteria workspaceCriteria = IWorkspaceSearchCriteria.FACTORY.newInstance();
workspaceCriteria.setKind(IWorkspaceSearchCriteria.WORKSPACES);
//getting workspaces of exact owner.
workspaceCriteria.setExactOwnerName(repository.loggedInContributor().getName());
List<IWorkspaceHandle> workspaceList;
workspaceList = mgr.findWorkspaces(workspaceCriteria, Integer.MAX_VALUE, null);
Stream workspaceObj = null;
@SuppressWarnings("unchecked")
           List<IWorkspace> iWorkspaces = repository.itemManager().fetchCompleteItems(workspaceList,       IItemManager.DEFAULT, null);
Ralph Schoon selected this answer as the correct answer

One other answer



permanent link
Ralph Schoon (62.0k33643) | answered Feb 01 '17, 7:47 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 I would suggest to look into https://rsjazz.wordpress.com/2013/09/24/managing-workspaces-streams-and-components-using-the-plain-java-client-libraries/ and to enhance the seach criteria for the owner.


Comments
Jayshri Burde commented Feb 24 '17, 5:48 a.m.

 Thanks Ralph for your quick response.

Your answer


Register or to post your answer.