Project

General

Profile

1 2211 jones
<?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 3686 barteau
  <xsl:param name="cgi-url" select='string("")'/>
35 2211 jones
  <xsl:param name="sessid"/>
36
  <xsl:param name="qformat">default</xsl:param>
37
  <xsl:param name="enableediting">false</xsl:param>
38
  <xsl:template match="/">
39
   <html>
40
      <head>
41
        <link rel="stylesheet" type="text/css"
42 3780 daigle
              href="{$contextURL}/style/skins/{$qformat}/{$qformat}.css" />
43 2211 jones
        <script language="Javascript" type="text/JavaScript"
44 3780 daigle
                src="{$contextURL}/style/skins/{$qformat}/{$qformat}.js" />
45 2211 jones
        <script language="Javascript" type="text/JavaScript"
46 3780 daigle
                src="{$contextURL}/style/common/branding.js" />
47 2211 jones
        <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
          ]]>
57
        </script>
58
      </head>
59
60
      <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
61
      <script language="JavaScript">
62 3780 daigle
          insertTemplateOpening("{$contextURL}");
63
          insertSearchBox("{$contextURL}");
64 2211 jones
      </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 3780 daigle
             <th class="tablehead_lcorner" align="right" valign="top"><img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" /></th>
77 2211 jones
             <th class="tablehead">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 3780 daigle
             <th class="tablehead_rcorner" align="right" valign="top"><img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" /></th>
85 2211 jones
           </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 3780 daigle
               <form action="{$servletURL}" method="POST">
100 2211 jones
                 <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
                 <xsl:if test="starts-with(./doctype, 'eml://ecoinformatics.org/eml-2.0.0')">
141
                 <a>
142 3780 daigle
                   <xsl:attribute name="href"><![CDATA[http://nebulous.nceas.ucsb.edu:8080/httprenderer/servlet/jalamafrontservlet?action=loadxmlinstance&url={$servletURL}%3Faction=read%26qformat=xml%26docid=]]><xsl:value-of select="./docid"/></xsl:attribute>
143 2236 brooke
                   <xsl:attribute name="target">_blank</xsl:attribute>
144 2211 jones
                   <xsl:text>&#187;&#160;</xsl:text>
145
                   <b>Create data entry form</b>
146
                 </a><br/>
147
                 </xsl:if>
148
149
               </form>
150
             </td>
151
152
             <td class="text_plain">
153
               <xsl:for-each select="./param[@name='originator/individualName/surName']" >
154
                 <xsl:value-of select="." />
155
                 <br/>
156
                </xsl:for-each>
157
               <xsl:for-each select="./param[@name='creator/individualName/surName']" >
158
                 <xsl:value-of select="." />
159
                 <br/>
160
               </xsl:for-each>
161
162
             </td>
163
             <td class="text_plain">
164
                 <xsl:value-of select="./param[@name='originator/organizationName']" />
165
                 <xsl:value-of select="./param[@name='creator/organizationName']" />
166
167
             </td>
168
169
             <td class="text_plain">
170
               <xsl:for-each
171
                select="./param[@name='keyword']">
172
                 <xsl:value-of select="." />
173
                 <br/>
174
               </xsl:for-each>
175
176
             </td>
177
178
             <xsl:if test="$enableediting = 'true'">
179
               <td class="text_plain">
180 3780 daigle
	       <form action="{$servletURL}" method="POST">
181 2211 jones
	               <input type="hidden" name="action" value="read"/>
182
	 	       <input type="hidden" name="qformat" value="{$qformat}"/>
183
				<input type="hidden" name="sessionid"  value="{$sessid}"/>
184
                       <input type="hidden" name="docid">
185
                       <xsl:attribute name="value">
186
                          <xsl:value-of select="./docid"/>
187
                       </xsl:attribute>
188
                       </input>
189
                       <center>
190
		       <input type="SUBMIT"  value=" View " name="View">
191
 	               </input>
192
	               </center>
193
	             </form>
194 3686 barteau
                 <form action="{$cgi-url}/register-dataset.cgi"
195 2211 jones
                       method="POST">
196
	               <input type="hidden" name="stage" value="modify"/>
197
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
198
					<input type="hidden" name="sessionid"  value="{$sessid}"/>
199
                   <input type="hidden" name="docid">
200
                     <xsl:attribute name="value">
201
                       <xsl:value-of select="./docid"/>
202
                     </xsl:attribute>
203
                   </input>
204
                   <center>
205
		             <input type="SUBMIT"  value=" Edit " name="Edit">
206
 	                 </input>
207
	               </center>
208
	             </form>
209 3686 barteau
                 <form action="{$cgi-url}/register-dataset.cgi"
210 2211 jones
                       method="POST">
211
	               <input type="hidden" name="stage" value="delete"/>
212
	 	           <input type="hidden" name="cfg" value="{$qformat}"/>
213
					<input type="hidden" name="sessionid"  value="{$sessid}"/>
214
                   <input type="hidden" name="docid">
215
                     <xsl:attribute name="value">
216
                       <xsl:value-of select="./docid"/>
217
                     </xsl:attribute>
218
                   </input>
219
                   <center>
220
		             <input type="SUBMIT"  value="Delete" name="Delete">
221
 	                 </input>
222
	               </center>
223
	             </form>
224
	           </td>
225
             </xsl:if>
226
             <td width="10">&#160;</td>
227
             </tr>
228
             <tr class="searchresultsdivider"><td colspan="6">
229 3780 daigle
             <img src="{$contextURL}/style/skins/default/images/transparent1x1.gif" width="1" height="1" /></td></tr>
230 2211 jones
231
          </xsl:for-each>
232
          </table>
233
234
       </xsl:if>
235
      <script language="JavaScript">
236 3780 daigle
          insertTemplateClosing("{$contextURL}");
237 2211 jones
      </script>
238
    </body>
239
    </html>
240
    </xsl:template>
241
242
</xsl:stylesheet>