From 8c4d6ae5a3bb6a19d759f20e40019e0accdfffc9 Mon Sep 17 00:00:00 2001
From: srosse <none@none>
Date: Thu, 26 Jan 2012 16:14:58 +0100
Subject: [PATCH] no-jira: send all infos for contacts

---
 .../java/org/olat/user/restapi/ContactsWebService.java   | 2 +-
 src/main/java/org/olat/user/restapi/UserVOFactory.java   | 9 +++++----
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/main/java/org/olat/user/restapi/ContactsWebService.java b/src/main/java/org/olat/user/restapi/ContactsWebService.java
index e5cb782cdcf..d4159e589f7 100644
--- a/src/main/java/org/olat/user/restapi/ContactsWebService.java
+++ b/src/main/java/org/olat/user/restapi/ContactsWebService.java
@@ -76,7 +76,7 @@ public class ContactsWebService {
 		int count = 0;
 		UserVO[] userVOs = new UserVO[contacts.size()];
 		for(Identity contact:contacts) {
-			userVOs[count++] = link(get(contact), uriInfo);
+			userVOs[count++] = link(get(contact, null, true, false, true), uriInfo);
 		}
 		UserVOes voes = new UserVOes();
 		voes.setUsers(userVOs);
diff --git a/src/main/java/org/olat/user/restapi/UserVOFactory.java b/src/main/java/org/olat/user/restapi/UserVOFactory.java
index 0ff7484ad57..370075558af 100644
--- a/src/main/java/org/olat/user/restapi/UserVOFactory.java
+++ b/src/main/java/org/olat/user/restapi/UserVOFactory.java
@@ -193,16 +193,17 @@ public class UserVOFactory {
 	
 	public static UserVO link(UserVO userVO, UriInfo uriInfo) {
 		if(uriInfo != null) {
-			UriBuilder baseUriBuilder = uriInfo.getBaseUriBuilder();
-			URI getUri = baseUriBuilder.path("users").path(userVO.getKey().toString()).build();
+			URI baseUri = uriInfo.getBaseUriBuilder().build();
+
+			URI getUri = UriBuilder.fromUri(baseUri).path("users").path(userVO.getKey().toString()).build();
 			userVO.getLink().add(new LinkVO("self", getUri.toString(), ""));
 			userVO.getLink().add(new LinkVO("edit", getUri.toString(), ""));
 			userVO.getLink().add(new LinkVO("delete", getUri.toString(), ""));
 
-			URI groupUri = baseUriBuilder.path("users").path(userVO.getKey().toString()).path("groups").build();
+			URI groupUri = UriBuilder.fromUri(baseUri).path("users").path(userVO.getKey().toString()).path("groups").build();
 			userVO.getLink().add(new LinkVO("self", groupUri.toString(), "Groups"));
 			
-			URI portraitUri = baseUriBuilder.path("users").path(userVO.getKey().toString()).path("portrait").build();
+			URI portraitUri = UriBuilder.fromUri(baseUri).path("users").path(userVO.getKey().toString()).path("portrait").build();
 			userVO.getLink().add(new LinkVO("self", portraitUri.toString(), "Portrait"));
 		}
 		return userVO;
-- 
GitLab