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