1 | package dbnp.setup |
---|
2 | |
---|
3 | /** |
---|
4 | * Setup / migration assistant |
---|
5 | * |
---|
6 | * @author Jeroen Wesbeek |
---|
7 | * @since 20101111 |
---|
8 | * @package studycapturing |
---|
9 | * |
---|
10 | * Revision information: |
---|
11 | * $Rev$ |
---|
12 | * $Author$ |
---|
13 | * $Date$ |
---|
14 | */ |
---|
15 | class SetupController { |
---|
16 | def index = { |
---|
17 | redirect(action: 'pages') |
---|
18 | } |
---|
19 | |
---|
20 | def pagesFlow = { |
---|
21 | // start the flow |
---|
22 | onStart { |
---|
23 | // define flow variables |
---|
24 | flow.page = 0 |
---|
25 | flow.pages = [ |
---|
26 | //[title: 'Templates'], // templates |
---|
27 | [title: 'Start'], // load or create a study |
---|
28 | [title: 'Study'], // study |
---|
29 | [title: 'Subjects'], // subjects |
---|
30 | [title: 'Events'], // events and event grouping |
---|
31 | //[title: 'Event Groups'], // groups |
---|
32 | [title: 'Samples'], // samples |
---|
33 | [title: 'Assays'], // assays |
---|
34 | //[title: 'Assay Groups'], // assays |
---|
35 | [title: 'Confirmation'], // confirmation page |
---|
36 | [title: 'Done'] // finish page |
---|
37 | ] |
---|
38 | flow.jump = session.jump |
---|
39 | success() |
---|
40 | } |
---|
41 | |
---|
42 | // render the main wizard page which immediately |
---|
43 | // triggers the 'next' action (hence, the main |
---|
44 | // page dynamically renders the study template |
---|
45 | // and makes the flow jump to the study logic) |
---|
46 | mainPage { |
---|
47 | render(view: "/setup/index") |
---|
48 | onRender { |
---|
49 | flow.page = 1 |
---|
50 | success() |
---|
51 | } |
---|
52 | on("next").to "start" |
---|
53 | } |
---|
54 | |
---|
55 | // create or modify a study |
---|
56 | start { |
---|
57 | render(view: "_start") |
---|
58 | onRender { |
---|
59 | flow.page = 1 |
---|
60 | success() |
---|
61 | } |
---|
62 | on("next") { |
---|
63 | // clean the flow scope |
---|
64 | flow.remove('study') |
---|
65 | |
---|
66 | // set 'quicksave' variable to false |
---|
67 | flow.quickSave = false |
---|
68 | }.to "study" |
---|
69 | on("modify").to "modify" |
---|
70 | on("import").to "redirectToImport" |
---|
71 | } |
---|
72 | } |
---|
73 | } |
---|