From 395cf8bfc21ed168f7cd5326b1a829d8a40d1cca Mon Sep 17 00:00:00 2001 From: sgiannopoulos Date: Tue, 28 May 2024 17:26:33 +0300 Subject: [PATCH] merge user changes --- .../org/opencdmp/service/user/UserServiceImpl.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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 62c13b805..00e806ac8 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 @@ -43,6 +43,7 @@ import org.opencdmp.data.tenant.TenantScopedBaseEntity; import org.opencdmp.errorcode.ErrorThesaurusProperties; import org.opencdmp.event.EventBroker; import org.opencdmp.event.UserTouchedEvent; +import org.opencdmp.integrationevent.outbox.annotationentitytouch.AnnotationEntityTouchedIntegrationEventHandler; import org.opencdmp.integrationevent.outbox.notification.NotifyIntegrationEvent; import org.opencdmp.integrationevent.outbox.notification.NotifyIntegrationEventHandler; import org.opencdmp.integrationevent.outbox.userremoval.UserRemovalIntegrationEventHandler; @@ -112,7 +113,7 @@ public class UserServiceImpl implements UserService { private final UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler; private final AuthorizationProperties authorizationProperties; private final TenantScope tenantScope; - + private final AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler; @Autowired public UserServiceImpl( TenantEntityManager entityManager, @@ -125,7 +126,7 @@ public class UserServiceImpl implements UserService { EventBroker eventBroker, JsonHandlingService jsonHandlingService, XmlHandlingService xmlHandlingService, QueryFactory queryFactory, - UserScope userScope, KeycloakService keycloakService, ActionConfirmationService actionConfirmationService, NotificationProperties notificationProperties, NotifyIntegrationEventHandler eventHandler, ValidatorFactory validatorFactory, ElasticService elasticService, UserTouchedIntegrationEventHandler userTouchedIntegrationEventHandler, UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler, AuthorizationProperties authorizationProperties, TenantScope tenantScope) { + UserScope userScope, KeycloakService keycloakService, ActionConfirmationService actionConfirmationService, NotificationProperties notificationProperties, NotifyIntegrationEventHandler eventHandler, ValidatorFactory validatorFactory, ElasticService elasticService, UserTouchedIntegrationEventHandler userTouchedIntegrationEventHandler, UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler, AuthorizationProperties authorizationProperties, TenantScope tenantScope, AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler) { this.entityManager = entityManager; this.authorizationService = authorizationService; this.deleterFactory = deleterFactory; @@ -148,6 +149,7 @@ public class UserServiceImpl implements UserService { this.userRemovalIntegrationEventHandler = userRemovalIntegrationEventHandler; this.authorizationProperties = authorizationProperties; this.tenantScope = tenantScope; + this.annotationEntityTouchedIntegrationEventHandler = annotationEntityTouchedIntegrationEventHandler; } //region persist @@ -739,6 +741,14 @@ public class UserServiceImpl implements UserService { for (DescriptionEntity description : descriptions){ this.elasticService.persistDescription(description); } + + for (DmpEntity dmp : dmps){ + this.annotationEntityTouchedIntegrationEventHandler.handleDmp(dmp.getId()); + } + + for (DescriptionEntity description : descriptions){ + this.annotationEntityTouchedIntegrationEventHandler.handleDescription(description.getId()); + } } public void confirmRemoveCredential(String token) throws InvalidApplicationException {