Project

General

Profile

metacat / lib / marine / marine.xsl @ 666

1
<?xml version="1.0"?>
2
<!--
3
  *  '$RCSfile$'
4
  *      Authors: Matt Jones, Chad Berkley
5
  *    Copyright: 2000 Regents of the University of California and the
6
  *               National Center for Ecological Analysis and Synthesis
7
  *  For Details: http://www.nceas.ucsb.edu/
8
  *
9
  *   '$Author: jones $'
10
  *     '$Date: 2001-01-18 11:02:14 -0800 (Thu, 18 Jan 2001) $'
11
  * '$Revision: 666 $'
12
  * 
13
  * This is an HTML document for displaying metadata catalog tools
14
  *
15
  * This program is free software; you can redistribute it and/or modify
16
  * it under the terms of the GNU General Public License as published by
17
  * the Free Software Foundation; either version 2 of the License, or
18
  * (at your option) any later version.
19
  *
20
  * This program is distributed in the hope that it will be useful,
21
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
22
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
23
  * GNU General Public License for more details.
24
  *
25
  * You should have received a copy of the GNU General Public License
26
  * along with this program; if not, write to the Free Software
27
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
28
  *
29
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
30
  * convert an XML file showing the resultset of a query
31
  * into an HTML format suitable for rendering with modern web browsers.
32
  * This stylesheet formats .
33
-->
34
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
35
  <xsl:output method="html"/>
36
  <xsl:template match="/">
37
    <html>
38
      <head>
39
        <link rel="stylesheet" type="text/css" href="@html-path@/style/rowcol.css" />
40
        <script language="JavaScript">
41
          <![CDATA[
42
          function submitform(current_action,form_ref) {
43
              form_ref.action.value=current_action;
44
              form_ref.submit();
45
          }
46
          ]]>
47
        </script>
48

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

    
392
            <font size="2">
393
            <a>
394
              <xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '.', '')"/>)</xsl:attribute>
395
               Dataset Information
396
            </a><br />
397
            <a>
398
              <xsl:attribute name="href">javascript:submitform('getabstract',document.<xsl:value-of select="translate(./docid,'.','')"/>)</xsl:attribute>
399
              View Abstract
400
            </a><br />
401
            <a>
402
              <xsl:attribute name="href">javascript:submitform('getdatadoc',document.<xsl:value-of select="translate(./docid,'.','')"/>)</xsl:attribute>
403
               Download Data and Metadata
404
            </a><br />
405
            </font>
406
            </form>
407
            &nbsp;
408
          </td>
409
          <td>
410
            <xsl:if test="count(./relation) &gt; 0">
411
              <xsl:for-each select="./relation">
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://@server@@servlet-path@?action=read&amp;qformat=html&amp;docid=</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
            &nbsp;
483
          </td>
484
          <td>
485
            <xsl:for-each 
486
               select="./param[@name='resource/dataset/originator/individualName/surName']" >  
487
              <font size="2">
488
              <xsl:value-of 
489
                select="." />
490
              </font> 
491
              <br/>
492

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

    
550
        <h3><a href="#top">New Search</a></h3>
551
        </xsl:if>
552
        
553
      </body>
554
    </html>
555
  </xsl:template>
556

    
557
</xsl:stylesheet>