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 5536 leinfelder
<xsl:stylesheet
32
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
33
	xmlns:sms="http://ecoinformatics.org/sms/annotation.0.9"
34 5385 leinfelder
	version="1.0">
35 5541 leinfelder
	<xsl:import href="annotation-root.xsl"/>
36 5385 leinfelder
37
	<xsl:output method="html" />
38
	<xsl:param name="sessid" />
39
	<xsl:param name="qformat">semtools</xsl:param>
40
	<xsl:param name="enableediting">false</xsl:param>
41
	<xsl:param name="contextURL"/>
42
	<xsl:template match="/">
43
		<html>
44
			<head>
45
				<title>Search Results</title>
46
				<link rel="stylesheet" type="text/css"
47
					href="/knb/style/skins/{$qformat}/{$qformat}.css" />
48
				<script language="Javascript" type="text/JavaScript"
49
					src="/knb/style/skins/{$qformat}/{$qformat}.js" />
50
				<script language="Javascript" type="text/JavaScript"
51
					src="/knb/style/common/branding.js" />
52
			</head>
53
54 5574 leinfelder
			<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
55 5385 leinfelder
				<script language="JavaScript">
56
					insertTemplateOpening('<xsl:value-of select="$contextURL" />'); insertSearchBox('<xsl:value-of select="$contextURL" />');
57
				</script>
58 5574 leinfelder
59
				<div id="content_wrapper">
60
61 5385 leinfelder
				<table style="width:100%;" align="center" border="0"
62
					cellpadding="5" cellspacing="0">
63
					<tr>
64
						<td align="left">
65
							<p class="emphasis">
66
								<xsl:number
67
									value="count(resultset/document)" />
68
								total records found
69
							</p>
70
						</td>
71
					</tr>
72
				</table>
73
74 5536 leinfelder
				<table align="left" border="0" cellpadding="0" cellspacing="5" width="100%">
75 5385 leinfelder
					<tr valign="top">
76
77
						<!-- EML HERE  -->
78
						<xsl:if test="count(resultset/document[docname='eml']) &gt; 0">
79 5533 leinfelder
							<td>
80 5385 leinfelder
								<xsl:call-template name="emlResults"/>
81
							</td>
82
						</xsl:if>
83
84
					</tr>
85
				</table>
86
87 5574 leinfelder
				</div>
88
89 5385 leinfelder
				<script language="JavaScript">
90
					insertTemplateClosing('<xsl:value-of select="$contextURL" />');
91
				</script>
92
			</body>
93
		</html>
94
	</xsl:template>
95
96
	<xsl:template name="emlResults">
97
98 5677 leinfelder
		<div id="results">
99
100 5385 leinfelder
			<xsl:for-each
101
				select="resultset/document[docname='eml']">
102
				<xsl:sort
103
					select="./param[@name='dataset/title']" />
104 5675 leinfelder
105
				<!-- the header portion of the result -->
106 5677 leinfelder
				<div>
107 5385 leinfelder
					<xsl:attribute name="class">
108
	              			<xsl:choose>
109 5675 leinfelder
						    <xsl:when test="position() mod 2 = 1">rowodd accordian</xsl:when>
110
						    <xsl:when test="position() mod 2 = 0">roweven accordian</xsl:when>
111 5385 leinfelder
						</xsl:choose>
112
					</xsl:attribute>
113
114 5677 leinfelder
					<a>
115
						<xsl:attribute name="href">
116
							<xsl:value-of select="$tripleURI"/><xsl:value-of select="./docid"/>
117
						</xsl:attribute>
118
						<b>
119
							<xsl:value-of select="./param[@name='dataset/title']"/>
120
						</b>
121
					</a>
122
					(<xsl:value-of select="./docid" />)
123
				</div>
124 5536 leinfelder
125 5675 leinfelder
				<!-- the content part -->
126 5677 leinfelder
				<div>
127 5385 leinfelder
					<xsl:attribute name="class">
128 5675 leinfelder
	              		<xsl:choose>
129
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
130
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
131 5385 leinfelder
						</xsl:choose>
132
					</xsl:attribute>
133
134 5677 leinfelder
					<table class="onehundred_percent">
135 5690 leinfelder
136 5677 leinfelder
						<tr>
137 5727 leinfelder
							<td colspan="2">
138 5732 leinfelder
								<table class="subGroup subGroup_border onehundred_percent">
139
									<tr>
140
										<td class="rowodd">
141
											Citation:
142
										</td>
143
										<td class="roweven">
144
											<!-- the author -->
145
											<xsl:choose>
146
												<xsl:when test="count(./param[@name='creator/individualName/surName']) > 0">
147
													<xsl:for-each select="./param[@name='creator/individualName/surName']">
148
														<xsl:value-of select="." />
149
														<xsl:if test="position() != last()">, </xsl:if>
150
													</xsl:for-each>
151
												</xsl:when>
152
												<xsl:otherwise>
153
													<xsl:for-each select="./param[@name='creator/organizationName']">
154
														<xsl:value-of select="." />
155
														<xsl:if test="position() != last()">, </xsl:if>
156
													</xsl:for-each>
157
												</xsl:otherwise>
158
											</xsl:choose>
159
											<xsl:text>. </xsl:text>
160
											<!-- the pubdate -->
161
											<xsl:value-of select="substring(string(./param[@name='dataset/pubDate']),1,4)"/>
162
	        								<xsl:if test="substring(string(./param[@name='dataset/pubDate']),1,4) != ''">. </xsl:if>
163
											<!-- the link -->
164
											<a>
165
												<xsl:attribute name="href">
166
													<xsl:value-of select="$tripleURI"/><xsl:value-of select="./docid"/>
167
												</xsl:attribute>
168
												<xsl:value-of select="$contextURL" /><![CDATA[/metacat/]]><xsl:value-of select="./docid"/><![CDATA[/]]><xsl:value-of select="$qformat" />
169
											</a>
170
										</td>
171
									</tr>
172
								</table>
173 5677 leinfelder
							</td>
174 5690 leinfelder
						</tr>
175
176
						<tr>
177 5727 leinfelder
178 5690 leinfelder
							<!-- annotation section -->
179 5727 leinfelder
							<td width="50%">
180 5690 leinfelder
								<!-- render the annotation -->
181
								<xsl:for-each select="./*[local-name()='annotation']">
182
									<xsl:call-template name="annotation">
183 5727 leinfelder
										 <xsl:with-param name="showAll" select="'true'"/>
184 5690 leinfelder
									</xsl:call-template>
185
								</xsl:for-each>
186
							</td>
187
188 5727 leinfelder
							<!-- EML section -->
189
							<td>
190
								<xsl:call-template name="emlDetails"/>
191
							</td>
192
193 5677 leinfelder
						</tr>
194 5727 leinfelder
195 5677 leinfelder
					</table>
196
197
				</div>
198
199 5385 leinfelder
			</xsl:for-each>
200 5677 leinfelder
201
		</div>
202
203 5675 leinfelder
	</xsl:template>
204 5385 leinfelder
205 5727 leinfelder
	<xsl:template name="emlDetails">
206
		<!-- render the DP details -->
207
		<table class="subGroup subGroup_border onehundred_percent">
208
			<tr>
209
				<th>
210
					Owner[s]
211
				</th>
212
				<th>
213
					Organizations[s]
214
				</th>
215
				<th>
216
					Keyword[s]
217
				</th>
218
			</tr>
219
			<tr>
220
				<td>
221
					<xsl:for-each
222
						select="./param[@name='creator/individualName/surName']">
223
						<xsl:value-of select="." />
224
						<br/>
225
					</xsl:for-each>
226
				</td>
227
				<td>
228
					<xsl:for-each
229
						select="./param[@name='creator/organizationName']">
230
						<xsl:value-of select="." />
231
						<br/>
232
					</xsl:for-each>
233
				</td>
234
				<td>
235
					<xsl:for-each
236
						select="./param[@name='keyword']">
237
						<xsl:value-of select="." />
238
						<br/>
239
					</xsl:for-each>
240
				</td>
241
			</tr>
242
		</table>
243
	</xsl:template>
244
245 5385 leinfelder
246
</xsl:stylesheet>