Sending annotation users event on dmp persist

This commit is contained in:
Thomas Georgios Giannos 2024-03-11 16:02:09 +02:00
parent 7347fbbd5a
commit 3fc805ab85
1 changed files with 9 additions and 1 deletions

View File

@ -23,6 +23,7 @@ import eu.eudat.data.*;
import eu.eudat.errorcode.ErrorThesaurusProperties;
import eu.eudat.event.DmpTouchedEvent;
import eu.eudat.event.EventBroker;
import eu.eudat.integrationevent.outbox.annotationentitytouch.AnnotationEntityTouchedIntegrationEventHandler;
import eu.eudat.integrationevent.outbox.dmptouched.DmpTouchedIntegrationEventHandler;
import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEvent;
import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEventHandler;
@ -123,6 +124,8 @@ public class DmpServiceImpl implements DmpService {
private final DmpTouchedIntegrationEventHandler dmpTouchedIntegrationEventHandler;
private final AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler;
@Autowired
public DmpServiceImpl(
EntityManager entityManager,
@ -143,7 +146,9 @@ public class DmpServiceImpl implements DmpService {
ActionConfirmationService actionConfirmationService,
FileTransformerService fileTransformerService,
ValidatorFactory validatorFactory,
ElasticService elasticService, DmpTouchedIntegrationEventHandler dmpTouchedIntegrationEventHandler) {
ElasticService elasticService,
DmpTouchedIntegrationEventHandler dmpTouchedIntegrationEventHandler,
AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler) {
this.entityManager = entityManager;
this.authorizationService = authorizationService;
this.deleterFactory = deleterFactory;
@ -164,6 +169,7 @@ public class DmpServiceImpl implements DmpService {
this.validatorFactory = validatorFactory;
this.elasticService = elasticService;
this.dmpTouchedIntegrationEventHandler = dmpTouchedIntegrationEventHandler;
this.annotationEntityTouchedIntegrationEventHandler = annotationEntityTouchedIntegrationEventHandler;
}
public Dmp persist(DmpPersist model, FieldSet fields) throws MyForbiddenException, MyValidationException, MyApplicationException, MyNotFoundException, InvalidApplicationException, JAXBException, IOException {
@ -184,6 +190,8 @@ public class DmpServiceImpl implements DmpService {
this.dmpTouchedIntegrationEventHandler.handle(DmpTouchedIntegrationEventHandler.buildEventFromPersistModel(model));
this.annotationEntityTouchedIntegrationEventHandler.handle(AnnotationEntityTouchedIntegrationEventHandler.buildEventFromPersistModel(model));
this.sendNotification(data);
this.elasticService.persistDmp(data);