use of de.metas.ui.web.view.IEditableView.RowEditingContext in project metasfresh-webui-api by metasfresh.
the class ViewRowEditRestController method patchRow.
@PatchMapping
public JSONViewRow patchRow(@PathVariable(PARAM_WindowId) final String windowIdStr, @PathVariable(PARAM_ViewId) final String viewIdStr, @PathVariable(PARAM_RowId) final String rowIdStr, @RequestBody final List<JSONDocumentChangedEvent> fieldChangeRequests) {
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);
view.patchViewRow(editingCtx, fieldChangeRequests);
final IViewRow row = view.getById(rowId);
final IViewRowOverrides rowOverrides = ViewRowOverridesHelper.getViewRowOverrides(view);
return JSONViewRow.ofRow(row, rowOverrides, userSession.getAD_Language());
}
use of de.metas.ui.web.view.IEditableView.RowEditingContext 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.view.IEditableView.RowEditingContext 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