From 3c41f3206aa9327e1b67678c938b316b528d13c8 Mon Sep 17 00:00:00 2001 From: spyroukon Date: Wed, 7 Sep 2022 13:29:04 +0000 Subject: [PATCH] fixed getting accessSets and accessFormats --- .../eu/dnetlib/repo/manager/domain/RepositoryInterface.java | 4 ++-- .../dnetlib/repo/manager/service/RepositoryServiceImpl.java | 4 +++- src/main/java/eu/dnetlib/repo/manager/utils/HttpUtils.java | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/dnetlib/repo/manager/domain/RepositoryInterface.java b/src/main/java/eu/dnetlib/repo/manager/domain/RepositoryInterface.java index 08d650e..87554c2 100644 --- a/src/main/java/eu/dnetlib/repo/manager/domain/RepositoryInterface.java +++ b/src/main/java/eu/dnetlib/repo/manager/domain/RepositoryInterface.java @@ -32,7 +32,7 @@ public class RepositoryInterface extends ApiDetails { if (apiParams != null) { map = apiParams.stream() .filter(Objects::nonNull) - .filter(k -> k.getParam() == null && k.getValue() == null) + .filter(k -> k.getParam() != null && k.getValue() != null) .collect(Collectors.toMap(ApiParamDetails::getParam, ApiParamDetails::getValue)); return map.get("set"); } @@ -48,7 +48,7 @@ public class RepositoryInterface extends ApiDetails { if (apiParams != null) { map = apiParams.stream() .filter(Objects::nonNull) - .filter(k -> k.getParam() == null && k.getValue() == null) + .filter(k -> k.getParam() != null && k.getValue() != null) .collect(Collectors.toMap(ApiParamDetails::getParam, ApiParamDetails::getValue)); return map.get("format"); } diff --git a/src/main/java/eu/dnetlib/repo/manager/service/RepositoryServiceImpl.java b/src/main/java/eu/dnetlib/repo/manager/service/RepositoryServiceImpl.java index 104e556..1fb5183 100644 --- a/src/main/java/eu/dnetlib/repo/manager/service/RepositoryServiceImpl.java +++ b/src/main/java/eu/dnetlib/repo/manager/service/RepositoryServiceImpl.java @@ -707,7 +707,9 @@ public class RepositoryServiceImpl implements RepositoryService { job.setOfficialName(repo.getOfficialname()); job.setRepoType(repo.getEoscDatasourceType()); job.setUserEmail(userEmail); - job.setValidationSet((iFace.getAccessSet().isEmpty() ? "none" : iFace.getAccessSet())); + String accessSet = iFace.getAccessSet(); + + job.setValidationSet((accessSet.isEmpty() ? "none" : accessSet)); job.setRecords(-1); job.setRegistration(!updateExisting); job.setUpdateExisting(updateExisting); diff --git a/src/main/java/eu/dnetlib/repo/manager/utils/HttpUtils.java b/src/main/java/eu/dnetlib/repo/manager/utils/HttpUtils.java index 5a05eb3..bb2c7be 100644 --- a/src/main/java/eu/dnetlib/repo/manager/utils/HttpUtils.java +++ b/src/main/java/eu/dnetlib/repo/manager/utils/HttpUtils.java @@ -87,7 +87,7 @@ public class HttpUtils { private JsonElement getResponseEntityAsJsonElement(ResponseEntity responseEntity) { if (responseEntity != null && responseEntity.getBody() != null) { - logger.info(responseEntity.getBody()); + logger.debug(responseEntity.getBody()); try { return new JsonParser().parse(responseEntity.getBody()); } catch (Exception e) {