use of org.eclipse.sirius.web.services.documents.DocumentMapper in project sirius-web by eclipse-sirius.
the class EditingContextPersistenceService method persist.
@Override
public void persist(IEditingContext editingContext) {
long start = System.currentTimeMillis();
if (editingContext instanceof EditingContext) {
EditingDomain editingDomain = ((EditingContext) editingContext).getDomain();
List<DocumentEntity> documentEntities = this.persist(editingDomain);
List<Document> documents = documentEntities.stream().map(new DocumentMapper()::toDTO).collect(Collectors.toList());
// @formatter:off
new IDParser().parse(editingContext.getId()).map(editingContextId -> new DocumentsModifiedEvent(editingContextId, documents)).ifPresent(this.applicationEventPublisher::publishEvent);
// @formatter:on
}
long end = System.currentTimeMillis();
this.timer.record(end - start, TimeUnit.MILLISECONDS);
}
Aggregations