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

    
338
          <td>
339
            <font size="3">
340
              <xsl:value-of select="./param[@name='resource/dataset/title']"/>
341
              <xsl:value-of select="./param[@name='eml-dataset/title']"/>
342
              <br/>
343
            </font>
344
            <p><pre>Document ID: <xsl:value-of select="./docid"/></pre></p>
345
          </td>
346
          <td>
347
            <form action="@html-path@/servlet/marine" method="POST">
348
              <xsl:attribute name="name">
349
                <xsl:value-of select="translate(./docid,':','')"/>
350
              </xsl:attribute>
351
            <!-- abstractpath tells the servlet where the abstract is in the 
352
                 document.  The % sign is used because the path could be
353
                 resource/literature or resource/dataset. -->
354
            <input type="hidden" name="abstractpath" 
355
                   value="resource/%/abstract" />
356
            <input type="hidden" name="action" value="getdocument"/>
357
            <input type="hidden" name="docid">
358
              <xsl:attribute name="value">
359
                <xsl:value-of select="./docid"/>
360
              </xsl:attribute>
361
            </input>
362
            <xsl:for-each select="./relation">
363
              <input type="hidden" name="relation">
364
                <xsl:attribute name="value" >
365
                  <xsl:value-of select="./relationdoc" />
366
                </xsl:attribute>
367
              </input>
368
            </xsl:for-each>
369

    
370
            <font size="2">
371
            <a>
372
              <xsl:attribute name="href">javascript:submitform('getdocument',document.<xsl:value-of select="translate(./docid, ':', '')"/>)</xsl:attribute>
373
               Dataset Information
374
            </a><br />
375
            <a>
376
              <xsl:attribute name="href">javascript:submitform('getabstract',document.<xsl:value-of select="translate(./docid,':','')"/>)</xsl:attribute>
377
              View Abstract
378
            </a><br />
379
            <a>
380
              <xsl:attribute name="href">javascript:submitform('getdatadoc',document.<xsl:value-of select="translate(./docid,':','')"/>)</xsl:attribute>
381
               Download Data and Metadata
382
            </a><br />
383
            </font>
384
            </form>
385
          </td>
386
          <td>
387
            <xsl:if test="count(./relation) &gt; 0">
388
              <xsl:for-each select="./relation">
389
                <a>
390
                  <xsl:if test="starts-with(./relationdoc, 'http')">
391
                    <xsl:attribute name="href">
392
                      <xsl:value-of select="./relationdoc" />
393
                    </xsl:attribute>
394
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-variable//EN'">
395
                      <font size="2">Variable Information</font>
396
                    </xsl:if>
397
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-file//EN'">
398
                      <font size="2">File Information</font>
399
                    </xsl:if>
400
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-access//EN'">
401
                      <font size="2">Access Information</font>
402
                    </xsl:if>
403
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-context//EN'">
404
                      <font size="2">Context Information</font>
405
                    </xsl:if>
406
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-software//EN'">
407
                      <font size="2">Software Information</font>
408
                    </xsl:if>
409
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-status//EN'">
410
                      <font size="2">Status Information</font>
411
                    </xsl:if>
412
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-supplement//EN'">
413
                      <font size="2">Supplemental Information</font>
414
                    </xsl:if>
415
                    <!-- If the doctype is null, this file is assumed to 
416
                         be a data file
417
                     -->
418
                    <xsl:if test="./relationdoctype = 'null'">
419
                      <font size="2">Data File</font>
420
                    </xsl:if>
421
                  </xsl:if>
422
                  <xsl:if test="starts-with(./relationdoc, 'metacat')">
423
                    <xsl:attribute name="href">
424
                      <xsl:text>http://dev.nceas.ucsb.edu@html-path@/servlet/marine/?action=getrelateddocument&amp;qformat=html&amp;url=</xsl:text>
425
                      <xsl:value-of select="./relationdoc" />
426
                    </xsl:attribute>
427
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-variable//EN'">
428
                      <font size="2">Variable Information</font>
429
                    </xsl:if>
430
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-file//EN'">
431
                      <font size="2">File Information</font>
432
                    </xsl:if>
433
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-access//EN'">
434
                      <font size="2">Access Information</font>
435
                    </xsl:if>
436
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-context//EN'">
437
                      <font size="2">Context Information</font>
438
                    </xsl:if>
439
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-software//EN'">
440
                      <font size="2">Software Information</font>
441
                    </xsl:if>
442
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-status//EN'">
443
                      <font size="2">Status Information</font>
444
                    </xsl:if>
445
                    <xsl:if test="./relationdoctype = '-//NCEAS//eml-supplement//EN'">
446
                      <font size="2">Supplemental Information</font>
447
                    </xsl:if>
448
                    <!-- If the doctype is null, this file is assumed to 
449
                         be a data file
450
                     -->
451
                    <xsl:if test="./relationdoctype = 'null'">
452
                      <font size="2">Data File</font>
453
                    </xsl:if>
454
                  </xsl:if>
455
                </a>
456
                <br/>
457
              </xsl:for-each>  
458
            </xsl:if>
459
          </td>
460
          <td>
461
            <xsl:for-each 
462
               select="./param[@name='resource/dataset/originator/individualName/surName']" >  
463
              <font size="2">
464
              <xsl:value-of 
465
                select="." />
466
              </font> 
467
              <br/>
468

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

    
524
        <h3><a href="#top">New Search</a></h3>
525
        </xsl:if>
526
        
527
      </body>
528
    </html>
529
  </xsl:template>
530

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