use of de.metas.ui.web.process.json.JSONDocumentActionsList 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(PARAM_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, @RequestParam(name = "viewProfileId", required = false) final String viewProfileIdStr, @RequestParam(name = "all", required = false) final boolean all) {
userSession.assertLoggedIn();
final WebuiPreconditionsContext preconditionsContext = newPreconditionsContextBuilder().windowId(windowId).viewIdString(viewIdStr).viewProfileIdStr(viewProfileIdStr).selectedIdsList(selectedIdsListStr).parentViewId(parentViewIdStr).parentViewSelectedIdsList(parentViewSelectedIdsListStr).childViewId(childViewIdStr).childViewSelectedIdsList(childViewSelectedIdsListStr).displayPlace(DisplayPlace.ViewQuickActions).build();
return processRestController.streamDocumentRelatedProcesses(preconditionsContext).filter(// shall be already filtered out, but just to make sure
descriptor -> descriptor.isDisplayedOn(preconditionsContext.getDisplayPlace())).filter(// only those which are enabled or not silent
descriptor -> all || descriptor.isEnabledOrNotSilent()).collect(JSONDocumentActionsList.collect(newJSONOptions()));
}
use of de.metas.ui.web.process.json.JSONDocumentActionsList 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(PARAM_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, @RequestParam(name = "all", required = false) final boolean all) {
userSession.assertLoggedIn();
final WebuiPreconditionsContext preconditionsContext = newPreconditionsContextBuilder().windowId(windowId).viewIdString(viewIdStr).selectedIdsList(selectedIdsListStr).parentViewId(parentViewIdStr).parentViewSelectedIdsList(parentViewSelectedIdsListStr).childViewId(childViewIdStr).childViewSelectedIdsList(childViewSelectedIdsListStr).displayPlace(DisplayPlace.ViewActionsMenu).build();
return processRestController.streamDocumentRelatedProcesses(preconditionsContext).filter(// shall be already filtered out, but just to make sure
descriptor -> descriptor.isDisplayedOn(preconditionsContext.getDisplayPlace())).filter(// only those which are enabled and not internally rejected
descriptor -> all || descriptor.isEnabled()).collect(JSONDocumentActionsList.collect(newJSONOptions()));
}
Aggregations