What is the API for retriving jazz user's e-mail address from server side
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
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
Hi Lauren/Ralph,
Thank you both for replying.
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
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
Once you have the contributor, you can call contributor.getEmailAddress();
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();