use of de.metas.ui.web.process.WebuiPreconditionsContext in project metasfresh-webui-api by metasfresh.
the class ViewRestController method getDocumentActions.
@GetMapping("/{viewId}/actions")
public JSONDocumentActionsList getDocumentActions(@PathVariable(PARAM_WindowId) final String windowId, @PathVariable("viewId") final String viewIdStr, @RequestParam(name = "selectedIds", required = false) @ApiParam("comma separated IDs") final String selectedIdsListStr, @RequestParam(name = "parentViewId", required = false) final String parentViewIdStr, @RequestParam(name = "parentViewSelectedIds", required = false) @ApiParam("comma separated IDs") final String parentViewSelectedIdsListStr, @RequestParam(name = "childViewId", required = false) final String childViewIdStr, @RequestParam(name = "childViewSelectedIds", required = false) @ApiParam("comma separated IDs") final String childViewSelectedIdsListStr) {
userSession.assertLoggedIn();
final WebuiPreconditionsContext preconditionsContext = newPreconditionsContextBuilder().windowId(windowId).viewIdString(viewIdStr).selectedIdsList(selectedIdsListStr).parentViewId(parentViewIdStr).parentViewSelectedIdsList(parentViewSelectedIdsListStr).childViewId(childViewIdStr).childViewSelectedIdsList(childViewSelectedIdsListStr).build();
return processRestController.streamDocumentRelatedProcesses(preconditionsContext).filter(// only those which are enabled or not silent
WebuiRelatedProcessDescriptor::isEnabled).collect(JSONDocumentActionsList.collect(newJSONOptions()));
}
use of de.metas.ui.web.process.WebuiPreconditionsContext in project metasfresh-webui-api by metasfresh.
the class ViewRestController method getDocumentQuickActions.
@GetMapping("/{viewId}/quickActions")
public JSONDocumentActionsList getDocumentQuickActions(@PathVariable(PARAM_WindowId) final String windowId, @PathVariable("viewId") final String viewIdStr, @RequestParam(name = "selectedIds", required = false) @ApiParam("comma separated IDs") final String selectedIdsListStr, @RequestParam(name = "parentViewId", required = false) final String parentViewIdStr, @RequestParam(name = "parentViewSelectedIds", required = false) @ApiParam("comma separated IDs") final String parentViewSelectedIdsListStr, @RequestParam(name = "childViewId", required = false) final String childViewIdStr, @RequestParam(name = "childViewSelectedIds", required = false) @ApiParam("comma separated IDs") final String childViewSelectedIdsListStr) {
userSession.assertLoggedIn();
final WebuiPreconditionsContext preconditionsContext = newPreconditionsContextBuilder().windowId(windowId).viewIdString(viewIdStr).selectedIdsList(selectedIdsListStr).parentViewId(parentViewIdStr).parentViewSelectedIdsList(parentViewSelectedIdsListStr).childViewId(childViewIdStr).childViewSelectedIdsList(childViewSelectedIdsListStr).build();
return processRestController.streamDocumentRelatedProcesses(preconditionsContext).filter(WebuiRelatedProcessDescriptor::isQuickAction).filter(// only those which are enabled or not silent
WebuiRelatedProcessDescriptor::isEnabledOrNotSilent).collect(JSONDocumentActionsList.collect(newJSONOptions()));
}
Aggregations