Project

General

Profile

« Previous | Next » 

Revision 50756

1. Bug fixes on parameters for BrokerApi

View differences:

modules/uoa-repository-manager-service/trunk/src/main/java/eu/dnetlib/repo/manager/service/controllers/BrokerApiImpl.java
22 22
import org.springframework.util.LinkedMultiValueMap;
23 23
import org.springframework.util.MultiValueMap;
24 24
import org.springframework.web.bind.annotation.PathVariable;
25
import org.springframework.web.bind.annotation.RequestBody;
25 26
import org.springframework.web.bind.annotation.RequestParam;
26 27
import org.springframework.web.client.RestClientException;
27 28
import org.springframework.web.client.RestTemplate;
......
132 133
    }
133 134

  
134 135
    @Override
135
    public EventsPage advancedShowEvents(String page,String size,AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException {
136
        /*JSONObject json_params = new JSONObject(params);
136
    public EventsPage advancedShowEvents(@PathVariable("page") String page,
137
                                         @PathVariable("size") String size,
138
                                         @RequestBody AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException {
137 139

  
138
        String page = json_params.getString("page");
139
        String pagesize = json_params.getString("pagesize");
140
        String json_advQueryObject = json_params.getString("advQueryObject");
141

  
142
        ObjectMapper mapper = new ObjectMapper();
143
        AdvQueryObject advQueryObject = mapper.readValue(json_advQueryObject, AdvQueryObject.class);*/
144

  
145 140
        final String service = "/events/{page}/{pageSize}";
146 141

  
147 142
        Map<String, Long> uriParams = new HashMap<>();
......
219 214
    }
220 215

  
221 216
    @Override
222
    public EventsPage showEvents(String datasourceName,String topic,String page) throws BrokerException, JSONException {
217
    public EventsPage showEvents(@PathVariable("datasourceName") String datasourceName,
218
                                 @PathVariable("topic") String topic,
219
                                 @PathVariable("page") String page) throws BrokerException, JSONException {
223 220

  
224 221
        /*JSONObject json_params = new JSONObject(params);
225 222

  
......
251 248
    }
252 249

  
253 250
    @Override
254
    public Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser( String userEmail)
251
    public Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser(@PathVariable("userEmail")  String userEmail)
255 252
            throws BrokerException {
256 253

  
257 254
        final String service = "/subscriptions";
......
276 273
    }
277 274

  
278 275
    @Override
279
    public Subscription subscribe(OpenaireSubscription obj) throws BrokerException {
276
    public Subscription subscribe(@RequestBody  OpenaireSubscription obj) throws BrokerException {
280 277
        final String service = "/subscribe";
281 278

  
282 279
        //build the uri params
modules/uoa-repository-manager-service/trunk/src/main/java/eu/dnetlib/repo/manager/service/controllers/BrokerApi.java
25 25
    List<BrowseEntry> getTopicsForDatasource(String datasourceName) throws BrokerException;
26 26

  
27 27
    @RequestMapping(value = "/advancedShowEvents/{page}/{size}" , method = RequestMethod.POST,produces = MediaType.APPLICATION_JSON_VALUE)
28
    EventsPage advancedShowEvents(@PathVariable("page") String page,
29
                                  @PathVariable("size") String size,
30
                                  @RequestBody AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException;
28
    EventsPage advancedShowEvents(String page,
29
                                  String size,
30
                                  AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException;
31 31

  
32 32
    @RequestMapping(value = "/showEvents/{datasourceName}/{topic}/{page}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
33
    EventsPage showEvents(@PathVariable("datasourceName") String datasourceName,
34
                          @PathVariable("topic") String topic,
35
                          @PathVariable("page") String page) throws BrokerException, JSONException;
33
    EventsPage showEvents(String datasourceName,
34
                          String topic,
35
                          String page) throws BrokerException, JSONException;
36 36

  
37 37
    @RequestMapping(value = "/getSimpleSubscriptionsOfUser/{userEmail}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
38 38
    @ResponseBody
39
    Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser(@PathVariable("userEmail") String userEmail) throws BrokerException;
39
    Map<String, List<SimpleSubscriptionDesc>> getSimpleSubscriptionsOfUser(String userEmail) throws BrokerException;
40 40

  
41 41
    @RequestMapping(value = "/subscribe" , method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE,
42 42
            produces = MediaType.APPLICATION_JSON_VALUE)
43 43
    @ResponseBody
44
    Subscription subscribe(@RequestBody OpenaireSubscription obj) throws BrokerException;
44
    Subscription subscribe(OpenaireSubscription obj) throws BrokerException;
45 45

  
46 46
    @RequestMapping(value = "/unsubscribe/{subscriptionId}" , method = RequestMethod.POST,consumes = MediaType.APPLICATION_JSON_VALUE,
47 47
            produces = MediaType.APPLICATION_JSON_VALUE)
......
50 50

  
51 51
    @RequestMapping(value = "/getSubscription/{subscriptionId}" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
52 52
    @ResponseBody
53
    Subscription getSubscription(@PathVariable("subscriptionId") String subscriptionId) throws BrokerException;
53
    Subscription getSubscription(String subscriptionId) throws BrokerException;
54 54

  
55 55

  
56 56
    @RequestMapping(value = "/getDnetTopics" , method = RequestMethod.GET,produces = MediaType.APPLICATION_JSON_VALUE)
modules/uoa-repository-manager-service/trunk/pom.xml
153 153
        </dependency>
154 154

  
155 155
        <dependency>
156
            <groupId>org.slf4j</groupId>
157
            <artifactId>slf4j-log4j12</artifactId>
158
            <version>1.5.6</version>
159
        </dependency>
160

  
161
        <dependency>
162 156
            <groupId>xerces</groupId>
163 157
            <artifactId>xercesImpl</artifactId>
164 158
            <version>2.11.0</version>

Also available in: Unified diff