1
|
package eu.dnetlib.repo.manager.service.controllers;
|
2
|
|
3
|
import eu.dnetlib.domain.data.Repository;
|
4
|
import eu.dnetlib.domain.data.RepositoryInterface;
|
5
|
import eu.dnetlib.repo.manager.shared.*;
|
6
|
import io.swagger.annotations.Api;
|
7
|
import org.json.JSONException;
|
8
|
import org.springframework.http.MediaType;
|
9
|
import org.springframework.web.bind.annotation.*;
|
10
|
|
11
|
import java.util.List;
|
12
|
import java.util.Map;
|
13
|
|
14
|
|
15
|
@RestController
|
16
|
@RequestMapping(value = "/repository")
|
17
|
@Api(description = "Repository API", tags = {"repository"})
|
18
|
public interface RepositoryApi {
|
19
|
|
20
|
@RequestMapping(value = "/testAggregations", method = RequestMethod.GET,
|
21
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
22
|
@ResponseBody
|
23
|
List<String> testAggregations() throws JSONException;
|
24
|
|
25
|
@RequestMapping(value = "/getCountries", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
26
|
@ResponseBody
|
27
|
Country[] getCountries() ;
|
28
|
|
29
|
@RequestMapping(value = "/getRepositoriesByCountry/{country}/{mode}", method = RequestMethod.GET,
|
30
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
31
|
@ResponseBody
|
32
|
List<Repository> getRepositoriesByCountry(String country, String mode, Boolean managed) throws JSONException;
|
33
|
|
34
|
@RequestMapping(value = "/getRepositoriesOfUser/{userEmail}/{page}/{size}",method = RequestMethod.GET,
|
35
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
36
|
@ResponseBody
|
37
|
List<Repository> getRepositoriesOfUser(String userEmail,
|
38
|
String page,
|
39
|
String size) throws JSONException;
|
40
|
|
41
|
@RequestMapping(value = "/getRepositoryById/{id}", method = RequestMethod.GET,
|
42
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
43
|
@ResponseBody
|
44
|
Repository getRepositoryById(String id) throws JSONException;
|
45
|
|
46
|
|
47
|
@RequestMapping(value = "/getRepositoryAggregations/{id}", method = RequestMethod.GET,
|
48
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
49
|
@ResponseBody
|
50
|
Aggregations getRepositoryAggregations(String id) throws JSONException;
|
51
|
|
52
|
|
53
|
@RequestMapping(value = "/getRepositoriesByName/{name}/{page}/{size}/", method = RequestMethod.GET,
|
54
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
55
|
@ResponseBody
|
56
|
List<Repository> getRepositoriesByName(String name,
|
57
|
String page,
|
58
|
String size) throws JSONException;
|
59
|
|
60
|
@RequestMapping(value = "/getRepositoryInterface/{id}", method = RequestMethod.GET,
|
61
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
62
|
@ResponseBody
|
63
|
List<RepositoryInterface> getRepositoryInterface(String id) throws JSONException;
|
64
|
|
65
|
@RequestMapping(value = "/addRepository", method = RequestMethod.POST,
|
66
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
67
|
@ResponseBody
|
68
|
Repository addRepository(String datatype, Repository repository) throws Exception;
|
69
|
|
70
|
|
71
|
@RequestMapping(value = "/deleteInterface", method = RequestMethod.DELETE)
|
72
|
@ResponseBody
|
73
|
void deleteRepositoryInterface(String id);
|
74
|
|
75
|
@RequestMapping(value = "/addInterface", method = RequestMethod.POST,
|
76
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
77
|
@ResponseBody
|
78
|
RepositoryInterface addRepositoryInterface(String datatype,
|
79
|
String repoId,
|
80
|
RepositoryInterface iFace) throws JSONException;
|
81
|
|
82
|
@RequestMapping(value = "/getDnetCountries", method = RequestMethod.GET,
|
83
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
84
|
@ResponseBody
|
85
|
List<String> getDnetCountries();
|
86
|
|
87
|
@RequestMapping(value = "/getTypologies", method = RequestMethod.GET,
|
88
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
89
|
@ResponseBody
|
90
|
List<String> getTypologies();
|
91
|
|
92
|
@RequestMapping(value = "/getTimezones", method = RequestMethod.GET,
|
93
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
94
|
@ResponseBody
|
95
|
List<Timezone> getTimezones();
|
96
|
|
97
|
@RequestMapping(value = "/updateRepository", method = RequestMethod.POST,
|
98
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
99
|
@ResponseBody
|
100
|
Repository updateRepository(Repository repository) throws JSONException;
|
101
|
|
102
|
@RequestMapping(value = "/getUrlsOfUserRepos/{user_email}/{page}/{size}/",method = RequestMethod.GET,
|
103
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
104
|
@ResponseBody
|
105
|
List<String> getUrlsOfUserRepos(String user_email,
|
106
|
String page,
|
107
|
String size) throws JSONException;
|
108
|
|
109
|
@RequestMapping(value = "/getDatasourceVocabularies/{mode}",method = RequestMethod.GET,
|
110
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
111
|
@ResponseBody
|
112
|
List<String> getDatasourceVocabularies(String mode);
|
113
|
|
114
|
@RequestMapping(value = "/getCompatibilityClasses/{mode}",method = RequestMethod.GET,
|
115
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
116
|
@ResponseBody
|
117
|
Map<String, String> getCompatibilityClasses(String mode);
|
118
|
|
119
|
@RequestMapping(value = "/getDatasourceClasses/{mode}",method = RequestMethod.GET,
|
120
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
121
|
@ResponseBody
|
122
|
Map<String, String> getDatasourceClasses(String mode);
|
123
|
|
124
|
|
125
|
String getCountryName(String countryCode);
|
126
|
|
127
|
@RequestMapping(value = "/getMetricsInfoForRepository/{repoId}",method = RequestMethod.GET,
|
128
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
129
|
@ResponseBody
|
130
|
MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException;
|
131
|
|
132
|
@RequestMapping(value = "/getListLatestUpdate/{mode}",method = RequestMethod.GET,
|
133
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
134
|
@ResponseBody
|
135
|
Map<String, String> getListLatestUpdate(String mode) throws RepositoryServiceException, JSONException;
|
136
|
|
137
|
|
138
|
|
139
|
}
|