Search in sources :

Example 6 with DatasetUpdatedEvent

use of org.obiba.mica.dataset.event.DatasetUpdatedEvent in project mica2 by obiba.

the class CollectedDatasetService method saveInternal.

private void saveInternal(StudyDataset dataset, String comment) {
    StudyDataset saved = prepareSave(dataset);
    StudyDatasetState studyDatasetState = findEntityState(dataset, StudyDatasetState::new);
    if (!dataset.isNew())
        ensureGitRepository(studyDatasetState);
    studyDatasetState.incrementRevisionsAhead();
    studyDatasetStateRepository.save(studyDatasetState);
    saved.setLastModifiedDate(DateTime.now());
    studyDatasetRepository.save(saved);
    gitService.save(saved, comment);
    eventBus.post(new DatasetUpdatedEvent(saved));
}
Also used : DatasetUpdatedEvent(org.obiba.mica.dataset.event.DatasetUpdatedEvent) StudyDatasetState(org.obiba.mica.dataset.domain.StudyDatasetState) StudyDataset(org.obiba.mica.dataset.domain.StudyDataset)

Aggregations

DatasetUpdatedEvent (org.obiba.mica.dataset.event.DatasetUpdatedEvent)6 DatasetPublishedEvent (org.obiba.mica.dataset.event.DatasetPublishedEvent)3 NoSuchValueTableException (org.obiba.magma.NoSuchValueTableException)2 NoSuchVariableException (org.obiba.magma.NoSuchVariableException)2 NoSuchEntityException (org.obiba.mica.NoSuchEntityException)2 NoSuchDatasetException (org.obiba.mica.dataset.NoSuchDatasetException)2 DatasetVariable (org.obiba.mica.dataset.domain.DatasetVariable)2 HarmonizationDataset (org.obiba.mica.dataset.domain.HarmonizationDataset)2 StudyDataset (org.obiba.mica.dataset.domain.StudyDataset)2 NoSuchStudyException (org.obiba.mica.study.NoSuchStudyException)2 List (java.util.List)1 ExecutionException (java.util.concurrent.ExecutionException)1 Collectors.toList (java.util.stream.Collectors.toList)1 MagmaRuntimeException (org.obiba.magma.MagmaRuntimeException)1 EntityState (org.obiba.mica.core.domain.EntityState)1 StudyDatasetState (org.obiba.mica.dataset.domain.StudyDatasetState)1 HarmonizationDatasetIndexedEvent (org.obiba.mica.dataset.event.HarmonizationDatasetIndexedEvent)1