Revision 49746
Added by Panagiotis Kanakakis over 6 years ago
RepositoryApiImpl.java | ||
---|---|---|
3 | 3 |
import eu.dnetlib.domain.enabling.Vocabulary; |
4 | 4 |
import eu.dnetlib.repo.manager.service.shared.Aggregations; |
5 | 5 |
import eu.dnetlib.repo.manager.service.shared.Country; |
6 |
import eu.dnetlib.repo.manager.service.shared.Timezone; |
|
6 | 7 |
import eu.dnetlib.repo.manager.service.utils.Converter; |
7 | 8 |
import eu.dnetlib.domain.data.Repository; |
8 | 9 |
import eu.dnetlib.domain.data.RepositoryInterface; |
... | ... | |
21 | 22 |
import org.springframework.web.client.RestTemplate; |
22 | 23 |
import org.springframework.web.util.UriComponents; |
23 | 24 |
import org.springframework.web.util.UriComponentsBuilder; |
24 |
import se.kb.oai.ore.Aggregation; |
|
25 | 25 |
|
26 | 26 |
import javax.annotation.PostConstruct; |
27 | 27 |
import java.util.*; |
... | ... | |
261 | 261 |
} |
262 | 262 |
|
263 | 263 |
@Override |
264 |
public List<String> getTimezones() { |
|
265 |
return Converter.readFile("timezones.txt"); |
|
264 |
public List<Timezone> getTimezones() { |
|
265 |
List<String> timezones = Converter.readFile("timezones.txt"); |
|
266 |
return Converter.toTimezones(timezones); |
|
266 | 267 |
} |
267 | 268 |
|
268 | 269 |
@Override |
... | ... | |
329 | 330 |
} |
330 | 331 |
|
331 | 332 |
@Override |
332 |
public String getUrlsOfUserRepos(@PathVariable("user_email") String user_email,
|
|
333 |
@PathVariable("page") String page, |
|
334 |
@PathVariable("size") String size) throws JSONException { |
|
333 |
public List<String> getUrlsOfUserRepos(@PathVariable("user_email") String user_email,
|
|
334 |
@PathVariable("page") String page,
|
|
335 |
@PathVariable("size") String size) throws JSONException {
|
|
335 | 336 |
UriComponents uriComponents = UriComponentsBuilder |
336 | 337 |
.fromHttpUrl(baseAddress + "/api/baseurl/") |
337 | 338 |
.path("/{page}/{size}") |
338 | 339 |
.queryParam("userEmail",user_email) |
339 | 340 |
.build().expand(page,size).encode(); |
340 |
|
|
341 |
String rs = restTemplate.getForObject(uriComponents.toUri(), String.class); |
|
342 |
return rs; |
|
341 |
return Arrays.asList(restTemplate.getForObject(uriComponents.toUri(), String[].class)); |
|
343 | 342 |
} |
344 | 343 |
|
345 | 344 |
@Override |
Also available in: Unified diff
1. Make getTimezones return List<Timezone> instead of List<String>