Project

General

Profile

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: 2003-12-23 10:13:19 -0800 (Tue, 23 Dec 2003) $'
11
* '$Revision: 1981 $'
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

    
33
  <xsl:output method="html"/>
34
  <xsl:param name="qformat">default</xsl:param>
35
  <xsl:param name="enableediting">false</xsl:param>
36
  <xsl:template match="/">
37
   <html>
38
      <head>
39
        <link rel="stylesheet" type="text/css" 
40
              href="@style-skins-path@/{$qformat}/{$qformat}.css" />
41
        <script language="Javascript" type="text/JavaScript"
42
                src="@style-skins-path@/{$qformat}/{$qformat}.js" />
43
        <script language="Javascript" type="text/JavaScript"
44
                src="@style-common-path@/branding.js" />
45
        <script language="JavaScript">
46
          <![CDATA[
47
          function submitform(action,form_ref) {
48
              form_ref.action.value=action;
49
              form_ref.abstractpath.value="";
50
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
51
              form_ref.submit();
52
          }
53
          function submitform1(action, abstractpath, form_ref) {
54
              form_ref.action.value=action;
55
              form_ref.abstractpath.value=abstractpath;
56
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
57
              form_ref.submit();
58
          }
59
          function submitform2(action, qformat, form_ref) {
60
              form_ref.action.value=action;
61
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
62
              form_ref.abstractpath.value="";
63
              form_ref.submit();
64
          }
65
          ]]>
66
        </script>
67
      </head>
68

    
69
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
70
      <script language="JavaScript">
71
          insertTemplateOpening();
72
          insertSearchBox();
73
      </script>
74
        <table width="100%" align="center" border="0" cellpadding="5" cellspacing="0">
75
           <tr>
76
             <td align="left"><br></br><p class="emphasis"><xsl:number value="count(resultset/document)" /> data packages found</p></td>
77
           </tr></table>
78
<!-- This tests to see if there are returned documents,
79
            if there are not then don't show the query results -->
80

    
81
      <xsl:if test="count(resultset/document) &gt; 0">
82

    
83
         <table width="95%" align="center" border="0" cellpadding="0" cellspacing="0">
84
           <tr>
85
             <th class="tablehead_lcorner" align="right" valign="top"><img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></th>
86
             <th class="tablehead">Title</th>
87
             <th width="15%" class="tablehead" style="text-align: left">Contacts</th>
88
             <th width="15%" class="tablehead" style="text-align: left">Organization</th>
89
             <th width="15%" class="tablehead" style="text-align: left">Keywords</th>
90
             <xsl:if test="$enableediting = 'true'">
91
               <th width="10%" class="tablehead" style="text-align: middle">Actions</th>
92
             </xsl:if>
93
             <th class="tablehead_rcorner" align="right" valign="top"><img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></th>
94
           </tr>
95

    
96
         <xsl:for-each select="resultset/document">
97
           <xsl:sort select="title"/>
98
           <tr valign="top" class="subpanel">
99
             <xsl:attribute name="class">
100
               <xsl:choose>
101
                 <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
102
                 <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
103
               </xsl:choose>
104
             </xsl:attribute>
105

    
106
             <td width="10">&#160;</td>
107
             <td class="text_plain">
108
               <form action="@servlet-path@" method="POST">
109
                 <xsl:attribute name="name">
110
                   <xsl:value-of select="translate(./docid, '()-.', '')" />
111
                 </xsl:attribute>
112
                <!-- abstractpath tells the servlet where the abstract is in
113
                      the document.  The % sign is used because the path could
114
                      be resource/literature or resource/dataset. -->
115
                 <!-- specified down IN javascript:submitform1('read',abstractpath,docid) -->
116
                 <input type="hidden" name="abstractpath" />
117
                 <!-- specified down IN javascript:submitform2('read','zip',docid) -->
118

    
119
                 <input type="hidden" name="qformat" />
120
                 <xsl:if test="$enableediting = 'true'">
121
	 	           <input type="hidden" name="enableediting" value="{$enableediting}"/>
122
                 </xsl:if>
123
                 <input type="hidden" name="action" value="read"/>
124
                 <input type="hidden" name="docid">
125
                   <xsl:attribute name="value">
126
                     <xsl:value-of select="./docid"/>
127
                   </xsl:attribute>
128
                 </input>
129
                 <xsl:for-each select="./relation">
130
                   <input type="hidden" name="docid">
131
                     <xsl:attribute name="value" >
132
                       <xsl:value-of select="./relationdoc" />
133
                     </xsl:attribute>
134
                   </input>
135
                 </xsl:for-each>
136

    
137
                 <a>
138
                   <xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '')"/>)</xsl:attribute>
139
                   <xsl:choose>
140
                     <xsl:when test="./param[@name='dataset/title']!=''">
141
                        <xsl:value-of select="./param[@name='dataset/title']"/>
142
                     </xsl:when>
143
                     <xsl:otherwise>
144
                       <xsl:value-of select="./param[@name='citation/title']"/>
145
                       <xsl:value-of select="./param[@name='software/title']"/>
146
                       <xsl:value-of select="./param[@name='protocol/title']"/>
147
                     </xsl:otherwise>
148
                   </xsl:choose>
149
                 </a><br />
150
                 <br/>
151
                 <p><pre>ID: <xsl:value-of select="./docid"/></pre></p>
152

    
153
               </form>
154
             </td>
155

    
156
             <td class="text_plain">
157
               <xsl:for-each select="./param[@name='originator/individualName/surName']" >
158
                 <xsl:value-of select="." />
159
                 <br/>
160
                </xsl:for-each>
161
               <xsl:for-each select="./param[@name='creator/individualName/surName']" >
162
                 <xsl:value-of select="." />
163
                 <br/>
164
               </xsl:for-each>
165

    
166
             </td>
167
             <td class="text_plain">
168
                 <xsl:value-of select="./param[@name='originator/organizationName']" />
169
                 <xsl:value-of select="./param[@name='creator/organizationName']" />
170

    
171
             </td>
172

    
173
             <td class="text_plain">
174
               <xsl:for-each
175
                select="./param[@name='keyword']">
176
                 <xsl:value-of select="." />
177
                 <br/>
178
               </xsl:for-each>
179

    
180
             </td>
181
	   
182
             <xsl:if test="$enableediting = 'true'">
183
               <td class="text_plain">
184
                 <form action="@cgi-prefix@/register-dataset.cgi" 
185
                       method="POST">
186
	               <input type="hidden" name="stage" value="modify"/>	
187
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
188
                   <input type="hidden" name="docid">
189
                     <xsl:attribute name="value">
190
                       <xsl:value-of select="./docid"/>
191
                     </xsl:attribute>
192
                   </input>
193
                   <center>
194
		             <input type="SUBMIT"  value=" Edit " name="Edit">
195
 	                 </input>
196
	               </center>
197
	             </form>
198
                 <form action="@cgi-prefix@/register-dataset.cgi" 
199
                       method="POST">
200
	               <input type="hidden" name="stage" value="delete"/>	
201
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
202
                   <input type="hidden" name="docid">
203
                     <xsl:attribute name="value">
204
                       <xsl:value-of select="./docid"/>
205
                     </xsl:attribute>
206
                   </input>
207
                   <center>
208
		             <input type="SUBMIT"  value="Delete" name="Delete">
209
 	                 </input>
210
	               </center>
211
	             </form>
212
	           </td>	  
213
             </xsl:if>
214
             <td width="10">&#160;</td>
215
             </tr>
216
             <tr class="searchresultsdivider"><td colspan="6">
217
             <img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></td></tr>
218

    
219
          </xsl:for-each>
220
          </table>
221

    
222
       </xsl:if>
223
      <script language="JavaScript">
224
          insertTemplateClosing();
225
      </script>
226
    </body>
227
    </html>
228
    </xsl:template>
229

    
230
</xsl:stylesheet>
(8-8/8)