Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI05-delivery/ows_framework/trunk/ows_server/ows_server/controllers/visualise.py@2862
Revision 2862,
1.1 KB
checked in by lawrence, 14 years ago
(diff) |
Interim checkin on the way to handling options on the
visualise and download pages
|
Line | |
---|
1 | from ows_server.lib.base import * |
---|
2 | from ows_server.lib.ndgInterface import interface |
---|
3 | |
---|
4 | |
---|
5 | class VisualiseController(BaseController): |
---|
6 | |
---|
7 | def __setup(self): |
---|
8 | |
---|
9 | c.fullpage=1 # we want the whole page |
---|
10 | c.datasets = {} |
---|
11 | c.inpageid = 'api' |
---|
12 | self.first=None |
---|
13 | |
---|
14 | for uri, dif in session.get('selection', []): |
---|
15 | (rstatus, dataset) = interface.GetParsedCSML(uri) |
---|
16 | if not rstatus: |
---|
17 | c.xml='<div class="error">%s</div>'%dataset |
---|
18 | return render_response('error') |
---|
19 | |
---|
20 | c.datasets[uri] = dataset |
---|
21 | if self.first is None: self.first=uri |
---|
22 | |
---|
23 | def index(self): |
---|
24 | |
---|
25 | self.__setup() |
---|
26 | if c.datasets!={}: |
---|
27 | c.visible='Dataset' |
---|
28 | c.currentDataset=self.first |
---|
29 | |
---|
30 | return render_response('visualise') |
---|
31 | |
---|
32 | def inpagetab(self,dataset,view): |
---|
33 | ''' Take ajax request for inpage tab change ''' |
---|
34 | self.__setup() |
---|
35 | c.visible=view |
---|
36 | c.currentDataset=dataset |
---|
37 | |
---|
38 | c.fullpage=0 |
---|
39 | return render_response('visualise',fragment=True) |
---|
40 | |
---|
Note: See
TracBrowser
for help on using the repository browser.