19
19
20
20
package org .commonwl .view .workflow ;
21
21
22
+ import java .io .File ;
23
+ import java .io .IOException ;
24
+ import java .util .List ;
25
+
26
+ import javax .servlet .http .HttpServletRequest ;
27
+ import javax .servlet .http .HttpServletResponse ;
28
+ import javax .validation .Valid ;
29
+
22
30
import org .apache .commons .lang .StringUtils ;
31
+ import org .commonwl .view .WebConfig ;
23
32
import org .commonwl .view .cwl .CWLToolStatus ;
24
33
import org .commonwl .view .git .GitDetails ;
25
34
import org .commonwl .view .graphviz .GraphVizService ;
36
45
import org .springframework .ui .Model ;
37
46
import org .springframework .validation .BeanPropertyBindingResult ;
38
47
import org .springframework .validation .BindingResult ;
39
- import org .springframework .web .bind .annotation .*;
48
+ import org .springframework .web .bind .annotation .GetMapping ;
49
+ import org .springframework .web .bind .annotation .PathVariable ;
50
+ import org .springframework .web .bind .annotation .PostMapping ;
51
+ import org .springframework .web .bind .annotation .RequestParam ;
52
+ import org .springframework .web .bind .annotation .ResponseBody ;
40
53
import org .springframework .web .servlet .HandlerMapping ;
41
54
import org .springframework .web .servlet .ModelAndView ;
42
55
import org .springframework .web .servlet .mvc .support .RedirectAttributes ;
43
56
44
- import javax .servlet .http .HttpServletRequest ;
45
- import javax .servlet .http .HttpServletResponse ;
46
- import javax .validation .Valid ;
47
- import java .io .File ;
48
- import java .io .IOException ;
49
- import java .util .List ;
50
-
51
57
@ Controller
52
58
public class WorkflowController {
53
59
@@ -58,15 +64,19 @@ public class WorkflowController {
58
64
private final GraphVizService graphVizService ;
59
65
60
66
/**
61
- * Autowired constructor to initialise objects used by the controller
62
- * @param workflowFormValidator Validator to validate the workflow form
63
- * @param workflowService Builds new Workflow objects
64
- * @param graphVizService Generates and stores imagess
67
+ * Autowired constructor to initialise objects used by the controller.
68
+ *
69
+ * @param workflowFormValidator
70
+ * Validator to validate the workflow form
71
+ * @param workflowService
72
+ * Builds new Workflow objects
73
+ * @param graphVizService
74
+ * Generates and stores images
65
75
*/
66
76
@ Autowired
67
77
public WorkflowController (WorkflowFormValidator workflowFormValidator ,
68
78
WorkflowService workflowService ,
69
- GraphVizService graphVizService ) {
79
+ GraphVizService graphVizService ) {
70
80
this .workflowFormValidator = workflowFormValidator ;
71
81
this .workflowService = workflowService ;
72
82
this .graphVizService = graphVizService ;
@@ -532,7 +542,8 @@ private ModelAndView getWorkflow(GitDetails gitDetails, RedirectAttributes redir
532
542
}
533
543
return new ModelAndView ("loading" , "queued" , queued );
534
544
} else {
535
- return new ModelAndView ("workflow" , "workflow" , workflowModel );
545
+ return new ModelAndView ("workflow" , "workflow" , workflowModel ).addObject ("formats" ,
546
+ WebConfig .formats .values ());
536
547
}
537
548
}
538
549
}
0 commit comments