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