use of org.obiba.mica.project.event.ProjectUnpublishedEvent in project mica2 by obiba.
the class ProjectService method publish.
/**
* Set the publication flag on a {@link Project}.
*
* @param id
* @throws NoSuchProjectException
*/
@Caching(evict = { @CacheEvict(value = "aggregations-metadata", key = "'project'") })
public void publish(@NotNull String id, boolean publish, PublishCascadingScope cascadingScope) throws NoSuchEntityException {
Project project = projectRepository.findOne(id);
if (project == null)
return;
if (publish) {
publishState(id);
eventBus.post(new ProjectPublishedEvent(project, getCurrentUsername(), cascadingScope));
} else {
unPublishState(id);
eventBus.post(new ProjectUnpublishedEvent(project));
}
}
Aggregations