How to get username out of it's UUID ?
![]()
Hello,
I'm writing a plugin. I have the UUID of a user ( UUID wkspOwnerID = data.getSourceWorkspace().getOwner().getItemId(); ) , but I don't know how to get the username. How can I do it? Thanks. |
5 answers
![]()
If you're writing a client plugin, check out com.ibm.team.repository.client.IContributorManager. It looks like getting the user via UUID might be a pain, but if you can use a userId instead, that would be easier.
|
![]() the contributormanager is correct. in the javadoc here is the api fetchContributorRecordByIdentity(IContributorIdentity identity, which returns the contributor record from the identity, which is a UUID Sam |
![]() For what I know you can obtain every object (like object handle) by UUID using Object.ITEM_TYPE.createItemHandle method. for example: (IChangeSetHandle)IChangeSet.ITEM_TYPE.createItemHandle(uuid, null); |
![]()
HI,
I tried but did't make it.
I'm using server side plugin and need to have the username/userid on deliver action.
I thought I will make it like this:
String wkspOwner = data.getSourceWorkspace().getOwner().toString();
but it doesn't give the userid.
How can I get the userid out of the user UUID or how can I get the userid on deliver action (server side).
Need your assistance,
Yehiel
|
![]()
HI I got the data:
/*********get user name*************************
IContributorHandle wkspOwnerhandle = (IContributorHandle) data.getSourceWorkspace().getOwner();
IItem contributerHandle = itemService.fetchItem(wkspOwnerhandle, null);
IContributor userid = (IContributor) contributerHandle.getFullState();
String userName = userid.getName();
I did't use UUID but I got the userid of the wkspace owner on deliver operation - server side.
Regards,
Yehiel
|