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-11-17 12:32:02 -0800 (Thu, 17 Nov 2005) $'
11
* '$Revision: 2756 $'
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="@cgi-prefix@/register-dataset.cgi" method="POST">
172
	               <input type="hidden" name="stage" value="mod_accept"/>
173
	 	       <input type="hidden" name="cfg" 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="@cgi-prefix@/register-dataset.cgi" method="POST">
186
	               <input type="hidden" name="stage" value="mod_decline"/>
187
	 	       <input type="hidden" name="cfg" value="{$qformat}"/>
188
		       <input type="hidden" name="sessionid"  value="{$sessid}"/>
189
                   <input type="hidden" name="docid">
190
                     <xsl:attribute name="value">
191
                       <xsl:value-of select="./docid"/>
192
                     </xsl:attribute>
193
                   </input>
194
                   <center>
195
		             <input type="SUBMIT"  value="Decline" name="Decline">
196
 	                 </input>
197
	               </center>
198
	             </form>
199
                 <form action="@cgi-prefix@/register-dataset.cgi" method="POST">
200
	               <input type="hidden" name="stage" value="mod_revise"/>
201
	 	       <input type="hidden" name="cfg" value="{$qformat}"/>
202
		       <input type="hidden" name="sessionid"  value="{$sessid}"/>
203
                   <input type="hidden" name="docid">
204
                     <xsl:attribute name="value">
205
                       <xsl:value-of select="./docid"/>
206
                     </xsl:attribute>
207
                   </input>
208
                   <center>
209
		             <input type="SUBMIT"  value=" Revise " name="Revise">
210
 	                 </input>
211
	               </center>
212
	             </form>
213
	           </td>	  
214
             </xsl:if>
215
             <td width="10">&#160;</td>
216
             </tr>
217
             <tr class="searchresultsdivider"><td colspan="6">
218
             <img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></td></tr>
219

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

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

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