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