Search in sources :

Example 1 with JSONProcessLayout

use of de.metas.ui.web.process.json.JSONProcessLayout in project metasfresh-webui-api by metasfresh.

the class ProcessRestController method getLayout.

@RequestMapping(value = "/{processId}/layout", method = RequestMethod.GET)
public ResponseEntity<JSONProcessLayout> getLayout(@PathVariable("processId") final String adProcessIdStr, final WebRequest request) {
    userSession.assertLoggedIn();
    final ProcessId processId = ProcessId.fromJson(adProcessIdStr);
    final IProcessInstancesRepository instancesRepository = getRepository(processId);
    final ProcessDescriptor descriptor = instancesRepository.getProcessDescriptor(processId);
    return ETagResponseEntityBuilder.ofETagAware(request, descriptor).includeLanguageInETag().cacheMaxAge(userSession.getHttpCacheMaxAge()).map(ProcessDescriptor::getLayout).jsonOptions(() -> newJSONOptions()).toJson(JSONProcessLayout::of);
}
Also used : ProcessDescriptor(de.metas.ui.web.process.descriptor.ProcessDescriptor) WebuiRelatedProcessDescriptor(de.metas.ui.web.process.descriptor.WebuiRelatedProcessDescriptor) JSONProcessLayout(de.metas.ui.web.process.json.JSONProcessLayout) RequestMapping(org.springframework.web.bind.annotation.RequestMapping)

Aggregations

ProcessDescriptor (de.metas.ui.web.process.descriptor.ProcessDescriptor)1 WebuiRelatedProcessDescriptor (de.metas.ui.web.process.descriptor.WebuiRelatedProcessDescriptor)1 JSONProcessLayout (de.metas.ui.web.process.json.JSONProcessLayout)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1