use of de.metas.ui.web.process.DocumentPreconditionsAsContext in project metasfresh-webui-api by metasfresh.
the class WindowRestController method getDocumentActions.
private JSONDocumentActionsList getDocumentActions(final DocumentPath documentPath, final Set<TableRecordReference> selectedIncludedRecords, final boolean returnDisabled) {
userSession.assertLoggedIn();
final Predicate<WebuiRelatedProcessDescriptor> filter;
if (returnDisabled) {
filter = WebuiRelatedProcessDescriptor::isEnabledOrNotSilent;
} else {
filter = WebuiRelatedProcessDescriptor::isEnabled;
}
return documentCollection.forDocumentReadonly(documentPath, document -> {
final DocumentPreconditionsAsContext preconditionsContext = DocumentPreconditionsAsContext.of(document, selectedIncludedRecords);
return processRestController.streamDocumentRelatedProcesses(preconditionsContext).filter(filter).collect(JSONDocumentActionsList.collect(newJSONOptions().build()));
});
}
Aggregations