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 org.json.JSONException;
|
7
|
import org.springframework.http.MediaType;
|
8
|
import org.springframework.web.bind.annotation.*;
|
9
|
|
10
|
import java.util.List;
|
11
|
import java.util.Map;
|
12
|
|
13
|
@RestController
|
14
|
@RequestMapping(value = "/repository")
|
15
|
public interface RepositoryApi {
|
16
|
|
17
|
|
18
|
@RequestMapping(value = "/testAggregations", method = RequestMethod.GET,
|
19
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
20
|
@ResponseBody
|
21
|
Aggregations testAggregations() throws JSONException;
|
22
|
|
23
|
@RequestMapping(value = "/getCountries", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
|
24
|
@ResponseBody
|
25
|
Country[] getCountries() ;
|
26
|
|
27
|
@RequestMapping(value = "/getRepositoriesByCountry/{country}/{mode}", method = RequestMethod.GET,
|
28
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
29
|
@ResponseBody
|
30
|
List<Repository> getRepositoriesByCountry(String country,String mode) throws JSONException;
|
31
|
|
32
|
@RequestMapping(value = "/getRepositoriesOfUser/{userEmail}/{page}/{size}")
|
33
|
@ResponseBody
|
34
|
List<Repository> getRepositoriesOfUser(String userEmail,
|
35
|
String page,
|
36
|
String size) throws JSONException;
|
37
|
|
38
|
@RequestMapping(value = "/getRepositoryById/{id}", method = RequestMethod.GET,
|
39
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
40
|
@ResponseBody
|
41
|
Repository getRepositoryById(String id) throws JSONException;
|
42
|
|
43
|
|
44
|
@RequestMapping(value = "/getRepositoryAggregations/{id}", method = RequestMethod.GET,
|
45
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
46
|
@ResponseBody
|
47
|
Aggregations getRepositoryAggregations(String id) throws JSONException;
|
48
|
|
49
|
|
50
|
@RequestMapping(value = "/getRepositoriesByName/{name}/{page}/{size}/", method = RequestMethod.GET,
|
51
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
52
|
@ResponseBody
|
53
|
List<Repository> getRepositoriesByName(String name,
|
54
|
String page,
|
55
|
String size) throws JSONException;
|
56
|
|
57
|
@RequestMapping(value = "/getRepositoryInterface/{id}", method = RequestMethod.GET,
|
58
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
59
|
@ResponseBody
|
60
|
RepositoryInterface getRepositoyInterface(String id) throws JSONException;
|
61
|
|
62
|
@RequestMapping(value = "/addRepository", method = RequestMethod.POST,
|
63
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
64
|
@ResponseBody
|
65
|
void addRepository(Repository repository) throws JSONException;
|
66
|
|
67
|
@RequestMapping(value = "/deleteInterface", method = RequestMethod.DELETE)
|
68
|
@ResponseBody
|
69
|
void deleteRepositoryInterface(String id);
|
70
|
|
71
|
@RequestMapping(value = "/addInterface", method = RequestMethod.POST,
|
72
|
consumes = MediaType.APPLICATION_JSON_VALUE)
|
73
|
@ResponseBody
|
74
|
RepositoryInterface addRepositoryInterface(RepositoryInterface repositoryInterface) throws JSONException;
|
75
|
|
76
|
@RequestMapping(value = "/getDnetCountries", method = RequestMethod.GET,
|
77
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
78
|
@ResponseBody
|
79
|
List<String> getDnetCountries();
|
80
|
|
81
|
@RequestMapping(value = "/getTypologies", method = RequestMethod.GET,
|
82
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
83
|
@ResponseBody
|
84
|
List<String> getTypologies();
|
85
|
|
86
|
@RequestMapping(value = "/getTimezones", method = RequestMethod.GET,
|
87
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
88
|
@ResponseBody
|
89
|
List<Timezone> getTimezones();
|
90
|
|
91
|
@RequestMapping(value = "/updateManagedStatus", method = RequestMethod.POST,
|
92
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
93
|
@ResponseBody
|
94
|
String updateManagedStatus(String id, String managed);
|
95
|
|
96
|
@RequestMapping(value = "/updateEnglishName", method = RequestMethod.POST,
|
97
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
98
|
@ResponseBody
|
99
|
String updateEnglishName(String id, String englishName);
|
100
|
|
101
|
@RequestMapping(value = "/updateLatitude", method = RequestMethod.POST,
|
102
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
103
|
@ResponseBody
|
104
|
String updateLatitude(String id, String latitude);
|
105
|
|
106
|
@RequestMapping(value = "/updateLongitude", method = RequestMethod.POST,
|
107
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
108
|
@ResponseBody
|
109
|
String updateLongitude(String id, String longitude);
|
110
|
|
111
|
@RequestMapping(value = "/updateOfficialName", method = RequestMethod.POST,
|
112
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
113
|
@ResponseBody
|
114
|
String updateOfficialName(String id, String officialName);
|
115
|
|
116
|
@RequestMapping(value = "/updateTimezone", method = RequestMethod.POST,
|
117
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
118
|
@ResponseBody
|
119
|
String updateTimezone(String id, String timezone);
|
120
|
|
121
|
@RequestMapping(value = "/updateTypology", method = RequestMethod.POST,
|
122
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
123
|
@ResponseBody
|
124
|
String updateTypology(String id, String typology);
|
125
|
|
126
|
@RequestMapping(value = "/updateLogoUrl", method = RequestMethod.POST,
|
127
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
128
|
@ResponseBody
|
129
|
String updateLogoUrl(String id, String logoUrl);
|
130
|
|
131
|
|
132
|
@RequestMapping(value = "/getUrlsOfUserRepos/{user_email}/{page}/{size}/",method = RequestMethod.GET,
|
133
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
134
|
@ResponseBody
|
135
|
List<String> getUrlsOfUserRepos(String user_email,
|
136
|
String page,
|
137
|
String size) throws JSONException;
|
138
|
|
139
|
@RequestMapping(value = "/getDatasourceVocabularies/{mode}",method = RequestMethod.GET,
|
140
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
141
|
@ResponseBody
|
142
|
List<String> getDatasourceVocabularies(String mode);
|
143
|
|
144
|
@RequestMapping(value = "/getCompatibilityClasses/{mode}",method = RequestMethod.GET,
|
145
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
146
|
@ResponseBody
|
147
|
Map<String, String> getCompatibilityClasses(String mode);
|
148
|
|
149
|
@RequestMapping(value = "/getDatasourceClasses/{mode}",method = RequestMethod.GET,
|
150
|
produces = MediaType.APPLICATION_JSON_VALUE)
|
151
|
@ResponseBody
|
152
|
Map<String, String> getDatasourceClasses(String mode);
|
153
|
|
154
|
|
155
|
String getCountryName(String countryCode);
|
156
|
}
|