use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class ASIRestController method getAttributeTypeahead.
@GetMapping("/{asiDocId}/field/{attributeName}/typeahead")
public JSONLookupValuesList getAttributeTypeahead(//
@PathVariable("asiDocId") final String asiDocIdStr, //
@PathVariable("attributeName") final String attributeName, //
@RequestParam(name = "query", required = true) final String query) {
userSession.assertLoggedIn();
final DocumentId asiDocId = DocumentId.of(asiDocIdStr);
return asiRepo.forASIDocumentReadonly(asiDocId, asiDoc -> asiDoc.getFieldLookupValuesForQuery(attributeName, query)).transform(JSONLookupValuesList::ofLookupValuesList);
}
use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class ASIRestController method getAttributeDropdown.
@GetMapping("/{asiDocId}/field/{attributeName}/dropdown")
public JSONLookupValuesList getAttributeDropdown(//
@PathVariable("asiDocId") final String asiDocIdStr, //
@PathVariable("attributeName") final String attributeName) {
userSession.assertLoggedIn();
final DocumentId asiDocId = DocumentId.of(asiDocIdStr);
return asiRepo.forASIDocumentReadonly(asiDocId, asiDoc -> asiDoc.getFieldLookupValues(attributeName)).transform(JSONLookupValuesList::ofLookupValuesList);
}
use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class ViewRowAttributesRestController method getAttributeTypeahead.
@GetMapping("/attribute/{attributeName}/typeahead")
public JSONLookupValuesList getAttributeTypeahead(//
@PathVariable(PARAM_WindowId) final String windowIdStr, //
@PathVariable(PARAM_ViewId) final String viewIdStr, //
@PathVariable(PARAM_RowId) final String rowIdStr, //
@PathVariable("attributeName") final String attributeName, //
@RequestParam(name = "query", required = true) final String query) {
userSession.assertLoggedIn();
final ViewId viewId = ViewId.of(windowIdStr, viewIdStr);
final DocumentId rowId = DocumentId.of(rowIdStr);
return viewsRepo.getView(viewId).getById(rowId).getAttributes().getAttributeTypeahead(attributeName, query).transform(JSONLookupValuesList::ofLookupValuesList);
}
use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class ViewRowEditRestController method getFieldTypeahead.
@GetMapping("/{fieldName}/typeahead")
public JSONLookupValuesList getFieldTypeahead(@PathVariable(PARAM_WindowId) final String windowIdStr, @PathVariable(PARAM_ViewId) final String viewIdStr, @PathVariable(PARAM_RowId) final String rowIdStr, @PathVariable(PARAM_FieldName) final String fieldName, @RequestParam("query") final String query) {
userSession.assertLoggedIn();
final ViewId viewId = ViewId.of(windowIdStr, viewIdStr);
final DocumentId rowId = DocumentId.of(rowIdStr);
final IEditableView view = getEditableView(viewId);
final RowEditingContext editingCtx = createRowEditingContext(rowId);
return view.getFieldTypeahead(editingCtx, fieldName, query).transform(JSONLookupValuesList::ofLookupValuesList);
}
use of de.metas.ui.web.window.datatypes.json.JSONLookupValuesList in project metasfresh-webui-api by metasfresh.
the class ViewRowEditRestController method getFieldDropdown.
@GetMapping("/{fieldName}/dropdown")
public JSONLookupValuesList getFieldDropdown(@PathVariable(PARAM_WindowId) final String windowIdStr, @PathVariable(PARAM_ViewId) final String viewIdStr, @PathVariable(PARAM_RowId) final String rowIdStr, @PathVariable(PARAM_FieldName) final String fieldName) {
userSession.assertLoggedIn();
final ViewId viewId = ViewId.of(windowIdStr, viewIdStr);
final DocumentId rowId = DocumentId.of(rowIdStr);
final IEditableView view = getEditableView(viewId);
final RowEditingContext editingCtx = createRowEditingContext(rowId);
return view.getFieldDropdown(editingCtx, fieldName).transform(JSONLookupValuesList::ofLookupValuesList);
}
Aggregations