1 |
4285
|
daigle
|
<?xml version="1.0"?>
|
2 |
|
|
<!--
|
3 |
|
|
* '$RCSfile: resultset.xsl,v $'
|
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: cjones $'
|
10 |
|
|
* '$Date: 2004/10/05 23:50:46 $'
|
11 |
|
|
* '$Revision: 1.1 $'
|
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 |
|
|
<!-- import the header, footer, and sidebars for customized styling -->
|
34 |
|
|
<xsl:import href="@systemidserver@@style-skins-path@/@default-style@/templates/xsl/pageheader.xsl"/>
|
35 |
|
|
<xsl:import href="@systemidserver@@style-skins-path@/@default-style@/templates/xsl/pagefooter.xsl"/>
|
36 |
|
|
<xsl:import href="@systemidserver@@style-skins-path@/@default-style@/templates/xsl/page_leftsidebar.xsl"/>
|
37 |
|
|
<xsl:import href="@systemidserver@@style-skins-path@/@default-style@/templates/xsl/page_rightsidebar.xsl"/>
|
38 |
|
|
<xsl:import href="@systemidserver@@style-skins-path@/@default-style@/templates/xsl/loginbox.xsl"/>
|
39 |
|
|
<xsl:import href="@systemidserver@@style-skins-path@/@default-style@/templates/xsl/searchbox.xsl"/>
|
40 |
|
|
|
41 |
|
|
<!-- send the resultset back to the browser styled in HTML -->
|
42 |
|
|
<xsl:output method="html" encoding="iso-8859-1" indent="yes" standalone="yes"
|
43 |
|
|
doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
|
44 |
|
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" />
|
45 |
|
|
|
46 |
|
|
<xsl:param name="sessid"/>
|
47 |
|
|
<xsl:param name="enableediting">false</xsl:param>
|
48 |
|
|
<!-- This parameter gets overidden by the chosen default qformat -->
|
49 |
|
|
<xsl:param name="qformat">default</xsl:param>
|
50 |
|
|
|
51 |
|
|
<!-- The main template matches the XML document root -->
|
52 |
|
|
<xsl:template match="/">
|
53 |
|
|
<html>
|
54 |
|
|
<head>
|
55 |
|
|
<link rel="stylesheet" type="text/css"
|
56 |
|
|
href="@style-skins-path@/{$qformat}/{$qformat}.css" />
|
57 |
|
|
<script language="Javascript" type="text/JavaScript"
|
58 |
|
|
src="@style-skins-path@/{$qformat}/{$qformat}.js" />
|
59 |
|
|
<script language="Javascript" type="text/JavaScript"
|
60 |
|
|
src="@style-common-path@/branding.js" />
|
61 |
|
|
|
62 |
|
|
<script language="JavaScript">
|
63 |
|
|
<![CDATA[
|
64 |
|
|
function submitform(action,form_ref) {
|
65 |
|
|
form_ref.action.value=action;
|
66 |
|
|
form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
|
67 |
|
|
form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
|
68 |
|
|
form_ref.submit();
|
69 |
|
|
}
|
70 |
|
|
]]>
|
71 |
|
|
</script>
|
72 |
|
|
</head>
|
73 |
|
|
|
74 |
|
|
<body>
|
75 |
|
|
<!-- begin the header area -->
|
76 |
|
|
<xsl:call-template name="pageheader" />
|
77 |
|
|
<!-- end the header area -->
|
78 |
|
|
|
79 |
|
|
<!-- begin the left sidebar area -->
|
80 |
|
|
<xsl:call-template name="page_leftsidebar" />
|
81 |
|
|
<!-- end the left sidebar area -->
|
82 |
|
|
|
83 |
|
|
<!-- begin the content area -->
|
84 |
|
|
<div id="content">
|
85 |
|
|
|
86 |
|
|
<!-- begin login form area -->
|
87 |
|
|
<xsl:call-template name="loginbox" />
|
88 |
|
|
<!-- end login form area -->
|
89 |
|
|
|
90 |
|
|
<!-- begin search form area -->
|
91 |
|
|
<xsl:call-template name="searchbox" />
|
92 |
|
|
<!-- end search form area -->
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
<!-- begin results section (XSLT generated) -->
|
96 |
|
|
<div id="data-catalog-area">
|
97 |
|
|
|
98 |
|
|
<!-- State how many package hits were returned -->
|
99 |
|
|
<xsl:choose>
|
100 |
|
|
<xsl:when test="count(resultset/document)=1">
|
101 |
|
|
<p>
|
102 |
|
|
<xsl:number value="count(resultset/document)" /> data package found:
|
103 |
|
|
</p>
|
104 |
|
|
</xsl:when>
|
105 |
|
|
<xsl:otherwise>
|
106 |
|
|
<p>
|
107 |
|
|
<xsl:number value="count(resultset/document)" /> data packages found:
|
108 |
|
|
</p>
|
109 |
|
|
</xsl:otherwise>
|
110 |
|
|
</xsl:choose>
|
111 |
|
|
|
112 |
|
|
<!-- This tests to see if there are returned documents,
|
113 |
|
|
if there are not then don't show the query results -->
|
114 |
|
|
<xsl:if test="count(resultset/document) > 0">
|
115 |
|
|
|
116 |
|
|
<!-- create the results table, and style each of the returnfield that
|
117 |
|
|
were specified in the original query -->
|
118 |
|
|
<table class="group group_border">
|
119 |
|
|
<tr>
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
<!-- create links to each of the associated raw data entities -->
|
123 |
|
|
<td>
|
124 |
|
|
<xsl:attribute name="class">
|
125 |
|
|
<xsl:choose>
|
126 |
|
|
<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
|
127 |
|
|
<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
|
128 |
|
|
</xsl:choose>
|
129 |
|
|
</xsl:attribute>
|
130 |
|
|
<!-- take each entity name and link it to the physical object url-->
|
131 |
|
|
<xsl:for-each select="./param[@name='dataTable/entityName']">
|
132 |
|
|
<a>
|
133 |
|
|
<xsl:variable name="URL"
|
134 |
|
|
select="following-sibling::param[@name='dataTable/physical/distribution/online/url']" />
|
135 |
|
|
|
136 |
|
|
<xsl:choose>
|
137 |
|
|
<!-- if contents is a url to external data table -->
|
138 |
|
|
<xsl:when test="starts-with($URL,'http')">
|
139 |
|
|
<xsl:attribute name="href"><xsl:value-of select="$URL"/></xsl:attribute>
|
140 |
|
|
</xsl:when>
|
141 |
|
|
|
142 |
|
|
<!-- strip out the ecogrid:// syntax if it's there, and the rest is in metacat -->
|
143 |
|
|
<xsl:when test="starts-with($URL,'ecogrid')">
|
144 |
|
|
<xsl:variable name="URL1" select="substring-after($URL, 'ecogrid://')"/>
|
145 |
|
|
<xsl:variable name="docID" select="substring-after($URL1, '/')"/>
|
146 |
|
|
<xsl:attribute name="href">
|
147 |
|
|
<!-- this needs to be on one line ... -->
|
148 |
|
|
<xsl:text>@systemidserver@@servlet-path@?action=read&qformat=</xsl:text><xsl:value-of select="$qformat"/><xsl:text>&docid=</xsl:text><xsl:value-of select="$docID"/>
|
149 |
|
|
</xsl:attribute>
|
150 |
|
|
</xsl:when>
|
151 |
|
|
|
152 |
|
|
<!-- otherwise, assume the url field names a metacat table -->
|
153 |
|
|
<xsl:otherwise>
|
154 |
|
|
<xsl:attribute name="href">
|
155 |
|
|
<!-- this needs to be on one line -->
|
156 |
|
|
<xsl:text>@systemidserver@@servlet-path@?action=read&qformat=</xsl:text><xsl:value-of select="$qformat"/><xsl:text>&docid=</xsl:text><xsl:value-of select="$URL"/>
|
157 |
|
|
</xsl:attribute>
|
158 |
|
|
</xsl:otherwise>
|
159 |
|
|
</xsl:choose>
|
160 |
|
|
|
161 |
|
|
<!-- show the entityName value as the link -->
|
162 |
|
|
<xsl:value-of select="." />
|
163 |
|
|
</a>
|
164 |
|
|
<br />
|
165 |
|
|
</xsl:for-each>
|
166 |
|
|
</td>
|
167 |
|
|
|
168 |
|
|
<xsl:if test="$enableediting = 'true'">
|
169 |
|
|
<td>
|
170 |
|
|
<xsl:attribute name="class">
|
171 |
|
|
<xsl:choose>
|
172 |
|
|
<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
|
173 |
|
|
<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
|
174 |
|
|
</xsl:choose>
|
175 |
|
|
</xsl:attribute>
|
176 |
|
|
|
177 |
|
|
<form action="@servlet-path@" method="POST">
|
178 |
|
|
<input type="hidden" name="action" value="read"/>
|
179 |
|
|
<input type="hidden" name="qformat" value="{$qformat}"/>
|
180 |
|
|
<input type="hidden" name="sessionid" value="{$sessid}"/>
|
181 |
|
|
<input type="hidden" name="docid">
|
182 |
|
|
<xsl:attribute name="value">
|
183 |
|
|
<xsl:value-of select="./docid"/>
|
184 |
|
|
</xsl:attribute>
|
185 |
|
|
</input>
|
186 |
|
|
<center>
|
187 |
|
|
<input type="SUBMIT" value=" View " name="View">
|
188 |
|
|
</input>
|
189 |
|
|
</center>
|
190 |
|
|
</form>
|
191 |
|
|
<form action="@cgi-prefix@/register-dataset.cgi"
|
192 |
|
|
method="POST">
|
193 |
|
|
<input type="hidden" name="stage" value="modify"/>
|
194 |
|
|
<input type="hidden" name="cfg" value="{$qformat}"/>
|
195 |
|
|
<input type="hidden" name="sessionid" value="{$sessid}"/>
|
196 |
|
|
<input type="hidden" name="docid">
|
197 |
|
|
<xsl:attribute name="value">
|
198 |
|
|
<xsl:value-of select="./docid"/>
|
199 |
|
|
</xsl:attribute>
|
200 |
|
|
</input>
|
201 |
|
|
<input type="SUBMIT" value=" Edit " name="Edit">
|
202 |
|
|
</input>
|
203 |
|
|
</form>
|
204 |
|
|
<form action="@cgi-prefix@/register-dataset.cgi"
|
205 |
|
|
method="POST">
|
206 |
|
|
<input type="hidden" name="stage" value="delete"/>
|
207 |
|
|
<input type="hidden" name="cfg" value="{$qformat}"/>
|
208 |
|
|
<input type="hidden" name="sessionid" value="{$sessid}"/>
|
209 |
|
|
<input type="hidden" name="docid">
|
210 |
|
|
<xsl:attribute name="value">
|
211 |
|
|
<xsl:value-of select="./docid"/>
|
212 |
|
|
</xsl:attribute>
|
213 |
|
|
</input>
|
214 |
|
|
<input type="submit" value="Delete" name="Delete">
|
215 |
|
|
</input>
|
216 |
|
|
</form>
|
217 |
|
|
</td>
|
218 |
|
|
</xsl:if>
|
219 |
|
|
</tr>
|
220 |
|
|
</xsl:for-each>
|
221 |
|
|
</table>
|
222 |
|
|
</xsl:if>
|
223 |
|
|
|
224 |
|
|
</div> <!-- end data-catalog-area -->
|
225 |
|
|
</div>
|
226 |
|
|
<!-- end content area -->
|
227 |
|
|
|
228 |
|
|
<!-- begin the right sidebar area -->
|
229 |
|
|
<xsl:call-template name="page_rightsidebar" />
|
230 |
|
|
<!-- end the right sidebar area -->
|
231 |
|
|
|
232 |
|
|
<!-- begin the footer area -->
|
233 |
|
|
<xsl:call-template name="pagefooter" />
|
234 |
|
|
<!-- end the footer area -->
|
235 |
|
|
|
236 |
|
|
</body>
|
237 |
|
|
</html>
|
238 |
|
|
</xsl:template>
|
239 |
|
|
|
240 |
|
|
</xsl:stylesheet>
|