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 498 2000-10-07 01:40:28Z 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
        <script language="JavaScript">
24
          <![CDATA[
25
          function submitform(current_action,form_ref) {
26
              form_ref.action.value=current_action;
27
              form_ref.submit();
28
          }
29
          ]]>
30
        </script>
31

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

    
337
          <td>
338
            <form action="@html-path@/servlet/marine" method="POST">
339
              <xsl:attribute name="name">
340
                <xsl:value-of select="translate(./docid,':','')"/>
341
              </xsl:attribute>
342
            <!-- abstractpath tells the servlet where the abstract is in the 
343
                 document.  The % sign is used because the path could be
344
                 resource/literature or resource/dataset. -->
345
            <input type="hidden" name="abstractpath" value="resource/%/abstract" />
346
            <input type="hidden" name="action" value="getdocument"/>
347
            <input type="hidden" name="docid">
348
              <xsl:attribute name="value">
349
                <xsl:value-of select="./docid"/>
350
              </xsl:attribute>
351
            </input>
352
            <xsl:for-each select="./relation">
353
              <input type="hidden" name="relation">
354
                <xsl:attribute name="value" >
355
                  <xsl:value-of select="./relationdoc" />
356
                </xsl:attribute>
357
              </input>
358
            </xsl:for-each>
359

    
360
            <a>
361
              <xsl:attribute name="href">javascript:submitform('getdocument',document.<xsl:value-of select="translate(./docid, ':', '')"/>)</xsl:attribute>
362
               Dataset Information
363
            </a><br />
364
            <a>
365
              <xsl:attribute name="href">javascript:submitform('getabstract',document.<xsl:value-of select="translate(./docid,':','')"/>)</xsl:attribute>
366
              View Abstract
367
            </a><br />
368
            <a>
369
              <xsl:attribute name="href">javascript:submitform('getdatadoc',document.<xsl:value-of select="translate(./docid,':','')"/>)</xsl:attribute>
370
               Download Data and Metadata
371
            </a><br />
372
<!--
373
            <input border="0" type="image">
374
              <xsl:attribute name="src">
375
                <xsl:choose>
376
                  <xsl:when test="position() 
377
                       mod 2 = 1">@image-path@/marine/whiteMenu.jpg</xsl:when>
378
                  <xsl:when test="position() 
379
                       mod 2 = 0">@image-path@/marine/blueMenu.jpg</xsl:when>
380
                </xsl:choose>
381
              </xsl:attribute>
382
              <xsl:attribute name="name">
383
                <xsl:value-of select="./docid"/>
384
              </xsl:attribute>
385
            </input>
386
-->
387
            </form>
388
            <pre>Document ID: <xsl:value-of select="./docid"/></pre>
389
          </td>
390
          <td>
391
            <font size="4">
392
              <b>
393
              <xsl:value-of select="./param[@name='resource/dataset/title']"/>
394
              </b><br/>
395
              &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
396
            </font>
397
            <a>
398
              <xsl:attribute name="href">
399
                <xsl:text>@html-path@/servlet/marine/?action=getdocument&amp;qformat=html&amp;docid=</xsl:text>
400
                <xsl:value-of select="./docid"/>
401
              </xsl:attribute>
402
              <font size="2">
403
              Dataset Information
404
              </font>
405
            </a><br/><br/>
406
            <i>Related Documents:</i><br/>
407
            <xsl:if test="count(./relation) &gt; 0">
408
              <xsl:for-each select="./relation">
409
              <xsl:text>&nbsp;</xsl:text><xsl:text>&nbsp;</xsl:text>
410
              <xsl:text>&nbsp;</xsl:text><xsl:text>&nbsp;</xsl:text>
411
              <xsl:text>&nbsp;</xsl:text><xsl:text>&nbsp;</xsl:text>
412
                <a>
413
                  <xsl:if test="starts-with(./relationdoc, 'http')">
414
                    <xsl:attribute name="href">
415
                      <xsl:value-of select="./relationdoc" />
416
                    </xsl:attribute>
417
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-variable//EN'">
418
                      <font size="2">Variable Information</font>
419
                    </xsl:if>
420
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-file//EN'">
421
                      <font size="2">File Information</font>
422
                    </xsl:if>
423
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-access//EN'">
424
                      <font size="2">Access Information</font>
425
                    </xsl:if>
426
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-context//EN'">
427
                      <font size="2">Context Information</font>
428
                    </xsl:if>
429
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-software//EN'">
430
                      <font size="2">Software Information</font>
431
                    </xsl:if>
432
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-status//EN'">
433
                      <font size="2">Status Information</font>
434
                    </xsl:if>
435
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-supplement//EN'">
436
                      <font size="2">Supplemental Information</font>
437
                    </xsl:if>
438
                    <!-- If the doctype is null, this file is assumed to 
439
                         be a data file
440
                     -->
441
                    <xsl:if test="./relationdoctype = 'null'">
442
                      <font size="2">Data File</font>
443
                    </xsl:if>
444
                  </xsl:if>
445
                  <xsl:if test="starts-with(./relationdoc, 'metacat')">
446
                    <xsl:attribute name="href">
447
                      <xsl:text>http://dev.nceas.ucsb.edu@html-path@/servlet/marine/?action=getrelateddocument&amp;qformat=html&amp;url=</xsl:text>
448
                      <xsl:value-of select="./relationdoc" />
449
                    </xsl:attribute>
450
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-variable//EN'">
451
                      <font size="2">Variable Information</font>
452
                    </xsl:if>
453
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-file//EN'">
454
                      <font size="2">File Information</font>
455
                    </xsl:if>
456
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-access//EN'">
457
                      <font size="2">Access Information</font>
458
                    </xsl:if>
459
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-context//EN'">
460
                      <font size="2">Context Information</font>
461
                    </xsl:if>
462
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-software//EN'">
463
                      <font size="2">Software Information</font>
464
                    </xsl:if>
465
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-status//EN'">
466
                      <font size="2">Status Information</font>
467
                    </xsl:if>
468
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-supplement//EN'">
469
                      <font size="2">Supplemental Information</font>
470
                    </xsl:if>
471
                    <!-- If the doctype is null, this file is assumed to 
472
                         be a data file
473
                     -->
474
                    <xsl:if test="./relationdoctype = 'null'">
475
                      <font size="2">Data File</font>
476
                    </xsl:if>
477
                  </xsl:if>
478
                </a>
479
                <br/>
480
              </xsl:for-each>  
481
            </xsl:if>
482
          </td>
483
          <td>
484
            <xsl:for-each 
485
               select="./param[@name='resource/dataset/originator/individualName/surName']" >  
486
              <font size="2">
487
              <xsl:value-of 
488
                select="." />
489
              </font> 
490
              <br/>
491

    
492
      <!--        <font size="2">
493
              <xsl:value-of 
494
                select="./param[@name='resource/dataset/originator/individualName/surName']" />
495
              </font><br/>
496
      -->
497
            </xsl:for-each>
498
            <xsl:text>&nbsp;</xsl:text>
499
          </td>
500
          <td>
501
              <font size="2">
502
              <xsl:value-of 
503
                select="./param[@name='resource/dataset/originator/organizationName']" />
504
              </font>
505
              <xsl:text>&nbsp;</xsl:text>
506
          </td>
507
  
508
          <td>
509
           <xsl:for-each
510
            select="./param[@name='resource/dataset/keywordInfo/keyword']" >
511
              <font size="2">
512
              <xsl:value-of 
513
               select="." />
514
               <br/>
515
              </font>
516
            </xsl:for-each>
517
            <xsl:text>&nbsp;</xsl:text>
518
          </td>
519
          <!--
520
          <td>
521
            <xsl:text>&nbsp;</xsl:text>
522
            <xsl:if test="count(./relation) &gt; 0">
523
              <form action="@html-path@/servlet/marine" method="POST">
524
              <input type="hidden" name="action" value="getrelateddocument"/>
525
              <input type="hidden" name="qformat" value="xml" />
526
              <xsl:for-each select="./relation">
527
                <font size="2">
528
                <input type="radio" name="url">
529
                <xsl:attribute name="value" >
530
                  <xsl:value-of select="./relationdoc" />
531
                </xsl:attribute>
532
                <xsl:value-of select="./relationdoc" />
533
                </input>
534
                </font>
535
                <br/>
536
             </xsl:for-each>
537
             <input type="submit" value="Get" />
538
             </form>
539
            </xsl:if>
540
          </td>
541
          -->
542
          </tr>
543
        </xsl:for-each>
544
        </font>
545
        </table>
546

    
547
        <h3><a href="#top">New Search</a></h3>
548
        </xsl:if>
549
        
550
      </body>
551
    </html>
552
  </xsl:template>
553

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