Search in sources :

Example 1 with JSONQuickInputLayoutDescriptor

use of de.metas.ui.web.window.datatypes.json.JSONQuickInputLayoutDescriptor in project metasfresh-webui-api by metasfresh.

the class WindowQuickInputRestController method getLayout.

@GetMapping("/layout")
public JSONQuickInputLayoutDescriptor getLayout(// 
@PathVariable("windowId") final String windowIdStr, // 
@PathVariable("documentId") final String documentIdStr_NOTUSED, // 
@PathVariable("tabId") final String tabIdStr) {
    userSession.assertLoggedIn();
    final WindowId windowId = WindowId.fromJson(windowIdStr);
    final DocumentEntityDescriptor includedDocumentDescriptor = documentsCollection.getDocumentEntityDescriptor(windowId).getIncludedEntityByDetailId(DetailId.fromJson(tabIdStr));
    final QuickInputDescriptor quickInputDescriptor = quickInputDescriptors.getQuickInputEntityDescriptor(includedDocumentDescriptor);
    if (quickInputDescriptor == null) {
        return null;
    }
    final QuickInputLayoutDescriptor layout = quickInputDescriptor.getLayout();
    return JSONQuickInputLayoutDescriptor.fromNullable(layout, newJSONOptions());
}
Also used : WindowId(de.metas.ui.web.window.datatypes.WindowId) JSONQuickInputLayoutDescriptor(de.metas.ui.web.window.datatypes.json.JSONQuickInputLayoutDescriptor) DocumentEntityDescriptor(de.metas.ui.web.window.descriptor.DocumentEntityDescriptor) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

WindowId (de.metas.ui.web.window.datatypes.WindowId)1 JSONQuickInputLayoutDescriptor (de.metas.ui.web.window.datatypes.json.JSONQuickInputLayoutDescriptor)1 DocumentEntityDescriptor (de.metas.ui.web.window.descriptor.DocumentEntityDescriptor)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1