Project

General

Profile

1
<?xml version="1.0"?>
2
<!--
3
  * marine.xsl
4
  *
5
  *      Authors: Matt Jones, Chad Berkley
6
  *    Copyright: 2000 Regents of the University of California and the 
7
  *               National Center for Ecological Analysis and Synthesis
8
  *  For Details: http://www.nceas.ucsb.edu/
9
  *      Created: 2000 July 20
10
  *    File Info: '$Id: marine.xsl 400 2000-08-23 17:20:44Z berkley $' 
11
  *
12
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
13
  * convert an XML file showing the resultset of a query
14
  * into an HTML format suitable for rendering with modern web browsers.
15
  * This stylesheet formats .
16
-->
17
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
18

    
19
  <xsl:output method="html"/>
20

    
21
  <xsl:template match="/">
22
    <html>
23
      <head>
24
	<link rel="stylesheet" type="text/css" href="@html-path@/marine/rowcol.css" />
25
      </head>
26
      <body class="emlbody">
27
        <a name="top" />
28
        <table width="100%">
29
        <tr>
30
          <td align="left" valign="top">
31
            <form action="@html-path@/servlet/marine#browse"
32
                  method="POST">
33
             <input type="hidden" name="action" value="query" />   
34
    	       <input type="hidden" name="query" value="" />
35
    	       <input type="hidden" name="qformat" value="html" />
36
             <input type="hidden" name="operator" value="UNION" />
37
             <input type="hidden" name="anyfield" value="%" />
38
             <input type="hidden" name="returnfield" value="title" />
39
             <input type="hidden" name="returnfield" value="surname" />
40
             <input type="hidden" name="returnfield" value="organizationname" />
41
             <input type="submit" value="Browse the Database" size="15" />
42
            </form>   
43
          </td>
44
          <td align="center" valign="bottom">
45
            <img src="@html-path@/marine/logo-line.gif" alt="NCEAS Logo" 
46
                 onClick="gotoNceas()" />
47
          </td>
48
          <td align="right" valign="top">
49
            <form action="@html-path@/servlet/marine#browse"
50
                  method="POST">
51
               Quick Search: <input type="text" name="anyfield" size="10" />
52
               <input type="hidden" name="action" value="query" />   
53
    	       <input type="hidden" name="qformat" value="html" />
54
    	       <input type="hidden" name="operator" value="UNION" />
55
             <input type="hidden" name="returnfield" value="title" />
56
             <input type="hidden" name="returnfield" value="surname" />
57
             <input type="hidden" name="returnfield" value="organizationname" />
58
    	     </form>
59
    	   </td>
60
    	 </tr>
61
        </table>
62
        
63
        <hr />
64
        
65
        <center><h1>MARINE Query Interface</h1></center>
66
        <font size="2">
67
        <p class="intro">
68
          This page is used to query information for 
69
          <a href="http://www.mms.gov/omm/pacific/enviro/mint.htm">MARINE</a> 
70
          scientists from
71
          the NCEAS Ecological Metadata Database.  For more information on
72
          this project, please read the 
73
          <a href=
74
          "http://www.nceas.ucsb.edu/marinedata/">
75
          proposal abstract</a>.
76
        </p>
77
        
78
        <p class="intro">
79
           Each step below contains several fields relating to a part of the 
80
           dataset.  You may also browse
81
           the entire database by simply clicking the browse link at the top 
82
           of the page.
83
           Clicking on the buttons next to each data line will give you more
84
           information about the dataset or allow you to download the entire 
85
           dataset.  
86
           Please note some fields in the query forms will not be pertinent to
87
           your dataset.  
88
           If this is the case, simply leave any field blank to omit it from 
89
           the searching.  
90
        </p>
91
        
92
        <p class="intro">
93
           Note that the wildcard character is a percent sign (%).  It may 
94
           be used in any
95
           field to denote "any" value.  For example, the query "do%" would 
96
           return "document"
97
           or "dog" or "domino" or "dolphin", etc.  Placing a single percent 
98
           sign in a field
99
           will return any document that contains that field.  Placing a 
100
           percent sign in
101
           the "Any Field" field is equivalent to browsing the database (i.e. 
102
           it will return
103
           every document).  
104
        </p>
105
        </font>
106
        
107
        <form action="@html-path@/servlet/marine#browse" 
108
              method="POST"> 
109
           
110
        <table width="100%" border="1">
111
          <tr>
112
             <td valign="bottom" width = "25">
113
        	<img src="@html-path@/marine/step1.jpg" />
114
             </td>
115
             <td>
116
               <h4>Keywords and Title</h4>
117
               <p>
118
               <font size="2">
119
                 Enter any keywords that might partain to the dataset you 
120
                 are looking for.  
121
                 The "Any Field" text box will search for any field in any 
122
                 document for 
123
                 the text you provide.  The title and alternate title will 
124
                 search for text 
125
                 in the title or alternate title fields of a document only.  
126
                 Fields left 
127
                 blank will not be used in the search criteria.
128
               </font></p>
129
             </td> 
130
          </tr>
131
        </table>
132
        
133
        <table width="100%">
134
             <tr>
135
                <td>Title:</td>
136
                <td>
137
                  <input type="text" name="title" size="15">
138
                  <xsl:attribute name="value">
139
                  <xsl:value-of select="resultset/query/title" />
140
                  </xsl:attribute>
141
                  </input>
142
                </td>
143
                <td>Any Field:</td>
144
                <td>
145
                  <input type="text" name="anyfield" size="15">
146
                  <xsl:attribute name="value">
147
                  <xsl:value-of select="resultset/query/anyfield" />
148
                  </xsl:attribute>
149
                  </input>
150
                </td>
151
             </tr>
152
             <tr>
153
                <td>Alternate Title:</td>
154
             	<td>        
155
		  <input type="text" name="alttitle" size="15">
156
             	  <xsl:attribute name="value">
157
                  <xsl:value-of select="resultset/query/alttitle" />
158
                  </xsl:attribute>
159
                  </input>
160
                </td>
161
                <td>Keywords:</td>
162
                <td>
163
                  <input type="text" name="keyword" size="15">
164
                  <xsl:attribute name="value">
165
                  <xsl:value-of select="resultset/query/keyword" />
166
                  </xsl:attribute>
167
                  </input>
168
                </td>
169
             </tr>
170
        </table>
171
        
172
        <table width="100%" border="1">
173
          <tr>
174
             <td valign="bottom" width="25">
175
        	<img src="@html-path@/marine/step2.jpg" />
176
             </td>
177
             <td>
178
                <h4>Dataset Owner Information</h4>
179
        	<p>
180
        	   <font size="2">
181
        	   Enter data about the owner of the dataset.  There may be more 
182
             than one
183
        	   owner of any given dataset.  Any field(s) left blank will not be 
184
             used
185
        	   in the search criteria.
186
        	   </font>
187
        	</p>
188
             </td>
189
          </tr>
190
        </table>
191
        <table width="100%">
192
             <tr>
193
                <td>First Name:</td>
194
                <td> 
195
                  <input type="text" name="given_name" size="15">
196
             	  <xsl:attribute name="value">
197
                  <xsl:value-of select="resultset/query/given_name" />
198
                  </xsl:attribute>
199
                  </input>
200
                </td>
201
                <td>Last Name:</td>
202
                <td> <!-- <input type="text" name="surname" /> -->
203
                  <input type="text" name="surname" size="15">
204
             	  <xsl:attribute name="value">
205
                  <xsl:value-of select="resultset/query/surname" />
206
                  </xsl:attribute>
207
                  </input>
208
                </td>
209
             </tr>
210
             <tr>
211
             	<td>Organization:</td>
212
             	<td> 
213
             	  <input type="text" name="organizationName" size="15">
214
             	  <xsl:attribute name="value">
215
                  <xsl:value-of select="resultset/query/organizationName" />
216
                  </xsl:attribute>
217
                  </input>
218
                </td>
219
             	<td>Email Address:</td>
220
             	<td> 
221
             	  <input type="text" name="electronicMailAddress" size="15">
222
             	  <xsl:attribute name="value">
223
                  <xsl:value-of select="resultset/query/electronicMailAddress" />
224
                  </xsl:attribute>
225
                  </input>
226
                </td>
227
             </tr>
228
           </table>
229
           
230
        <table width="100%" border="1">
231
          <tr>
232
             <td valign="bottom" width="25">
233
        	<img src="@html-path@/marine/step3.jpg" />
234
             </td>
235
             <td>
236
        	<h4>Query the Database</h4>
237
        	<p>
238
        	   <font size="2">
239
        	   Click the Query button to submit your query.  The results will be
240
        	   displayed below under the heading "Results".
241
        	   </font>
242
        	</p>
243
             </td>
244
          </tr>
245
        </table>
246
      <input type="hidden" name="action" value="query" />   
247
    	<input type="hidden" name="qformat" value="html" />
248
    	<input type="hidden" name="operator" value="UNION" />
249
      <!--note that the value of the returnfield can be in either
250
         -case but in the xsl:value-of statement the select attribute
251
         -must always be in lower case
252
       -->
253
      <input type="hidden" name="returnfield" value="surname" />
254
      <input type="hidden" name="returnfield" value="givenname" />
255
      <input type="hidden" name="returnfield" value="organizationname" />
256
        
257
        <input type="submit" value="Query" />
258
        <input type="reset" value="Clear Form" />
259
        
260
        </form>
261
             
262
  <a name="browse" />
263
	<font size="3"><xsl:number value="count(resultset/document)" /> documents 
264
  found.</font>
265
	<!-- This tests to see if there are returned documents,
266
	     if there are not then don't show the query results
267
	-->
268
	<xsl:if test="count(resultset/document) &gt; 0">
269
	
270
	<center>
271
          <u><h2>Results</h2></u>
272
        </center>
273
        
274
        <form action="@html-path@/servlet/marine" method="POST">
275
        <input type="hidden" name="action" value="getdocument"/>
276
                
277
        <table width="100%">
278
        <tr class="rowodd">
279
        <th>&nbsp;</th>
280
        <th><xsl:text>Title</xsl:text></th>
281
        <th><xsl:text>Owner</xsl:text></th>
282
        <th><xsl:text>Organization</xsl:text></th>
283
        <th><xsl:text>Creation Date</xsl:text></th>
284
        <th><xsl:text>Last Updated</xsl:text></th>
285
        </tr>
286

    
287
	
288
	
289
        <xsl:for-each select="resultset/document">
290
          <xsl:sort select="doctitle"/>
291
          <tr valign="top">
292
            <xsl:attribute name="class">
293
              <xsl:choose>
294
                <xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>
295
                <xsl:when test="position() mod 2 = 0">rowlight</xsl:when>
296
              </xsl:choose>
297
            </xsl:attribute>
298

    
299
          <td>
300
              <input border="0" type="image">
301
                <xsl:attribute name="src">
302
                  <xsl:choose>
303
                    <xsl:when test="position() 
304
                         mod 2 = 1">@html-path@/marine/whiteMenu.jpg</xsl:when>
305
                    <xsl:when test="position() 
306
                         mod 2 = 0">@html-path@/marine/blueMenu.jpg</xsl:when>
307
                  </xsl:choose>
308
                </xsl:attribute>
309
                <xsl:attribute name="name">
310
                  <xsl:value-of select="./docid"/>
311
                </xsl:attribute>
312
              </input>
313
          </td>
314
          <!--note the lower case select attr. -->
315
          <td><xsl:value-of select="./doctitle"/>
316
              
317
              <xsl:text>&nbsp;</xsl:text>
318
          </td>
319
          <td>
320
              <xsl:value-of select="./givenname" /> 
321
              <xsl:text>&nbsp;</xsl:text>
322

    
323
              <xsl:value-of select="./surname" />
324
              <xsl:text>&nbsp;</xsl:text>
325
          </td>
326
          <td><xsl:value-of select="./organizationname" />
327
              <xsl:text>&nbsp;</xsl:text>
328
          </td>
329
  
330
          <td>
331
              <xsl:value-of select="./createdate" />
332
              <xsl:text>&nbsp;</xsl:text>
333
          </td>
334
          <td>
335
              <xsl:value-of select="./updatedate" /> 
336
              <xsl:text>&nbsp;</xsl:text>
337
          </td> -
338
          </tr>
339
        </xsl:for-each>
340
        </table>
341
        </form>
342

    
343
        <h3><a href="#top">New Query</a></h3>
344
        
345
        </xsl:if>
346
        
347
      </body>
348
    </html>
349
  </xsl:template>
350

    
351
</xsl:stylesheet>
(6-6/22)