merge user changes

This commit is contained in:
Efstratios Giannopoulos 2024-05-28 17:26:33 +03:00
parent fa00214cbf
commit 395cf8bfc2
1 changed files with 12 additions and 2 deletions

View File

@ -43,6 +43,7 @@ import org.opencdmp.data.tenant.TenantScopedBaseEntity;
import org.opencdmp.errorcode.ErrorThesaurusProperties; import org.opencdmp.errorcode.ErrorThesaurusProperties;
import org.opencdmp.event.EventBroker; import org.opencdmp.event.EventBroker;
import org.opencdmp.event.UserTouchedEvent; 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.NotifyIntegrationEvent;
import org.opencdmp.integrationevent.outbox.notification.NotifyIntegrationEventHandler; import org.opencdmp.integrationevent.outbox.notification.NotifyIntegrationEventHandler;
import org.opencdmp.integrationevent.outbox.userremoval.UserRemovalIntegrationEventHandler; import org.opencdmp.integrationevent.outbox.userremoval.UserRemovalIntegrationEventHandler;
@ -112,7 +113,7 @@ public class UserServiceImpl implements UserService {
private final UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler; private final UserRemovalIntegrationEventHandler userRemovalIntegrationEventHandler;
private final AuthorizationProperties authorizationProperties; private final AuthorizationProperties authorizationProperties;
private final TenantScope tenantScope; private final TenantScope tenantScope;
private final AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler;
@Autowired @Autowired
public UserServiceImpl( public UserServiceImpl(
TenantEntityManager entityManager, TenantEntityManager entityManager,
@ -125,7 +126,7 @@ public class UserServiceImpl implements UserService {
EventBroker eventBroker, EventBroker eventBroker,
JsonHandlingService jsonHandlingService, JsonHandlingService jsonHandlingService,
XmlHandlingService xmlHandlingService, QueryFactory queryFactory, 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.entityManager = entityManager;
this.authorizationService = authorizationService; this.authorizationService = authorizationService;
this.deleterFactory = deleterFactory; this.deleterFactory = deleterFactory;
@ -148,6 +149,7 @@ public class UserServiceImpl implements UserService {
this.userRemovalIntegrationEventHandler = userRemovalIntegrationEventHandler; this.userRemovalIntegrationEventHandler = userRemovalIntegrationEventHandler;
this.authorizationProperties = authorizationProperties; this.authorizationProperties = authorizationProperties;
this.tenantScope = tenantScope; this.tenantScope = tenantScope;
this.annotationEntityTouchedIntegrationEventHandler = annotationEntityTouchedIntegrationEventHandler;
} }
//region persist //region persist
@ -739,6 +741,14 @@ public class UserServiceImpl implements UserService {
for (DescriptionEntity description : descriptions){ for (DescriptionEntity description : descriptions){
this.elasticService.persistDescription(description); 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 { public void confirmRemoveCredential(String token) throws InvalidApplicationException {