Project

General

Profile

1 2656 sgarg
<?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
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 2788 sgarg
  <xsl:param name="isModerator">false</xsl:param>
38 2656 sgarg
  <xsl:template match="/">
39
   <html>
40
      <head>
41
        <link rel="stylesheet" type="text/css"
42
              href="@style-skins-path@/{$qformat}/{$qformat}.css" />
43
        <script language="Javascript" type="text/JavaScript"
44
                src="@style-skins-path@/{$qformat}/{$qformat}.js" />
45
        <script language="Javascript" type="text/JavaScript"
46
                src="@style-common-path@/branding.js" />
47
        <script language="JavaScript">
48
          <![CDATA[
49
          function submitform(action,form_ref) {
50
              form_ref.action.value=action;
51
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
52
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
53
              form_ref.submit();
54
          }
55
          ]]>
56
        </script>
57
      </head>
58
59
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
60
      <script language="JavaScript">
61 2686 sgarg
          <![CDATA[
62 2656 sgarg
          insertTemplateOpening();
63
          insertSearchBox();
64 2686 sgarg
          ]]>
65 2656 sgarg
      </script>
66
        <table width="100%" align="center" border="0" cellpadding="5" cellspacing="0">
67
           <tr>
68
             <td align="left"><br></br><p class="emphasis"><xsl:number value="count(resultset/document)" /> data packages found</p></td>
69
           </tr></table>
70
<!-- This tests to see if there are returned documents,
71
            if there are not then don't show the query results -->
72
73
      <xsl:if test="count(resultset/document) &gt; 0">
74
75
         <table width="95%" align="center" border="0" cellpadding="0" cellspacing="0">
76
           <tr>
77
             <th class="tablehead_lcorner" align="right" valign="top"><img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></th>
78
             <th class="tablehead" style="text-align: left">Title</th>
79
             <th width="15%" class="tablehead" style="text-align: left">Contacts</th>
80
             <th width="15%" class="tablehead" style="text-align: left">Organization</th>
81
             <th width="15%" class="tablehead" style="text-align: left">Keywords</th>
82
             <xsl:if test="$enableediting = 'true'">
83
               <th width="10%" class="tablehead" style="text-align: middle">Actions</th>
84
             </xsl:if>
85
             <th class="tablehead_rcorner" align="right" valign="top"><img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></th>
86
           </tr>
87
88
         <xsl:for-each select="resultset/document">
89
           <xsl:sort select="./param[@name='dataset/title']"/>
90
           <tr valign="top" class="subpanel">
91
             <xsl:attribute name="class">
92
               <xsl:choose>
93
                 <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
94
                 <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
95
               </xsl:choose>
96
             </xsl:attribute>
97
98
             <td width="10">&#160;</td>
99
             <td class="text_plain">
100
               <form action="@servlet-path@" method="POST">
101
                 <xsl:attribute name="name">
102
                   <xsl:value-of select="translate(./docid, '()-.', '____')" />
103
                 </xsl:attribute>
104
105
                 <input type="hidden" name="qformat" />
106
                 <input type="hidden" name="sessionid" />
107
                 <xsl:if test="$enableediting = 'true'">
108
	 	           <input type="hidden" name="enableediting" value="{$enableediting}"/>
109
                 </xsl:if>
110
                 <input type="hidden" name="action" value="read"/>
111
                 <input type="hidden" name="docid">
112
                   <xsl:attribute name="value">
113
                     <xsl:value-of select="./docid"/>
114
                   </xsl:attribute>
115
                 </input>
116
                 <xsl:for-each select="./relation">
117
                   <input type="hidden" name="docid">
118
                     <xsl:attribute name="value" >
119
                       <xsl:value-of select="./relationdoc" />
120
                     </xsl:attribute>
121
                   </input>
122
                 </xsl:for-each>
123
124
                 <a>
125
                   <xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')"/>)</xsl:attribute>
126
                   <xsl:text>&#187;&#160;</xsl:text>
127
                   <xsl:choose>
128
                     <xsl:when test="./param[@name='dataset/title']!=''">
129
                        <xsl:value-of select="./param[@name='dataset/title']"/>
130
                     </xsl:when>
131
                     <xsl:otherwise>
132
                       <xsl:value-of select="./param[@name='citation/title']"/>
133
                       <xsl:value-of select="./param[@name='software/title']"/>
134
                       <xsl:value-of select="./param[@name='protocol/title']"/>
135
                     </xsl:otherwise>
136
                   </xsl:choose>
137
                 </a><br />
138
                 <br/>
139
                 <p><pre>ID: <xsl:value-of select="./docid"/></pre></p>
140
141
               </form>
142
             </td>
143
144
             <td class="text_plain">
145
               <xsl:for-each select="./param[@name='originator/individualName/surName']" >
146
                 <xsl:value-of select="." />
147
                 <br/>
148
                </xsl:for-each>
149
               <xsl:for-each select="./param[@name='creator/individualName/surName']" >
150
                 <xsl:value-of select="." />
151
                 <br/>
152
               </xsl:for-each>
153
154
             </td>
155
             <td class="text_plain">
156
                 <xsl:value-of select="./param[@name='originator/organizationName']" />
157
                 <xsl:value-of select="./param[@name='creator/organizationName']" />
158
159
             </td>
160
161
             <td class="text_plain">
162
               <xsl:for-each
163
                select="./param[@name='keyword']">
164
                 <xsl:value-of select="." />
165
                 <br/>
166
               </xsl:for-each>
167
168
             </td>
169
170
             <xsl:if test="$enableediting = 'true'">
171 2788 sgarg
               <xsl:choose>
172
                     <xsl:when test="$isModerator = 'true'">
173
               		<td class="text_plain">
174
	       		<form action="@cgi-prefix@/register-dataset.cgi" method="POST">
175
	               	<input type="hidden" name="stage" value="mod_accept"/>
176
	 	       	<input type="hidden" name="cfg" value="{$qformat}"/>
177
		       	<input type="hidden" name="sessionid"  value="{$sessid}"/>
178
                       	<input type="hidden" name="docid">
179
                       		<xsl:attribute name="value">
180
                          		<xsl:value-of select="./docid"/>
181
                       		</xsl:attribute>
182
                       	</input>
183
                       	<center>
184
		       		<input type="SUBMIT"  value=" Accept " name="Accept">
185
 	               		</input>
186
	               	</center>
187
	             </form>
188
	       	     <form action="@cgi-prefix@/register-dataset.cgi" method="POST">
189
	               <input type="hidden" name="stage" value="mod_decline"/>
190 2756 sgarg
	 	       <input type="hidden" name="cfg" value="{$qformat}"/>
191
		       <input type="hidden" name="sessionid"  value="{$sessid}"/>
192 2788 sgarg
                   	<input type="hidden" name="docid">
193
                     		<xsl:attribute name="value">
194
                       			<xsl:value-of select="./docid"/>
195
                     		</xsl:attribute>
196
                   	</input>
197
                     	<center>
198
		        	<input type="SUBMIT"  value="Decline" name="Decline">
199
 	                 	</input>
200
	                </center>
201
	            </form>
202
                    <form action="@cgi-prefix@/register-dataset.cgi" method="POST">
203
	               <input type="hidden" name="stage" value="mod_revise"/>
204
	 	       <input type="hidden" name="cfg" value="{$qformat}"/>
205
		       <input type="hidden" name="sessionid"  value="{$sessid}"/>
206
                   	<input type="hidden" name="docid">
207
                     		<xsl:attribute name="value">
208
                       			<xsl:value-of select="./docid"/>
209
                     		</xsl:attribute>
210
                   	</input>
211
                   	<center>
212
		             	<input type="SUBMIT"  value=" Revise " name="Revise">
213
 	                 	</input>
214
	               </center>
215
	             </form>
216
	           </td>
217
		  </xsl:when>
218
		  <xsl:otherwise>
219
               	     <td class="text_plain">
220
			<form action="@servlet-path@" method="POST">
221
                       <input type="hidden" name="action" value="read"/>
222
                        <input type="hidden" name="qformat" value="{$qformat}"/>
223
                                <input type="hidden" name="sessionid"  value="{$sessid}"/>
224 2656 sgarg
                       <input type="hidden" name="docid">
225
                       <xsl:attribute name="value">
226
                          <xsl:value-of select="./docid"/>
227
                       </xsl:attribute>
228
                       </input>
229
                       <center>
230 2788 sgarg
                       <input type="SUBMIT"  value=" View " name="View">
231
                       </input>
232
                       </center>
233
                     </form>
234
                 <form action="@cgi-prefix@/register-dataset.cgi"
235
                       method="POST">
236
                       <input type="hidden" name="stage" value="modify"/>
237
                            <input type="hidden" name="cfg" value="{$qformat}"/>
238
                                        <input type="hidden" name="sessionid"  value="{$sessid}"/>
239 2656 sgarg
                   <input type="hidden" name="docid">
240
                     <xsl:attribute name="value">
241
                       <xsl:value-of select="./docid"/>
242
                     </xsl:attribute>
243
                   </input>
244
                   <center>
245 2788 sgarg
                             <input type="SUBMIT"  value=" Edit " name="Edit">
246
                         </input>
247
                       </center>
248
                     </form>
249
		     </td>
250
		  </xsl:otherwise>
251
             </xsl:choose>
252 2656 sgarg
             </xsl:if>
253
             <td width="10">&#160;</td>
254
             </tr>
255
             <tr class="searchresultsdivider"><td colspan="6">
256
             <img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></td></tr>
257
258
          </xsl:for-each>
259
          </table>
260
261
       </xsl:if>
262
      <script language="JavaScript">
263
          insertTemplateClosing();
264
      </script>
265
    </body>
266
    </html>
267
    </xsl:template>
268
269
</xsl:stylesheet>