use of org.obiba.mica.core.domain.RevisionStatus in project mica2 by obiba.
the class FileSystemService method updateStatus.
/**
* Update {@link RevisionStatus} of all files at a given path (and children).
*
* @param path
* @param status
*/
public void updateStatus(String path, RevisionStatus status) {
List<AttachmentState> states = findAttachmentStates(String.format("^%s$", path), false);
AttachmentState state = states.stream().filter(s -> DIR_NAME.equals(s.getName())).findFirst().orElseThrow(() -> NoSuchEntityException.withPath(AttachmentState.class, path));
RevisionStatus currentStatus = state.getRevisionStatus();
states.addAll(findAttachmentStates(String.format("^%s/", path), false));
states.forEach(s -> updateStatus(s, status));
filePublicationFlowNotification.send(path, currentStatus, status);
}
use of org.obiba.mica.core.domain.RevisionStatus in project mica2 by obiba.
the class AbstractGitPersistableService method updateStatus.
public T updateStatus(String id, RevisionStatus status) {
T entityState = findStateById(id);
RevisionStatus current = entityState.getRevisionStatus();
entityState.setRevisionStatus(status);
getEntityStateRepository().save(entityState);
entityPublicationFlowNotification.send(id, getTypeName(), current, status);
return entityState;
}
Aggregations