Project

General

Profile

1 5385 leinfelder
<?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"
32
	version="1.0">
33
34
	<xsl:output method="html" />
35
	<xsl:param name="sessid" />
36
	<xsl:param name="qformat">semtools</xsl:param>
37
	<xsl:param name="enableediting">false</xsl:param>
38
	<xsl:param name="contextURL"/>
39
	<xsl:template match="/">
40
		<html>
41
			<head>
42
				<title>Search Results</title>
43
				<link rel="stylesheet" type="text/css"
44
					href="/knb/style/skins/{$qformat}/{$qformat}.css" />
45
				<script language="Javascript" type="text/JavaScript"
46
					src="/knb/style/skins/{$qformat}/{$qformat}.js" />
47
				<script language="Javascript" type="text/JavaScript"
48
					src="/knb/style/common/branding.js" />
49
				<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
				</script>
59
			</head>
60
61
			<body leftmargin="0" topmargin="0" marginwidth="0"
62
				marginheight="0">
63
				<script language="JavaScript">
64
					insertTemplateOpening('<xsl:value-of select="$contextURL" />'); insertSearchBox('<xsl:value-of select="$contextURL" />');
65
				</script>
66
67
				<table style="width:100%;" align="center" border="0"
68
					cellpadding="5" cellspacing="0">
69
					<tr>
70
						<td align="left">
71
							<p class="emphasis">
72
								<xsl:number
73
									value="count(resultset/document)" />
74
								total records found
75
							</p>
76
						</td>
77
					</tr>
78
				</table>
79
80 5533 leinfelder
				<table align="left" border="0" cellpadding="0" cellspacing="5">
81 5385 leinfelder
					<tr valign="top">
82
83
						<!-- ANNOTATIONS HERE  -->
84
						<xsl:if test="count(resultset/document[docname='annotation']) &gt; 0">
85 5533 leinfelder
							<td>
86 5385 leinfelder
								<xsl:call-template name="annotationResults"/>
87
							</td>
88
						</xsl:if>
89
90 5533 leinfelder
						<xsl:if test="count(resultset/document[docname='annotation']) &gt; 0">
91
							<xsl:if test="count(resultset/document[docname='eml']) &gt; 0">
92
								<td width="10%"></td>
93
							</xsl:if>
94
						</xsl:if>
95 5385 leinfelder
96
						<!-- EML HERE  -->
97
						<xsl:if test="count(resultset/document[docname='eml']) &gt; 0">
98 5533 leinfelder
							<td>
99 5385 leinfelder
								<xsl:call-template name="emlResults"/>
100
							</td>
101
						</xsl:if>
102
103
					</tr>
104
				</table>
105
106
				<script language="JavaScript">
107
					insertTemplateClosing('<xsl:value-of select="$contextURL" />');
108
				</script>
109
			</body>
110
		</html>
111
	</xsl:template>
112
113
	<xsl:template name="emlResults">
114
		<table align="center" border="0" cellpadding="5" cellspacing="0">
115
			<tr>
116
				<th class="tablehead" colspan="4">
117
					Datapackages
118
				</th>
119
			</tr>
120
			<tr>
121
				<th	style="text-align: left">
122
					Title
123
				</th>
124
				<th	style="text-align: left">
125
					Owners[s]
126
				</th>
127
				<th	style="text-align: left">
128
					Organization[s]
129
				</th>
130
				<th	style="text-align: left">
131
					Keywords
132
				</th>
133
			</tr>
134
135
			<xsl:for-each
136
				select="resultset/document[docname='eml']">
137
				<xsl:sort
138
					select="./param[@name='dataset/title']" />
139
				<tr valign="top" class="subpanel">
140
					<xsl:attribute name="class">
141
	              			<xsl:choose>
142
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
143
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
144
						</xsl:choose>
145
					</xsl:attribute>
146
147
					<td class="text_plain">
148
						<form action="/knb/metacat"
149
							method="POST">
150
							<xsl:attribute name="name">
151
								<xsl:value-of select="translate(./docid, '()-.', '____')" />
152
							</xsl:attribute>
153
154
							<input type="hidden"
155
								name="qformat" />
156
							<input type="hidden"
157
								name="sessionid" />
158
							<input type="hidden"
159
								name="action" value="read" />
160
							<input type="hidden"
161
								name="docid">
162
								<xsl:attribute name="value">
163
									<xsl:value-of select="./docid" />
164
								</xsl:attribute>
165
							</input>
166
							<a>
167
								<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of	select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
168
								<xsl:text>&#187;&#160;</xsl:text>
169
								<xsl:value-of select="./param[@name='dataset/title']"/>
170
							</a>
171
							<br />
172
							<br />
173
							<p>
174
								<pre>ID: <xsl:value-of select="./docid" /></pre>
175
							</p>
176
177
						</form>
178
					</td>
179
180
					<td class="text_plain">
181
						<xsl:for-each
182
							select="./param[@name='creator/individualName/surName']">
183
							<xsl:value-of select="." />
184
							<br />
185
						</xsl:for-each>
186
					</td>
187
188
					<td class="text_plain">
189
						<xsl:for-each
190
							select="./param[@name='creator/organizationName']">
191
							<xsl:value-of select="." />
192
							<br />
193
						</xsl:for-each>
194
					</td>
195
196
					<td class="text_plain">
197
						<xsl:for-each
198
							select="./param[@name='keyword']">
199
							<xsl:value-of select="." />
200
							<br />
201
						</xsl:for-each>
202
					</td>
203
204
				</tr>
205
				<tr class="searchresultsdivider">
206
					<td colspan="5">
207
					</td>
208
				</tr>
209
210
			</xsl:for-each>
211
		</table>
212
	</xsl:template>
213
214
	<xsl:template name="annotationResults">
215
		<table align="left" border="0" cellpadding="5" cellspacing="0">
216
			<tr>
217
				<th class="tablehead" colspan="3">
218
					Annotations
219
				</th>
220
			</tr>
221
222
			<tr>
223
				<th	style="text-align: left">
224
					Identifier
225
				</th>
226
				<th	style="text-align: left">
227
					Datapackage
228
				</th>
229
				<th	style="text-align: left">
230
					Entities
231
				</th>
232
			</tr>
233
234
			<xsl:for-each select="resultset/document[docname='annotation']">
235
				<xsl:sort select="./param[@name='@id']" />
236
				<tr valign="top">
237
					<xsl:attribute name="class">
238
						<xsl:choose>
239
							<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
240
							<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
241
						</xsl:choose>
242
					</xsl:attribute>
243
244
					<td class="text_plain">
245
						<a>
246
							<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
247
							<xsl:text>&#187;&#160;</xsl:text>
248
							<xsl:value-of select="./docid" />
249
						</a>
250
						<form action="{$contextURL}/metacat" method="POST">
251
							<xsl:attribute name="name">
252
								<xsl:value-of select="translate(./docid, '()-.', '____')" />
253
							</xsl:attribute>
254
							<input type="hidden" name="qformat" value="{$qformat}"/>
255
							<input type="hidden" name="sessionid" />
256
							<input type="hidden" name="action" value="read" />
257
							<input type="hidden" name="docid">
258
								<xsl:attribute name="value">
259
									<xsl:value-of select="./docid" />
260
								</xsl:attribute>
261
							</input>
262
						</form>
263
					</td>
264
265
					<td class="text_plain">
266
						<a>
267
							<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="concat(translate(./param[@name='@emlPackage'], '()-.', '____'), '_annotation')" />)</xsl:attribute>
268
							<xsl:value-of select="./param[@name='@emlPackage']"/>
269
						</a>
270
271
						<form action="{$contextURL}/metacat" method="POST">
272
							<xsl:attribute name="name">
273
								<xsl:value-of select="concat(translate(./param[@name='@emlPackage'], '()-.', '____'), '_annotation')" />
274
							</xsl:attribute>
275
							<input type="hidden" name="qformat" value="{$qformat}"/>
276
							<input type="hidden" name="sessionid" />
277
							<input type="hidden" name="action" value="read" />
278
							<input type="hidden" name="docid">
279
								<xsl:attribute name="value">
280
									<xsl:value-of select="./param[@name='@emlPackage']"/>
281
								</xsl:attribute>
282
							</input>
283
						</form>
284
285
					</td>
286
287
					<td class="text_plain">
288
						<xsl:for-each
289
							select="./param[@name='entity/@id']">
290
							<xsl:value-of select="." />
291
							<br />
292
						</xsl:for-each>
293
					</td>
294
295
296
				</tr>
297
298
				<tr class="searchresultsdivider">
299
					<td colspan="3">
300
					</td>
301
				</tr>
302
303
			</xsl:for-each>
304
		</table>
305
306
	</xsl:template>
307
308
</xsl:stylesheet>