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

    
289
	
290
	      <font size="2">
291
        <xsl:for-each select="resultset/document[doctype = 'resource']">
292
          <xsl:sort select="doctitle"/>
293
          <tr valign="top">
294
            <xsl:attribute name="class">
295
              <xsl:choose>
296
                <xsl:when test="position() mod 2 = 1">rowwhite</xsl:when>
297
                <xsl:when test="position() mod 2 = 0">rowlight</xsl:when>
298
              </xsl:choose>
299
            </xsl:attribute>
300

    
301
          <td>
302
            <form action="@html-path@/servlet/marine" method="POST">
303
            <!-- abstractpath tells the servlet where the abstract is in the 
304
                 document.  The % sign is used because the path could be
305
                 resource/literature or resource/dataset. -->
306
            <input type="hidden" name="abstractpath" value="resource/%/abstract" />
307
            <input type="hidden" name="action" value="getdocument"/>
308
            <xsl:for-each select="./relation">
309
              <input type="hidden" name="relation">
310
                <xsl:attribute name="value" >
311
                  <xsl:value-of select="./relationdoc" />
312
                </xsl:attribute>
313
              </input>
314
            </xsl:for-each>
315
              <input border="0" type="image">
316
                <xsl:attribute name="src">
317
                  <xsl:choose>
318
                    <xsl:when test="position() 
319
                         mod 2 = 1">@image-path@/marine/whiteMenu.jpg</xsl:when>
320
                    <xsl:when test="position() 
321
                         mod 2 = 0">@image-path@/marine/blueMenu.jpg</xsl:when>
322
                  </xsl:choose>
323
                </xsl:attribute>
324
                <xsl:attribute name="name">
325
                  <xsl:value-of select="./docid"/>
326
                </xsl:attribute>
327
              </input>
328
              </form>
329
          </td>
330
          <td><font size="2"><xsl:value-of select="./doctitle"/></font>
331
              <xsl:text>&nbsp;</xsl:text>
332
          </td>
333
          <td>
334
          <xsl:for-each 
335
               select="./param[@name='resource/dataset/originator/individualName/surName']" >  
336
              <font size="2">
337
              <xsl:value-of 
338
                select="." />
339
              </font> 
340
              <xsl:text>&nbsp;</xsl:text><br/>
341

    
342
      <!--        <font size="2">
343
              <xsl:value-of 
344
                select="./param[@name='resource/dataset/originator/individualName/surName']" />
345
              </font><br/>
346
      -->
347
            </xsl:for-each> 
348
          </td>
349
          <td>
350
              <font size="2">
351
              <xsl:value-of 
352
                select="./param[@name='resource/dataset/originator/organizationName']" />
353
              </font>
354
              <xsl:text>&nbsp;</xsl:text>
355
          </td>
356
  
357
          <td>
358
           <xsl:for-each
359
            select="./param[@name='resource/dataset/keywordInfo/keyword']" >
360
              <font size="2">
361
              <xsl:value-of 
362
               select="." />
363
               <br/>
364
              </font>
365
            </xsl:for-each>
366
            <xsl:text>&nbsp;</xsl:text>
367
          </td>
368
          
369
          <td>
370
            <xsl:if test="count(./relation) &gt; 0">
371
              <form action="@html-path@/servlet/marine" method="POST">
372
              <input type="hidden" name="action" value="getrelateddocument"/>
373
              <input type="hidden" name="qformat" value="xml" />
374
              <xsl:for-each select="./relation">
375
              <font size="2">
376
              <input type="radio" name="url">
377
              <!--<xsl:attribute name="name" >
378
                <xsl:value-of select="./../docid" />
379
              </xsl:attribute> -->
380
              <xsl:attribute name="value" >
381
                <xsl:value-of select="./relationdoc" />
382
              </xsl:attribute>
383
              &nbsp;<xsl:value-of select="./relationdoc" />
384
              </input>
385
              </font>
386
              <br/>
387
             </xsl:for-each>
388
             <input type="submit" value="Get" />
389
             </form>
390
            </xsl:if>
391
            <xsl:text>&nbsp;</xsl:text>
392
          </td>
393
          
394
          </tr>
395
        </xsl:for-each>
396
        </font>
397
        </table>
398

    
399
        <h3><a href="#top">New Query</a></h3>
400
        </xsl:if>
401
        
402
      </body>
403
    </html>
404
  </xsl:template>
405

    
406
</xsl:stylesheet>
(8-8/28)