Project

General

Profile

1 1929 brooke
<?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$'
10
  *     '$Date$'
11
  * '$Revision$'
12
  *
13
  * This program is free software; you can redistribute it and/or modify
14
  * it under the terms of the GNU General Public License as published by
15
  * the Free Software Foundation; either version 2 of the License, or
16
  * (at your option) any later version.
17
  *
18
  * This program is distributed in the hope that it will be useful,
19
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
21
  * GNU General Public License for more details.
22
  *
23
  * You should have received a copy of the GNU General Public License
24
  * along with this program; if not, write to the Free Software
25
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
26
  *
27
  * This is an XSLT (http://www.w3.org/TR/xslt) stylesheet designed to
28
  * convert an XML file showing the resultset of a query
29
  * into an HTML format suitable for rendering with modern web browsers.
30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
32
  <xsl:output method="html"/>
33
  <xsl:param name="qformat">default</xsl:param>
34
  <xsl:template match="/">
35
    <html>
36
      <head>
37
        <link rel="stylesheet" type="text/css"
38
              href="@style-skins-path@/{$qformat}/{$qformat}.css" />
39
        <script language="JavaScript">
40
          <![CDATA[
41
          function submitform(action,form_ref) {
42
              form_ref.action.value=action;
43
              form_ref.abstractpath.value="";
44
              form_ref.qformat.value="knb";
45
              form_ref.submit();
46
          }
47
          function submitform1(action, abstractpath, form_ref) {
48
              form_ref.action.value=action;
49
              form_ref.abstractpath.value=abstractpath;
50
              form_ref.qformat.value="";
51
              form_ref.submit();
52
          }
53
          function submitform2(action, qformat, form_ref) {
54
              form_ref.action.value=action;
55
              form_ref.qformat.value=qformat;
56
              form_ref.abstractpath.value="";
57
              form_ref.submit();
58
          }
59
          ]]>
60
        </script>
61
      </head>
62
63
      <body>
64
        <table width="100%">
65
          <tr>
66
            <td rowspan="2"><img src="@web-base-url@/images/KNBLogo.gif"/></td>
67
            <td colspan="7"><div class="title">Biocomplexity Data Search</div>
68
            </td>
69
          </tr>
70
          <tr>
71
            <td><a href="@web-base-url@" class="toollink"> KNB </a></td>
72
            <td><a href="@web-base-url@/data.html" class="toollink">
73
                Data </a></td>
74
            <td><a href="@web-base-url@/people.html" class="toollink">
75
                People </a></td>
76
            <td><a href="@web-base-url@/informatics" class="toollink">
77
                Informatics </a></td>
78
            <td><a href="@web-base-url@/biodiversity" class="toollink">
79
                Biodiversity </a></td>
80
            <td><a href="@web-base-url@/education" class="toollink">
81
                Education </a></td>
82
            <td><a href="@web-base-url@/software" class="toollink">
83
                Software </a></td>
84
         </tr>
85
         <tr>
86
          <td align="right" valign="top" colspan="7">
87
            <form action="@servlet-path@" method="POST">
88
             Data Search: <input type="text" name="anyfield" size="10" />
89
             <input type="hidden" name="action" value="query" />
90
             <input type="hidden" name="qformat" value="knb" />
91
             <input type="hidden" name="operator" value="UNION" />
92
93
             <input type="hidden" name="returnfield"
94
              value="creator/individualName/surName" />
95
             <input type="hidden" name="returnfield"
96
              value="creator/organizationName" />
97
             <input type="hidden" name="returnfield"
98
              value="originator/individualName/surName" />
99
             <input type="hidden" name="returnfield"
100
              value="originator/individualName/givenName" />
101
             <input type="hidden" name="returnfield"
102
              value="originator/organizationName" />
103
             <input type="hidden" name="returnfield"
104
              value="dataset/title" />
105
             <input type="hidden" name="returnfield"
106
              value="keyword" />
107
             <input type="hidden" name="returndoctype"
108
              value="eml://ecoinformatics.org/eml-2.0.0" />
109
             <input type="hidden" name="returndoctype"
110
              value="-//NCEAS//eml-dataset-2.0//EN" />
111
             <input type="hidden" name="returndoctype"
112
              value="-//NCEAS//resource//EN" />
113
             <input type="hidden" name="returndoctype"
114
              value="-//NCEAS//eml-dataset//EN" />
115
              <input type="hidden" name="returndoctype"
116
              value="-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN" />
117
              <input type="hidden" name="returndoctype"
118
              value="-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN" />
119
           </form>
120
          </td>
121
        </tr>
122
       </table>
123
124
       <p><xsl:number value="count(resultset/document)" /> documents found.</p>
125
       <!-- This tests to see if there are returned documents,
126
            if there are not then don't show the query results -->
127
       <xsl:if test="count(resultset/document) &gt; 0">
128
           <table border="0" cellpadding="2" cellspacing="2">
129
           <tr valign="top">
130
           <td width="33%">
131
           <h3>Browse data sets by keyword:</h3>
132
           <ul>
133
               <xsl:apply-templates select="//param[@name='keyword' and not(. = preceding::param) and not(normalize-space(.) = '')]">
134
                   <xsl:sort select="."/>
135
               </xsl:apply-templates>
136
           </ul>
137
           </td>
138
           <td width="33%">
139
           <h3>Browse data sets by creator:</h3>
140
           <ul>
141
               <xsl:apply-templates select="//param[@name='surName' and not(. = preceding::param) and not(normalize-space(.) = '')]">
142
                   <xsl:sort select="."/>
143
               </xsl:apply-templates>
144
           </ul>
145
           </td>
146
           <td width="33%">
147
           <h3>Browse data sets by organization:</h3>
148
           <ul>
149
               <xsl:apply-templates select="//param[@name='organizationName' and not(. = preceding::param) and not(normalize-space(.) = '')]">
150
                   <xsl:sort select="."/>
151
               </xsl:apply-templates>
152
           </ul>
153
           </td>
154
           </tr>
155
           </table>
156
       </xsl:if>
157
      </body>
158
    </html>
159
  </xsl:template>
160
161
  <xsl:template match="param[@name='keyword']">
162
     <li>
163
     <a>
164
       <xsl:attribute name="href">@servlet-path@?action=query&amp;operator=INTERSECT&amp;qformat=knb&amp;returndoctype=eml://ecoinformatics.org/eml-2.0.0&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN&amp;returnfield=dataset/title&amp;returnfield=citation/title&amp;returnfield=software/title&amp;returnfield=protocol/title&amp;returnfield=keyword&amp;returnfield=originator/individualName/surName&amp;returnfield=creator/individualName/surName&amp;returnfield=originator/organizationName&amp;returnfield=creator/organizationName&amp;keyword=<xsl:value-of select="."/></xsl:attribute>
165
     <xsl:value-of select="."/>
166
     </a> (<xsl:value-of select="count(//param[.=current()])"/>)
167
     </li>
168
  </xsl:template>
169
170
  <xsl:template match="param[@name='surName']">
171
     <li>
172
     <a>
173
       <xsl:attribute name="href">@servlet-path@?action=query&amp;operator=INTERSECT&amp;qformat=knb&amp;returndoctype=eml://ecoinformatics.org/eml-2.0.0&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN&amp;returnfield=dataset/title&amp;returnfield=citation/title&amp;returnfield=software/title&amp;returnfield=protocol/title&amp;returnfield=keyword&amp;returnfield=originator/individualName/surName&amp;returnfield=creator/individualName/surName&amp;returnfield=originator/organizationName&amp;returnfield=creator/organizationName&amp;surName=<xsl:value-of select="."/></xsl:attribute>
174
     <xsl:value-of select="."/>
175
     </a> (<xsl:value-of select="count(//param[.=current()])"/>)
176
     </li>
177
  </xsl:template>
178
179
  <xsl:template match="param[@name='organizationName']">
180
     <li>
181
     <a>
182
       <xsl:attribute name="href">@servlet-path@?action=query&amp;operator=INTERSECT&amp;qformat=knb&amp;returndoctype=eml://ecoinformatics.org/eml-2.0.0&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta4//EN&amp;returndoctype=-//ecoinformatics.org//eml-dataset-2.0.0beta6//EN&amp;returnfield=dataset/title&amp;returnfield=citation/title&amp;returnfield=software/title&amp;returnfield=protocol/title&amp;returnfield=keyword&amp;returnfield=originator/individualName/surName&amp;returnfield=creator/individualName/surName&amp;returnfield=originator/organizationName&amp;returnfield=creator/organizationName&amp;organizationName=<xsl:value-of select="."/></xsl:attribute>
183
     <xsl:value-of select="."/>
184
     </a> (<xsl:value-of select="count(//param[.=current()])"/>)
185
     </li>
186
  </xsl:template>
187
188
</xsl:stylesheet>