use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class ViewRowAttributesRestController method getAttributeDropdown.
@GetMapping("/attribute/{attributeName}/dropdown")
public JSONLookupValuesList getAttributeDropdown(//
@PathVariable(PARAM_WindowId) final String windowIdStr, //
@PathVariable(PARAM_ViewId) final String viewIdStr, //
@PathVariable(PARAM_RowId) final String rowIdStr, //
@PathVariable("attributeName") final String attributeName) {
userSession.assertLoggedIn();
final ViewId viewId = ViewId.of(windowIdStr, viewIdStr);
final DocumentId rowId = DocumentId.of(rowIdStr);
return viewsRepo.getView(viewId).getById(rowId).getAttributes().getAttributeDropdown(attributeName).transform(JSONLookupValuesList::ofLookupValuesList);
}
use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class ProcessRestController method getParameterTypeahead.
@RequestMapping(value = "/{processId}/{pinstanceId}/field/{parameterName}/typeahead", method = RequestMethod.GET)
public JSONLookupValuesList getParameterTypeahead(//
@PathVariable("processId") final String processIdStr, //
@PathVariable("pinstanceId") final String pinstanceIdStr, //
@PathVariable("parameterName") final String parameterName, //
@RequestParam(name = "query", required = true) final String query) {
userSession.assertLoggedIn();
final ProcessId processId = ProcessId.fromJson(processIdStr);
final DocumentId pinstanceId = DocumentId.of(pinstanceIdStr);
final IProcessInstancesRepository instancesRepository = getRepository(processId);
return instancesRepository.forProcessInstanceReadonly(pinstanceId, processInstance -> processInstance.getParameterLookupValuesForQuery(parameterName, query)).transform(JSONLookupValuesList::ofLookupValuesList);
}
use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class BoardRestController method getFilterParameterTypeahead.
@GetMapping("/{boardId}/newCardsView/{viewId}/filter/{filterId}/field/{parameterName}/typeahead")
public JSONLookupValuesList getFilterParameterTypeahead(@PathVariable("boardId") final int boardId, @PathVariable("viewId") final String viewIdStr, @PathVariable("filterId") final String filterId, @PathVariable("parameterName") final String parameterName, @RequestParam(name = "query", required = true) final String query) {
userSession.assertLoggedIn();
final ViewId viewId = ViewId.ofViewIdString(viewIdStr);
return viewsRepo.getView(viewId).getFilterParameterTypeahead(filterId, parameterName, query, userSession.toEvaluatee()).transform(JSONLookupValuesList::ofLookupValuesList);
}
use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class BoardRestController method getFilterParameterDropdown.
@GetMapping("/{boardId}/newCardsView/{viewId}/filter/{filterId}/field/{parameterName}/dropdown")
public JSONLookupValuesList getFilterParameterDropdown(@PathVariable("boardId") final int boardId, @PathVariable("viewId") final String viewIdStr, @PathVariable("filterId") final String filterId, @PathVariable("parameterName") final String parameterName) {
userSession.assertLoggedIn();
final ViewId viewId = ViewId.ofViewIdString(viewIdStr);
return viewsRepo.getView(viewId).getFilterParameterDropdown(filterId, parameterName, userSession.toEvaluatee()).transform(JSONLookupValuesList::ofLookupValuesList);
}
use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class ProcessRestController method getParameterDropdown.
@RequestMapping(value = "/{processId}/{pinstanceId}/field/{parameterName}/dropdown", method = RequestMethod.GET)
public JSONLookupValuesList getParameterDropdown(//
@PathVariable("processId") final String processIdStr, //
@PathVariable("pinstanceId") final String pinstanceIdStr, //
@PathVariable("parameterName") final String parameterName) {
userSession.assertLoggedIn();
final ProcessId processId = ProcessId.fromJson(processIdStr);
final DocumentId pinstanceId = DocumentId.of(pinstanceIdStr);
final IProcessInstancesRepository instancesRepository = getRepository(processId);
return instancesRepository.forProcessInstanceReadonly(pinstanceId, processInstance -> processInstance.getParameterLookupValues(parameterName)).transform(JSONLookupValuesList::ofLookupValuesList);
}
Aggregations