use of org.obiba.mica.dataset.event.DatasetUnpublishedEvent in project mica2 by obiba.
the class HarmonizedDatasetService method publish.
/**
* Apply dataset publication flag.
*
* @param id
* @param published
*/
@Caching(evict = { @CacheEvict(value = "aggregations-metadata", key = "'dataset'") })
public void publish(@NotNull String id, boolean published, PublishCascadingScope cascadingScope) {
HarmonizationDataset dataset = findById(id);
helper.evictCache(dataset);
if (published) {
checkIsPublishable(dataset);
publishState(id);
eventBus.post(new DatasetPublishedEvent(dataset, wrappedGetDatasetVariables(dataset), null, getCurrentUsername(), cascadingScope));
indexHarmonizedVariables(dataset);
} else {
unPublishState(id);
eventBus.post(new DatasetUnpublishedEvent(dataset));
}
}
use of org.obiba.mica.dataset.event.DatasetUnpublishedEvent in project mica2 by obiba.
the class CollectedDatasetService method publish.
/**
* Apply dataset publication flag.
*
* @param id
* @param published
*/
@Caching(evict = { @CacheEvict(value = "aggregations-metadata", key = "'dataset'") })
public void publish(@NotNull String id, boolean published, PublishCascadingScope cascadingScope) {
StudyDataset dataset = findById(id);
helper.evictCache(dataset);
if (published) {
checkIsPublishable(dataset);
Iterable<DatasetVariable> variables = wrappedGetDatasetVariables(dataset);
publishState(id);
prepareForIndex(dataset);
eventBus.post(new DatasetPublishedEvent(dataset, variables, getCurrentUsername(), cascadingScope));
// helper.asyncBuildDatasetVariablesCache(dataset, variables);
} else {
unPublishState(id);
eventBus.post(new DatasetUnpublishedEvent(dataset));
}
}
Aggregations