It's all about the answers!

Ask a question

What is the API for retriving jazz user's e-mail address from server side


Weiping Lu (452910) | asked Jun 25 '13, 1:38 p.m.
JAZZ DEVELOPER
Hi,

The HttpRequest object passed to a jazz server side contains user url and user name info, but it does not seem to contain user e-mail address. Is there any configuration needed to make it contain the e-mail address, or do I miss something - e.g. a simple API would do the job?

Thanks

Weiping

3 answers



permanent link
Lauren Hayward Schaefer (3.3k11727) | answered Jul 03 '13, 7:17 a.m.
JAZZ DEVELOPER
Hi Weiping,

I don't fully understand the scenario you're working on.  It seems like if you can get the user's uuid, you could get generate the contributor handle by doing something along the lines of
IContributorHandle handle = (IContributorHandle) IContributor.ITEM_TYPE.createItemHandle(uuid, null);
and then fetch the contributor by doing something along the lines of what is posted here: https://jazz.net/forum/questions/112468/how-to-get-creator-id-using-plain-java-api.
Once you have the contributor, you can call contributor.getEmailAddress();

permanent link
Ralph Schoon (63.4k33646) | answered Jul 03 '13, 7:30 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
https://rsjazz.wordpress.com/2012/11/30/a-create-approval-work-item-save-participant/ shows the server API to get the IContributor object in some scenarios..

permanent link
Weiping Lu (452910) | answered Jul 03 '13, 11:53 a.m.
JAZZ DEVELOPER
Hi Lauren/Ralph,

Thank you both for replying.

I did not explain my context clearly - it is in the context of a  rest servlet application registered with jts, and not in the context of work item.  But your info is still helpful for my other applications.

 A colleague of mine helped me solve the problem I raised. The code is something like this:

HttpResponse jfsResponse = ...

RDFEntity entity = new RDFEntity(jfsResponse.getEntity());

Model model = entity.getModel();

Property mboxProp = model.getProperty("http://xmlns.com/foaf/0.1/mbox");

String mboxStr = user.getProperty(mbox).getObject().toString();

Thanks,

Weiping




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.