diff --git a/backend/core/src/main/java/org/opencdmp/commons/enums/ActionConfirmationType.java b/backend/core/src/main/java/org/opencdmp/commons/enums/ActionConfirmationType.java index 15eed455e..37ac7b759 100644 --- a/backend/core/src/main/java/org/opencdmp/commons/enums/ActionConfirmationType.java +++ b/backend/core/src/main/java/org/opencdmp/commons/enums/ActionConfirmationType.java @@ -20,7 +20,7 @@ public enum ActionConfirmationType implements DatabaseEnum { @Override @JsonValue public Short getValue() { - return value; + return this.value; } private static final Map map = EnumUtils.getEnumValueMap(ActionConfirmationType.class); diff --git a/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java b/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java index a8c503914..d34503e54 100644 --- a/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java +++ b/backend/core/src/main/java/org/opencdmp/service/user/UserServiceImpl.java @@ -536,9 +536,6 @@ public class UserServiceImpl implements UserService { fieldInfoList.add(new FieldInfo("{userName}", DataType.String, currentUser.getName())); fieldInfoList.add(new FieldInfo("{confirmationToken}", DataType.String, token)); fieldInfoList.add(new FieldInfo("{expiration_time}", DataType.String, this.secondsToTime(this.notificationProperties.getEmailExpirationTimeSeconds()))); - if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){ - fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode()))); - } data.setFields(fieldInfoList); event.setData(this.jsonHandlingService.toJsonSafe(data)); this.eventHandler.handle(event); @@ -563,9 +560,6 @@ public class UserServiceImpl implements UserService { List fieldInfoList = new ArrayList<>(); fieldInfoList.add(new FieldInfo("{confirmationToken}", DataType.String, token)); fieldInfoList.add(new FieldInfo("{expiration_time}", DataType.String, this.secondsToTime(this.notificationProperties.getEmailExpirationTimeSeconds()))); - if(this.tenantScope.getTenantCode() != null && !this.tenantScope.getTenantCode().equals(this.tenantScope.getDefaultTenantCode())){ - fieldInfoList.add(new FieldInfo("{tenant-url-path}", DataType.String, String.format("/t/%s", this.tenantScope.getTenantCode()))); - } data.setFields(fieldInfoList); event.setData(this.jsonHandlingService.toJsonSafe(data)); this.eventHandler.handle(event); @@ -579,9 +573,14 @@ public class UserServiceImpl implements UserService { persist.setMergeAccountConfirmation(new MergeAccountConfirmationPersist()); persist.getMergeAccountConfirmation().setEmail(email); persist.setExpiresAt(Instant.now().plusSeconds(this.notificationProperties.getEmailExpirationTimeSeconds())); - this.validatorFactory.validator(ActionConfirmationPersist.ActionConfirmationPersistValidator.class).validateForce(persist); + this.validatorFactory.validator(ActionConfirmationPersist.ActionConfirmationPersistValidator.class).validateForce(persist); this.actionConfirmationService.persist(persist, null); - + + try { + this.entityManager.disableTenantFilters(); + } finally { + this.entityManager.reloadTenantFilters(); + } return persist.getToken(); } @@ -593,9 +592,13 @@ public class UserServiceImpl implements UserService { persist.setRemoveCredentialRequest(new RemoveCredentialRequestPersist()); persist.getRemoveCredentialRequest().setCredentialId(credentialId); persist.setExpiresAt(Instant.now().plusSeconds(this.notificationProperties.getEmailExpirationTimeSeconds())); - this.validatorFactory.validator(ActionConfirmationPersist.ActionConfirmationPersistValidator.class).validateForce(persist); - this.actionConfirmationService.persist(persist, null); - + this.validatorFactory.validator(ActionConfirmationPersist.ActionConfirmationPersistValidator.class).validateForce(persist); + try { + this.entityManager.disableTenantFilters(); + this.actionConfirmationService.persist(persist, null); + } finally { + this.entityManager.reloadTenantFilters(); + } return persist.getToken(); } @@ -614,9 +617,14 @@ public class UserServiceImpl implements UserService { } public void confirmMergeAccount(String token) throws IOException, InvalidApplicationException { - ActionConfirmationEntity action = this.queryFactory.query(ActionConfirmationQuery.class).tokens(token).types(ActionConfirmationType.MergeAccount).isActive(IsActive.Active).first(); + ActionConfirmationEntity action; + try { + this.entityManager.disableTenantFilters(); + action = this.queryFactory.query(ActionConfirmationQuery.class).tokens(token).types(ActionConfirmationType.MergeAccount).isActive(IsActive.Active).first(); + } finally { + this.entityManager.reloadTenantFilters(); + } if (action == null) throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{token, ActionConfirmationEntity.class.getSimpleName()}, LocaleContextHolder.getLocale())); - this.checkActionState(action); MergeAccountConfirmationEntity mergeAccountConfirmationEntity = this.xmlHandlingService.fromXmlSafe(MergeAccountConfirmationEntity.class, action.getData()); @@ -637,11 +645,17 @@ public class UserServiceImpl implements UserService { this.mergeNewUserToOld(newUser, userToBeMerge); } - action.setUpdatedAt(Instant.now()); - action.setStatus(ActionConfirmationStatus.Accepted); - this.entityManager.merge(action); - this.entityManager.flush(); + try { + this.entityManager.disableTenantFilters(); + action.setUpdatedAt(Instant.now()); + action.setStatus(ActionConfirmationStatus.Accepted); + this.entityManager.merge(action); + + this.entityManager.flush(); + } finally { + this.entityManager.reloadTenantFilters(); + } this.userTouchedIntegrationEventHandler.handle(newUser.getId()); this.userRemovalIntegrationEventHandler.handle(userToBeMerge.getId()); @@ -805,9 +819,15 @@ public class UserServiceImpl implements UserService { } public void confirmRemoveCredential(String token) throws InvalidApplicationException { - ActionConfirmationEntity action = this.queryFactory.query(ActionConfirmationQuery.class).tokens(token).types(ActionConfirmationType.RemoveCredential).isActive(IsActive.Active).first(); + ActionConfirmationEntity action; + try { + this.entityManager.disableTenantFilters(); + action = this.queryFactory.query(ActionConfirmationQuery.class).tokens(token).types(ActionConfirmationType.RemoveCredential).isActive(IsActive.Active).first(); + } finally { + this.entityManager.reloadTenantFilters(); + } if (action == null) throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{token, ActionConfirmationEntity.class.getSimpleName()}, LocaleContextHolder.getLocale())); - + this.checkActionState(action); RemoveCredentialRequestEntity removeCredentialRequestEntity = this.xmlHandlingService.fromXmlSafe(RemoveCredentialRequestEntity.class, action.getData()); @@ -828,11 +848,17 @@ public class UserServiceImpl implements UserService { } this.deleterFactory.deleter(UserCredentialDeleter.class).delete(List.of(userCredentialEntity)); - action.setUpdatedAt(Instant.now()); - action.setStatus(ActionConfirmationStatus.Accepted); - this.entityManager.merge(action); - this.entityManager.flush(); + + try { + this.entityManager.disableTenantFilters(); + action.setUpdatedAt(Instant.now()); + action.setStatus(ActionConfirmationStatus.Accepted); + this.entityManager.merge(action); + this.entityManager.flush(); + } finally { + this.entityManager.reloadTenantFilters(); + } this.userTouchedIntegrationEventHandler.handle(userCredentialEntity.getUserId()); @@ -854,10 +880,16 @@ public class UserServiceImpl implements UserService { } } - private UserEntity getUserEntityFromToken(String token) throws MyForbiddenException, MyNotFoundException { - ActionConfirmationEntity action = this.queryFactory.query(ActionConfirmationQuery.class).tokens(token).types(ActionConfirmationType.MergeAccount).isActive(IsActive.Active).first(); + private UserEntity getUserEntityFromToken(String token) throws MyForbiddenException, MyNotFoundException, InvalidApplicationException { + ActionConfirmationEntity action; + try { + this.entityManager.disableTenantFilters(); + action = this.queryFactory.query(ActionConfirmationQuery.class).tokens(token).types(ActionConfirmationType.MergeAccount).isActive(IsActive.Active).first(); + } finally { + this.entityManager.reloadTenantFilters(); + } if (action == null) throw new MyNotFoundException(this.messageSource.getMessage("General_ItemNotFound", new Object[]{token, ActionConfirmationEntity.class.getSimpleName()}, LocaleContextHolder.getLocale())); - + this.checkActionState(action); MergeAccountConfirmationEntity mergeAccountConfirmationEntity = this.xmlHandlingService.fromXmlSafe(MergeAccountConfirmationEntity.class, action.getData()); diff --git a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java index 40985a172..e49571637 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/DescriptionController.java @@ -16,6 +16,7 @@ import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Parameter; import io.swagger.v3.oas.annotations.media.Content; import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.responses.ApiResponse; import io.swagger.v3.oas.annotations.tags.Tag; import jakarta.xml.bind.JAXBException; import org.opencdmp.audit.AuditableAction; @@ -24,6 +25,8 @@ import org.opencdmp.commons.enums.DmpAccessType; import org.opencdmp.commons.enums.DmpStatus; import org.opencdmp.commons.enums.IsActive; import org.opencdmp.controllers.swagger.SwaggerHelpers; +import org.opencdmp.controllers.swagger.annotation.Swagger404; +import org.opencdmp.controllers.swagger.annotation.SwaggerErrorResponses; import org.opencdmp.convention.ConventionService; import org.opencdmp.data.StorageFileEntity; import org.opencdmp.model.DescriptionValidationResult; @@ -72,6 +75,7 @@ import static org.opencdmp.authorization.AuthorizationFlags.Public; @RestController @RequestMapping(path = "api/description") @Tag(name = "Descriptions", description = "Manage descriptions") +@SwaggerErrorResponses public class DescriptionController { private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(DescriptionController.class)); @@ -166,7 +170,24 @@ public class DescriptionController { } ) } - ) + ), + responses = { + @ApiResponse( + description = "OK", + responseCode = "200", + content = { + @Content( + examples = { + @ExampleObject( + name = "First page", + description = "Example with the first page of paginated results", + value = SwaggerHelpers.Description.endpoint_query_response_example + ) + } + ) + } + ) + } ) public QueryResult query(@RequestBody DescriptionLookup lookup) throws MyApplicationException, MyForbiddenException { logger.debug("querying {}", Description.class.getSimpleName()); @@ -183,6 +204,7 @@ public class DescriptionController { @GetMapping("{id}") @Operation(summary = "Fetch a specific description by id") + @Swagger404 public Description get( @Parameter(name = "id", description = "The id of a description to fetch", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("id") UUID id, @Parameter(name = "fieldSet", description = SwaggerHelpers.Commons.fieldset_description, required = true) FieldSet fieldSet @@ -207,6 +229,7 @@ public class DescriptionController { @PostMapping("persist") @Operation(summary = "Create a new or update an existing description") + @Swagger404 @Transactional @ValidationFilterAnnotation(validator = DescriptionPersist.DescriptionPersistValidator.ValidatorName, argumentName = "model") public Description persist( @@ -228,6 +251,7 @@ public class DescriptionController { @PostMapping("persist-status") @Operation(summary = "Update the status of an existing description") + @Swagger404 @Transactional @ValidationFilterAnnotation(validator = DescriptionStatusPersist.DescriptionStatusPersistValidator.ValidatorName, argumentName = "model") public Description persistStatus( @@ -281,6 +305,7 @@ public class DescriptionController { @DeleteMapping("{id}") @Operation(summary = "Delete a description by id") + @Swagger404 @Transactional public void delete( @Parameter(name = "id", description = "The id of a description to delete", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("id") UUID id @@ -294,6 +319,7 @@ public class DescriptionController { @GetMapping("{id}/export/{type}") @Operation(summary = "Export a description in various formats by id") + @Swagger404 public ResponseEntity export( @Parameter(name = "id", description = "The id of a description to export", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("id") UUID id, @Parameter(name = "type", description = "The type of the export", example = "rda", required = true) @PathVariable("type") String exportType @@ -305,6 +331,7 @@ public class DescriptionController { @PostMapping("field-file/upload") @Operation(summary = "Upload a file attachment on a field that supports it") + @Swagger404 @Transactional @ValidationFilterAnnotation(validator = DescriptionFieldFilePersist.PersistValidator.ValidatorName, argumentName = "model") public StorageFile uploadFieldFiles( @@ -327,6 +354,7 @@ public class DescriptionController { @GetMapping("{id}/field-file/{fileId}") @Operation(summary = "Fetch a field file attachment as byte array") + @Swagger404 public ResponseEntity getFieldFile( @Parameter(name = "id", description = "The id of a description", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("id") UUID id, @Parameter(name = "fileIid", description = "The id of the file we want to fetch", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("fileId") UUID fileId @@ -353,6 +381,7 @@ public class DescriptionController { @PostMapping("update-description-template") @Operation(summary = "Change the template of a description") + @Swagger404 @Transactional @ValidationFilterAnnotation(validator = UpdateDescriptionTemplatePersist.UpdateDescriptionTemplatePersistValidator.ValidatorName, argumentName = "model") public Boolean updateDescriptionTemplate(@RequestBody UpdateDescriptionTemplatePersist model) throws MyApplicationException, MyForbiddenException, MyNotFoundException, InvalidApplicationException, IOException, JAXBException { @@ -368,6 +397,7 @@ public class DescriptionController { @RequestMapping(method = RequestMethod.GET, value = "/xml/export/{id}", produces = "application/xml") @Operation(summary = "Export a description in xml format by id") + @Swagger404 public @ResponseBody ResponseEntity getXml( @Parameter(name = "id", description = "The id of a description to export", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable UUID id ) throws JAXBException, ParserConfigurationException, IOException, InstantiationException, IllegalAccessException, SAXException, InvalidApplicationException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/DmpController.java b/backend/web/src/main/java/org/opencdmp/controllers/DmpController.java index 08c00e7d5..3aff64573 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/DmpController.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/DmpController.java @@ -25,6 +25,8 @@ import org.opencdmp.commons.enums.DmpAccessType; import org.opencdmp.commons.enums.DmpStatus; import org.opencdmp.commons.enums.IsActive; import org.opencdmp.controllers.swagger.SwaggerHelpers; +import org.opencdmp.controllers.swagger.annotation.Swagger404; +import org.opencdmp.controllers.swagger.annotation.SwaggerErrorResponses; import org.opencdmp.model.DescriptionsToBeFinalized; import org.opencdmp.model.DmpUser; import org.opencdmp.model.DmpValidationResult; @@ -66,6 +68,7 @@ import static org.opencdmp.authorization.AuthorizationFlags.Public; @RestController @RequestMapping(path = "api/dmp") @Tag(name = "Plans", description = "Manage plans") +@SwaggerErrorResponses public class DmpController { private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(DmpController.class)); @@ -189,6 +192,7 @@ public class DmpController { @GetMapping("{id}") @Operation(summary = "Fetch a specific plan by id") + @Swagger404() public Dmp Get( @Parameter(name = "id", description = "The id of a plan to fetch", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("id") UUID id, @Parameter(name = "fieldSet", description = SwaggerHelpers.Commons.fieldset_description, required = true) FieldSet fieldSet, @@ -213,6 +217,7 @@ public class DmpController { @PostMapping("persist") @Operation(summary = "Create a new or update an existing plan") + @Swagger404 @Transactional @ValidationFilterAnnotation(validator = DmpPersist.DmpPersistValidator.ValidatorName, argumentName = "model") public Dmp Persist( @@ -233,6 +238,7 @@ public class DmpController { @DeleteMapping("{id}") @Operation(summary = "Delete a plan by id") + @Swagger404 @Transactional public void Delete( @Parameter(name = "id", description = "The id of a plan to delete", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("id") UUID id @@ -246,6 +252,7 @@ public class DmpController { @PostMapping("finalize/{id}") @Operation(summary = "Finalize a plan by id") + @Swagger404 @Transactional public boolean finalize( @Parameter(name = "id", description = "The id of a plan to finalize", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("id") UUID id, @@ -265,6 +272,7 @@ public class DmpController { @GetMapping("undo-finalize/{id}") @Operation(summary = "Undo the finalization of a plan by id (only possible if it is not already deposited)") + @Swagger404 @Transactional public boolean undoFinalize( @Parameter(name = "id", description = "The id of a plan to revert the finalization", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("id") UUID id, @@ -302,6 +310,7 @@ public class DmpController { @PostMapping("clone") @Operation(summary = "Create a clone of an existing plan") + @Swagger404 @Transactional @ValidationFilterAnnotation(validator = CloneDmpPersist.CloneDmpPersistValidator.ValidatorName, argumentName = "model") public Dmp buildClone( @@ -324,6 +333,7 @@ public class DmpController { @PostMapping("new-version") @Operation(summary = "Create a new version of an existing plan") + @Swagger404 @Transactional @ValidationFilterAnnotation(validator = NewVersionDmpPersist.NewVersionDmpPersistValidator.ValidatorName, argumentName = "model") public Dmp createNewVersion( @@ -380,6 +390,7 @@ public class DmpController { @GetMapping("{id}/export/{transformerId}/{type}") @Operation(summary = "Export a plan in various formats by id") + @Swagger404 public ResponseEntity export( @Parameter(name = "id", description = "The id of a plan to export", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable("id") UUID id, @PathVariable("transformerId") String transformerId, @@ -431,6 +442,7 @@ public class DmpController { @RequestMapping(method = RequestMethod.GET, value = "/xml/export/{id}", produces = "application/xml") @Operation(summary = "Export a plan in xml format by id") + @Swagger404 public @ResponseBody ResponseEntity getXml( @Parameter(name = "id", description = "The id of a plan to export", example = "c0c163dc-2965-45a5-9608-f76030578609", required = true) @PathVariable UUID id ) throws JAXBException, ParserConfigurationException, IOException, InstantiationException, IllegalAccessException, SAXException, InvalidApplicationException { diff --git a/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java b/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java index 55dc8a1e8..6f12eb981 100644 --- a/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java +++ b/backend/web/src/main/java/org/opencdmp/controllers/swagger/SwaggerHelpers.java @@ -3,13 +3,42 @@ package org.opencdmp.controllers.swagger; public class SwaggerHelpers { public static class Commons { + public static final String fieldset_description = """ - This is an object containing a list of the properties you wish to include in the response, similar to the 'project' attribute on queries. - """; + This is an object containing a list of the properties you wish to include in the response, similar to the 'project' attribute on queries. + """; + } + + public static class Errors { + + public static final String message_403 = + """ + { + "code": 403 + "message" null + } + """; + + public static final String message_404 = + """ + { + "code": 404, + "message": "Item {0} of type {1} not found" + } + """; + + public static final String message_500 = + """ + { + "error": "System error" + } + """; + } public static class Dmp { + public static final String endpoint_query = """ This endpoint is used to fetch all the available plans.
@@ -171,695 +200,695 @@ public class SwaggerHelpers { public static final String endpoint_query_response_example = """ - { - "items":[ - { - "id":"dbc5057b-d33e-4a2c-8963-e882da6765a0", - "label":"blueprint test with deleted description template", - "version":1, - "status":0, - "versionStatus":2, - "groupId":"dae2fd0b-74a4-4bde-b021-9ea44e033866", - "description":"blueprint test with deleted description template", - "updatedAt":"2024-06-06T12:35:57.293416Z", - "blueprint":{ - "id":"6fbfd40a-b41a-4928-b4b5-67d28bdba2ce", - "label":"test_for_plan_manager_role_new_v2 new ", - "definition":{ - "sections":[ - { - "id":"843c4181-dbe2-4e18-a1e4-cf178199947c", - "label":"1", - "hasTemplates":true, - "descriptionTemplates":[ - { - "descriptionTemplateGroupId":"3689bcce-405a-4d55-9854-669597b79c0a" - }, - { - "descriptionTemplateGroupId":"2a38d018-8e81-4ba2-80b2-4395a1d1b238" - } - ] - } - ] - } - }, - "hash":"1717677357", - "dmpUsers":[ - { - "id":"a61fdc31-fb1e-4cee-9c0a-a0a317b27b62", - "dmp":{ - "id":"dbc5057b-d33e-4a2c-8963-e882da6765a0" - }, - "user":{ - "id":"e60876ed-87f8-4a8e-8081-e5620ec839cf" - }, - "role":0, - "isActive":1 - } - ], - "dmpDescriptionTemplates":[ - { - "dmp":{ - \s - }, - "sectionId":"843c4181-dbe2-4e18-a1e4-cf178199947c", - "descriptionTemplateGroupId":"2a38d018-8e81-4ba2-80b2-4395a1d1b238", - "isActive":1 - }, - { - "dmp":{ - \s - }, - "sectionId":"843c4181-dbe2-4e18-a1e4-cf178199947c", - "descriptionTemplateGroupId":"3689bcce-405a-4d55-9854-669597b79c0a", - "isActive":0 - } - ], - "authorizationFlags":[ - "InviteDmpUsers", - "CreateNewVersionDmp", - "AssignDmpUsers", - "DeleteDmp", - "FinalizeDmp", - "CloneDmp", - "ExportDmp", - "EditDmp" - ], - "belongsToCurrentTenant":true - }, - { - "id":"d3d5cba3-50d0-4dcd-9660-b7bcfac51316", - "label":"description_template_delete_plan_New_v2.xml", - "version":1, - "status":0, - "versionStatus":2, - "groupId":"5ab5d0ca-5c8e-4450-bf3b-a701ceadfabb", - "description":"description template delete plan", - "updatedAt":"2024-06-06T12:30:24.936458Z", - "accessType":0, - "blueprint":{ - "id":"86635178-36a6-484f-9057-a934e4eeecd5", - "label":"Dmp Default Blueprint", - "definition":{ - "sections":[ - { - "id":"f94e50e0-cb97-4c65-8b88-e5db6badd41d", - "label":"Main Info", - "hasTemplates":false - }, - { - "id":"3c2608e5-9320-4d94-9ed7-1eab9500d84b", - "label":"Funding", - "hasTemplates":false - }, - { - "id":"2a77e1f6-9989-4aeb-acd9-48e911a92abd", - "label":"License", - "hasTemplates":false - }, - { - "id":"0db7845b-0e7c-41df-8d91-cbca97995fd5", - "label":"Templates", - "hasTemplates":true - } - ] - } - }, - "hash":"1717677024", - "dmpReferences":[ - { - "id":"0c470488-14ba-4c7e-8cf2-0f6f849ee56e", - "dmp":{ - \s - }, - "reference":{ - "id":"08577246-b50b-44ea-9bed-641ea4e40fe7", - "label":"unidentified", - "type":{ - "id":"5b9c284f-f041-4995-96cc-fad7ad13289c" - } - }, - "isActive":1 - }, - { - "id":"62211794-787c-407c-9512-05c2d60d410b", - "dmp":{ - \s - }, - "reference":{ - "id":"32c87599-e375-4294-a7cf-3db8722bd675", - "label":"APC Microbiome Institute||", - "type":{ - "id":"538928bb-c7c6-452e-b66d-08e539f5f082" - } - }, - "isActive":1 - } - ], - "dmpUsers":[ - { - "id":"313865d6-6a72-449f-ac04-1834d2f03b02", - "dmp":{ - "id":"d3d5cba3-50d0-4dcd-9660-b7bcfac51316" - }, - "user":{ - "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" - }, - "role":0, - "isActive":1 - } - ], - "descriptions":[ - { - "id":"1dc4e3e8-c125-4db8-a937-041405aaf5ec", - "label":"description template test", - "status":0, - "isActive":0, - "descriptionTemplate":{ - "groupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e" - }, - "dmp":{ - \s - } - }, - { - "id":"0059fa07-5698-42ba-958a-428b226ddcab", - "label":"test3v2 description template", - "status":0, - "isActive":1, - "descriptionTemplate":{ - "groupId":"2a38d018-8e81-4ba2-80b2-4395a1d1b238" - }, - "dmp":{ - \s - } - } - ], - "dmpDescriptionTemplates":[ - { - "dmp":{ - \s - }, - "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", - "descriptionTemplateGroupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e", - "isActive":0 - }, - { - "dmp":{ - \s - }, - "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", - "descriptionTemplateGroupId":"2a38d018-8e81-4ba2-80b2-4395a1d1b238", - "isActive":1 - } - ], - "authorizationFlags":[ - "InviteDmpUsers", - "CreateNewVersionDmp", - "AssignDmpUsers", - "DeleteDmp", - "FinalizeDmp", - "CloneDmp", - "ExportDmp", - "EditDmp" - ], - "belongsToCurrentTenant":true - }, - { - "id":"2ebbb8ac-742d-413a-a3e2-1cb21d555b3f", - "label":"description template delete plan New v2", - "version":2, - "status":0, - "versionStatus":2, - "groupId":"cf177996-f68c-4375-bf53-161953dadfc2", - "description":"description template delete plan", - "updatedAt":"2024-06-06T11:59:21.396453Z", - "accessType":0, - "blueprint":{ - "id":"86635178-36a6-484f-9057-a934e4eeecd5", - "label":"Dmp Default Blueprint", - "definition":{ - "sections":[ - { - "id":"f94e50e0-cb97-4c65-8b88-e5db6badd41d", - "label":"Main Info", - "hasTemplates":false - }, - { - "id":"3c2608e5-9320-4d94-9ed7-1eab9500d84b", - "label":"Funding", - "hasTemplates":false - }, - { - "id":"2a77e1f6-9989-4aeb-acd9-48e911a92abd", - "label":"License", - "hasTemplates":false - }, - { - "id":"0db7845b-0e7c-41df-8d91-cbca97995fd5", - "label":"Templates", - "hasTemplates":true - } - ] - } - }, - "hash":"1717675161", - "dmpReferences":[ - { - "id":"5cd1a1c3-bd9b-4a89-9329-ab3f152eebc7", - "dmp":{ - \s - }, - "reference":{ - "id":"32c87599-e375-4294-a7cf-3db8722bd675", - "label":"APC Microbiome Institute||", - "type":{ - "id":"538928bb-c7c6-452e-b66d-08e539f5f082" - } - }, - "isActive":1 - }, - { - "id":"0e5d165f-b8ae-44a2-8d90-5e8e1037caa7", - "dmp":{ - \s - }, - "reference":{ - "id":"08577246-b50b-44ea-9bed-641ea4e40fe7", - "label":"unidentified", - "type":{ - "id":"5b9c284f-f041-4995-96cc-fad7ad13289c" - } - }, - "isActive":1 - } - ], - "dmpUsers":[ - { - "id":"83b1680d-3d9a-4610-82d5-8fe0132f2a0b", - "dmp":{ - "id":"2ebbb8ac-742d-413a-a3e2-1cb21d555b3f" - }, - "user":{ - "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" - }, - "role":0, - "isActive":1 - } - ], - "descriptions":[ - { - "id":"2620507c-cb8b-4d67-bb42-64a702932b0a", - "label":"description template test", - "status":0, - "isActive":1, - "descriptionTemplate":{ - "groupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e" - }, - "dmp":{ - \s - } - } - ], - "dmpDescriptionTemplates":[ - { - "dmp":{ - \s - }, - "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", - "descriptionTemplateGroupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e", - "isActive":1 - } - ], - "authorizationFlags":[ - "InviteDmpUsers", - "CreateNewVersionDmp", - "AssignDmpUsers", - "DeleteDmp", - "FinalizeDmp", - "CloneDmp", - "ExportDmp", - "EditDmp" - ], - "belongsToCurrentTenant":true - }, - { - "id":"68e9aae2-f2f9-4d51-b5f4-9a0216efb00c", - "label":"description template delete plan New", - "version":1, - "status":1, - "versionStatus":0, - "groupId":"cf177996-f68c-4375-bf53-161953dadfc2", - "description":"description template delete plan", - "updatedAt":"2024-06-06T11:27:32.988143Z", - "finalizedAt":"2024-06-06T11:27:32.988143Z", - "accessType":0, - "blueprint":{ - "id":"86635178-36a6-484f-9057-a934e4eeecd5", - "label":"Dmp Default Blueprint", - "definition":{ - "sections":[ - { - "id":"f94e50e0-cb97-4c65-8b88-e5db6badd41d", - "label":"Main Info", - "hasTemplates":false - }, - { - "id":"3c2608e5-9320-4d94-9ed7-1eab9500d84b", - "label":"Funding", - "hasTemplates":false - }, - { - "id":"2a77e1f6-9989-4aeb-acd9-48e911a92abd", - "label":"License", - "hasTemplates":false - }, - { - "id":"0db7845b-0e7c-41df-8d91-cbca97995fd5", - "label":"Templates", - "hasTemplates":true - } - ] - } - }, - "hash":"1717673252", - "dmpReferences":[ - { - "id":"c1510688-4a70-4a70-abc0-9778d5db5d7f", - "dmp":{ - \s - }, - "reference":{ - "id":"32c87599-e375-4294-a7cf-3db8722bd675", - "label":"APC Microbiome Institute||", - "type":{ - "id":"538928bb-c7c6-452e-b66d-08e539f5f082" - } - }, - "isActive":1 - }, - { - "id":"f9755a49-c305-4afe-889f-3ec1834b139a", - "dmp":{ - \s - }, - "reference":{ - "id":"08577246-b50b-44ea-9bed-641ea4e40fe7", - "label":"unidentified", - "type":{ - "id":"5b9c284f-f041-4995-96cc-fad7ad13289c" - } - }, - "isActive":1 - } - ], - "dmpUsers":[ - { - "id":"dd48a20d-5166-453b-9a25-bc5ec49ade1f", - "dmp":{ - "id":"68e9aae2-f2f9-4d51-b5f4-9a0216efb00c" - }, - "user":{ - "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" - }, - "role":0, - "isActive":1 - } - ], - "descriptions":[ - { - "id":"18820f0b-8222-49fa-a997-86a171c41092", - "label":"description template test", - "status":1, - "isActive":1, - "descriptionTemplate":{ - "groupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e" - }, - "dmp":{ - \s - } - } - ], - "dmpDescriptionTemplates":[ - { - "dmp":{ - \s - }, - "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", - "descriptionTemplateGroupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e", - "isActive":1 - } - ], - "authorizationFlags":[ - "InviteDmpUsers", - "CreateNewVersionDmp", - "AssignDmpUsers", - "DeleteDmp", - "FinalizeDmp", - "CloneDmp", - "ExportDmp", - "EditDmp" - ], - "belongsToCurrentTenant":true - }, - { - "id":"f2e807f1-7fd4-48db-b781-e9c972057447", - "label":"user3 plan", - "version":1, - "status":0, - "versionStatus":2, - "groupId":"df98fefc-6213-450d-aea7-594b43421c3f", - "description":"test", - "updatedAt":"2024-06-06T11:03:56.668426Z", - "blueprint":{ - "id":"fc83c102-8c3c-4298-8e64-02bdd0fb7275", - "label":"blueprint with users", - "definition":{ - "sections":[ - { - "id":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", - "label":"Main info", - "hasTemplates":true, - "descriptionTemplates":[ - { - "descriptionTemplateGroupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" - } - ] - }, - { - "id":"109ceb1e-9703-2a03-462b-8bf93f993a53", - "label":"Section2", - "hasTemplates":true - } - ] - } - }, - "hash":"1717671836", - "dmpUsers":[ - { - "id":"fcce59eb-8e9e-4768-92fe-e772886836f2", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" - }, - "role":0, - "isActive":1 - }, - { - "id":"8f698ad7-69e4-4fcf-b9b3-563b1b05ac45", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":3, - "isActive":0 - }, - { - "id":"0b26b2eb-5346-463c-b0f4-fa22d9a4c964", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":3, - "isActive":0 - }, - { - "id":"5154ec6e-912d-4b4f-8f1e-cc2a34069344", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":1, - "isActive":0 - }, - { - "id":"9ec5f356-43a3-462d-bbf2-27476931892f", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":1, - "isActive":0 - }, - { - "id":"e4e6a68c-408e-47fa-8b40-cb8c155f9eda", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":2, - "isActive":0 - }, - { - "id":"f1de4a02-137f-48d9-bd31-5904b2ba504a", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":3, - "isActive":0 - }, - { - "id":"9e444526-94c4-4e50-9c35-adf73fab5f8c", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":3, - "isActive":0 - }, - { - "id":"c92686d2-b434-44e3-b8fb-ef0d6a30582d", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":3, - "isActive":1 - }, - { - "id":"42f9c224-8704-4c41-8a2d-71b5c78d7690", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":2, - "isActive":1 - }, - { - "id":"be5836f4-842a-4a74-b852-c4bb4212adb0", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":2, - "isActive":0 - }, - { - "id":"18bb660a-638c-4def-90da-0c83368f7c1e", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":2, - "isActive":1 - }, - { - "id":"e5a8f9d1-30a3-4ee0-8ca6-f74c5e73ba53", - "dmp":{ - "id":"f2e807f1-7fd4-48db-b781-e9c972057447" - }, - "user":{ - "id":"391252ba-926d-4bf9-8c28-a921036f6c39" - }, - "role":2, - "isActive":1 - } - ], - "descriptions":[ - { - "id":"49b4c2df-0bad-4173-85d4-c5b416a7125a", - "label":"user3 description", - "status":0, - "isActive":1, - "descriptionTemplate":{ - "groupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" - }, - "dmp":{ - \s - } - }, - { - "id":"546a6195-17b6-4d1e-bad2-fa322fbad3f1", - "label":"user3 description - to delete", - "status":0, - "isActive":1, - "descriptionTemplate":{ - "groupId":"33dc4612-32bf-46a3-b040-12e32a06b3c7" - }, - "dmp":{ - \s - } - } - ], - "dmpDescriptionTemplates":[ - { - "dmp":{ - \s - }, - "sectionId":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", - "descriptionTemplateGroupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12", - "isActive":1 - }, - { - "dmp":{ - \s - }, - "sectionId":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", - "descriptionTemplateGroupId":"33dc4612-32bf-46a3-b040-12e32a06b3c7", - "isActive":0 - } - ], - "authorizationFlags":[ - "InviteDmpUsers", - "CreateNewVersionDmp", - "AssignDmpUsers", - "DeleteDmp", - "FinalizeDmp", - "CloneDmp", - "ExportDmp", - "EditDmp" - ], - "belongsToCurrentTenant":true - } - ], - "count":2912 - } - """; + { + "items":[ + { + "id":"dbc5057b-d33e-4a2c-8963-e882da6765a0", + "label":"blueprint test with deleted description template", + "version":1, + "status":0, + "versionStatus":2, + "groupId":"dae2fd0b-74a4-4bde-b021-9ea44e033866", + "description":"blueprint test with deleted description template", + "updatedAt":"2024-06-06T12:35:57.293416Z", + "blueprint":{ + "id":"6fbfd40a-b41a-4928-b4b5-67d28bdba2ce", + "label":"test_for_plan_manager_role_new_v2 new ", + "definition":{ + "sections":[ + { + "id":"843c4181-dbe2-4e18-a1e4-cf178199947c", + "label":"1", + "hasTemplates":true, + "descriptionTemplates":[ + { + "descriptionTemplateGroupId":"3689bcce-405a-4d55-9854-669597b79c0a" + }, + { + "descriptionTemplateGroupId":"2a38d018-8e81-4ba2-80b2-4395a1d1b238" + } + ] + } + ] + } + }, + "hash":"1717677357", + "dmpUsers":[ + { + "id":"a61fdc31-fb1e-4cee-9c0a-a0a317b27b62", + "dmp":{ + "id":"dbc5057b-d33e-4a2c-8963-e882da6765a0" + }, + "user":{ + "id":"e60876ed-87f8-4a8e-8081-e5620ec839cf" + }, + "role":0, + "isActive":1 + } + ], + "dmpDescriptionTemplates":[ + { + "dmp":{ + \s + }, + "sectionId":"843c4181-dbe2-4e18-a1e4-cf178199947c", + "descriptionTemplateGroupId":"2a38d018-8e81-4ba2-80b2-4395a1d1b238", + "isActive":1 + }, + { + "dmp":{ + \s + }, + "sectionId":"843c4181-dbe2-4e18-a1e4-cf178199947c", + "descriptionTemplateGroupId":"3689bcce-405a-4d55-9854-669597b79c0a", + "isActive":0 + } + ], + "authorizationFlags":[ + "InviteDmpUsers", + "CreateNewVersionDmp", + "AssignDmpUsers", + "DeleteDmp", + "FinalizeDmp", + "CloneDmp", + "ExportDmp", + "EditDmp" + ], + "belongsToCurrentTenant":true + }, + { + "id":"d3d5cba3-50d0-4dcd-9660-b7bcfac51316", + "label":"description_template_delete_plan_New_v2.xml", + "version":1, + "status":0, + "versionStatus":2, + "groupId":"5ab5d0ca-5c8e-4450-bf3b-a701ceadfabb", + "description":"description template delete plan", + "updatedAt":"2024-06-06T12:30:24.936458Z", + "accessType":0, + "blueprint":{ + "id":"86635178-36a6-484f-9057-a934e4eeecd5", + "label":"Dmp Default Blueprint", + "definition":{ + "sections":[ + { + "id":"f94e50e0-cb97-4c65-8b88-e5db6badd41d", + "label":"Main Info", + "hasTemplates":false + }, + { + "id":"3c2608e5-9320-4d94-9ed7-1eab9500d84b", + "label":"Funding", + "hasTemplates":false + }, + { + "id":"2a77e1f6-9989-4aeb-acd9-48e911a92abd", + "label":"License", + "hasTemplates":false + }, + { + "id":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "label":"Templates", + "hasTemplates":true + } + ] + } + }, + "hash":"1717677024", + "dmpReferences":[ + { + "id":"0c470488-14ba-4c7e-8cf2-0f6f849ee56e", + "dmp":{ + \s + }, + "reference":{ + "id":"08577246-b50b-44ea-9bed-641ea4e40fe7", + "label":"unidentified", + "type":{ + "id":"5b9c284f-f041-4995-96cc-fad7ad13289c" + } + }, + "isActive":1 + }, + { + "id":"62211794-787c-407c-9512-05c2d60d410b", + "dmp":{ + \s + }, + "reference":{ + "id":"32c87599-e375-4294-a7cf-3db8722bd675", + "label":"APC Microbiome Institute||", + "type":{ + "id":"538928bb-c7c6-452e-b66d-08e539f5f082" + } + }, + "isActive":1 + } + ], + "dmpUsers":[ + { + "id":"313865d6-6a72-449f-ac04-1834d2f03b02", + "dmp":{ + "id":"d3d5cba3-50d0-4dcd-9660-b7bcfac51316" + }, + "user":{ + "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" + }, + "role":0, + "isActive":1 + } + ], + "descriptions":[ + { + "id":"1dc4e3e8-c125-4db8-a937-041405aaf5ec", + "label":"description template test", + "status":0, + "isActive":0, + "descriptionTemplate":{ + "groupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e" + }, + "dmp":{ + \s + } + }, + { + "id":"0059fa07-5698-42ba-958a-428b226ddcab", + "label":"test3v2 description template", + "status":0, + "isActive":1, + "descriptionTemplate":{ + "groupId":"2a38d018-8e81-4ba2-80b2-4395a1d1b238" + }, + "dmp":{ + \s + } + } + ], + "dmpDescriptionTemplates":[ + { + "dmp":{ + \s + }, + "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "descriptionTemplateGroupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e", + "isActive":0 + }, + { + "dmp":{ + \s + }, + "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "descriptionTemplateGroupId":"2a38d018-8e81-4ba2-80b2-4395a1d1b238", + "isActive":1 + } + ], + "authorizationFlags":[ + "InviteDmpUsers", + "CreateNewVersionDmp", + "AssignDmpUsers", + "DeleteDmp", + "FinalizeDmp", + "CloneDmp", + "ExportDmp", + "EditDmp" + ], + "belongsToCurrentTenant":true + }, + { + "id":"2ebbb8ac-742d-413a-a3e2-1cb21d555b3f", + "label":"description template delete plan New v2", + "version":2, + "status":0, + "versionStatus":2, + "groupId":"cf177996-f68c-4375-bf53-161953dadfc2", + "description":"description template delete plan", + "updatedAt":"2024-06-06T11:59:21.396453Z", + "accessType":0, + "blueprint":{ + "id":"86635178-36a6-484f-9057-a934e4eeecd5", + "label":"Dmp Default Blueprint", + "definition":{ + "sections":[ + { + "id":"f94e50e0-cb97-4c65-8b88-e5db6badd41d", + "label":"Main Info", + "hasTemplates":false + }, + { + "id":"3c2608e5-9320-4d94-9ed7-1eab9500d84b", + "label":"Funding", + "hasTemplates":false + }, + { + "id":"2a77e1f6-9989-4aeb-acd9-48e911a92abd", + "label":"License", + "hasTemplates":false + }, + { + "id":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "label":"Templates", + "hasTemplates":true + } + ] + } + }, + "hash":"1717675161", + "dmpReferences":[ + { + "id":"5cd1a1c3-bd9b-4a89-9329-ab3f152eebc7", + "dmp":{ + \s + }, + "reference":{ + "id":"32c87599-e375-4294-a7cf-3db8722bd675", + "label":"APC Microbiome Institute||", + "type":{ + "id":"538928bb-c7c6-452e-b66d-08e539f5f082" + } + }, + "isActive":1 + }, + { + "id":"0e5d165f-b8ae-44a2-8d90-5e8e1037caa7", + "dmp":{ + \s + }, + "reference":{ + "id":"08577246-b50b-44ea-9bed-641ea4e40fe7", + "label":"unidentified", + "type":{ + "id":"5b9c284f-f041-4995-96cc-fad7ad13289c" + } + }, + "isActive":1 + } + ], + "dmpUsers":[ + { + "id":"83b1680d-3d9a-4610-82d5-8fe0132f2a0b", + "dmp":{ + "id":"2ebbb8ac-742d-413a-a3e2-1cb21d555b3f" + }, + "user":{ + "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" + }, + "role":0, + "isActive":1 + } + ], + "descriptions":[ + { + "id":"2620507c-cb8b-4d67-bb42-64a702932b0a", + "label":"description template test", + "status":0, + "isActive":1, + "descriptionTemplate":{ + "groupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e" + }, + "dmp":{ + \s + } + } + ], + "dmpDescriptionTemplates":[ + { + "dmp":{ + \s + }, + "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "descriptionTemplateGroupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e", + "isActive":1 + } + ], + "authorizationFlags":[ + "InviteDmpUsers", + "CreateNewVersionDmp", + "AssignDmpUsers", + "DeleteDmp", + "FinalizeDmp", + "CloneDmp", + "ExportDmp", + "EditDmp" + ], + "belongsToCurrentTenant":true + }, + { + "id":"68e9aae2-f2f9-4d51-b5f4-9a0216efb00c", + "label":"description template delete plan New", + "version":1, + "status":1, + "versionStatus":0, + "groupId":"cf177996-f68c-4375-bf53-161953dadfc2", + "description":"description template delete plan", + "updatedAt":"2024-06-06T11:27:32.988143Z", + "finalizedAt":"2024-06-06T11:27:32.988143Z", + "accessType":0, + "blueprint":{ + "id":"86635178-36a6-484f-9057-a934e4eeecd5", + "label":"Dmp Default Blueprint", + "definition":{ + "sections":[ + { + "id":"f94e50e0-cb97-4c65-8b88-e5db6badd41d", + "label":"Main Info", + "hasTemplates":false + }, + { + "id":"3c2608e5-9320-4d94-9ed7-1eab9500d84b", + "label":"Funding", + "hasTemplates":false + }, + { + "id":"2a77e1f6-9989-4aeb-acd9-48e911a92abd", + "label":"License", + "hasTemplates":false + }, + { + "id":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "label":"Templates", + "hasTemplates":true + } + ] + } + }, + "hash":"1717673252", + "dmpReferences":[ + { + "id":"c1510688-4a70-4a70-abc0-9778d5db5d7f", + "dmp":{ + \s + }, + "reference":{ + "id":"32c87599-e375-4294-a7cf-3db8722bd675", + "label":"APC Microbiome Institute||", + "type":{ + "id":"538928bb-c7c6-452e-b66d-08e539f5f082" + } + }, + "isActive":1 + }, + { + "id":"f9755a49-c305-4afe-889f-3ec1834b139a", + "dmp":{ + \s + }, + "reference":{ + "id":"08577246-b50b-44ea-9bed-641ea4e40fe7", + "label":"unidentified", + "type":{ + "id":"5b9c284f-f041-4995-96cc-fad7ad13289c" + } + }, + "isActive":1 + } + ], + "dmpUsers":[ + { + "id":"dd48a20d-5166-453b-9a25-bc5ec49ade1f", + "dmp":{ + "id":"68e9aae2-f2f9-4d51-b5f4-9a0216efb00c" + }, + "user":{ + "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" + }, + "role":0, + "isActive":1 + } + ], + "descriptions":[ + { + "id":"18820f0b-8222-49fa-a997-86a171c41092", + "label":"description template test", + "status":1, + "isActive":1, + "descriptionTemplate":{ + "groupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e" + }, + "dmp":{ + \s + } + } + ], + "dmpDescriptionTemplates":[ + { + "dmp":{ + \s + }, + "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "descriptionTemplateGroupId":"fab932b2-4285-44a2-b9ab-1a4306bd3e0e", + "isActive":1 + } + ], + "authorizationFlags":[ + "InviteDmpUsers", + "CreateNewVersionDmp", + "AssignDmpUsers", + "DeleteDmp", + "FinalizeDmp", + "CloneDmp", + "ExportDmp", + "EditDmp" + ], + "belongsToCurrentTenant":true + }, + { + "id":"f2e807f1-7fd4-48db-b781-e9c972057447", + "label":"user3 plan", + "version":1, + "status":0, + "versionStatus":2, + "groupId":"df98fefc-6213-450d-aea7-594b43421c3f", + "description":"test", + "updatedAt":"2024-06-06T11:03:56.668426Z", + "blueprint":{ + "id":"fc83c102-8c3c-4298-8e64-02bdd0fb7275", + "label":"blueprint with users", + "definition":{ + "sections":[ + { + "id":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", + "label":"Main info", + "hasTemplates":true, + "descriptionTemplates":[ + { + "descriptionTemplateGroupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" + } + ] + }, + { + "id":"109ceb1e-9703-2a03-462b-8bf93f993a53", + "label":"Section2", + "hasTemplates":true + } + ] + } + }, + "hash":"1717671836", + "dmpUsers":[ + { + "id":"fcce59eb-8e9e-4768-92fe-e772886836f2", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" + }, + "role":0, + "isActive":1 + }, + { + "id":"8f698ad7-69e4-4fcf-b9b3-563b1b05ac45", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"0b26b2eb-5346-463c-b0f4-fa22d9a4c964", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"5154ec6e-912d-4b4f-8f1e-cc2a34069344", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":1, + "isActive":0 + }, + { + "id":"9ec5f356-43a3-462d-bbf2-27476931892f", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":1, + "isActive":0 + }, + { + "id":"e4e6a68c-408e-47fa-8b40-cb8c155f9eda", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":0 + }, + { + "id":"f1de4a02-137f-48d9-bd31-5904b2ba504a", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"9e444526-94c4-4e50-9c35-adf73fab5f8c", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"c92686d2-b434-44e3-b8fb-ef0d6a30582d", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":1 + }, + { + "id":"42f9c224-8704-4c41-8a2d-71b5c78d7690", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":1 + }, + { + "id":"be5836f4-842a-4a74-b852-c4bb4212adb0", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":0 + }, + { + "id":"18bb660a-638c-4def-90da-0c83368f7c1e", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":1 + }, + { + "id":"e5a8f9d1-30a3-4ee0-8ca6-f74c5e73ba53", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":1 + } + ], + "descriptions":[ + { + "id":"49b4c2df-0bad-4173-85d4-c5b416a7125a", + "label":"user3 description", + "status":0, + "isActive":1, + "descriptionTemplate":{ + "groupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" + }, + "dmp":{ + \s + } + }, + { + "id":"546a6195-17b6-4d1e-bad2-fa322fbad3f1", + "label":"user3 description - to delete", + "status":0, + "isActive":1, + "descriptionTemplate":{ + "groupId":"33dc4612-32bf-46a3-b040-12e32a06b3c7" + }, + "dmp":{ + \s + } + } + ], + "dmpDescriptionTemplates":[ + { + "dmp":{ + \s + }, + "sectionId":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", + "descriptionTemplateGroupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12", + "isActive":1 + }, + { + "dmp":{ + \s + }, + "sectionId":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", + "descriptionTemplateGroupId":"33dc4612-32bf-46a3-b040-12e32a06b3c7", + "isActive":0 + } + ], + "authorizationFlags":[ + "InviteDmpUsers", + "CreateNewVersionDmp", + "AssignDmpUsers", + "DeleteDmp", + "FinalizeDmp", + "CloneDmp", + "ExportDmp", + "EditDmp" + ], + "belongsToCurrentTenant":true + } + ], + "count":2912 + } + """; public static final String endpoint_ = """ @@ -868,6 +897,7 @@ public class SwaggerHelpers { } public static class Description { + public static final String endpoint_query = """ This endpoint is used to fetch all the available descriptions.
@@ -1038,10 +1068,687 @@ public class SwaggerHelpers { } """; - public static final String endpoint_get = + public static final String endpoint_query_response_example = """ - - """; + { + "items":[ + { + "id":"a18258c6-8a47-4716-81f3-9cbe383af182", + "label":"delete template", + "status":0, + "updatedAt":"2024-06-06T13:15:15.763826Z", + "dmpDescriptionTemplate":{ + "id":"29a3385c-a2ae-4675-b1c6-0fd5a49017be", + "dmp":{ + "id":"9dcb614e-05c5-4679-bbe8-7cb8913586e8" + }, + "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "descriptionTemplateGroupId":"f0979866-f9d1-4eb3-b33e-572e744ce8af" + }, + "descriptionTemplate":{ + "id":"2ea4c926-df57-48fa-b22d-2b2bafae1267", + "label":"delete", + "groupId":"f0979866-f9d1-4eb3-b33e-572e744ce8af" + }, + "authorizationFlags":[ + "DeleteDescription", + "EditDescription", + "InviteDmpUsers" + ], + "dmp":{ + "id":"9dcb614e-05c5-4679-bbe8-7cb8913586e8", + "label":"description template delete plan", + "status":0, + "blueprint":{ + "id":"86635178-36a6-484f-9057-a934e4eeecd5", + "label":"Dmp Default Blueprint", + "definition":{ + "sections":[ + { + "id":"f94e50e0-cb97-4c65-8b88-e5db6badd41d", + "label":"Main Info", + "hasTemplates":false + }, + { + "id":"3c2608e5-9320-4d94-9ed7-1eab9500d84b", + "label":"Funding", + "hasTemplates":false + }, + { + "id":"2a77e1f6-9989-4aeb-acd9-48e911a92abd", + "label":"License", + "hasTemplates":false + }, + { + "id":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "label":"Templates", + "hasTemplates":true + } + ] + } + }, + "dmpUsers":[ + { + "id":"cbd64e90-846e-4c4e-8678-89ebc54b1c5f", + "dmp":{ + \s + }, + "user":{ + "id":"e60876ed-87f8-4a8e-8081-e5620ec839cf" + }, + "role":0, + "isActive":1 + } + ] + }, + "belongsToCurrentTenant":true + }, + { + "id":"46c9be1b-9809-4bd3-b730-ce4a9b457484", + "label":"description from default", + "status":0, + "updatedAt":"2024-06-06T12:56:33.171675Z", + "dmpDescriptionTemplate":{ + "id":"69ea7b42-e5e4-4b23-b17d-9883ece3ee53", + "dmp":{ + "id":"703b00d0-af49-4e5a-9002-fc3f4ae6e107" + }, + "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "descriptionTemplateGroupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" + }, + "descriptionTemplate":{ + "id":"57ced1f1-6e8c-482a-88c4-2e2d6322b25c", + "label":"Academy Of Finland", + "groupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" + }, + "authorizationFlags":[ + "DeleteDescription", + "EditDescription", + "InviteDmpUsers" + ], + "dmp":{ + "id":"703b00d0-af49-4e5a-9002-fc3f4ae6e107", + "label":"plan from default", + "status":0, + "blueprint":{ + "id":"86635178-36a6-484f-9057-a934e4eeecd5", + "label":"Dmp Default Blueprint", + "definition":{ + "sections":[ + { + "id":"f94e50e0-cb97-4c65-8b88-e5db6badd41d", + "label":"Main Info", + "hasTemplates":false + }, + { + "id":"3c2608e5-9320-4d94-9ed7-1eab9500d84b", + "label":"Funding", + "hasTemplates":false + }, + { + "id":"2a77e1f6-9989-4aeb-acd9-48e911a92abd", + "label":"License", + "hasTemplates":false + }, + { + "id":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "label":"Templates", + "hasTemplates":true + } + ] + } + }, + "dmpUsers":[ + { + "id":"dff384f8-3e06-47b9-84f9-b91b66ab3327", + "dmp":{ + \s + }, + "user":{ + "id":"e60876ed-87f8-4a8e-8081-e5620ec839cf" + }, + "role":0, + "isActive":1 + } + ] + }, + "belongsToCurrentTenant":true + }, + { + "id":"546a6195-17b6-4d1e-bad2-fa322fbad3f1", + "label":"user3 description - to delete", + "status":0, + "updatedAt":"2024-06-06T09:58:17.507386Z", + "dmpDescriptionTemplate":{ + "id":"0e8a5e65-c3bc-49b0-a6f3-d7da22836f3b", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "sectionId":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", + "descriptionTemplateGroupId":"33dc4612-32bf-46a3-b040-12e32a06b3c7" + }, + "descriptionTemplate":{ + "id":"d8a1ac10-ffa4-4f7f-afe9-36b904af4ae7", + "label":"RDA_madmp-only new TO DELETE ", + "groupId":"33dc4612-32bf-46a3-b040-12e32a06b3c7" + }, + "authorizationFlags":[ + "DeleteDescription", + "EditDescription", + "InviteDmpUsers" + ], + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447", + "label":"user3 plan", + "status":0, + "blueprint":{ + "id":"fc83c102-8c3c-4298-8e64-02bdd0fb7275", + "label":"blueprint with users", + "definition":{ + "sections":[ + { + "id":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", + "label":"Main info", + "hasTemplates":true + }, + { + "id":"109ceb1e-9703-2a03-462b-8bf93f993a53", + "label":"Section2", + "hasTemplates":true + } + ] + } + }, + "dmpUsers":[ + { + "id":"fcce59eb-8e9e-4768-92fe-e772886836f2", + "dmp":{ + \s + }, + "user":{ + "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" + }, + "role":0, + "isActive":1 + }, + { + "id":"8f698ad7-69e4-4fcf-b9b3-563b1b05ac45", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"0b26b2eb-5346-463c-b0f4-fa22d9a4c964", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"5154ec6e-912d-4b4f-8f1e-cc2a34069344", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":1, + "isActive":0 + }, + { + "id":"9ec5f356-43a3-462d-bbf2-27476931892f", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":1, + "isActive":0 + }, + { + "id":"e4e6a68c-408e-47fa-8b40-cb8c155f9eda", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":0 + }, + { + "id":"f1de4a02-137f-48d9-bd31-5904b2ba504a", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"9e444526-94c4-4e50-9c35-adf73fab5f8c", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"c92686d2-b434-44e3-b8fb-ef0d6a30582d", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":1 + }, + { + "id":"42f9c224-8704-4c41-8a2d-71b5c78d7690", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":1 + }, + { + "id":"be5836f4-842a-4a74-b852-c4bb4212adb0", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":0 + }, + { + "id":"18bb660a-638c-4def-90da-0c83368f7c1e", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":1 + }, + { + "id":"e5a8f9d1-30a3-4ee0-8ca6-f74c5e73ba53", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":1 + } + ] + }, + "belongsToCurrentTenant":true + }, + { + "id":"49b4c2df-0bad-4173-85d4-c5b416a7125a", + "label":"user3 description", + "status":0, + "updatedAt":"2024-06-05T14:43:20.353594Z", + "dmpDescriptionTemplate":{ + "id":"3432e0b5-fbda-4a81-ab56-06657636da57", + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447" + }, + "sectionId":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", + "descriptionTemplateGroupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" + }, + "descriptionTemplate":{ + "id":"57ced1f1-6e8c-482a-88c4-2e2d6322b25c", + "label":"Academy Of Finland", + "groupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" + }, + "authorizationFlags":[ + "DeleteDescription", + "EditDescription", + "InviteDmpUsers" + ], + "dmp":{ + "id":"f2e807f1-7fd4-48db-b781-e9c972057447", + "label":"user3 plan", + "status":0, + "blueprint":{ + "id":"fc83c102-8c3c-4298-8e64-02bdd0fb7275", + "label":"blueprint with users", + "definition":{ + "sections":[ + { + "id":"44e6e93b-a6e0-6036-bda5-b33fe1df2f02", + "label":"Main info", + "hasTemplates":true + }, + { + "id":"109ceb1e-9703-2a03-462b-8bf93f993a53", + "label":"Section2", + "hasTemplates":true + } + ] + } + }, + "dmpUsers":[ + { + "id":"fcce59eb-8e9e-4768-92fe-e772886836f2", + "dmp":{ + \s + }, + "user":{ + "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" + }, + "role":0, + "isActive":1 + }, + { + "id":"8f698ad7-69e4-4fcf-b9b3-563b1b05ac45", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"0b26b2eb-5346-463c-b0f4-fa22d9a4c964", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"5154ec6e-912d-4b4f-8f1e-cc2a34069344", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":1, + "isActive":0 + }, + { + "id":"9ec5f356-43a3-462d-bbf2-27476931892f", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":1, + "isActive":0 + }, + { + "id":"e4e6a68c-408e-47fa-8b40-cb8c155f9eda", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":0 + }, + { + "id":"f1de4a02-137f-48d9-bd31-5904b2ba504a", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"9e444526-94c4-4e50-9c35-adf73fab5f8c", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":0 + }, + { + "id":"c92686d2-b434-44e3-b8fb-ef0d6a30582d", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":3, + "isActive":1 + }, + { + "id":"42f9c224-8704-4c41-8a2d-71b5c78d7690", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":1 + }, + { + "id":"be5836f4-842a-4a74-b852-c4bb4212adb0", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":0 + }, + { + "id":"18bb660a-638c-4def-90da-0c83368f7c1e", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":1 + }, + { + "id":"e5a8f9d1-30a3-4ee0-8ca6-f74c5e73ba53", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":2, + "isActive":1 + } + ] + }, + "belongsToCurrentTenant":true + }, + { + "id":"9ac982e6-1cdd-4e03-b083-e91911114cc7", + "label":"test", + "status":0, + "updatedAt":"2024-06-05T13:54:15.215978Z", + "dmpDescriptionTemplate":{ + "id":"af011eaf-211c-40f5-af02-66a86912349a", + "dmp":{ + "id":"c5c9b67f-3c27-4677-900a-1f6f799f2bc9" + }, + "sectionId":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "descriptionTemplateGroupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" + }, + "descriptionTemplate":{ + "id":"57ced1f1-6e8c-482a-88c4-2e2d6322b25c", + "label":"Academy Of Finland", + "groupId":"11559a4f-d6f4-4dc9-8e6b-d1879700ac12" + }, + "authorizationFlags":[ + "DeleteDescription", + "EditDescription", + "InviteDmpUsers" + ], + "dmp":{ + "id":"c5c9b67f-3c27-4677-900a-1f6f799f2bc9", + "label":"test export contact", + "status":0, + "accessType":1, + "blueprint":{ + "id":"86635178-36a6-484f-9057-a934e4eeecd5", + "label":"Dmp Default Blueprint", + "definition":{ + "sections":[ + { + "id":"f94e50e0-cb97-4c65-8b88-e5db6badd41d", + "label":"Main Info", + "hasTemplates":false + }, + { + "id":"3c2608e5-9320-4d94-9ed7-1eab9500d84b", + "label":"Funding", + "hasTemplates":false + }, + { + "id":"2a77e1f6-9989-4aeb-acd9-48e911a92abd", + "label":"License", + "hasTemplates":false + }, + { + "id":"0db7845b-0e7c-41df-8d91-cbca97995fd5", + "label":"Templates", + "hasTemplates":true + } + ] + } + }, + "dmpReferences":[ + { + "id":"f74eca5b-f865-440d-b888-7ebe8482290a", + "dmp":{ + \s + }, + "reference":{ + "id":"ab7a87f2-69bb-4b14-94fc-6b65d822a8b2", + "label":"Archiv der Deutschen Frauenbewegung", + "type":{ + "id":"7eeffb98-58fb-4921-82ec-e27f32f8e738" + }, + "reference":"pending_org_::44714f780f925d981f99b085346d1e2a" + }, + "isActive":1 + }, + { + "id":"09e66ee1-4b29-4195-9a9b-f931af1b093f", + "dmp":{ + \s + }, + "reference":{ + "id":"8ea5ff4d-4a0a-4baa-8dc1-7f1de31bc3e2", + "label":"Aisha Mohammed (0000-0002-0131-1543)", + "type":{ + "id":"5a2112e7-ea99-4cfe-98a1-68665e26726e" + }, + "reference":"0000-0002-0131-1543" + }, + "isActive":1 + }, + { + "id":"ffdfec53-2a53-4953-a977-76149bc269af", + "dmp":{ + \s + }, + "reference":{ + "id":"7aed6061-39a9-4a86-944b-f7c49024ccfc", + "label":"Autonomously Assembling Nanomaterial Scaffolds for Treating Myocardial Infarction (nih_________::5R01HL117326-03)", + "type":{ + "id":"5b9c284f-f041-4995-96cc-fad7ad13289c" + }, + "reference":"nih_________::5R01HL117326-03" + }, + "isActive":1 + }, + { + "id":"48877b47-fd2b-42f7-b7f0-bc6a379f0971", + "dmp":{ + \s + }, + "reference":{ + "id":"98435709-ccc6-42c7-aa96-30b7e4d8f317", + "label":"ADAPT - Centre for Digital Content Technology||", + "type":{ + "id":"538928bb-c7c6-452e-b66d-08e539f5f082" + }, + "reference":"501100014826::501100014826||ADAPT - Centre for Digital Content Technology||" + }, + "isActive":1 + } + ], + "dmpUsers":[ + { + "id":"bcf92d98-1492-4423-b1a2-2b1ef76ea25e", + "dmp":{ + \s + }, + "user":{ + "id":"391252ba-926d-4bf9-8c28-a921036f6c39" + }, + "role":0, + "isActive":1 + }, + { + "id":"8caa96de-82f7-4593-b0f6-7e88cfe76530", + "dmp":{ + \s + }, + "user":{ + "id":"7d6e54b6-31e8-48df-9c3f-1e5b3eb48404" + }, + "role":0, + "isActive":1 + } + ] + }, + "belongsToCurrentTenant":true + } + ], + "count":4006 + } + """; } } diff --git a/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/Swagger403.java b/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/Swagger403.java new file mode 100644 index 000000000..d021d7182 --- /dev/null +++ b/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/Swagger403.java @@ -0,0 +1,31 @@ +package org.opencdmp.controllers.swagger.annotation; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import java.lang.annotation.*; + +import static org.opencdmp.controllers.swagger.SwaggerHelpers.Errors.message_403; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) +@ApiResponse( + description = "This is generally the response you should expect when you don't have sufficient permissions to perform an action.", + responseCode = "403", + content = { + @Content( + examples = { + @ExampleObject( + name = "404 response", + description = "This is the response in case of a 403 error.", + value = message_403 + ) + } + ) + } +) +public @interface Swagger403 { + +} diff --git a/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/Swagger404.java b/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/Swagger404.java new file mode 100644 index 000000000..b0b26069d --- /dev/null +++ b/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/Swagger404.java @@ -0,0 +1,31 @@ +package org.opencdmp.controllers.swagger.annotation; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import java.lang.annotation.*; + +import static org.opencdmp.controllers.swagger.SwaggerHelpers.Errors.message_404; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) +@ApiResponse( + description = "This is generally the response you should expect when an entity is not found or you don't have sufficient permissions to view it.", + responseCode = "404", + content = { + @Content( + examples = { + @ExampleObject( + name = "404 response", + description = "This is the response in case of a 404 error where the first placeholder {0} will be replaced by the item id and the second one {1} by the item type.", + value = message_404 + ) + } + ) + } +) +public @interface Swagger404 { + +} diff --git a/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/Swagger500.java b/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/Swagger500.java new file mode 100644 index 000000000..51bf86c93 --- /dev/null +++ b/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/Swagger500.java @@ -0,0 +1,31 @@ +package org.opencdmp.controllers.swagger.annotation; + +import io.swagger.v3.oas.annotations.media.Content; +import io.swagger.v3.oas.annotations.media.ExampleObject; +import io.swagger.v3.oas.annotations.responses.ApiResponse; + +import java.lang.annotation.*; + +import static org.opencdmp.controllers.swagger.SwaggerHelpers.Errors.message_500; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.FIELD}) +@ApiResponse( + description = "This is the response you should expect when an unexpected exception has occurred.", + responseCode = "500", + content = { + @Content( + examples = { + @ExampleObject( + name = "500 response", + description = "This is the response in case of an internal server error.", + value = message_500 + ) + } + ) + } +) +public @interface Swagger500 { + +} diff --git a/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/SwaggerErrorResponses.java b/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/SwaggerErrorResponses.java new file mode 100644 index 000000000..8bf210489 --- /dev/null +++ b/backend/web/src/main/java/org/opencdmp/controllers/swagger/annotation/SwaggerErrorResponses.java @@ -0,0 +1,12 @@ +package org.opencdmp.controllers.swagger.annotation; + +import java.lang.annotation.*; + +@Documented +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.FIELD, ElementType.METHOD}) +@Swagger500 +@Swagger403 +public @interface SwaggerErrorResponses { + +} diff --git a/backend/web/src/main/java/org/opencdmp/interceptors/user/UserInterceptor.java b/backend/web/src/main/java/org/opencdmp/interceptors/user/UserInterceptor.java index d936c4182..f21c79ce4 100644 --- a/backend/web/src/main/java/org/opencdmp/interceptors/user/UserInterceptor.java +++ b/backend/web/src/main/java/org/opencdmp/interceptors/user/UserInterceptor.java @@ -1,23 +1,6 @@ package org.opencdmp.interceptors.user; -import org.opencdmp.authorization.AuthorizationProperties; -import org.opencdmp.authorization.ClaimNames; -import org.opencdmp.commons.JsonHandlingService; -import org.opencdmp.commons.enums.ContactInfoType; -import org.opencdmp.commons.enums.IsActive; -import org.opencdmp.commons.lock.LockByKeyManager; -import org.opencdmp.commons.scope.user.UserScope; -import org.opencdmp.commons.types.user.AdditionalInfoEntity; -import org.opencdmp.commons.types.usercredential.UserCredentialDataEntity; -import org.opencdmp.commons.locale.LocaleProperties; -import org.opencdmp.convention.ConventionService; -import org.opencdmp.data.*; -import org.opencdmp.integrationevent.outbox.usertouched.UserTouchedIntegrationEventHandler; -import org.opencdmp.model.UserContactInfo; -import org.opencdmp.model.usercredential.UserCredential; -import org.opencdmp.query.UserContactInfoQuery; -import org.opencdmp.query.UserCredentialQuery; import gr.cite.commons.web.oidc.principal.CurrentPrincipalResolver; import gr.cite.commons.web.oidc.principal.extractor.ClaimExtractor; import gr.cite.tools.data.query.QueryFactory; @@ -30,6 +13,23 @@ import jakarta.persistence.criteria.CriteriaBuilder; import jakarta.persistence.criteria.CriteriaQuery; import jakarta.persistence.criteria.Root; import org.apache.commons.validator.routines.EmailValidator; +import org.opencdmp.authorization.AuthorizationProperties; +import org.opencdmp.authorization.ClaimNames; +import org.opencdmp.commons.JsonHandlingService; +import org.opencdmp.commons.enums.ContactInfoType; +import org.opencdmp.commons.enums.IsActive; +import org.opencdmp.commons.locale.LocaleProperties; +import org.opencdmp.commons.lock.LockByKeyManager; +import org.opencdmp.commons.scope.user.UserScope; +import org.opencdmp.commons.types.user.AdditionalInfoEntity; +import org.opencdmp.commons.types.usercredential.UserCredentialDataEntity; +import org.opencdmp.convention.ConventionService; +import org.opencdmp.data.*; +import org.opencdmp.integrationevent.outbox.usertouched.UserTouchedIntegrationEventHandler; +import org.opencdmp.model.UserContactInfo; +import org.opencdmp.model.usercredential.UserCredential; +import org.opencdmp.query.UserContactInfoQuery; +import org.opencdmp.query.UserCredentialQuery; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.lang.NonNull; @@ -66,6 +66,8 @@ public class UserInterceptor implements WebRequestInterceptor { private final ConventionService conventionService; @PersistenceContext public EntityManager entityManager; + public final TenantEntityManager tenantEntityManager; + @Autowired public UserInterceptor( @@ -77,7 +79,7 @@ public class UserInterceptor implements WebRequestInterceptor { JsonHandlingService jsonHandlingService, QueryFactory queryFactory, LockByKeyManager lockByKeyManager, - LocaleProperties localeProperties, UserTouchedIntegrationEventHandler userTouchedIntegrationEventHandler, AuthorizationProperties authorizationProperties, ConventionService conventionService) { + LocaleProperties localeProperties, UserTouchedIntegrationEventHandler userTouchedIntegrationEventHandler, AuthorizationProperties authorizationProperties, ConventionService conventionService, TenantEntityManager tenantEntityManager) { this.userScope = userScope; this.currentPrincipalResolver = currentPrincipalResolver; this.claimExtractor = claimExtractor; @@ -90,6 +92,7 @@ public class UserInterceptor implements WebRequestInterceptor { this.userTouchedIntegrationEventHandler = userTouchedIntegrationEventHandler; this.authorizationProperties = authorizationProperties; this.conventionService = conventionService; + this.tenantEntityManager = tenantEntityManager; } @Override @@ -101,12 +104,14 @@ public class UserInterceptor implements WebRequestInterceptor { UserInterceptorCacheService.UserInterceptorCacheValue cacheValue = this.userInterceptorCacheService.lookup(this.userInterceptorCacheService.buildKey(subjectId)); - if (cacheValue != null && emailExistsToPrincipal(cacheValue.getProviderEmail()) && userRolesSynced(cacheValue.getRoles()) && providerExistsToPrincipal(cacheValue.getExternalProviderNames())) { + if (cacheValue != null && this.emailExistsToPrincipal(cacheValue.getProviderEmail()) && this.userRolesSynced(cacheValue.getRoles()) && this.providerExistsToPrincipal(cacheValue.getExternalProviderNames())) { userId = cacheValue.getUserId(); } else { boolean usedResource = false; boolean shouldSendUserTouchedIntegrationEvent = false; try { + this.tenantEntityManager.disableTenantFilters(); + usedResource = this.lockByKeyManager.tryLock(subjectId, 5000, TimeUnit.MILLISECONDS); String email = this.getEmailFromClaims(); @@ -116,7 +121,7 @@ public class UserInterceptor implements WebRequestInterceptor { definition.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED); TransactionStatus status = null; try { - status = transactionManager.getTransaction(definition); + status = this.transactionManager.getTransaction(definition); userId = this.findExistingUserFromDb(subjectId); boolean isNewUser = userId == null; @@ -133,9 +138,9 @@ public class UserInterceptor implements WebRequestInterceptor { } this.entityManager.flush(); - transactionManager.commit(status); + this.transactionManager.commit(status); } catch (Exception ex) { - if (status != null) transactionManager.rollback(status); + if (status != null) this.transactionManager.rollback(status); throw ex; } @@ -151,6 +156,7 @@ public class UserInterceptor implements WebRequestInterceptor { this.userInterceptorCacheService.put(cacheValue); } finally { if (usedResource) this.lockByKeyManager.unlock(subjectId); + this.tenantEntityManager.reloadTenantFilters(); } if (shouldSendUserTouchedIntegrationEvent){ this.userTouchedIntegrationEventHandler.handle(userId); @@ -235,7 +241,7 @@ public class UserInterceptor implements WebRequestInterceptor { } private List getRolesFromClaims() { - List claimsRoles = this.claimExtractor.asStrings(currentPrincipalResolver.currentPrincipal(), ClaimNames.GlobalRolesClaimName); + List claimsRoles = this.claimExtractor.asStrings(this.currentPrincipalResolver.currentPrincipal(), ClaimNames.GlobalRolesClaimName); if (claimsRoles == null) claimsRoles = new ArrayList<>(); claimsRoles = claimsRoles.stream().filter(x -> x != null && !x.isBlank() && (this.conventionService.isListNullOrEmpty(this.authorizationProperties.getAllowedGlobalRoles()) || this.authorizationProperties.getAllowedGlobalRoles().contains(x))).distinct().toList(); claimsRoles = claimsRoles.stream().filter(x -> x != null && !x.isBlank()).distinct().toList(); diff --git a/backend/web/src/main/resources/config/keycloak-devel.yml b/backend/web/src/main/resources/config/keycloak-devel.yml index 22df61d43..b66a05ed4 100644 --- a/backend/web/src/main/resources/config/keycloak-devel.yml +++ b/backend/web/src/main/resources/config/keycloak-devel.yml @@ -10,7 +10,7 @@ keycloak-resources: groupId: 88a65fff-dffe-474a-a461-252ff4230203 tenantAuthorities: TenantAdmin: - parent: 1e650f57-8b7c-4f32-bf5b-e1a9147c597b + parent: 4453d854-4aea-4d19-af80-7f9d85e5a2c9 roleAttributeValueStrategy: 'TenantAdmin:{tenantCode}' TenantUser: parent: c7057c4d-e7dc-49ef-aa5d-02ad3a22bff8 diff --git a/dmp-frontend/src/app/app.component.ts b/dmp-frontend/src/app/app.component.ts index 0187e0567..1bda3c6c6 100644 --- a/dmp-frontend/src/app/app.component.ts +++ b/dmp-frontend/src/app/app.component.ts @@ -188,7 +188,7 @@ export class AppComponent implements OnInit, AfterViewInit { .subscribe((event: NavigationStart) => { const enrichedUrl = this.tenantHandlingService.getUrlEnrichedWithTenantCode(event.url, this.authentication.selectedTenant() ?? 'default'); if (event.url != enrichedUrl) { - this.router.navigate([enrichedUrl]); + this.router.navigateByUrl(enrichedUrl); } }); diff --git a/dmp-frontend/src/app/core/services/tenant/tenant-handling.service.ts b/dmp-frontend/src/app/core/services/tenant/tenant-handling.service.ts index 779c3e53d..1ddaf2651 100644 --- a/dmp-frontend/src/app/core/services/tenant/tenant-handling.service.ts +++ b/dmp-frontend/src/app/core/services/tenant/tenant-handling.service.ts @@ -1,6 +1,6 @@ import { DOCUMENT, LocationStrategy } from '@angular/common'; import { Inject, Injectable } from '@angular/core'; -import { PRIMARY_OUTLET, Router, UrlSegment, UrlSegmentGroup, UrlTree } from '@angular/router'; +import { PRIMARY_OUTLET, Router, UrlSegment, UrlSegmentGroup, UrlSerializer, UrlTree } from '@angular/router'; @Injectable() export class TenantHandlingService { @@ -9,6 +9,7 @@ export class TenantHandlingService { @Inject(DOCUMENT) private readonly document: Document, private readonly locationStrategy: LocationStrategy, private readonly router: Router, + private urlSerializer: UrlSerializer ) { } @@ -25,16 +26,16 @@ export class TenantHandlingService { getCurrentUrlEnrichedWithTenantCode(tenantCode: string, withOrigin: boolean) { const path = this.getUrlEnrichedWithTenantCode(this.router.routerState.snapshot.url, tenantCode) - return withOrigin ? this.getBaseUrl() + path.substring(1) : path; + return withOrigin ? this.getBaseUrl() + path.toString().substring(1) : path; } - getUrlEnrichedWithTenantCode(url: string, tenantCode: string) { + getUrlEnrichedWithTenantCode(url: string, tenantCode: string): string { const urlTree: UrlTree = this.router.parseUrl(url); const urlSegmentGroup: UrlSegmentGroup = urlTree.root.children[PRIMARY_OUTLET]; - const urlSegments: UrlSegment[] = urlSegmentGroup.segments; + const urlSegments: UrlSegment[] = urlSegmentGroup?.segments; - const tenantParamIndex = urlSegments.findIndex(x => x.path == 't'); + const tenantParamIndex = urlSegments?.findIndex(x => x.path == 't'); if (tenantParamIndex >= 0) { if (tenantCode == 'default') { @@ -49,7 +50,7 @@ export class TenantHandlingService { } } - return urlTree.toString(); + return this.urlSerializer.serialize(urlTree); } getBaseUrl(): string { diff --git a/dmp-frontend/src/common/modules/hybrid-listing/hybrid-listing.component.ts b/dmp-frontend/src/common/modules/hybrid-listing/hybrid-listing.component.ts index ea20f34bd..2da3aebef 100644 --- a/dmp-frontend/src/common/modules/hybrid-listing/hybrid-listing.component.ts +++ b/dmp-frontend/src/common/modules/hybrid-listing/hybrid-listing.component.ts @@ -173,7 +173,7 @@ export class HybridListingComponent extends BaseComponent implements OnInit, OnC this.resizeObserver?.unobserve(this.wrapperCard.nativeElement) this.resizeObserver?.disconnect(); this.resizeObserver = null; - this.resizeSubject$.complete(); + this.resizeSubject$?.complete(); } private resizeObserver: ResizeObserver; diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DataRepositoryMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DataRepositoryMigrationService.java index 12cc8a250..faa568173 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DataRepositoryMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DataRepositoryMigrationService.java @@ -51,10 +51,14 @@ public class DataRepositoryMigrationService { logger.debug("Migrate DataRepository " + page * PageSize + " of " + total); for (DataRepository item : items) { entityManager.detach(item); - if (item.getReference() == null || !item.getReference().contains(":")){ + if (item.getReference() == null || item.getReference().isBlank()){ logger.warn("Reference generated because is null DataRepository " + item.getId()); item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); } + if (!item.getReference().contains(":")){ + logger.warn("Reference generated because is not contains ':' DataRepository " + item.getId() + " reference " + item.getReference()); + item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); + } eu.old.eudat.models.data.datarepository.DataRepositoryModel model = new eu.old.eudat.models.data.datarepository.DataRepositoryModel().fromDataModel(item); String[] referenceParts = item.getReference().split(":", 2); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DatasetMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DatasetMigrationService.java index 947a4d51c..8167773f1 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DatasetMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/DatasetMigrationService.java @@ -1,5 +1,6 @@ package eu.old.eudat.migration; +import eu.old.eudat.data.entities.DMP; import org.opencdmp.commons.JsonHandlingService; import org.opencdmp.commons.XmlHandlingService; import org.opencdmp.commons.enums.*; @@ -194,7 +195,8 @@ public class DatasetMigrationService { private List getOrCreateDmpDescriptionTemplateEntity(Dataset item, UUID sectionId, UUID groupId, List dmpDescriptionTemplateEntities){ List itemDescriptionTemplates = dmpDescriptionTemplateEntities.stream().filter(x-> x.getDescriptionTemplateGroupId().equals(groupId) && x.getDmpId().equals(item.getDmp().getId()) && x.getSectionId().equals(sectionId)).toList(); if (itemDescriptionTemplates.isEmpty()) { - if (!item.getStatus().equals(Dataset.Status.DELETED.getValue())) logger.warn("Migrate Dataset " + item.getId() + " cannot found DmpDescriptionTemplateEntity for section " + item.getDmpSectionIndex()); + boolean isDeleted = item.getStatus().equals(Dataset.Status.CANCELED.getValue()) ||item.getStatus().equals(Dataset.Status.DELETED.getValue()) || item.getDmp().getStatus().equals(DMP.DMPStatus.DELETED.getValue()); + if (!isDeleted) logger.warn("Migrate Dataset " + item.getId() + " cannot found DmpDescriptionTemplateEntity for section " + item.getDmpSectionIndex()); if (dmpDescriptionTemplateEntities.stream().anyMatch(x -> x.getDmpId().equals(item.getDmp().getId()) && x.getSectionId().equals(sectionId))) { DmpDescriptionTemplateEntity dmpDescriptionTemplateEntity = new DmpDescriptionTemplateEntity(); dmpDescriptionTemplateEntity.setId(UUID.randomUUID()); @@ -203,7 +205,7 @@ public class DatasetMigrationService { dmpDescriptionTemplateEntity.setCreatedAt(item.getCreated() != null ? item.getCreated().toInstant() : Instant.now()); dmpDescriptionTemplateEntity.setUpdatedAt(item.getModified() != null ? item.getModified().toInstant() : Instant.now()); dmpDescriptionTemplateEntity.setSectionId(sectionId); - dmpDescriptionTemplateEntity.setIsActive(!item.getStatus().equals(Dataset.Status.DELETED.getValue()) ? IsActive.Active : IsActive.Inactive); + dmpDescriptionTemplateEntity.setIsActive(!isDeleted ? IsActive.Active : IsActive.Inactive); this.entityManager.persist(dmpDescriptionTemplateEntity); this.entityManager.flush(); itemDescriptionTemplates = List.of(dmpDescriptionTemplateEntity); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ExternalDatasetMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ExternalDatasetMigrationService.java index 82f496e36..bc9e07d38 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ExternalDatasetMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ExternalDatasetMigrationService.java @@ -40,10 +40,14 @@ public class ExternalDatasetMigrationService { logger.debug("Migrate ExternalDataset " + page * PageSize + " of " + total); for (ExternalDataset item : items) { entityManager.detach(item); - if (item.getReference() == null || !item.getReference().contains(":")){ + if (item.getReference() == null || item.getReference().isBlank()){ logger.warn("Reference generated because is null ExternalDataset " + item.getId()); item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); } + if (!item.getReference().contains(":")){ + logger.warn("Reference generated because is not contains ':' ExternalDataset " + item.getId() + " reference " + item.getReference()); + item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); + } eu.old.eudat.models.data.externaldataset.ExternalDatasetModel model = new eu.old.eudat.models.data.externaldataset.ExternalDatasetModel().fromDataModel(item); String[] referenceParts = item.getReference().split(":", 2); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/FunderMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/FunderMigrationService.java index cace49916..4f538f9b7 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/FunderMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/FunderMigrationService.java @@ -44,10 +44,14 @@ public class FunderMigrationService { logger.debug("Migrate Funder " + page * PageSize + " of " + total); for (Funder item : items) { entityManager.detach(item); - if (item.getReference() == null || !item.getReference().contains(":")){ + if (item.getReference() == null || item.getReference().isBlank()){ logger.warn("Reference generated because is null Funder " + item.getId()); item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); } + if (!item.getReference().contains(":")){ + logger.warn("Reference generated because is not contains ':' Funder " + item.getId() + " reference " + item.getReference()); + item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); + } eu.old.eudat.models.data.funder.Funder model = new eu.old.eudat.models.data.funder.Funder().fromDataModel(item); String[] referenceParts = item.getReference().split(":", 2); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/GrantMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/GrantMigrationService.java index 4bbbafa00..b98497c3e 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/GrantMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/GrantMigrationService.java @@ -51,10 +51,14 @@ GrantMigrationService { logger.debug("Migrate Grant " + page * PageSize + " of " + total); for (Grant item : items) { entityManager.detach(item); - if (item.getReference() == null || !item.getReference().contains(":")){ + if (item.getReference() == null || item.getReference().isBlank()){ logger.warn("Reference generated because is null Grant " + item.getId()); item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); } + if (!item.getReference().contains(":")){ + logger.warn("Reference generated because is not contains ':' Grant " + item.getId() + " reference " + item.getReference()); + item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); + } String[] referenceParts = item.getReference().split(":", 2); boolean isInternal = referenceParts[0].equals(InternalReferenceSource); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/OrganizationMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/OrganizationMigrationService.java index ecbf2aad2..6e15ee8fe 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/OrganizationMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/OrganizationMigrationService.java @@ -49,10 +49,14 @@ public class OrganizationMigrationService { logger.debug("Migrate Organisation " + page * PageSize + " of " + total); for (Organisation item : items) { entityManager.detach(item); - if (item.getReference() == null || !item.getReference().contains(":")){ + if (item.getReference() == null || item.getReference().isBlank()){ logger.warn("Reference generated because is null Organisation " + item.getId()); item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); } + if (!item.getReference().contains(":")){ + logger.warn("Reference generated because is not contains ':' Organisation " + item.getId() + " reference " + item.getReference()); + item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); + } eu.old.eudat.models.data.dmp.Organisation model = new eu.old.eudat.models.data.dmp.Organisation().fromDataModel(item); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ProjectMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ProjectMigrationService.java index 50eeabb4d..b747c8a0a 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ProjectMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ProjectMigrationService.java @@ -50,10 +50,14 @@ public class ProjectMigrationService { logger.debug("Migrate Project " + page * PageSize + " of " + total); for (Project item : items) { entityManager.detach(item); - if (item.getReference() == null || !item.getReference().contains(":")){ + if (item.getReference() == null || item.getReference().isBlank()){ logger.warn("Reference generated because is null Project " + item.getId()); item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); } + if (!item.getReference().contains(":")){ + logger.warn("Reference generated because is not contains ':' Project " + item.getId() + " reference " + item.getReference()); + item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); + } eu.old.eudat.models.data.project.Project model = new eu.old.eudat.models.data.project.Project().fromDataModel(item); String[] referenceParts = item.getReference().split(":", 2); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/RegistryMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/RegistryMigrationService.java index a45935d0d..2a67ab4fa 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/RegistryMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/RegistryMigrationService.java @@ -49,10 +49,14 @@ public class RegistryMigrationService { logger.debug("Migrate Registry " + page * PageSize + " of " + total); for (Registry item : items) { entityManager.detach(item); - if (item.getReference() == null || !item.getReference().contains(":")){ + if (item.getReference() == null || item.getReference().isBlank()){ logger.warn("Reference generated because is null Registry " + item.getId()); item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); } + if (!item.getReference().contains(":")){ + logger.warn("Reference generated because is not contains ':' Registry " + item.getId() + " reference " + item.getReference()); + item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); + } eu.old.eudat.models.data.registries.RegistryModel model = new eu.old.eudat.models.data.registries.RegistryModel().fromDataModel(item); String[] referenceParts = item.getReference().split(":", 2); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ResearcherMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ResearcherMigrationService.java index 9cc6e77c8..25fb2fd42 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ResearcherMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ResearcherMigrationService.java @@ -50,10 +50,14 @@ public class ResearcherMigrationService { logger.debug("Migrate Researcher " + page * PageSize + " of " + total); for (Researcher item : items) { entityManager.detach(item); - if (item.getReference() == null || !item.getReference().contains(":")){ + if (item.getReference() == null || item.getReference().isBlank()){ logger.warn("Reference generated because is null Researcher " + item.getId()); item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); } + if (!item.getReference().contains(":")){ + logger.warn("Reference generated because is not contains ':' Researcher " + item.getId() + " reference " + item.getReference()); + item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); + } eu.old.eudat.models.data.dmp.Researcher model = new eu.old.eudat.models.data.dmp.Researcher().fromDataModel(item); String[] referenceParts = item.getReference().split(":", 2); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ServiceMigrationService.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ServiceMigrationService.java index f61cf1f7a..fb9c8563a 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ServiceMigrationService.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/migration/ServiceMigrationService.java @@ -48,10 +48,14 @@ public class ServiceMigrationService { logger.debug("Migrate Service " + page * PageSize + " of " + total); for (eu.old.eudat.data.entities.Service item : items) { entityManager.detach(item); - if (item.getReference() == null || !item.getReference().contains(":")){ + if (item.getReference() == null || item.getReference().isBlank()){ logger.warn("Reference generated because is null Service " + item.getId()); item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); } + if (!item.getReference().contains(":")){ + logger.warn("Reference generated because is not contains ':' Service " + item.getId() + " reference " + item.getReference()); + item.setReference(InternalReferenceSource + ":" + item.getId().toString().replace("-", "").toLowerCase(Locale.ROOT)); + } eu.old.eudat.models.data.services.ServiceModel model = new eu.old.eudat.models.data.services.ServiceModel().fromDataModel(item); String[] referenceParts = item.getReference().split(":", 2); diff --git a/dmp-migration-tool/web/src/main/java/eu/old/eudat/publicapi/migration/MigrationController.java b/dmp-migration-tool/web/src/main/java/eu/old/eudat/publicapi/migration/MigrationController.java index a67f48cf6..091efe744 100644 --- a/dmp-migration-tool/web/src/main/java/eu/old/eudat/publicapi/migration/MigrationController.java +++ b/dmp-migration-tool/web/src/main/java/eu/old/eudat/publicapi/migration/MigrationController.java @@ -175,6 +175,7 @@ public class MigrationController { public boolean step3() throws IOException, JAXBException, ParserConfigurationException, InstantiationException, IllegalAccessException, SAXException, NoSuchFieldException, InvalidApplicationException, TransformerException, URISyntaxException { //Description this.datasetMigrationService.migrate(); +// throw new InvalidApplicationException(""); this.datasetReferenceMigrationService.migrateDatasetReferences(); this.tagMigrationService.migrate(); diff --git a/notification-service/notification-web/src/main/resources/config/notification-devel.yml b/notification-service/notification-web/src/main/resources/config/notification-devel.yml index d429c4180..75a6ed388 100644 --- a/notification-service/notification-web/src/main/resources/config/notification-devel.yml +++ b/notification-service/notification-web/src/main/resources/config/notification-devel.yml @@ -208,8 +208,6 @@ notification: optional: - key: "{expiration_time}" value: --- - - key: "{tenant-url-path}" - value: formatting: '[{userName}]': null '[{installation-url}]': null @@ -235,8 +233,6 @@ notification: value: email - key: "{expiration_time}" value: -- - - key: "{tenant-url-path}" - value: formatting: '[{email}]': null '[{tenant-url-path}]': null diff --git a/notification-service/notification-web/src/main/resources/notification_templates/mergeacountconfirmation/email/body.en.html b/notification-service/notification-web/src/main/resources/notification_templates/mergeacountconfirmation/email/body.en.html index bc83e6bff..90b7607e6 100644 --- a/notification-service/notification-web/src/main/resources/notification_templates/mergeacountconfirmation/email/body.en.html +++ b/notification-service/notification-web/src/main/resources/notification_templates/mergeacountconfirmation/email/body.en.html @@ -271,7 +271,7 @@ - +
Confirm Merge Request Confirm Merge Request
diff --git a/notification-service/notification-web/src/main/resources/notification_templates/mergeacountconfirmation/inapp/body.en.html b/notification-service/notification-web/src/main/resources/notification_templates/mergeacountconfirmation/inapp/body.en.html index 262b32651..fd2e7a0c7 100644 --- a/notification-service/notification-web/src/main/resources/notification_templates/mergeacountconfirmation/inapp/body.en.html +++ b/notification-service/notification-web/src/main/resources/notification_templates/mergeacountconfirmation/inapp/body.en.html @@ -9,6 +9,6 @@

User {userName} have sent you a merge Request.

Please confirm that you want to merge your {installation-url} account with that account.
The link will expire in {expiration_time}.

- Confirm Merge Request + Confirm Merge Request \ No newline at end of file diff --git a/notification-service/notification-web/src/main/resources/notification_templates/removecredentialconfirmation/email/body.en.html b/notification-service/notification-web/src/main/resources/notification_templates/removecredentialconfirmation/email/body.en.html index bd992e823..059cae435 100644 --- a/notification-service/notification-web/src/main/resources/notification_templates/removecredentialconfirmation/email/body.en.html +++ b/notification-service/notification-web/src/main/resources/notification_templates/removecredentialconfirmation/email/body.en.html @@ -271,7 +271,7 @@ - +
Confirm Unlink Request Confirm Unlink Request
diff --git a/notification-service/notification-web/src/main/resources/notification_templates/removecredentialconfirmation/inapp/body.en.html b/notification-service/notification-web/src/main/resources/notification_templates/removecredentialconfirmation/inapp/body.en.html index b49ccb1ad..4a3d5dd30 100644 --- a/notification-service/notification-web/src/main/resources/notification_templates/removecredentialconfirmation/inapp/body.en.html +++ b/notification-service/notification-web/src/main/resources/notification_templates/removecredentialconfirmation/inapp/body.en.html @@ -9,6 +9,6 @@

You have made a request to unlink your email account in OpenCDMP.

Please confirm that you want to unlink your {email} account.
The link will expire in {expiration_time}.

- Confirm Unlink Request + Confirm Unlink Request \ No newline at end of file