It's all about the answers!

Ask a question

is there anyway to get the workspace handle from its name?


Guanchao Yang (122) | asked Nov 04 '09, 5:19 a.m.
currently i am using

IWorkspaceHandle wh = (IWorkspaceHandle) IWorkspace.ITEM_TYPE.createItemHandle(UUID.valueOf("_o5XGcMkdEd6y7LdSH_YGOA"), null);


to get the handle, but the UUID are not hard to memorize and the requirement wants me to use the workspace name only.

so i want to ask is there any other way?

I have checked https://jazz.net/wiki/bin/view/Main/RTCSDK20_SourceControl

but it does not mention the exact way

thanks

One answer



permanent link
Andrew Hoo (1.0k1) | answered Nov 04 '09, 8:38 a.m.
JAZZ DEVELOPER
You can populate an IWorkspaceSearchCriteria with the name, and then call
SCMPlatform.getWorkspaceManager(repo).findWorkspaces(query, limit,
progress).

Note that this is a search, so it's not as efficient as directly
identifying your workspace by UUID. Also, workspace names are not
necessarily unique, so the query returns a list of matches back to you,
and you will need to make some sort of decision if you get more than 1
back.



On Wed, 04 Nov 2009 05:23:05 -0500, imey
<aimettiyang> wrote:

currently i am using

IWorkspaceHandle wh = (IWorkspaceHandle)
IWorkspace.ITEM_TYPE.createItemHandle(UUID.valueOf("_o5XGcMkdEd6y7LdSH_YGOA"),
null);


to get the handle, but the UUID are not hard to memorize and the
requirement wants me to use the workspace name only.

so i want to ask is there any other way?

I have checked
https://jazz.net/wiki/bin/view/Main/RTCSDK20_SourceControl

but it does not mention the exact way

thanks



--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

Your answer


Register or 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.