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: 2010-12-14 16:30:04 -0800 (Tue, 14 Dec 2010) $'
11
	* '$Revision: 5739 $'
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
	<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
			<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
55
				<script language="JavaScript">
56
					insertTemplateOpening('<xsl:value-of select="$contextURL" />'); insertSearchBox('<xsl:value-of select="$contextURL" />');
57
				</script>
58
				
59
				<div id="content_wrapper">
60
				
61
				<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
				<table align="left" border="0" cellpadding="0" cellspacing="5" width="100%">
75
					<tr valign="top">
76
							
77
						<!-- EML HERE  -->
78
						<xsl:if test="count(resultset/document[docname='eml']) &gt; 0">
79
							<td>
80
								<xsl:call-template name="emlResults"/>
81
							</td>	
82
						</xsl:if>
83
						
84
					</tr>	
85
				</table>
86
				
87
				</div>
88
				
89
				<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
		<div id="results">
99
	
100
			<xsl:for-each
101
				select="resultset/document[docname='eml']">
102
				<xsl:sort
103
					select="./param[@name='dataset/title']" />
104
					
105
				<!-- the header portion of the result -->
106
				<div>
107
					<xsl:attribute name="class">
108
	              			<xsl:choose>
109
						    <xsl:when test="position() mod 2 = 1">rowodd accordian</xsl:when>
110
						    <xsl:when test="position() mod 2 = 0">roweven accordian</xsl:when>
111
						</xsl:choose>
112
					</xsl:attribute>
113
	
114
					<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
					
123
					(<xsl:value-of select="./docid" />)
124
					
125
				</div>
126
				
127
				<!-- the content part -->	
128
				<div>
129
					<xsl:attribute name="class">
130
	              		<xsl:choose>
131
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
132
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
133
						</xsl:choose>
134
					</xsl:attribute>
135
					
136
					<table class="onehundred_percent">
137
					
138
						<tr>
139
							<td colspan="2">
140
								<!-- citation -->
141
								<xsl:call-template name="citation"/>								
142
							</td>
143
						</tr>
144
						
145
						<tr>
146
						
147
							<!-- annotation section -->
148
							<td width="50%">
149
								<!-- render the annotation -->
150
								<xsl:for-each select="./*[local-name()='annotation']">
151
									<xsl:call-template name="annotation">
152
										 <xsl:with-param name="showAll" select="'true'"/>
153
									</xsl:call-template>	
154
								</xsl:for-each>
155
							</td>
156
							
157
							<!-- EML section (div for padding) -->
158
							<td>
159
								<div class="subGroup">
160
									<xsl:call-template name="emlDetails"/>
161
								</div>	
162
							</td>
163
							
164
						</tr>
165
						
166
					</table>
167
											
168
				</div>
169
		
170
			</xsl:for-each>
171
			
172
		</div>	
173
			
174
	</xsl:template>
175
	
176
	<xsl:template name="citation">
177
		<table class="subGroup subGroup_border onehundred_percent">
178
			<tr>
179
				<td class="rowodd">
180
					Citation:
181
				</td>
182
				<td class="roweven">
183
					<!-- the author -->
184
					<xsl:choose>
185
						<xsl:when test="count(./param[@name='creator/individualName/surName']) > 0">
186
							<xsl:for-each select="./param[@name='creator/individualName/surName']">
187
								<xsl:value-of select="." />
188
								<xsl:if test="position() != last()">, </xsl:if>
189
							</xsl:for-each>
190
						</xsl:when>
191
						<xsl:otherwise>
192
							<xsl:for-each select="./param[@name='creator/organizationName']">
193
								<xsl:value-of select="." />
194
								<xsl:if test="position() != last()">, </xsl:if>
195
							</xsl:for-each>
196
						</xsl:otherwise>
197
					</xsl:choose>
198
					<xsl:text>. </xsl:text>
199
					<!-- the pubdate -->
200
					<xsl:value-of select="substring(string(./param[@name='dataset/pubDate']),1,4)"/>
201
   					<xsl:if test="substring(string(./param[@name='dataset/pubDate']),1,4) != ''">. </xsl:if>
202
   					<!-- the title -->
203
   					<xsl:value-of select="./param[@name='dataset/title']"/>
204
   					<xsl:text>. </xsl:text>
205
   					<!-- the id -->
206
   					<xsl:value-of select="./docid"/>
207
   					<xsl:text>. </xsl:text>
208
   					<br/>
209
					<!-- the link -->
210
					(<a>
211
						<xsl:attribute name="href">
212
							<xsl:value-of select="$tripleURI"/><xsl:value-of select="./docid"/>
213
						</xsl:attribute>
214
						<xsl:value-of select="$contextURL" /><![CDATA[/metacat/]]><xsl:value-of select="./docid"/><![CDATA[/]]><xsl:value-of select="$qformat" />										
215
					</a>)
216
				</td>
217
			</tr>		
218
		</table>
219
	</xsl:template>
220
	
221
	<xsl:template name="emlDetails">
222
		<!-- render the DP details -->
223
		<table class="subGroup subGroup_border onehundred_percent">
224
			<tr>
225
				<th>
226
					Owners
227
				</th>
228
				<th>
229
					Organizations
230
				</th>
231
				<th>
232
					Keywords
233
				</th>
234
			</tr>
235
			<tr>
236
				<td>
237
					<xsl:for-each
238
						select="./param[@name='creator/individualName/surName']">
239
						<xsl:value-of select="." />
240
						<br/>
241
					</xsl:for-each>
242
				</td>
243
				<td>
244
					<xsl:for-each
245
						select="./param[@name='creator/organizationName']">
246
						<xsl:value-of select="." />
247
						<br/>
248
					</xsl:for-each>
249
				</td>
250
				<td>
251
					<xsl:for-each
252
						select="./param[@name='keyword']">
253
						<xsl:value-of select="." />
254
						<br/>
255
					</xsl:for-each>
256
				</td>
257
			</tr>			
258
		</table>
259
	</xsl:template>
260
	
261

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