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

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

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

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

    
527
        <h3><a href="#top">New Search</a></h3>
528
        </xsl:if>
529
        
530
      </body>
531
    </html>
532
  </xsl:template>
533

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