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

    
328
          <td>
329
            <form action="@html-path@/servlet/marine" method="POST">
330
            <!-- abstractpath tells the servlet where the abstract is in the 
331
                 document.  The % sign is used because the path could be
332
                 resource/literature or resource/dataset. -->
333
            <input type="hidden" name="abstractpath" value="resource/%/abstract" />
334
            <input type="hidden" name="action" value="getdocument"/>
335
            <xsl:for-each select="./relation">
336
              <input type="hidden" name="relation">
337
                <xsl:attribute name="value" >
338
                  <xsl:value-of select="./relationdoc" />
339
                </xsl:attribute>
340
              </input>
341
            </xsl:for-each>
342
              <input border="0" type="image">
343
                <xsl:attribute name="src">
344
                  <xsl:choose>
345
                    <xsl:when test="position() 
346
                         mod 2 = 1">@image-path@/marine/whiteMenu.jpg</xsl:when>
347
                    <xsl:when test="position() 
348
                         mod 2 = 0">@image-path@/marine/blueMenu.jpg</xsl:when>
349
                  </xsl:choose>
350
                </xsl:attribute>
351
                <xsl:attribute name="name">
352
                  <xsl:value-of select="./docid"/>
353
                </xsl:attribute>
354
              </input>
355
              </form>
356
              <pre>Document ID: <xsl:value-of select="./docid"/></pre>
357
          </td>
358
          <td>
359
            <font size="4">
360
              <b>
361
              <xsl:value-of select="./param[@name='resource/dataset/title']"/>
362
              </b><br/>
363
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
364
            </font>
365
            <a>
366
              <xsl:attribute name="href">
367
                <xsl:text>@html-path@/servlet/marine/?action=getdocument&amp;qformat=html&amp;docid=</xsl:text>
368
                <xsl:value-of select="./docid"/>
369
              </xsl:attribute>
370
              <font size="2">
371
              Dataset Information
372
              </font>
373
            </a><br/><br/>
374
            <i>Related Documents:</i><br/>
375
            <xsl:if test="count(./relation) &gt; 0">
376
              <xsl:for-each select="./relation">
377
              <xsl:text>&nbsp;</xsl:text><xsl:text>&nbsp;</xsl:text>
378
              <xsl:text>&nbsp;</xsl:text><xsl:text>&nbsp;</xsl:text>
379
              <xsl:text>&nbsp;</xsl:text><xsl:text>&nbsp;</xsl:text>
380
                <a>
381
                  <xsl:if test="starts-with(./relationdoc, 'http')">
382
                    <xsl:attribute name="href">
383
                      <xsl:value-of select="./relationdoc" />
384
                    </xsl:attribute>
385
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-variable//EN'">
386
                      <font size="2">Variable Information</font>
387
                    </xsl:if>
388
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-file//EN'">
389
                      <font size="2">File Information</font>
390
                    </xsl:if>
391
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-access//EN'">
392
                      <font size="2">Access Information</font>
393
                    </xsl:if>
394
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-context//EN'">
395
                      <font size="2">Context Information</font>
396
                    </xsl:if>
397
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-software//EN'">
398
                      <font size="2">Software Information</font>
399
                    </xsl:if>
400
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-status//EN'">
401
                      <font size="2">Status Information</font>
402
                    </xsl:if>
403
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-supplement//EN'">
404
                      <font size="2">Supplemental Information</font>
405
                    </xsl:if>
406
                    <!-- If the doctype is null, this file is assumed to 
407
                         be a data file
408
                     -->
409
                    <xsl:if test="./relationdoctype = 'null'">
410
                      <font size="2">Data File</font>
411
                    </xsl:if>
412
                  </xsl:if>
413
                  <xsl:if test="starts-with(./relationdoc, 'metacat')">
414
                    <xsl:attribute name="href">
415
                      <xsl:text>http://dev.nceas.ucsb.edu@html-path@/servlet/marine/?action=getrelateddocument&amp;qformat=html&amp;url=</xsl:text>
416
                      <xsl:value-of select="./relationdoc" />
417
                    </xsl:attribute>
418
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-variable//EN'">
419
                      <font size="2">Variable Information</font>
420
                    </xsl:if>
421
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-file//EN'">
422
                      <font size="2">File Information</font>
423
                    </xsl:if>
424
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-access//EN'">
425
                      <font size="2">Access Information</font>
426
                    </xsl:if>
427
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-context//EN'">
428
                      <font size="2">Context Information</font>
429
                    </xsl:if>
430
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-software//EN'">
431
                      <font size="2">Software Information</font>
432
                    </xsl:if>
433
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-status//EN'">
434
                      <font size="2">Status Information</font>
435
                    </xsl:if>
436
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-supplement//EN'">
437
                      <font size="2">Supplemental Information</font>
438
                    </xsl:if>
439
                    <!-- If the doctype is null, this file is assumed to 
440
                         be a data file
441
                     -->
442
                    <xsl:if test="./relationdoctype = 'null'">
443
                      <font size="2">Data File</font>
444
                    </xsl:if>
445
                  </xsl:if>
446
                </a>
447
                <br/>
448
              </xsl:for-each>  
449
            </xsl:if>
450
          </td>
451
          <td>
452
            <xsl:for-each 
453
               select="./param[@name='resource/dataset/originator/individualName/surName']" >  
454
              <font size="2">
455
              <xsl:value-of 
456
                select="." />
457
              </font> 
458
              <br/>
459

    
460
      <!--        <font size="2">
461
              <xsl:value-of 
462
                select="./param[@name='resource/dataset/originator/individualName/surName']" />
463
              </font><br/>
464
      -->
465
            </xsl:for-each>
466
            <xsl:text>&nbsp;</xsl:text>
467
          </td>
468
          <td>
469
              <font size="2">
470
              <xsl:value-of 
471
                select="./param[@name='resource/dataset/originator/organizationName']" />
472
              </font>
473
              <xsl:text>&nbsp;</xsl:text>
474
          </td>
475
  
476
          <td>
477
           <xsl:for-each
478
            select="./param[@name='resource/dataset/keywordInfo/keyword']" >
479
              <font size="2">
480
              <xsl:value-of 
481
               select="." />
482
               <br/>
483
              </font>
484
            </xsl:for-each>
485
            <xsl:text>&nbsp;</xsl:text>
486
          </td>
487
          <!--
488
          <td>
489
            <xsl:text>&nbsp;</xsl:text>
490
            <xsl:if test="count(./relation) &gt; 0">
491
              <form action="@html-path@/servlet/marine" method="POST">
492
              <input type="hidden" name="action" value="getrelateddocument"/>
493
              <input type="hidden" name="qformat" value="xml" />
494
              <xsl:for-each select="./relation">
495
                <font size="2">
496
                <input type="radio" name="url">
497
                <xsl:attribute name="value" >
498
                  <xsl:value-of select="./relationdoc" />
499
                </xsl:attribute>
500
                <xsl:value-of select="./relationdoc" />
501
                </input>
502
                </font>
503
                <br/>
504
             </xsl:for-each>
505
             <input type="submit" value="Get" />
506
             </form>
507
            </xsl:if>
508
          </td>
509
          -->
510
          </tr>
511
        </xsl:for-each>
512
        </font>
513
        </table>
514

    
515
        <h3><a href="#top">New Search</a></h3>
516
        </xsl:if>
517
        
518
      </body>
519
    </html>
520
  </xsl:template>
521

    
522
</xsl:stylesheet>
(8-8/27)