From 28d08d99e84efd80cb10b53bd4a6836d394a0763 Mon Sep 17 00:00:00 2001 From: sgiannopoulos Date: Tue, 13 Feb 2024 09:53:33 +0200 Subject: [PATCH] clean up code --- dmp-backend/data/pom.xml | 40 ------------------- dmp-backend/queryable/pom.xml | 24 ----------- .../{v2 => }/ContactSupportController.java | 2 +- .../{v2 => }/DashboardController.java | 2 +- .../{v2 => }/DepositController.java | 2 +- .../{v2 => }/DescriptionController.java | 2 +- .../DescriptionTemplateController.java | 2 +- .../DescriptionTemplateTypeController.java | 2 +- .../{v2 => }/DmpBlueprintController.java | 2 +- .../controllers/{v2 => }/DmpController.java | 13 +++--- .../{v2 => }/EntityDoiController.java | 2 +- .../ExternalValidationController.java | 13 ++---- .../{v2 => }/FileTransformerController.java | 2 +- .../{v2 => }/LanguageController.java | 2 +- .../controllers/{v2 => }/LockController.java | 2 +- .../{v2 => }/MaintenanceController.java | 2 +- .../{v2 => }/PrefillingController.java | 2 +- .../{v2 => }/PrincipalController.java | 2 +- .../{v2 => }/ReferenceController.java | 2 +- .../{v2 => }/ReferenceTypeController.java | 2 +- .../{v2 => }/StorageFileController.java | 2 +- .../SupportiveMaterialController.java | 2 +- .../controllers/{v2 => }/TagController.java | 2 +- .../{v2 => }/TenantController.java | 2 +- .../controllers/{v2 => }/UserController.java | 2 +- .../{v2 => }/UserSettingsController.java | 2 +- .../{ => old}/CurrencyController.java | 10 ++--- .../{ => old}/ManagementController.java | 18 ++++----- .../controllers/{ => old}/Validation.java | 10 ++--- ...ublicDatasetsDescriptionDocumentation.java | 4 +- .../publicapi/PublicDmpsDocumentation.java | 4 +- .../publicapi}/types/ApiMessageCode.java | 2 +- .../publicapi}/types/ApiResponseType.java | 2 +- .../publicapi/types}/ResponseItem.java | 5 +-- .../dashboard/recent/RecentActivityData.java | 38 ------------------ .../old/helpers/common/DataTableData.java | 24 ----------- 36 files changed, 50 insertions(+), 201 deletions(-) delete mode 100644 dmp-backend/data/pom.xml delete mode 100644 dmp-backend/queryable/pom.xml rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/ContactSupportController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/DashboardController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/DepositController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/DescriptionController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/DescriptionTemplateController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/DescriptionTemplateTypeController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/DmpBlueprintController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/DmpController.java (92%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/EntityDoiController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/ExternalValidationController.java (62%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/FileTransformerController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/LanguageController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/LockController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/MaintenanceController.java (98%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/PrefillingController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/PrincipalController.java (98%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/ReferenceController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/ReferenceTypeController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/StorageFileController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/SupportiveMaterialController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/TagController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/TenantController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/UserController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{v2 => }/UserSettingsController.java (99%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{ => old}/CurrencyController.java (55%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{ => old}/ManagementController.java (63%) rename dmp-backend/web/src/main/java/eu/eudat/controllers/{ => old}/Validation.java (75%) rename dmp-backend/web/src/main/java/eu/eudat/{ => controllers/publicapi}/types/ApiMessageCode.java (95%) rename dmp-backend/web/src/main/java/eu/eudat/{ => controllers/publicapi}/types/ApiResponseType.java (93%) rename dmp-backend/web/src/main/java/eu/eudat/{models/old/helpers/responses => controllers/publicapi/types}/ResponseItem.java (91%) delete mode 100644 dmp-backend/web/src/main/java/eu/eudat/models/old/dashboard/recent/RecentActivityData.java delete mode 100644 dmp-backend/web/src/main/java/eu/eudat/models/old/helpers/common/DataTableData.java diff --git a/dmp-backend/data/pom.xml b/dmp-backend/data/pom.xml deleted file mode 100644 index 67ba588e3..000000000 --- a/dmp-backend/data/pom.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - 4.0.0 - - data - 1.0-SNAPSHOT - jar - - - eu.eudat - dmp-backend - 1.0.0-SNAPSHOT - - - - - - eu.eudat - core - 1.0.0-SNAPSHOT - - - - com.fasterxml.jackson.datatype - jackson-datatype-jsr310 - - - dmp-backend - queryable - 1.0-SNAPSHOT - - - io.swagger - swagger-annotations - 1.5.20 - - - \ No newline at end of file diff --git a/dmp-backend/queryable/pom.xml b/dmp-backend/queryable/pom.xml deleted file mode 100644 index 1f36551ba..000000000 --- a/dmp-backend/queryable/pom.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - 4.0.0 - - dmp-backend - queryable - 1.0-SNAPSHOT - jar - - - eu.eudat - dmp-backend - 1.0.0-SNAPSHOT - - - - eu.eudat - core - 1.0.0-SNAPSHOT - - - \ No newline at end of file diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ContactSupportController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactSupportController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ContactSupportController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/ContactSupportController.java index e817c49a9..9c51ea17c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ContactSupportController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/ContactSupportController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.model.persist.ContactSupportPersist; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DashboardController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DashboardController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DashboardController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/DashboardController.java index 0b86a9616..a4c868cb0 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DashboardController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DashboardController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.commons.scope.user.UserScope; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DepositController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DepositController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DepositController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/DepositController.java index 1bc418467..fcbf32fcb 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DepositController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DepositController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import gr.cite.tools.validation.ValidationFilterAnnotation; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionController.java index 6d25f54cc..ebc82ff5b 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.authorization.AuthorizationFlags; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateController.java index cc1237e6d..1ffbc5d97 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import com.fasterxml.jackson.core.JsonProcessingException; import eu.eudat.audit.AuditableAction; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateTypeController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateTypeController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateTypeController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateTypeController.java index 579cb4a83..fe84db4d6 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DescriptionTemplateTypeController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DescriptionTemplateTypeController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.authorization.AuthorizationFlags; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DmpBlueprintController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DmpBlueprintController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DmpBlueprintController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/DmpBlueprintController.java index 3c333b810..50d84caf0 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DmpBlueprintController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DmpBlueprintController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import com.fasterxml.jackson.core.JsonProcessingException; import eu.eudat.audit.AuditableAction; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DmpController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DmpController.java similarity index 92% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DmpController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/DmpController.java index 46260cf13..60e6c2b60 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/DmpController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DmpController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.authorization.AuthorizationFlags; @@ -9,12 +9,10 @@ import eu.eudat.model.censorship.DmpCensor; import eu.eudat.model.censorship.PublicDmpCensor; import eu.eudat.model.persist.*; import eu.eudat.model.result.QueryResult; -import eu.eudat.models.old.helpers.responses.ResponseItem; import eu.eudat.query.DmpQuery; import eu.eudat.query.lookup.DmpLookup; import eu.eudat.service.dmp.DmpService; import eu.eudat.service.elastic.ElasticQueryHelperService; -import eu.eudat.types.ApiMessageCode; import gr.cite.tools.auditing.AuditService; import gr.cite.tools.data.builder.BuilderFactory; import gr.cite.tools.data.censor.CensorFactory; @@ -29,7 +27,6 @@ import jakarta.xml.bind.JAXBException; import org.slf4j.LoggerFactory; import org.springframework.context.MessageSource; import org.springframework.context.i18n.LocaleContextHolder; -import org.springframework.http.HttpStatus; import org.springframework.http.ResponseEntity; import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; @@ -228,7 +225,7 @@ public class DmpController { @PostMapping("{id}/invite-users") @Transactional @ValidationFilterAnnotation(validator = DmpUserInvitePersist.DmpUserInvitePersistValidator.ValidatorName, argumentName = "model") - public ResponseEntity> inviteUsers(@PathVariable("id") UUID id, @RequestBody DmpUserInvitePersist model) throws InvalidApplicationException, JAXBException, IOException { + public boolean inviteUsers(@PathVariable("id") UUID id, @RequestBody DmpUserInvitePersist model) throws InvalidApplicationException, JAXBException, IOException { logger.debug(new MapLogEntry("inviting users to dmp").And("model", model)); this.dmpService.inviteUsers(id, model); @@ -237,12 +234,12 @@ public class DmpController { new AbstractMap.SimpleEntry("model", model) )); - return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.SUCCESS_MESSAGE).payload("Invite Users Success")); + return true; } @GetMapping("{id}/token/{token}/invite-accept") @Transactional - public ResponseEntity> acceptInvitation(@PathVariable("id") UUID id, @PathVariable("token") String token) throws InvalidApplicationException, JAXBException, IOException { + public boolean acceptInvitation(@PathVariable("id") UUID id, @PathVariable("token") String token) throws InvalidApplicationException, JAXBException, IOException { logger.debug(new MapLogEntry("inviting users to dmp").And("id", id)); this.dmpService.dmpInvitationAccept(token); @@ -251,7 +248,7 @@ public class DmpController { new AbstractMap.SimpleEntry("token", token) )); - return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.SUCCESS_MESSAGE).payload("Invite Accept Success")); + return true; } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/EntityDoiController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/EntityDoiController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/EntityDoiController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/EntityDoiController.java index 31d0e87cd..4e8914dd4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/EntityDoiController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/EntityDoiController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.authorization.AuthorizationFlags; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ExternalValidationController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/ExternalValidationController.java similarity index 62% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ExternalValidationController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/ExternalValidationController.java index 919dfaa0b..2a0297821 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ExternalValidationController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/ExternalValidationController.java @@ -1,15 +1,11 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.authorization.Permission; import eu.eudat.commons.exceptions.HugeResultSetException; import eu.eudat.logic.services.ExternalValidationService; -import eu.eudat.models.old.helpers.responses.ResponseItem; -import eu.eudat.types.ApiMessageCode; import gr.cite.commons.web.authz.service.AuthorizationService; import gr.cite.tools.exception.MyNotFoundException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController @@ -26,13 +22,10 @@ public class ExternalValidationController { } @GetMapping(path = {""}, produces = "application/json") - public @ResponseBody - ResponseEntity> validate( - @RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type + public @ResponseBody Boolean validate(@RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type ) throws HugeResultSetException, MyNotFoundException { this.authorizationService.authorizeForce(Permission.AuthenticatedRole); - Boolean isValid = this.externalValidationService.validateIdentifier(query, type); - return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().payload(isValid).status(ApiMessageCode.NO_MESSAGE)); + return this.externalValidationService.validateIdentifier(query, type); } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/FileTransformerController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/FileTransformerController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/FileTransformerController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/FileTransformerController.java index 613a8c216..43f6ff731 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/FileTransformerController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/FileTransformerController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.file.transformer.models.misc.FileFormat; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/LanguageController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/LanguageController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java index d7223edf5..7b81bb6df 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/LanguageController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/LanguageController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import com.fasterxml.jackson.core.JsonProcessingException; import eu.eudat.audit.AuditableAction; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/LockController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/LockController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/LockController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/LockController.java index 68b8c68e0..cd298d48f 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/LockController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/LockController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.authorization.AuthorizationFlags; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/MaintenanceController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/MaintenanceController.java similarity index 98% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/MaintenanceController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/MaintenanceController.java index d7725e85c..768633f43 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/MaintenanceController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/MaintenanceController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.authorization.Permission; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/PrefillingController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/PrefillingController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/PrefillingController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/PrefillingController.java index 1505f8674..e43dca4c3 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/PrefillingController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/PrefillingController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import gr.cite.tools.validation.ValidationFilterAnnotation; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/PrincipalController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/PrincipalController.java similarity index 98% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/PrincipalController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/PrincipalController.java index 5d3078f1e..0ee3fd5b0 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/PrincipalController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/PrincipalController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.models.Account; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/ReferenceController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/ReferenceController.java index 1e38757f1..684102bb4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/ReferenceController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import com.fasterxml.jackson.core.JsonProcessingException; import eu.eudat.audit.AuditableAction; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceTypeController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/ReferenceTypeController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceTypeController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/ReferenceTypeController.java index 870c3e526..bde464354 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/ReferenceTypeController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/ReferenceTypeController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import com.fasterxml.jackson.core.JsonProcessingException; import eu.eudat.audit.AuditableAction; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/StorageFileController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/StorageFileController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/StorageFileController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/StorageFileController.java index f629a40f6..b8b2db6bf 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/StorageFileController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/StorageFileController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.authorization.Permission; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/SupportiveMaterialController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/SupportiveMaterialController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/SupportiveMaterialController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/SupportiveMaterialController.java index 266fe8985..1ff3c0007 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/SupportiveMaterialController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/SupportiveMaterialController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import com.fasterxml.jackson.core.JsonProcessingException; import eu.eudat.audit.AuditableAction; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/TagController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/TagController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java index de6117d74..ef8a9b4d0 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/TagController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/TagController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.authorization.AuthorizationFlags; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/TenantController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/TenantController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/TenantController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/TenantController.java index 83f0b9456..1dcbd2be4 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/TenantController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/TenantController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import com.fasterxml.jackson.core.JsonProcessingException; import eu.eudat.audit.AuditableAction; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/UserController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/UserController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/UserController.java index 1ab597f1a..783758510 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/UserController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import com.fasterxml.jackson.core.JsonProcessingException; import eu.eudat.audit.AuditableAction; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/UserSettingsController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserSettingsController.java similarity index 99% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/v2/UserSettingsController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/UserSettingsController.java index e674d3f81..fc6c83d97 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/v2/UserSettingsController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/UserSettingsController.java @@ -1,4 +1,4 @@ -package eu.eudat.controllers.v2; +package eu.eudat.controllers; import eu.eudat.audit.AuditableAction; import eu.eudat.authorization.AuthorizationFlags; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/old/CurrencyController.java similarity index 55% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/old/CurrencyController.java index 26c58cac1..af62b03c8 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/CurrencyController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/old/CurrencyController.java @@ -1,12 +1,8 @@ -package eu.eudat.controllers; +package eu.eudat.controllers.old; import eu.eudat.logic.managers.LocalFetchManager; -import eu.eudat.models.old.helpers.responses.ResponseItem; import eu.eudat.models.old.local.LocalFetchModel; -import eu.eudat.types.ApiMessageCode; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; import java.util.List; @@ -24,8 +20,8 @@ public class CurrencyController { } @RequestMapping(method = RequestMethod.GET) - public ResponseEntity>> getCurrencies( @RequestParam(value = "query", required = false) String query) throws Exception { + public List getCurrencies( @RequestParam(value = "query", required = false) String query) throws Exception { List currencies = localFetchManager.getCurrency(query); - return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem>().status(ApiMessageCode.NO_MESSAGE).payload(currencies)); + return currencies; } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/ManagementController.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/old/ManagementController.java similarity index 63% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/ManagementController.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/old/ManagementController.java index 786f5b955..5b839e32a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/ManagementController.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/old/ManagementController.java @@ -1,14 +1,10 @@ -package eu.eudat.controllers; +package eu.eudat.controllers.old; import eu.eudat.authorization.Permission; import eu.eudat.logic.managers.DatasetProfileManager; -import eu.eudat.models.old.helpers.responses.ResponseItem; -import eu.eudat.types.ApiMessageCode; import gr.cite.commons.web.authz.service.AuthorizationService; import jakarta.transaction.Transactional; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.CrossOrigin; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMethod; @@ -30,25 +26,25 @@ public class ManagementController{ @Transactional @RequestMapping(method = RequestMethod.POST, value = {"/addSemantics"}) - public ResponseEntity addSemanticsInDatasetProfiles() throws Exception { + public boolean addSemanticsInDatasetProfiles() throws Exception { this.authorizationService.authorizeForce(Permission.AdminRole); try { this.datasetProfileManager.addSemanticsInDatasetProfiles(); - return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.SUCCESS_MESSAGE)); + return true; } catch (Exception exception) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem().status(ApiMessageCode.ERROR_MESSAGE).message(exception.getMessage())); + return false; } } @Transactional @RequestMapping(method = RequestMethod.POST, value = {"/addRdaInSemantics"}) - public ResponseEntity addRdaInSemanticsInDatasetProfiles() throws Exception { + public boolean addRdaInSemanticsInDatasetProfiles() throws Exception { this.authorizationService.authorizeForce(Permission.AdminRole); try { this.datasetProfileManager.addRdaInSemanticsInDatasetProfiles(); - return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().status(ApiMessageCode.SUCCESS_MESSAGE)); + return true; } catch (Exception exception) { - return ResponseEntity.status(HttpStatus.BAD_REQUEST).body(new ResponseItem().status(ApiMessageCode.ERROR_MESSAGE).message(exception.getMessage())); + return false; } } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/Validation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/old/Validation.java similarity index 75% rename from dmp-backend/web/src/main/java/eu/eudat/controllers/Validation.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/old/Validation.java index cc22a105f..029940c2a 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/Validation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/old/Validation.java @@ -1,15 +1,11 @@ -package eu.eudat.controllers; +package eu.eudat.controllers.old; import eu.eudat.authorization.Permission; import eu.eudat.logic.managers.ValidationManager; import eu.eudat.commons.exceptions.HugeResultSetException; -import eu.eudat.models.old.helpers.responses.ResponseItem; -import eu.eudat.types.ApiMessageCode; import gr.cite.commons.web.authz.service.AuthorizationService; import gr.cite.tools.exception.MyNotFoundException; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.http.HttpStatus; -import org.springframework.http.ResponseEntity; import org.springframework.web.bind.annotation.*; @RestController @@ -28,13 +24,13 @@ public class Validation { @RequestMapping(method = RequestMethod.GET, value = {"/external/validation"}, produces = "application/json") public @ResponseBody - ResponseEntity> validate( + Boolean validate( @RequestParam(value = "query", required = false) String query, @RequestParam(value = "type", required = false) String type ) throws HugeResultSetException, MyNotFoundException { this.authorizationService.authorizeForce(Permission.AuthenticatedRole); Boolean isValid = this.validationManager.validateIdentifier(query, type); - return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem().payload(isValid).status(ApiMessageCode.NO_MESSAGE)); + return isValid; } } diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/PublicDatasetsDescriptionDocumentation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/PublicDatasetsDescriptionDocumentation.java index 44c572765..4522d2ae5 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/PublicDatasetsDescriptionDocumentation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/PublicDatasetsDescriptionDocumentation.java @@ -15,13 +15,13 @@ import eu.eudat.model.mapper.publicapi.DescriptionToPublicApiDatasetMapper; import eu.eudat.model.mapper.publicapi.DmpToPublicApiDmpListingMapper; import eu.eudat.model.publicapi.listingmodels.DatasetPublicListingModel; import eu.eudat.model.publicapi.overviewmodels.DatasetPublicModel; -import eu.eudat.models.old.helpers.responses.ResponseItem; +import eu.eudat.controllers.publicapi.types.ResponseItem; import eu.eudat.query.DescriptionQuery; import eu.eudat.query.DmpQuery; import eu.eudat.query.lookup.DescriptionLookup; import eu.eudat.query.lookup.DmpLookup; import eu.eudat.service.publicapi.PublicApiProperties; -import eu.eudat.types.ApiMessageCode; +import eu.eudat.controllers.publicapi.types.ApiMessageCode; import gr.cite.tools.data.builder.BuilderFactory; import gr.cite.tools.data.query.QueryFactory; import gr.cite.tools.exception.MyNotFoundException; diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/PublicDmpsDocumentation.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/PublicDmpsDocumentation.java index 2435bd091..87274ad75 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/PublicDmpsDocumentation.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/PublicDmpsDocumentation.java @@ -15,13 +15,13 @@ import eu.eudat.model.publicapi.listingmodels.DataManagementPlanPublicListingMod import eu.eudat.model.publicapi.overviewmodels.DataManagementPlanPublicModel; import eu.eudat.model.referencedefinition.Definition; import eu.eudat.model.referencedefinition.Field; -import eu.eudat.models.old.helpers.responses.ResponseItem; +import eu.eudat.controllers.publicapi.types.ResponseItem; import eu.eudat.query.DmpDescriptionTemplateQuery; import eu.eudat.query.DmpQuery; import eu.eudat.query.EntityDoiQuery; import eu.eudat.query.lookup.DmpLookup; import eu.eudat.service.publicapi.PublicApiProperties; -import eu.eudat.types.ApiMessageCode; +import eu.eudat.controllers.publicapi.types.ApiMessageCode; import gr.cite.tools.data.builder.BuilderFactory; import gr.cite.tools.data.query.QueryFactory; import gr.cite.tools.exception.MyNotFoundException; diff --git a/dmp-backend/web/src/main/java/eu/eudat/types/ApiMessageCode.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/types/ApiMessageCode.java similarity index 95% rename from dmp-backend/web/src/main/java/eu/eudat/types/ApiMessageCode.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/types/ApiMessageCode.java index f08959b06..30abb3549 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/types/ApiMessageCode.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/types/ApiMessageCode.java @@ -1,4 +1,4 @@ -package eu.eudat.types; +package eu.eudat.controllers.publicapi.types; public enum ApiMessageCode { NO_MESSAGE(0), SUCCESS_MESSAGE(200), WARN_MESSAGE(300), ERROR_MESSAGE(400), diff --git a/dmp-backend/web/src/main/java/eu/eudat/types/ApiResponseType.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/types/ApiResponseType.java similarity index 93% rename from dmp-backend/web/src/main/java/eu/eudat/types/ApiResponseType.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/types/ApiResponseType.java index 501ed62fa..6cb525491 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/types/ApiResponseType.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/types/ApiResponseType.java @@ -1,4 +1,4 @@ -package eu.eudat.types; +package eu.eudat.controllers.publicapi.types; /** * Created by ikalyvas on 3/5/2018. diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/old/helpers/responses/ResponseItem.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/types/ResponseItem.java similarity index 91% rename from dmp-backend/web/src/main/java/eu/eudat/models/old/helpers/responses/ResponseItem.java rename to dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/types/ResponseItem.java index 7bc1539d3..d906b533c 100644 --- a/dmp-backend/web/src/main/java/eu/eudat/models/old/helpers/responses/ResponseItem.java +++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/publicapi/types/ResponseItem.java @@ -1,7 +1,4 @@ -package eu.eudat.models.old.helpers.responses; - -import eu.eudat.types.ApiMessageCode; -import eu.eudat.types.ApiResponseType; +package eu.eudat.controllers.publicapi.types; public class ResponseItem { diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/old/dashboard/recent/RecentActivityData.java b/dmp-backend/web/src/main/java/eu/eudat/models/old/dashboard/recent/RecentActivityData.java deleted file mode 100644 index 2b4bc9075..000000000 --- a/dmp-backend/web/src/main/java/eu/eudat/models/old/dashboard/recent/RecentActivityData.java +++ /dev/null @@ -1,38 +0,0 @@ -package eu.eudat.models.old.dashboard.recent; - -import java.util.Date; - -/** - * Created by ikalyvas on 3/14/2018. - */ -public class RecentActivityData { - - private String label; - private String id; - private Date timestamp; - - public String getId() { - return id; - } - - public void setId(String id) { - this.id = id; - } - - public Date getTimestamp() { - return timestamp; - } - - public void setTimestamp(Date timestamp) { - this.timestamp = timestamp; - } - - public String getLabel() { - return label; - } - - public void setLabel(String label) { - this.label = label; - } - -} diff --git a/dmp-backend/web/src/main/java/eu/eudat/models/old/helpers/common/DataTableData.java b/dmp-backend/web/src/main/java/eu/eudat/models/old/helpers/common/DataTableData.java deleted file mode 100644 index fc176523e..000000000 --- a/dmp-backend/web/src/main/java/eu/eudat/models/old/helpers/common/DataTableData.java +++ /dev/null @@ -1,24 +0,0 @@ -package eu.eudat.models.old.helpers.common; - -import java.util.List; - -public class DataTableData { - private Long totalCount; - private List data; - - public Long getTotalCount() { - return totalCount; - } - - public void setTotalCount(Long totalCount) { - this.totalCount = totalCount; - } - - public List getData() { - return data; - } - - public void setData(List data) { - this.data = data; - } -}