Project

General

Profile

1
<?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: leinfelder $'
10
	*     '$Date: 2011-01-04 11:46:10 -0800 (Tue, 04 Jan 2011) $'
11
	* '$Revision: 5765 $'
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 
32
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
33
	xmlns:sms="http://ecoinformatics.org/sms/annotation.0.9"
34
	version="1.0">
35
	<xsl:import href="annotation-root.xsl"/>
36

    
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
	
43
	<xsl:param name="labelWidth">120</xsl:param>
44
	
45
	<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
			<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
58
				<script language="JavaScript">
59
					insertTemplateOpening('<xsl:value-of select="$contextURL" />'); insertSearchBox('<xsl:value-of select="$contextURL" />');
60
				</script>
61
				
62
				<div id="content_wrapper">
63
				
64
				<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
				<table align="left" border="0" cellpadding="0" cellspacing="5" width="100%">
78
					<tr valign="top">
79
							
80
						<!-- EML HERE  -->
81
						<xsl:if test="count(resultset/document[docname='eml']) &gt; 0">
82
							<td>
83
								<xsl:call-template name="emlResults"/>
84
							</td>	
85
						</xsl:if>
86
						
87
					</tr>	
88
				</table>
89
				
90
				</div>
91
				
92
				<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
		<div id="results">
102
	
103
			<xsl:for-each
104
				select="resultset/document[docname='eml']">
105
				<xsl:sort
106
					select="./param[@name='dataset/title']" />
107
					
108
				<!-- the header portion of the result -->
109
				<div>
110
					<xsl:attribute name="class">
111
	              			<xsl:choose>
112
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
113
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
114
						</xsl:choose>
115
					</xsl:attribute>
116
					
117
					<a href="#" class="accordian">+</a><xsl:text> </xsl:text>
118
					
119
					<!-- citation -->
120
					<xsl:call-template name="citation"/>
121
					
122
				</div>
123
				
124
				<!-- the content part -->	
125
				<div>
126
					<xsl:attribute name="class">
127
	              		<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
						</xsl:choose>
131
					</xsl:attribute>
132
					
133
					<table class="onehundred_percent">
134
						<tr>
135
							<td>
136
								<!-- keywords -->
137
								<xsl:call-template name="keywords"/>								
138
							</td>
139
						</tr>
140
						<tr>
141
						
142
							<!-- annotation section -->
143
							<td>
144
								<!-- render the annotation -->
145
								<xsl:for-each select="./*[local-name()='annotation']">
146
									<xsl:call-template name="annotation">
147
										 <xsl:with-param name="showAll" select="'false'"/>
148
									</xsl:call-template>	
149
								</xsl:for-each>
150
							</td>
151
							
152
						</tr>
153
					</table>
154
											
155
				</div>
156
		
157
			</xsl:for-each>
158
			
159
		</div>	
160
			
161
	</xsl:template>
162
	
163
	<xsl:template name="citationContainer">
164
		<table class="subGroup subGroup_border onehundred_percent">
165
			<tr>
166
				<td class="rowodd" width="{$labelWidth}">
167
					Citation:
168
				</td>
169
				<td class="roweven">
170
					<xsl:call-template name="citation"/>
171
				</td>
172
			</tr>		
173
		</table>
174
	</xsl:template>
175
	
176
	<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
	<xsl:template name="keywords">
215
		<!-- render the keywords -->
216
		<table class="subGroup subGroup_border onehundred_percent">	
217
			<tr>
218
				<td class="rowodd" width="{$labelWidth}">
219
					Keywords:
220
				</td>
221
				<td>
222
					<p>
223
					<xsl:for-each select="./param[@name='keyword']">
224
						<xsl:value-of select="." />
225
						<xsl:if test="position() != last()">, </xsl:if>
226
					</xsl:for-each>
227
					</p>
228
				</td>
229
			</tr>			
230
		</table>
231
	</xsl:template>
232
	
233

    
234
</xsl:stylesheet>
(7-7/14)