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: 2005-12-01 10:24:39 -0800 (Thu, 01 Dec 2005) $'
11
* '$Revision: 2802 $'
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="sessid"/>
35
  <xsl:param name="qformat">default</xsl:param>
36
  <xsl:param name="enableediting">false</xsl:param>
37
  <xsl:param name="isModerator">false</xsl:param>
38
  <xsl:param name="message"></xsl:param>
39
  <xsl:template match="/">
40
   <html>
41
      <head>
42
        <link rel="stylesheet" type="text/css" 
43
              href="@style-skins-path@/{$qformat}/{$qformat}.css" />
44
        <script language="Javascript" type="text/JavaScript"
45
                src="@style-skins-path@/{$qformat}/{$qformat}.js" />
46
        <script language="Javascript" type="text/JavaScript"
47
                src="@style-common-path@/branding.js" />
48
        <script language="JavaScript">
49
          <![CDATA[
50
          function submitform(action,form_ref) {
51
              form_ref.action.value=action;
52
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
53
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
54
              form_ref.submit();
55
          }
56
          ]]>
57
        </script>
58
      </head>
59

    
60
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
61
      <script language="JavaScript">
62
          <![CDATA[
63
          insertTemplateOpening();
64
          insertSearchBox();
65
          ]]>
66
      </script>
67
        <table width="100%" align="center" border="0" cellpadding="2" cellspacing="0">
68
           <tr>
69
             <td align="left"><br></br><p class="emphasis"><xsl:value-of select="$message"/><br></br><xsl:number value="count(resultset/document)" /> data packages found</p></td>
70
           </tr></table>
71
<!-- This tests to see if there are returned documents,
72
            if there are not then don't show the query results -->
73

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

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

    
89
         <xsl:for-each select="resultset/document">
90
           <xsl:sort select="./param[@name='dataset/title']"/>
91
           <tr valign="top" class="subpanel">
92
             <xsl:attribute name="class">
93
               <xsl:choose>
94
                 <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
95
                 <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
96
               </xsl:choose>
97
             </xsl:attribute>
98

    
99
             <td width="10">&#160;</td>
100
             <td class="text_plain">
101
               <form action="@servlet-path@" method="POST">
102
                 <xsl:attribute name="name">
103
                   <xsl:value-of select="translate(./docid, '()-.', '____')" />
104
                 </xsl:attribute>
105

    
106
                 <input type="hidden" name="qformat" />
107
                 <input type="hidden" name="sessionid" />
108
                 <xsl:if test="$enableediting = 'true'">
109
	 	           <input type="hidden" name="enableediting" value="{$enableediting}"/>
110
                 </xsl:if>
111
                 <input type="hidden" name="action" value="read"/>
112
                 <input type="hidden" name="docid">
113
                   <xsl:attribute name="value">
114
                     <xsl:value-of select="./docid"/>
115
                   </xsl:attribute>
116
                 </input>
117
                 <xsl:for-each select="./relation">
118
                   <input type="hidden" name="docid">
119
                     <xsl:attribute name="value" >
120
                       <xsl:value-of select="./relationdoc" />
121
                     </xsl:attribute>
122
                   </input>
123
                 </xsl:for-each>
124

    
125
                 <a>
126
                   <xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')"/>)</xsl:attribute>
127
                   <xsl:text>&#187;&#160;</xsl:text>
128
                   <xsl:choose>
129
                     <xsl:when test="./param[@name='dataset/title']!=''">
130
                        <xsl:value-of select="./param[@name='dataset/title']"/>
131
                     </xsl:when>
132
                     <xsl:otherwise>
133
                       <xsl:value-of select="./param[@name='citation/title']"/>
134
                       <xsl:value-of select="./param[@name='software/title']"/>
135
                       <xsl:value-of select="./param[@name='protocol/title']"/>
136
                     </xsl:otherwise>
137
                   </xsl:choose>
138
                 </a><br />
139
                 <br/>
140
                 <p><pre>ID: <xsl:value-of select="./docid"/></pre></p>
141

    
142
               </form>
143
             </td>
144

    
145
             <td class="text_plain">
146
               <xsl:for-each select="./param[@name='originator/individualName/surName']" >
147
                 <xsl:value-of select="." />
148
                 <br/>
149
                </xsl:for-each>
150
               <xsl:for-each select="./param[@name='creator/individualName/surName']" >
151
                 <xsl:value-of select="." />
152
                 <br/>
153
               </xsl:for-each>
154

    
155
             </td>
156
             <td class="text_plain">
157
                 <xsl:value-of select="./param[@name='originator/organizationName']" />
158
                 <xsl:value-of select="./param[@name='creator/organizationName']" />
159

    
160
             </td>
161

    
162
             <td class="text_plain">
163
               <xsl:for-each
164
                select="./param[@name='keyword']">
165
                 <xsl:value-of select="." />
166
                 <br/>
167
               </xsl:for-each>
168

    
169
             </td>
170
	   
171
             <xsl:if test="$enableediting = 'true'">
172
               <xsl:choose>
173
                     <xsl:when test="$isModerator = 'true'">
174
               		<td class="text_plain">
175
	       		<form action="@cgi-prefix@/register-dataset.cgi" method="POST">
176
	               	<input type="hidden" name="stage" value="mod_accept"/>
177
	 	       	<input type="hidden" name="cfg" value="{$qformat}"/>
178
		       	<input type="hidden" name="sessionid"  value="{$sessid}"/>
179
                       	<input type="hidden" name="docid">
180
                       		<xsl:attribute name="value">
181
                          		<xsl:value-of select="./docid"/>
182
                       		</xsl:attribute>
183
                       	</input>
184
                       	<center>
185
		       		<input type="SUBMIT"  value=" Accept " name="Accept">
186
 	               		</input>
187
	               	</center>
188
	             </form>
189
	       	     <form action="@cgi-prefix@/register-dataset.cgi" method="POST">
190
	               <input type="hidden" name="stage" value="mod_decline"/>
191
	 	       <input type="hidden" name="cfg" value="{$qformat}"/>
192
		       <input type="hidden" name="sessionid"  value="{$sessid}"/>
193
                   	<input type="hidden" name="docid">
194
                     		<xsl:attribute name="value">
195
                       			<xsl:value-of select="./docid"/>
196
                     		</xsl:attribute>
197
                   	</input>
198
                     	<center>
199
		        	<input type="SUBMIT"  value="Decline" name="Decline">
200
 	                 	</input>
201
	                </center>
202
	            </form>
203
                    <form action="@cgi-prefix@/register-dataset.cgi" method="POST">
204
	               <input type="hidden" name="stage" value="mod_revise"/>
205
	 	       <input type="hidden" name="cfg" value="{$qformat}"/>
206
		       <input type="hidden" name="sessionid"  value="{$sessid}"/>
207
                   	<input type="hidden" name="docid">
208
                     		<xsl:attribute name="value">
209
                       			<xsl:value-of select="./docid"/>
210
                     		</xsl:attribute>
211
                   	</input>
212
                   	<center>
213
		             	<input type="SUBMIT"  value=" Revise " name="Revise">
214
 	                 	</input>
215
	               </center>
216
	             </form>
217
	           </td>	  
218
		  </xsl:when>
219
		  <xsl:otherwise>
220
               	     <td class="text_plain">
221
			<form action="@servlet-path@" method="POST">
222
                       <input type="hidden" name="action" value="read"/>
223
                        <input type="hidden" name="qformat" value="{$qformat}"/>
224
                                <input type="hidden" name="sessionid"  value="{$sessid}"/>
225
                       <input type="hidden" name="docid">
226
                       <xsl:attribute name="value">
227
                          <xsl:value-of select="./docid"/>
228
                       </xsl:attribute>
229
                       </input>
230
                       <center>
231
                       <input type="SUBMIT"  value=" View " name="View">
232
                       </input>
233
                       </center>
234
                     </form>
235
                 <form action="@cgi-prefix@/register-dataset.cgi" 
236
                       method="POST">
237
                       <input type="hidden" name="stage" value="modify"/>        
238
                            <input type="hidden" name="cfg" value="{$qformat}"/>
239
                                        <input type="hidden" name="sessionid"  value="{$sessid}"/>
240
                   <input type="hidden" name="docid">
241
                     <xsl:attribute name="value">
242
                       <xsl:value-of select="./docid"/>
243
                     </xsl:attribute>
244
                   </input>
245
                   <center>
246
                             <input type="SUBMIT"  value=" Edit " name="Edit">
247
                         </input>
248
                       </center>
249
                     </form>
250
		     </td>
251
		  </xsl:otherwise>
252
             </xsl:choose>
253
             </xsl:if>
254
             <td width="10">&#160;</td>
255
             </tr>
256
             <tr class="searchresultsdivider"><td colspan="6">
257
             <img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></td></tr>
258

    
259
          </xsl:for-each>
260
          </table>
261

    
262
       </xsl:if>
263
      <script language="JavaScript">
264
          insertTemplateClosing();
265
      </script>
266
    </body>
267
    </html>
268
    </xsl:template>
269

    
270
</xsl:stylesheet>
(7-7/16)