Project

General

Profile

« Previous | Next » 

Revision 61375

minor refactoring

View differences:

modules/uoa-repository-manager-service/branches/aai_roles_new/src/main/java/eu/dnetlib/repo/manager/service/RepositoryService.java
14 14
public interface RepositoryService {
15 15

  
16 16

  
17
    Country[] getCountries() ;
17
    // TODO: move this elsewhere
18
    Country[] getCountries();
18 19

  
19 20
    List<Repository> getRepositories(List<String> ids) throws JSONException;
20 21

  
......
26 27

  
27 28
    List<RepositorySnippet> getRepositoriesByCountry(String country, String mode, Boolean managed) throws JSONException, IOException;
28 29

  
30
    // TODO: remove?
29 31
    List<Repository> getRepositoriesOfUser(String page, String size) throws JSONException, IOException;
30 32

  
33
    // TODO: remove?
31 34
    List<Repository> getRepositoriesOfUser(String userEmail,
32 35
                                           String page,
33 36
                                           String size) throws JSONException, IOException;
......
37 40
    List<RepositorySnippet> getRepositoriesSnippetOfUser(String userEmail, String page, String size) throws Exception;
38 41

  
39 42
    RepositorySnippet getRepositorySnippetById(String id) throws JSONException, ResourceNotFoundException;
43

  
40 44
    Repository getRepositoryById(String id) throws JSONException, ResourceNotFoundException;
41 45

  
42 46
    List<AggregationDetails> getRepositoryAggregations(String id, int from, int size) throws JSONException;
43 47

  
44
    Map<String,List<AggregationDetails>> getRepositoryAggregationsByYear(String id) throws JSONException;
48
    Map<String, List<AggregationDetails>> getRepositoryAggregationsByYear(String id) throws JSONException;
45 49

  
46 50
    List<Repository> getRepositoriesByName(String name,
47 51
                                           String page,
48 52
                                           String size) throws JSONException;
49 53

  
50 54
    List<RepositorySnippet> searchRegisteredRepositories(String country, String typology, String englishName,
51
                                                                String officialName, String requestSortBy, String order,
52
                                                                int page, int pageSize) throws Exception;
55
                                                         String officialName, String requestSortBy, String order,
56
                                                         int page, int pageSize) throws Exception;
53 57

  
54 58
    List<RepositoryInterface> getRepositoryInterface(String id) throws JSONException;
55 59

  
......
72 76

  
73 77
    List<String> getUrlsOfUserRepos(String user_email,
74 78
                                    String page,
75
                                    String size) throws JSONException;
79
                                    String size);
76 80

  
77 81
    List<String> getDatasourceVocabularies(String mode);
78 82

  
......
84 88

  
85 89
    MetricsInfo getMetricsInfoForRepository(String repoId) throws RepositoryServiceException;
86 90

  
87
    Map<String, String> getListLatestUpdate(String mode) throws RepositoryServiceException, JSONException;
91
    Map<String, String> getListLatestUpdate(String mode) throws JSONException;
88 92

  
89 93
    RepositoryInterface updateRepositoryInterface(String repoId, String registeredBy, String comment, RepositoryInterface repositoryInterface) throws Exception;
90 94

  
modules/uoa-repository-manager-service/branches/aai_roles_new/src/main/java/eu/dnetlib/repo/manager/service/BrokerServiceImpl.java
2 2

  
3 3
import com.fasterxml.jackson.databind.JsonNode;
4 4
import com.fasterxml.jackson.databind.ObjectMapper;
5
import eu.dnetlib.domain.data.Repository;
6 5
import eu.dnetlib.repo.manager.domain.BrokerException;
7 6
import eu.dnetlib.repo.manager.domain.RepositorySnippet;
8 7
import eu.dnetlib.repo.manager.domain.Term;
......
44 43
            .getLogger(BrokerServiceImpl.class);
45 44

  
46 45
    @Autowired
47
    RestTemplate restTemplate ;
46
    RestTemplate restTemplate;
48 47

  
49 48
    private HttpHeaders httpHeaders;
50 49

  
51
    private HashMap<String,Term> topics = new HashMap<String, Term>();
50
    private HashMap<String, Term> topics = new HashMap<String, Term>();
52 51

  
53 52
    @Autowired
54 53
    private EmailUtils emailUtils;
......
60 59
        httpHeaders.set("Content-Type", "application/json");
61 60

  
62 61
        LOGGER.debug("Init dnet topics!");
63
        try (InputStream is = new URL(topicsURL).openStream() ){
62
        try (InputStream is = new URL(topicsURL).openStream()) {
64 63
            ObjectMapper mapper = new ObjectMapper();
65 64
            JsonNode root = mapper.readTree(is);
66
            for (JsonNode term : root.path("terms") )
65
            for (JsonNode term : root.path("terms"))
67 66
                topics.put(term.path("code").textValue(), parseTerm(term));
68 67
        } catch (IOException e) {
69
            LOGGER.debug("Exception on initDnetTopicsMap" , e);
68
            LOGGER.debug("Exception on initDnetTopicsMap", e);
70 69
            emailUtils.reportException(e);
71 70
        }
72 71
    }
73 72

  
74 73
    private Term parseTerm(JsonNode term) {
75
        return new Term(term.path("englishName").textValue(),term.path("nativeName").textValue(),
76
                term.path("encoding").textValue(),term.path("code").textValue());
74
        return new Term(term.path("englishName").textValue(), term.path("nativeName").textValue(),
75
                term.path("encoding").textValue(), term.path("code").textValue());
77 76
    }
78 77

  
79 78

  
80 79
    @Override
81
    public DatasourcesBroker getDatasourcesOfUser(String user,String includeShared,String includeByOthers) throws JSONException {
80
    public DatasourcesBroker getDatasourcesOfUser(String user, String includeShared, String includeByOthers) throws JSONException {
82 81
        long start = System.currentTimeMillis();
83 82
        DatasourcesBroker ret = new DatasourcesBroker();
84 83
        try {
85
            ret.setDatasourcesOfUser(getDatasourcesOfUserType(repoAPI.getRepositoriesSnippetOfUser(user,"0","100")));
84
            ret.setDatasourcesOfUser(getDatasourcesOfUserType(repoAPI.getRepositoriesSnippetOfUser(user, "0", "100")));
86 85
            //TODO fix bug when values are true
87 86
//            if (Boolean.parseBoolean(includeShared)) {
88 87
//                List<String> sharedDatasourceIds = new ArrayList<String>();
......
93 92
//                ret.setDatasourcesOfOthers(getDatasourcesOfUserType(getRepositoriesOfUser(user)));
94 93
//            }
95 94
        } catch (Exception e) {
96
            LOGGER.debug("Exception on getDatasourcesOfUser" , e);
95
            LOGGER.debug("Exception on getDatasourcesOfUser", e);
97 96
            emailUtils.reportException(e);
98 97
        }
99 98
        long end = System.currentTimeMillis();
100
        System.out.println("Getting datasources of user in " + (end-start)+"ms");
99
        System.out.println("Getting datasources of user in " + (end - start) + "ms");
101 100
        return ret;
102 101
    }
103 102

  
......
117 116
                    new ParameterizedTypeReference<List<BrowseEntry>>() {
118 117
                    });
119 118
        } catch (RestClientException e) {
120
            LOGGER.debug("Exception on getTopicsForDatasource" , e);
119
            LOGGER.debug("Exception on getTopicsForDatasource", e);
121 120
            emailUtils.reportException(e);
122 121
            throw new BrokerException(e);
123 122
        }
......
128 127
    @Override
129 128
    public EventsPage advancedShowEvents(String page,
130 129
                                         String size,
131
                                         AdvQueryObject advQueryObject) throws BrokerException, JSONException ,IOException {
130
                                         AdvQueryObject advQueryObject) throws BrokerException, JSONException, IOException {
132 131

  
133 132
        final String service = "/events/{page}/{pageSize}";
134 133

  
......
151 150
                    }
152 151
            );
153 152
        } catch (RestClientException e) {
154
            LOGGER.debug("Exception on advancedShowEvents" , e);
153
            LOGGER.debug("Exception on advancedShowEvents", e);
155 154
            emailUtils.reportException(e);
156 155
            throw new BrokerException(e);
157 156
        }
......
166 165
        List<Tuple<BrowseEntry, String>> entries = new ArrayList<>();
167 166
        for (RepositorySnippet repo : repositories) {
168 167
            BrowseEntry temp = new BrowseEntry();
169
            temp.setValue(repo.getOfficialname());
168
            temp.setValue(repo.getOfficialName());
170 169
            temp.setSize(new Long(0));
171
            for (BrowseEntry e : getTopicsForDatasource(repo.getOfficialname())) {
170
            for (BrowseEntry e : getTopicsForDatasource(repo.getOfficialName())) {
172 171
                temp.setSize(temp.getSize() + e.getSize());
173 172
            }
174 173
            Tuple<BrowseEntry, String> tup = new Tuple<>(temp, repo.getLogoUrl());
......
183 182
            }
184 183
        });
185 184
        long stop = System.currentTimeMillis();
186
        System.out.println("getDatasourcesOfUserType returned in " + (stop-start) + "ms ");
185
        System.out.println("getDatasourcesOfUserType returned in " + (stop - start) + "ms ");
187 186

  
188 187
        return entries;
189 188
    }
190 189

  
191
    private List<Repository> getRepositoriesOfUser(String userEmail) throws JSONException {
192

  
193
        int page = 0;
194
        int size = 50;
195
        List<Repository> rs ;
196
        List<Repository> resultSet = new ArrayList<>();
197

  
198
        while (true){
199
            rs = repoAPI.getRepositoriesOfUser(userEmail, String.valueOf(page), String.valueOf(size));
200
            resultSet.addAll(rs);
201
            page+=1;
202
            if(rs.size() == 0) break;
203
        }
204
        return resultSet;
205
    }
206

  
207
    private List<Repository> getRepositoriesByIds(List<String> sharedDatasourceIds) {
208
        return null;
209
    }
210

  
211 190
    @Override
212 191
    public EventsPage showEvents(String datasourceName,
213 192
                                 String topic,
......
230 209
                    new ParameterizedTypeReference<EventsPage>() {
231 210
                    });
232 211
        } catch (RestClientException e) {
233
            LOGGER.debug("Exception on showEvents" , e);
212
            LOGGER.debug("Exception on showEvents", e);
234 213
            emailUtils.reportException(e);
235 214
            throw new BrokerException(e);
236 215
        }
......
256 235
                    new ParameterizedTypeReference<Map<String, List<SimpleSubscriptionDesc>>>() {
257 236
                    });
258 237
        } catch (RestClientException e) {
259
            LOGGER.debug("Exception on getSimpleSubscriptionsOfUser" , e);
238
            LOGGER.debug("Exception on getSimpleSubscriptionsOfUser", e);
260 239
            emailUtils.reportException(e);
261 240
            throw new BrokerException(e);
262 241
        }
......
292 271
                    new ParameterizedTypeReference<Subscription>() {
293 272
                    });
294 273
        } catch (RestClientException e) {
295
            LOGGER.debug("Exception on OpenaireSubscription" , e);
274
            LOGGER.debug("Exception on OpenaireSubscription", e);
296 275
            emailUtils.reportException(e);
297 276
            throw new BrokerException(e);
298 277
        }
......
316 295
                    new ParameterizedTypeReference<Void>() {
317 296
                    });
318 297
        } catch (RestClientException e) {
319
            LOGGER.debug("Exception on unsubscribe" , e);
298
            LOGGER.debug("Exception on unsubscribe", e);
320 299
            emailUtils.reportException(e);
321 300
            throw new BrokerException(e);
322 301
        }
323
        return new ResponseEntity<>("OK",HttpStatus.OK);
302
        return new ResponseEntity<>("OK", HttpStatus.OK);
324 303
    }
325 304

  
326 305
    @Override
327
    public Subscription getSubscription( String subscriptionId) throws BrokerException {
306
    public Subscription getSubscription(String subscriptionId) throws BrokerException {
328 307
        final String service = "/subscriptions/" + subscriptionId;
329 308

  
330 309
        //build the uri params
......
340 319
                    new ParameterizedTypeReference<Subscription>() {
341 320
                    });
342 321
        } catch (RestClientException e) {
343
            LOGGER.debug("Exception on getSubscription" , e);
322
            LOGGER.debug("Exception on getSubscription", e);
344 323
            emailUtils.reportException(e);
345 324
            throw new BrokerException(e);
346 325
        }
......
360 339
        UriComponents uriComponents = UriComponentsBuilder
361 340
                .fromHttpUrl(openairePath + "/notifications/")
362 341
                .path("/{id}/{page}/{size}/")
363
                .build().expand(subscriptionId,page, size).encode();
342
                .build().expand(subscriptionId, page, size).encode();
364 343

  
365 344
        ResponseEntity<EventsPage> resp;
366 345
        try {
......
371 350
                    new ParameterizedTypeReference<EventsPage>() {
372 351
                    });
373 352
        } catch (RestClientException e) {
374
            LOGGER.debug("Exception on getNotificationsBySubscriptionId" , e);
353
            LOGGER.debug("Exception on getNotificationsBySubscriptionId", e);
375 354
            emailUtils.reportException(e);
376 355
            throw new BrokerException(e);
377 356
        }
......
383 362
            throws BrokerException {
384 363

  
385 364
        Map<String, List<SimpleSubscriptionDesc>> simpleSubs = getSimpleSubscriptionsOfUser(userEmail);
386
        Map<String,List<Subscription>> subs = new HashMap<>();
365
        Map<String, List<Subscription>> subs = new HashMap<>();
387 366
        List<Subscription> subscriptions = null;
388 367

  
389
        for(String s:simpleSubs.keySet()){
368
        for (String s : simpleSubs.keySet()) {
390 369
            List<SimpleSubscriptionDesc> simpleSubscriptionDescs = simpleSubs.get(s);
391
            for(SimpleSubscriptionDesc simpleSubscriptionDesc : simpleSubscriptionDescs) {
370
            for (SimpleSubscriptionDesc simpleSubscriptionDesc : simpleSubscriptionDescs) {
392 371
                subscriptions = new ArrayList<>();
393 372
                subscriptions.add(getSubscription(simpleSubscriptionDesc.getId()));
394 373
            }
395
            subs.put(s,subscriptions);
374
            subs.put(s, subscriptions);
396 375
        }
397 376
        return subs;
398 377
    }
modules/uoa-repository-manager-service/branches/aai_roles_new/src/main/java/eu/dnetlib/repo/manager/service/DashboardServiceImpl.java
1 1
package eu.dnetlib.repo.manager.service;
2 2

  
3
import eu.dnetlib.domain.data.Repository;
4 3
import eu.dnetlib.repo.manager.domain.*;
5 4
import eu.dnetlib.repo.manager.domain.broker.BrowseEntry;
6 5
import org.apache.log4j.Logger;
......
27 26
    @Override
28 27
    public List<RepositorySummaryInfo> getRepositoriesSummaryInfo(String userEmail,
29 28
                                                                  String page,
30
                                                                  String size){
29
                                                                  String size) {
31 30

  
32 31
        List<RepositorySummaryInfo> repositorySummaryInfoList = new ArrayList<>();
33 32

  
34 33
        try {
35 34

  
36
                List<Repository> repositoriesOfUser = repositoryService.getRepositoriesOfUser(userEmail, page, size);
37
                for(Repository repository: repositoriesOfUser) {
38
                    RepositorySummaryInfo repositorySummaryInfo = new RepositorySummaryInfo();
39
                    repositorySummaryInfo.setId(repository.getId());
40
                    repositorySummaryInfo.setRepositoryName(repository.getOfficialName());
41
                    repositorySummaryInfo.setLogoURL(repository.getLogoUrl());
35
            List<RepositorySnippet> repositoriesOfUser = repositoryService.getRepositoriesSnippetOfUser(userEmail, page, size);
36
            for (RepositorySnippet repository : repositoriesOfUser) {
37
                RepositorySummaryInfo repositorySummaryInfo = new RepositorySummaryInfo();
38
                repositorySummaryInfo.setId(repository.getId());
39
                repositorySummaryInfo.setRepositoryName(repository.getOfficialName());
40
                repositorySummaryInfo.setLogoURL(repository.getLogoUrl());
42 41

  
43
                    //TODO getRepositoryAggregations returns only the 20 more recent items. Is it positive that we will find an indexed version there?
44
                    long start = System.currentTimeMillis();
45
                    List<AggregationDetails> aggregationDetailsList = repositoryService.getRepositoryAggregations(repository.getId(),0,20);
46
                    for(AggregationDetails aggregationDetails: aggregationDetailsList) {
47
                        if(aggregationDetails.getIndexedVersion()) {
48
                            repositorySummaryInfo.setRecordsCollected(aggregationDetails.getNumberOfRecords());
49
                            repositorySummaryInfo.setLastIndexedVersion(aggregationDetails.getDate());
50
                            break;
51
                        }
42
                //TODO getRepositoryAggregations returns only the 20 more recent items. Is it positive that we will find an indexed version there?
43
                long start = System.currentTimeMillis();
44
                List<AggregationDetails> aggregationDetailsList = repositoryService.getRepositoryAggregations(repository.getId(), 0, 20);
45
                for (AggregationDetails aggregationDetails : aggregationDetailsList) {
46
                    if (aggregationDetails.getIndexedVersion()) {
47
                        repositorySummaryInfo.setRecordsCollected(aggregationDetails.getNumberOfRecords());
48
                        repositorySummaryInfo.setLastIndexedVersion(aggregationDetails.getDate());
49
                        break;
52 50
                    }
53
                    long end = System.currentTimeMillis();
51
                }
52
                long end = System.currentTimeMillis();
54 53

  
55
                    System.out.println("Got repo aggregations in "+ (end-start)+"ms");
54
                System.out.println("Got repo aggregations in " + (end - start) + "ms");
56 55

  
57
                    try {
56
                try {
58 57

  
59
                        MetricsInfo metricsInfo = repositoryService.getMetricsInfoForRepository(repository.getId());
60
                        repositorySummaryInfo.setTotalDownloads(metricsInfo.getMetricsNumbers().getTotalDownloads());
61
                        repositorySummaryInfo.setTotalViews(metricsInfo.getMetricsNumbers().getTotalViews());
58
                    MetricsInfo metricsInfo = repositoryService.getMetricsInfoForRepository(repository.getId());
59
                    repositorySummaryInfo.setTotalDownloads(metricsInfo.getMetricsNumbers().getTotalDownloads());
60
                    repositorySummaryInfo.setTotalViews(metricsInfo.getMetricsNumbers().getTotalViews());
62 61

  
63
                    } catch (RepositoryServiceException e) {
64
                        logger.error("Exception getting metrics info for repository: " + repository.getId(), e);
65
                    }
62
                } catch (RepositoryServiceException e) {
63
                    logger.error("Exception getting metrics info for repository: " + repository.getId(), e);
64
                }
66 65

  
67
                    try {
66
                try {
68 67

  
69
                        List<BrowseEntry> events = brokerService.getTopicsForDatasource(repository.getOfficialName());
70
                        Long totalEvents = 0L;
71
                        for(BrowseEntry browseEntry: events)
72
                            totalEvents += browseEntry.getSize();
73
                        repositorySummaryInfo.setEnrichmentEvents(totalEvents);
68
                    List<BrowseEntry> events = brokerService.getTopicsForDatasource(repository.getOfficialName());
69
                    Long totalEvents = 0L;
70
                    for (BrowseEntry browseEntry : events)
71
                        totalEvents += browseEntry.getSize();
72
                    repositorySummaryInfo.setEnrichmentEvents(totalEvents);
74 73

  
75 74

  
76
                    } catch (BrokerException e) {
77
                        logger.error("Exception getting broker events for repository: " + repository.getId(), e);
78
                    }
79

  
80
                    repositorySummaryInfoList.add(repositorySummaryInfo);
75
                } catch (BrokerException e) {
76
                    logger.error("Exception getting broker events for repository: " + repository.getId(), e);
81 77
                }
82 78

  
79
                repositorySummaryInfoList.add(repositorySummaryInfo);
80
            }
81

  
83 82
        } catch (Exception e) {
84 83
            logger.error("Something baad happened!", e);
85 84
        }
modules/uoa-repository-manager-service/branches/aai_roles_new/src/main/java/eu/dnetlib/repo/manager/utils/Converter.java
156 156

  
157 157

  
158 158
        repositorySnippet.setId(repositorySnippetObject.get("id").toString());
159
        repositorySnippet.setOfficialname(repositorySnippetObject.get("officialname").toString());
159
        repositorySnippet.setOfficialName(repositorySnippetObject.get("officialname").toString());
160 160

  
161
        repositorySnippet.setEnglishname(repositorySnippetObject.get("englishname").toString());
162
        if (repositorySnippet.getEnglishname().equals("null"))
163
            repositorySnippet.setEnglishname("");
161
        repositorySnippet.setEnglishName(repositorySnippetObject.get("englishname").toString());
162
        if (repositorySnippet.getEnglishName().equals("null"))
163
            repositorySnippet.setEnglishName("");
164 164

  
165
        repositorySnippet.setWebsiteurl(repositorySnippetObject.get("websiteurl").toString());
166
        if (repositorySnippet.getWebsiteurl().equals("null"))
167
            repositorySnippet.setWebsiteurl("");
165
        repositorySnippet.setWebsiteUrl(repositorySnippetObject.get("websiteurl").toString());
166
        if (repositorySnippet.getWebsiteUrl().equals("null"))
167
            repositorySnippet.setWebsiteUrl("");
168 168

  
169
        repositorySnippet.setRegisteredby(repositorySnippetObject.get("registeredby").toString());
170
        if (repositorySnippet.getRegisteredby().equals("null"))
171
            repositorySnippet.setRegisteredby("");
169
        repositorySnippet.setRegisteredBy(repositorySnippetObject.get("registeredby").toString());
170
        if (repositorySnippet.getRegisteredBy().equals("null"))
171
            repositorySnippet.setRegisteredBy("");
172 172
        return repositorySnippet;
173 173

  
174 174
    }
modules/uoa-repository-manager-service/branches/aai_roles_new/src/main/java/eu/dnetlib/repo/manager/controllers/RepositoryController.java
5 5
import eu.dnetlib.repo.manager.domain.*;
6 6
import eu.dnetlib.repo.manager.domain.dto.User;
7 7
import eu.dnetlib.repo.manager.exception.ResourceNotFoundException;
8
import eu.dnetlib.repo.manager.service.RepositoryServiceImpl;
8
import eu.dnetlib.repo.manager.service.RepositoryService;
9 9
import eu.dnetlib.repo.manager.service.security.AuthorizationService;
10 10
import eu.dnetlib.repo.manager.utils.JsonUtils;
11 11
import io.swagger.annotations.Api;
......
28 28
import java.util.Map;
29 29

  
30 30
@RestController
31
@RequestMapping(value = "/repository")
32
@Api(description = "Repository API", tags = {"repository"})
31
@RequestMapping(value = "/repositories")
32
@Api(description = "Repository API", tags = {"repositories"})
33 33
public class RepositoryController {
34 34

  
35 35
    private static final Logger logger = Logger.getLogger(RepositoryController.class);
36 36

  
37
    private final RepositoryServiceImpl repositoryService; //TODO: why not RepositoryService??
37
    private final RepositoryService repositoryService;
38 38
    private final AuthorizationService authorizationService;
39 39

  
40 40
    @Autowired
41
    RepositoryController(RepositoryServiceImpl repositoryService,
41
    RepositoryController(RepositoryService repositoryService,
42 42
                         AuthorizationService authorizationService) {
43 43
        this.repositoryService = repositoryService;
44 44
        this.authorizationService = authorizationService;
45 45
    }
46 46

  
47 47

  
48
    @RequestMapping(value = "/getCountries", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
48
    @RequestMapping(value = "/countries", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
49 49
    @ResponseBody
50 50
    public Country[] getCountries() {
51 51
        return repositoryService.getCountries();
......
60 60
        return repositoryService.getRepositoriesByCountry(country, mode, managed);
61 61
    }
62 62

  
63
    @RequestMapping(value = "/getRepositoriesOfUser/{page}/{size}", method = RequestMethod.GET,
63
    @RequestMapping(value = "/snippets/user", method = RequestMethod.GET,
64 64
            produces = MediaType.APPLICATION_JSON_VALUE)
65 65
    @ResponseBody
66 66
    @PreAuthorize("hasAuthority('REGISTERED_USER')")
67
    public List<RepositorySnippet> getRepositoriesSnippetOfUser(
68
            @PathVariable("page") String page,
69
            @PathVariable("size") String size) throws Exception {
70
        return repositoryService.getRepositoriesSnippetOfUser(page, size);
67
    public List<RepositorySnippet> getRepositoriesSnippetsOfUser() throws Exception {
68
        return repositoryService.getRepositoriesSnippetOfUser("0", "100");
71 69
    }
72 70

  
73
    @RequestMapping(value = "/user/repositories/{page}/{size}", method = RequestMethod.GET,
74
            produces = MediaType.APPLICATION_JSON_VALUE)
75
    @ResponseBody
76
    @PreAuthorize("hasAuthority('REGISTERED_USER')")
77
    public List<Repository> getRepositoriesOfUser(
78
            @PathVariable("page") String page,
79
            @PathVariable("size") String size) throws JSONException, IOException {
80
        return repositoryService.getRepositoriesOfUser(page, size);
81
    }
82

  
83 71
    @RequestMapping(value = "/searchRegisteredRepositories/{page}/{size}", method = RequestMethod.GET,
84 72
            produces = MediaType.APPLICATION_JSON_VALUE)
85 73
    @ResponseBody
modules/uoa-repository-manager-service/branches/aai_roles_new/src/main/java/eu/dnetlib/repo/manager/domain/RepositorySnippet.java
8 8
public class RepositorySnippet {
9 9

  
10 10
    private String id;
11
    private String officialname;
12
    private String englishname;
13
    private String websiteurl;
11
    private String officialName;
12
    private String englishName;
13
    private String websiteUrl;
14 14
    private String typology;
15
    private String registeredby;
15
    private String registeredBy;
16 16
    private Organization[] organizations;
17
    private String registrationdate;
17
    private String registrationDate;
18 18
    private String logoUrl;
19 19
    private String description;
20 20
    private String fullTextDownload;
......
24 24

  
25 25
    private PiwikInfo piwikInfo;
26 26

  
27
    public RepositorySnippet() {}
27
    public RepositorySnippet() {
28
    }
28 29

  
29 30
    public String getId() {
30 31
        return id;
......
34 35
        this.id = id;
35 36
    }
36 37

  
37
    public String getOfficialname() {
38
        return officialname;
38
    public String getOfficialName() {
39
        return officialName;
39 40
    }
40 41

  
41
    public void setOfficialname(String officialname) {
42
        this.officialname = officialname;
42
    public void setOfficialName(String officialName) {
43
        this.officialName = officialName;
43 44
    }
44 45

  
45
    public String getEnglishname() {
46
        return englishname;
46
    public String getEnglishName() {
47
        return englishName;
47 48
    }
48 49

  
49
    public void setEnglishname(String englishname) {
50
        this.englishname = englishname;
50
    public void setEnglishName(String englishName) {
51
        this.englishName = englishName;
51 52
    }
52 53

  
53
    public String getWebsiteurl() {
54
        return websiteurl;
54
    public String getWebsiteUrl() {
55
        return websiteUrl;
55 56
    }
56 57

  
57
    public void setWebsiteurl(String websiteurl) {
58
        this.websiteurl = websiteurl;
58
    public void setWebsiteUrl(String websiteUrl) {
59
        this.websiteUrl = websiteUrl;
59 60
    }
60 61

  
61
    public String getRegisteredby() {
62
        return registeredby;
62
    public String getRegisteredBy() {
63
        return registeredBy;
63 64
    }
64 65

  
65
    public void setRegisteredby(String registeredby) {
66
        this.registeredby = registeredby;
66
    public void setRegisteredBy(String registeredBy) {
67
        this.registeredBy = registeredBy;
67 68
    }
68 69

  
69 70
    public String getTypology() {
......
82 83
        this.organizations = organizations;
83 84
    }
84 85

  
85
    public String getRegistrationdate() {
86
        return registrationdate;
86
    public String getRegistrationDate() {
87
        return registrationDate;
87 88
    }
88 89

  
89
    public void setRegistrationdate(String registrationdate) {
90
        this.registrationdate = registrationdate;
90
    public void setRegistrationDate(String registrationDate) {
91
        this.registrationDate = registrationDate;
91 92
    }
92 93

  
93 94
    public PiwikInfo getPiwikInfo() {

Also available in: Unified diff