use of de.metas.ui.web.window.datatypes.json.JSONDocumentOptions in project metasfresh-webui-api by metasfresh.
the class ETagResponseEntityBuilder method getJSONDocumentOptions.
private JSONDocumentOptions getJSONDocumentOptions() {
final Supplier<JSONDocumentOptions> jsonDocumentOptionsSupplier = this._jsonDocumentOptionsSupplier;
if (jsonDocumentOptionsSupplier == null) {
throw new IllegalStateException("jsonDocumentOptions suppliere not configured");
}
final JSONDocumentOptions jsonDocumentOptions = jsonDocumentOptionsSupplier.get();
if (jsonDocumentOptions == null) {
throw new IllegalStateException("jsonDocumentOptions not configured");
}
return jsonDocumentOptions;
}
use of de.metas.ui.web.window.datatypes.json.JSONDocumentOptions in project metasfresh-webui-api by metasfresh.
the class WindowRestController method patchDocument.
private List<JSONDocument> patchDocument(final DocumentPath documentPath, final boolean advanced, final List<JSONDocumentChangedEvent> events) {
userSession.assertLoggedIn();
final JSONDocumentOptions jsonOpts = newJSONDocumentOptions().showAdvancedFields(advanced).build();
return Execution.callInNewExecution("window.commit", () -> patchDocument0(documentPath, events, jsonOpts));
}
use of de.metas.ui.web.window.datatypes.json.JSONDocumentOptions in project metasfresh-webui-api by metasfresh.
the class WindowRestController method getIncludedTabRow.
@GetMapping("/{windowId}/{documentId}/{tabId}/{rowId}")
public List<JSONDocument> getIncludedTabRow(//
@PathVariable("windowId") final String windowIdStr, //
@PathVariable("documentId") final String documentIdStr, //
@PathVariable("tabId") final String tabIdStr, //
@PathVariable("rowId") final String rowIdStr, //
@RequestParam(name = PARAM_FieldsList, required = false) @ApiParam("comma separated field names") final String fieldsListStr, //
@RequestParam(name = PARAM_Advanced, required = false, defaultValue = PARAM_Advanced_DefaultValue) final boolean advanced) {
final WindowId windowId = WindowId.fromJson(windowIdStr);
final DocumentPath documentPath = DocumentPath.includedDocumentPath(windowId, documentIdStr, tabIdStr, rowIdStr);
final JSONDocumentOptions jsonOpts = newJSONDocumentOptions().showOnlyFieldsListStr(fieldsListStr).showAdvancedFields(advanced).build();
return getData(documentPath, DocumentQueryOrderByList.EMPTY, jsonOpts);
}
use of de.metas.ui.web.window.datatypes.json.JSONDocumentOptions in project metasfresh-webui-api by metasfresh.
the class WindowRestController method deleteDocuments.
private List<JSONDocument> deleteDocuments(final List<DocumentPath> documentPaths) {
userSession.assertLoggedIn();
final JSONDocumentOptions jsonOpts = newJSONDocumentOptions().showAdvancedFields(false).build();
return Execution.callInNewExecution("window.delete", () -> {
final IDocumentChangesCollector changesCollector = Execution.getCurrentDocumentChangesCollectorOrNull();
documentCollection.deleteAll(documentPaths, changesCollector);
return JSONDocument.ofEvents(changesCollector, jsonOpts);
});
}
use of de.metas.ui.web.window.datatypes.json.JSONDocumentOptions in project metasfresh-webui-api by metasfresh.
the class WindowRestController method getRootDocuments.
@GetMapping("/{windowId}/{documentId}")
public List<JSONDocument> getRootDocuments(@PathVariable("windowId") final String windowIdStr, @PathVariable("documentId") final String documentIdStr, @RequestParam(name = PARAM_FieldsList, required = false) @ApiParam("comma separated field names") final String fieldsListStr, @RequestParam(name = PARAM_Advanced, required = false, defaultValue = PARAM_Advanced_DefaultValue) final boolean advanced, @RequestParam(name = "noTabs", required = false, defaultValue = "false") final boolean noTabs) {
final WindowId windowId = WindowId.fromJson(windowIdStr);
final DocumentPath documentPath = DocumentPath.rootDocumentPath(windowId, documentIdStr);
final JSONDocumentOptions jsonOpts = newJSONDocumentOptions().showOnlyFieldsListStr(fieldsListStr).showAdvancedFields(advanced).doNotFetchIncludedTabs(noTabs).build();
return getData(documentPath, DocumentQueryOrderByList.EMPTY, jsonOpts);
}
Aggregations