1 | <html xmlns="http://www.w3.org/1999/xhtml" |
---|
2 | xmlns:py="http://genshi.edgewall.org/"> |
---|
3 | <dl py:def="attributes(attrs)" class="attributes"> |
---|
4 | <py:for each="k, v in attrs.items()"> |
---|
5 | <dt>${k}</dt> |
---|
6 | <dd py:choose=""> |
---|
7 | <py:when test="isinstance(v, dict)">${attributes(v)}</py:when> |
---|
8 | <py:otherwise>${v}</py:otherwise> |
---|
9 | </dd> |
---|
10 | </py:for> |
---|
11 | </dl> |
---|
12 | |
---|
13 | <div py:def="children(var)" class="children"> |
---|
14 | <fieldset py:for="child in var.walk()"> |
---|
15 | <legend>${child.name}</legend> |
---|
16 | |
---|
17 | <?python |
---|
18 | from pydap.model import * |
---|
19 | ?> |
---|
20 | <py:choose test=""> |
---|
21 | <p py:when="isinstance(child, SequenceType)" class="filter"> |
---|
22 | <select class="var1" name="var1_${child.id}[0]" id="var1_${child.id}[0]"> |
---|
23 | <option value="--" selected="selected">--</option> |
---|
24 | <option py:for="grandchild in child.walk()" value="${grandchild.id}">${grandchild.id}</option> |
---|
25 | </select> |
---|
26 | <select class="op" name="op_${child.id}[0]" id="op_${child.id}[0]"> |
---|
27 | <option value="%3D" selected="selected">=</option> |
---|
28 | <option value="%21%3D">!=</option> |
---|
29 | <option value="%3C"><</option> |
---|
30 | <option value="%3C%3D"><=</option> |
---|
31 | <option value="%3E">></option> |
---|
32 | <option value="%3E%3D">>=</option> |
---|
33 | <option value="%3D%7E">=~</option> |
---|
34 | </select> |
---|
35 | <input type="text" name="var2_${child.id}[0]" id="var2_${child.id}[0]" value="" class="var2" /> |
---|
36 | </p> |
---|
37 | <div py:when="isinstance(child, (BaseType, GridType))"> |
---|
38 | <p><input type="checkbox" name="${child.id}" id="${child.id}" /><label for="${child.id}">Retrieve this variable.</label></p> |
---|
39 | <?python |
---|
40 | dimensions = child.dimensions or ['dim_%id' % j for j in range(len(child.shape))] |
---|
41 | ?> |
---|
42 | <div py:for="i in range(len(child.shape))"> |
---|
43 | <label for="${child.id}[${i}]">${dimensions[i]}</label>:<br /> |
---|
44 | <input type="text" name="${child.id}[${i}]" id="${child.id}[${i}]" value="0:1:${child.shape[i]-1}" /><br /> |
---|
45 | </div> |
---|
46 | </div> |
---|
47 | </py:choose> |
---|
48 | |
---|
49 | ${attributes(child.attributes)} |
---|
50 | ${children(child)} |
---|
51 | </fieldset> |
---|
52 | </div> |
---|
53 | |
---|
54 | <head> |
---|
55 | <title>DODS Server: ${dataset.name}</title> |
---|
56 | |
---|
57 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
---|
58 | <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.min.js"> |
---|
59 | </script> |
---|
60 | <script type="text/javascript"> |
---|
61 | //<![CDATA[ |
---|
62 | $(document).ready(function(){ |
---|
63 | var re = /(.*)\[(\d+)\]/; |
---|
64 | $('p.filter:last > select.var1').change(function() { |
---|
65 | if (this.value != '--') { |
---|
66 | var snippet = $(this.parentNode).clone(true); |
---|
67 | // Replace ids with unique ones. |
---|
68 | snippet.find('.var1,.op,.var2').each(function() { |
---|
69 | match = re.exec(this.id); |
---|
70 | base = match[1]; |
---|
71 | counter = parseInt(match[2]) + 1; |
---|
72 | this.name = this.id = base + '[' + counter + ']'; |
---|
73 | }); |
---|
74 | snippet.insertAfter(this.parentNode); |
---|
75 | $(this).unbind('change'); |
---|
76 | } |
---|
77 | }); |
---|
78 | }); |
---|
79 | //]]> |
---|
80 | </script> |
---|
81 | <link media="all, screen" href="ndg2.css" type="text/css" rel="stylesheet"/> |
---|
82 | </head> |
---|
83 | |
---|
84 | <body> |
---|
85 | <div> |
---|
86 | <div id="header"></div> |
---|
87 | <div id="logo"><img src="NERC_Logo.gif" alt="Natural Environment Research Council"/></div> |
---|
88 | </div> |
---|
89 | <h1>DODS Server: ${dataset.name}</h1> |
---|
90 | |
---|
91 | <!-- Global attributes --> |
---|
92 | ${attributes(dataset.attributes)} |
---|
93 | |
---|
94 | <hr /> |
---|
95 | <form id="dods_form" method="post" action="${location}"> |
---|
96 | <!-- Dataset variables --> |
---|
97 | ${children(dataset)} |
---|
98 | |
---|
99 | <p><input type="submit" id="submit" value="Download data" /> as |
---|
100 | <select id="response" name="response"> |
---|
101 | <option value="ascii" selected="selected">ASCII</option> |
---|
102 | <option py:for="response in responses" value="$response">$response</option> |
---|
103 | </select> |
---|
104 | <br /><input type="reset" value="Reset" /></p> |
---|
105 | </form> |
---|
106 | |
---|
107 | <hr /> |
---|
108 | <pre><code>$dds</code></pre> |
---|
109 | |
---|
110 | <div id="Footer"> |
---|
111 | |
---|
112 | <center><table><tbody> |
---|
113 | <tr> |
---|
114 | <td width="60%" align="left"> |
---|
115 | <table><tbody> |
---|
116 | <tr> |
---|
117 | <td><span> |
---|
118 | <a href="http://ndg.nerc.ac.uk/"><image src="ndg_logo_circle.gif" alt="NDG" title="NDG"></image></a> |
---|
119 | </span></td> |
---|
120 | <td><a href="http://pydap.org">pydap/$version</a> based OPeNDAP site for <a href="http://ndg.nerc.ac.uk">NERC DataGrid</a>. |
---|
121 | |
---|
122 | This site is for test purposes only and is under active development.</td> |
---|
123 | </tr> |
---|
124 | </tbody></table> |
---|
125 | </td> |
---|
126 | <td align="right"><span> |
---|
127 | <a href="http://www.stfc.ac.uk/"><image src="stfc-circle-sm.gif" alt="Hosted by the STFC CEDA" title="Hosted by the STFC CEDA"></image></a> |
---|
128 | </span></td> |
---|
129 | </tr> |
---|
130 | </tbody></table></center> |
---|
131 | </div> |
---|
132 | </body> |
---|
133 | </html> |
---|
134 | |
---|
135 | <!--! vim:ft=genshi |
---|
136 | --> |
---|