Revision 61422
Added by Konstantinos Spyrou over 2 years ago
RegistryCalls.java | ||
---|---|---|
14 | 14 |
import org.springframework.security.core.context.SecurityContextHolder; |
15 | 15 |
import org.springframework.stereotype.Service; |
16 | 16 |
|
17 |
import java.net.URLEncoder; |
|
17 | 18 |
import java.util.ArrayList; |
18 | 19 |
import java.util.HashMap; |
19 | 20 |
import java.util.List; |
... | ... | |
29 | 30 |
public final RegistryUtils jsonUtils; |
30 | 31 |
|
31 | 32 |
@Autowired |
32 |
RegistryCalls(@Value("${registry.coid:2}") String coid, |
|
33 |
RegistryCalls(@Value("${aai.registry.coid:2}") String coid,
|
|
33 | 34 |
HttpUtils httpUtils, RegistryUtils registryUtils) { |
34 | 35 |
this.coid = coid; |
35 | 36 |
this.httpUtils = httpUtils; |
... | ... | |
121 | 122 |
Map<String, String> params = new HashMap<>(); |
122 | 123 |
params.put("coid", coid); |
123 | 124 |
if (name != null) { |
124 |
params.put("name", name.toLowerCase());
|
|
125 |
params.put("name", URLEncoder.encode(name).toLowerCase());
|
|
125 | 126 |
} |
126 | 127 |
JsonElement response = httpUtils.get("cous.json", params); |
127 | 128 |
return (response != null) ? response.getAsJsonObject().get("Cous").getAsJsonArray() : new JsonArray(); |
... | ... | |
245 | 246 |
@Override |
246 | 247 |
public JsonArray getUserEmailByCouId(Integer couId, boolean admin) { |
247 | 248 |
Map<String, String> params = new HashMap<>(); |
249 |
if (couId == null) { |
|
250 |
throw new IllegalArgumentException("Provided 'couId' is null"); |
|
251 |
} |
|
248 | 252 |
params.put("couid", couId.toString()); |
249 | 253 |
if (admin) { |
250 | 254 |
params.put("admin", "true"); |
Also available in: Unified diff
added functionality to hide repos/roles from beta to production and vice versa