]> git.argeo.org Git - gpl/argeo-slc.git/blob - runtime/org.argeo.slc.server/src/main/java/org/argeo/slc/web/mvc/process/GetSlcExecution.java
eea87a6ab8abadd980cd727a76f1121c49483d88
[gpl/argeo-slc.git] / runtime / org.argeo.slc.server / src / main / java / org / argeo / slc / web / mvc / process / GetSlcExecution.java
1 package org.argeo.slc.web.mvc.process;
2
3 import javax.servlet.http.HttpServletRequest;
4 import javax.servlet.http.HttpServletResponse;
5
6 import org.argeo.slc.dao.process.SlcExecutionDao;
7 import org.argeo.slc.msg.ObjectList;
8 import org.argeo.slc.process.SlcExecution;
9 import org.argeo.slc.web.mvc.AbstractServiceController;
10 import org.springframework.oxm.Unmarshaller;
11 import org.springframework.web.servlet.ModelAndView;
12 import org.springframework.xml.transform.StringSource;
13
14 /** Lists SLC executions possibly filtering them. */
15 public class GetSlcExecution extends AbstractServiceController {
16 private SlcExecutionDao slcExecutionDao;
17 private Unmarshaller unmarshaller;
18
19 @Override
20 protected void handleServiceRequest(HttpServletRequest request,
21 HttpServletResponse response, ModelAndView modelAndView)
22 throws Exception {
23 String uuid = request.getParameter("uuid");
24 SlcExecution slcExecution = slcExecutionDao.getSlcExecution(uuid);
25
26 StringSource source = new StringSource(slcExecution
27 .getRealizedFlowsXml());
28 ObjectList ol2 = (ObjectList) unmarshaller.unmarshal(source);
29 ol2.fill(slcExecution.getRealizedFlows());
30
31 modelAndView.addObject(slcExecution);
32 }
33
34 public void setSlcExecutionDao(SlcExecutionDao slcExecutionDao) {
35 this.slcExecutionDao = slcExecutionDao;
36 }
37
38 public void setUnmarshaller(Unmarshaller unmarshaller) {
39 this.unmarshaller = unmarshaller;
40 }
41
42 }