use of org.obiba.mica.study.event.StudyUnpublishedEvent in project mica2 by obiba.
the class AbstractStudyService method publish.
@Caching(evict = { @CacheEvict(value = "aggregations-metadata", allEntries = true), @CacheEvict(value = { "studies-draft", "studies-published" }, key = "#id") })
public void publish(@NotNull String id, boolean publish, PublishCascadingScope cascadingScope) throws NoSuchEntityException {
log.info("Publish study: {}", id);
T study = getRepository().findOne(id);
if (publish) {
publishState(id);
eventBus.post(new StudyPublishedEvent(study, getCurrentUsername(), cascadingScope));
} else {
unPublishState(id);
eventBus.post(new StudyUnpublishedEvent(study));
}
}
Aggregations