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

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

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

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

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

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

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

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

    
140
               </form>
141
             </td>
142

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

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

    
158
             </td>
159

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

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

    
222
          </xsl:for-each>
223
          </table>
224

    
225
       </xsl:if>
226
      <script language="JavaScript">
227
          insertTemplateClosing();
228
      </script>
229
    </body>
230
    </html>
231
    </xsl:template>
232

    
233
</xsl:stylesheet>
(4-4/13)