1 package org
.argeo
.slc
.web
.mvc
.process
;
5 import javax
.servlet
.http
.HttpServletRequest
;
6 import javax
.servlet
.http
.HttpServletResponse
;
8 import org
.springframework
.web
.servlet
.ModelAndView
;
9 import org
.springframework
.web
.servlet
.mvc
.ParameterizableViewController
;
11 import org
.apache
.commons
.logging
.Log
;
12 import org
.apache
.commons
.logging
.LogFactory
;
14 import org
.argeo
.slc
.core
.SlcException
;
15 import org
.argeo
.slc
.core
.process
.SlcExecution
;
16 import org
.argeo
.slc
.core
.process
.SlcExecutionStep
;
17 import org
.argeo
.slc
.dao
.process
.SlcExecutionDao
;
19 public class SlcExecutionViewController
extends ParameterizableViewController
{
20 private Log log
= LogFactory
.getLog(getClass());
22 private final SlcExecutionDao slcExecutionDao
;
24 public SlcExecutionViewController(SlcExecutionDao slcExecutionDao
) {
25 this.slcExecutionDao
= slcExecutionDao
;
29 protected ModelAndView
handleRequestInternal(HttpServletRequest request
,
30 HttpServletResponse response
) throws Exception
{
31 ModelAndView modelAndView
= new ModelAndView();
33 // List<SlcExecution> slcExecutions =
34 // slcExecutionDao.listSlcExecutions();
35 String uuid
= request
.getParameter("uuid");
37 throw new SlcException("Parameter uuid required.");
39 SlcExecution slcExecution
= slcExecutionDao
.getSlcExecution(uuid
);
41 if (slcExecution
== null)
42 throw new SlcException("Could not find slc execution with uuid "
45 if (log
.isDebugEnabled()) {
46 log
.debug("SlcExecution " + slcExecution
.getUuid());
49 List
<SlcExecutionStep
> slcExecutionSteps
= slcExecution
.getSteps();
51 modelAndView
.addObject("slcExecutionSteps", slcExecutionSteps
);
52 modelAndView
.addObject("slcExecution", slcExecution
);
53 modelAndView
.setViewName(getViewName());