source: trunk/grails-app/controllers/dbnp/query/QueryController.groovy @ 482

Last change on this file since 482 was 482, checked in by keesvb, 13 years ago

solved compilation error, added relative date type, restructured menu's, changed topnav layout to also scrolldown on click on main buttons

  • Property svn:keywords set to Date Author Rev
File size: 3.1 KB
Line 
1package dbnp.query
2
3import org.compass.core.engine.SearchEngineQueryParseException
4
5/*
6 * Copyright 2007 the original author or authors.
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 *      http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20
21
22/**
23 * Basic web interface for Grails Searchable Plugin
24 *
25 * @author Adem and Jahn
26 */
27class QueryController {
28
29    def searchableService
30
31    def index = {
32        redirect( action:'pages')
33    }
34
35        def results= {
36          println('query controller')
37        if (!params.q?.trim()) {
38            return [:]
39        }
40        try {
41            return [searchResult: searchableService.search(params.q, params)]
42        } catch (SearchEngineQueryParseException ex) {
43            return [parseException: true]
44        }
45    }
46
47    def pagesFlow = {
48       
49        onStart {
50                flow.page = 0
51                        flow.pages = [
52                                [title: 'Query'],
53                                [title: 'Study'],
54                                [title: 'Samples'],
55                                [title: 'Biomarkers'],
56                                [title: 'Groups'],
57                                [title: 'Done']
58                        ]
59        }
60
61        mainPage {
62
63             render( view:'/query/mainPage')
64
65             onRender {
66                println "done randering index"
67                flow.page=1
68             }
69             on("next") {
70                println "clicked next in sample"
71             } .to 'inputQuery'
72        }       
73
74        inputQuery {
75            render(view:'_inputQuery')
76            onRender {
77                flow.page=1
78            }
79        }
80
81        study {
82             render( view:'_study')
83            onRender {
84                flow.page=2
85             }
86             on("next") {
87                println "clicked next in sample"
88             } .to 'sample'
89             on("previous"){}.to 'inputQuery'
90        }
91
92        sample {
93             render( view:'_sample')
94            onRender {
95                flow.page=3
96             }
97             on("next") {
98                println "clicked next in sample"
99             } .to 'biomarker'
100             on("previous"){}.to 'study'
101        }
102
103
104        biomarker {
105             render( view:'_biomarker')
106            onRender {
107                flow.page=4
108             }
109             on("next") {
110                println "clicked next in sample"
111             } .to 'group'
112             on("previous"){}.to 'sample'
113        }
114
115        group {
116             render( view:'_group')
117            onRender {
118                flow.page=5
119             }
120             on("next") {
121                println "clicked next in sample"
122             } .to 'result'
123             on("previous"){}.to 'biomarkers'
124        }
125
126        result {
127             render( view:'_result')
128
129            onRender {
130                flow.page=6
131             }
132             on("previous"){}.to 'group'
133        }
134
135    }
136
137
138    def testo = {
139       render "Hello testo"
140       render MyManager.hello() 
141    }
142
143
144}
Note: See TracBrowser for help on using the repository browser.