Project

General

Profile

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}", 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
    String 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 = "/getUrlsOfUserRepos/{user_email}/{page}/{size}/",method = RequestMethod.GET,
117
            produces = MediaType.APPLICATION_JSON_VALUE)
118
    @ResponseBody
119
    List<String> getUrlsOfUserRepos(String user_email,
120
                                    String page,
121
                                    String size) throws JSONException;
122

    
123
    @RequestMapping(value = "/getDatasourceVocabularies/{mode}",method = RequestMethod.GET,
124
            produces = MediaType.APPLICATION_JSON_VALUE)
125
    @ResponseBody
126
    List<String> getDatasourceVocabularies(String mode);
127

    
128
    @RequestMapping(value = "/getCompatibilityClasses/{mode}",method = RequestMethod.GET,
129
            produces = MediaType.APPLICATION_JSON_VALUE)
130
    @ResponseBody
131
    Map<String, String> getCompatibilityClasses(String mode);
132

    
133
    @RequestMapping(value = "/getDatasourceClasses/{mode}",method = RequestMethod.GET,
134
            produces = MediaType.APPLICATION_JSON_VALUE)
135
    @ResponseBody
136
    Map<String, String> getDatasourceClasses(String mode);
137

    
138

    
139

    
140
}
(5-5/8)