Search in sources :

Example 1 with JSONViewLayout

use of de.metas.ui.web.view.json.JSONViewLayout in project metasfresh-webui-api by metasfresh.

the class ViewRestController method getViewLayout.

@GetMapping("/layout")
public ResponseEntity<JSONViewLayout> getViewLayout(@PathVariable(PARAM_WindowId) final String windowIdStr, @RequestParam(name = PARAM_ViewDataType, required = true) final JSONViewDataType viewDataType, @RequestParam(name = "profileId", required = false) final String profileIdStr, final WebRequest request) {
    userSession.assertLoggedIn();
    final WindowId windowId = WindowId.fromJson(windowIdStr);
    final ViewLayout viewLayout = viewsRepo.getViewLayout(windowId, viewDataType, ViewProfileId.fromJson(profileIdStr));
    return ETagResponseEntityBuilder.ofETagAware(request, viewLayout).includeLanguageInETag().cacheMaxAge(userSession.getHttpCacheMaxAge()).jsonOptions(() -> newJSONOptions()).toJson(JSONViewLayout::of);
}
Also used : WindowId(de.metas.ui.web.window.datatypes.WindowId) ViewLayout(de.metas.ui.web.view.descriptor.ViewLayout) JSONViewLayout(de.metas.ui.web.view.json.JSONViewLayout) JSONViewLayout(de.metas.ui.web.view.json.JSONViewLayout) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

ViewLayout (de.metas.ui.web.view.descriptor.ViewLayout)1 JSONViewLayout (de.metas.ui.web.view.json.JSONViewLayout)1 WindowId (de.metas.ui.web.window.datatypes.WindowId)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1