use of de.metas.ui.web.window.datatypes.DocumentId in project metasfresh-webui-api by metasfresh.
the class QuickInput method complete.
/**
* @return newly created document
*/
public Document complete() {
Services.get(ITrxManager.class).assertThreadInheritedTrxExists();
final IQuickInputProcessor processor = descriptor.createProcessor();
final DocumentId documentLineId = processor.process(this);
final Document rootDocument = getRootDocument();
final Document includedDocumentJustCreated = rootDocument.getIncludedDocument(targetDetailId, documentLineId);
this.completed = true;
return includedDocumentJustCreated;
}
use of de.metas.ui.web.window.datatypes.DocumentId in project metasfresh-webui-api by metasfresh.
the class DefaultView method getFieldTypeahead.
@Override
public LookupValuesList getFieldTypeahead(final RowEditingContext ctx, final String fieldName, final String query) {
final DocumentId rowId = ctx.getRowId();
final DocumentCollection documentsCollection = ctx.getDocumentsCollection();
final DocumentPath documentPath = getById(rowId).getDocumentPath();
return documentsCollection.forDocumentReadonly(documentPath, document -> document.getFieldLookupValuesForQuery(fieldName, query));
}
use of de.metas.ui.web.window.datatypes.DocumentId 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.DocumentId 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