Search in sources :

Example 96 with DocumentId

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;
}
Also used : ITrxManager(org.adempiere.ad.trx.api.ITrxManager) DocumentId(de.metas.ui.web.window.datatypes.DocumentId) Document(de.metas.ui.web.window.model.Document)

Example 97 with DocumentId

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));
}
Also used : DocumentId(de.metas.ui.web.window.datatypes.DocumentId) DocumentPath(de.metas.ui.web.window.datatypes.DocumentPath) DocumentCollection(de.metas.ui.web.window.model.DocumentCollection)

Example 98 with DocumentId

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);
}
Also used : DocumentId(de.metas.ui.web.window.datatypes.DocumentId) RowEditingContext(de.metas.ui.web.view.IEditableView.RowEditingContext) JSONLookupValuesList(de.metas.ui.web.window.datatypes.json.JSONLookupValuesList) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Example 99 with DocumentId

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);
}
Also used : DocumentId(de.metas.ui.web.window.datatypes.DocumentId) RowEditingContext(de.metas.ui.web.view.IEditableView.RowEditingContext) JSONLookupValuesList(de.metas.ui.web.window.datatypes.json.JSONLookupValuesList) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

DocumentId (de.metas.ui.web.window.datatypes.DocumentId)99 DocumentPath (de.metas.ui.web.window.datatypes.DocumentPath)18 DocumentIdsSelection (de.metas.ui.web.window.datatypes.DocumentIdsSelection)14 List (java.util.List)14 ImmutableList (com.google.common.collect.ImmutableList)12 GetMapping (org.springframework.web.bind.annotation.GetMapping)12 AdempiereException (org.adempiere.exceptions.AdempiereException)11 JSONLookupValuesList (de.metas.ui.web.window.datatypes.json.JSONLookupValuesList)9 ArrayList (java.util.ArrayList)9 Set (java.util.Set)9 NonNull (lombok.NonNull)9 Test (org.junit.Test)9 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)9 UserSession (de.metas.ui.web.session.UserSession)8 ViewId (de.metas.ui.web.view.ViewId)8 DocumentEntityDescriptor (de.metas.ui.web.window.descriptor.DocumentEntityDescriptor)8 Document (de.metas.ui.web.window.model.Document)8 IDocumentChangesCollector (de.metas.ui.web.window.model.IDocumentChangesCollector)8 TableRecordReference (org.adempiere.util.lang.impl.TableRecordReference)8 Autowired (org.springframework.beans.factory.annotation.Autowired)8