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: sgarg $'
10
*     '$Date: 2004-03-16 18:21:15 -0800 (Tue, 16 Mar 2004) $'
11
* '$Revision: 2048 $'
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="./param[@name='dataset/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
		  <xsl:text disable-output-escaping='yes'>&#160;</xsl:text>
150
                 </a><br />
151
                 <br/>
152
                 <p><pre>ID: <xsl:value-of select="./docid"/></pre></p>
153

    
154
               </form>
155
             </td>
156

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

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

    
172
             </td>
173

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

    
181
             </td>
182
	   
183
             <xsl:if test="$enableediting = 'true'">
184
               <td class="text_plain">
185
	       <form action="@servlet-path@" method="POST">
186
	               <input type="hidden" name="action" value="read"/>
187
	 	       <input type="hidden" name="qformat" 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=" View " name="View">
195
 	               </input>
196
	               </center>
197
	             </form>
198
                 <form action="@cgi-prefix@/register-dataset.cgi" 
199
                       method="POST">
200
	               <input type="hidden" name="stage" value="modify"/>	
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=" Edit " name="Edit">
209
 	                 </input>
210
	               </center>
211
	             </form>
212
                 <form action="@cgi-prefix@/register-dataset.cgi" 
213
                       method="POST">
214
	               <input type="hidden" name="stage" value="delete"/>	
215
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
216
                   <input type="hidden" name="docid">
217
                     <xsl:attribute name="value">
218
                       <xsl:value-of select="./docid"/>
219
                     </xsl:attribute>
220
                   </input>
221
                   <center>
222
		             <input type="SUBMIT"  value="Delete" name="Delete">
223
 	                 </input>
224
	               </center>
225
	             </form>
226
	           </td>	  
227
             </xsl:if>
228
             <td width="10">&#160;</td>
229
             </tr>
230
             <tr class="searchresultsdivider"><td colspan="6">
231
             <img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></td></tr>
232

    
233
          </xsl:for-each>
234
          </table>
235

    
236
       </xsl:if>
237
      <script language="JavaScript">
238
          insertTemplateClosing();
239
      </script>
240
    </body>
241
    </html>
242
    </xsl:template>
243

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