Revision 62316
Added by Antonis Lempesis almost 2 years ago
modules/uoa-repository-manager-service/branches/new-datasource-model/src/main/java/eu/dnetlib/repo/manager/controllers/RepositoryController.java | ||
---|---|---|
225 | 225 |
return repositoryService.getUrlsOfUserRepos(((OIDCAuthenticationToken) SecurityContextHolder.getContext().getAuthentication()).getUserInfo().getEmail(), page, size); |
226 | 226 |
} |
227 | 227 |
|
228 |
@RequestMapping(value = "/getDatasourceVocabularies/{mode}", method = RequestMethod.GET, |
|
229 |
produces = MediaType.APPLICATION_JSON_VALUE) |
|
230 |
@ResponseBody |
|
231 |
public List<String> getDatasourceVocabularies(@PathVariable("mode") String mode) { |
|
232 |
return repositoryService.getDatasourceVocabularies(mode); |
|
233 |
} |
|
234 |
|
|
235 | 228 |
@RequestMapping(value = "/getCompatibilityClasses/{mode}", method = RequestMethod.GET, |
236 | 229 |
produces = MediaType.APPLICATION_JSON_VALUE) |
237 | 230 |
@ResponseBody |
modules/uoa-repository-manager-service/branches/new-datasource-model/src/main/java/eu/dnetlib/repo/manager/service/RepositoryService.java | ||
---|---|---|
82 | 82 |
String page, |
83 | 83 |
String size); |
84 | 84 |
|
85 |
List<String> getDatasourceVocabularies(String mode); |
|
86 |
|
|
87 | 85 |
Map<String, String> getCompatibilityClasses(String mode); |
88 | 86 |
|
89 | 87 |
Map<String, String> getDatasourceClasses(String mode); |
modules/uoa-repository-manager-service/branches/new-datasource-model/src/main/java/eu/dnetlib/repo/manager/service/RepositoryServiceImpl.java | ||
---|---|---|
399 | 399 |
List<AggregationDetails> aggregationHistory = new ArrayList<>(Converter.getAggregationHistoryFromJson(aggregationInfo)); |
400 | 400 |
|
401 | 401 |
return aggregationHistory; |
402 |
// return aggregationHistory.size() == 0 ? aggregationHistory : aggregationHistory.stream() |
|
403 |
// .sorted(Comparator.comparing(AggregationDetails::getDate).reversed()) |
|
404 |
// .collect(Collectors.toList()); |
|
405 | 402 |
} |
406 | 403 |
|
407 | 404 |
@Override |
... | ... | |
756 | 753 |
return Arrays.asList(restTemplate.postForObject(uriComponents.toUri(), requestFilter, String[].class)); |
757 | 754 |
} |
758 | 755 |
|
759 |
@Override |
|
760 |
public List<String> getDatasourceVocabularies(String mode) { |
|
761 |
|
|
762 |
List<String> resultSet = new ArrayList<>(); |
|
763 |
for (Map.Entry<String, String> entry : this.getVocabulary("dnet:datasource_typologies").getAsMap().entrySet()) { |
|
764 |
if (mode.equalsIgnoreCase("aggregator")) { |
|
765 |
if (entry.getKey().contains("aggregator")) |
|
766 |
resultSet.add(entry.getValue()); |
|
767 |
} else if (mode.equalsIgnoreCase("journal")) { |
|
768 |
if (entry.getKey().contains("journal")) |
|
769 |
resultSet.add(entry.getValue()); |
|
770 |
} else if (mode.equalsIgnoreCase("opendoar")) { |
|
771 |
if (entry.getKey().contains("pubsrepository")) |
|
772 |
resultSet.add(entry.getValue()); |
|
773 |
} else if (mode.equalsIgnoreCase("re3data")) { |
|
774 |
if (entry.getKey().contains("datarepository")) |
|
775 |
resultSet.add(entry.getValue()); |
|
776 |
} else if (mode.equalsIgnoreCase("cris")) { |
|
777 |
if (entry.getKey().contains("crissystem")) |
|
778 |
resultSet.add(entry.getValue()); |
|
779 |
} |
|
780 |
} |
|
781 |
|
|
782 |
|
|
783 |
return resultSet; |
|
784 |
} |
|
785 |
|
|
786 | 756 |
private Vocabulary getVocabulary(String vocName) { |
787 | 757 |
|
788 | 758 |
if (!vocabularyMap.containsKey(vocName)) { |
Also available in: Unified diff
removed unused method