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-11-30 15:34:49 -0800 (Tue, 30 Nov 2010) $'
11
	* '$Revision: 5672 $'
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
						<!-- ANNOTATIONS HERE  -->
78
						<xsl:if test="count(resultset/document[docname='annotation']) &gt; 0">
79
							<td>
80
								<xsl:call-template name="annotationResults"/>
81
							</td>	
82
						</xsl:if>	
83
							
84
						<!-- EML HERE  -->
85
						<xsl:if test="count(resultset/document[docname='eml']) &gt; 0">
86
							<td>
87
								<xsl:call-template name="emlResults"/>
88
							</td>	
89
						</xsl:if>
90
						
91
					</tr>	
92
				</table>
93
				
94
				</div>
95
				
96
				<script language="JavaScript">
97
					insertTemplateClosing('<xsl:value-of select="$contextURL" />');
98
				</script>
99
			</body>
100
		</html>
101
	</xsl:template>
102
	
103
	<xsl:template name="emlResults">
104
		<table align="center" border="0" cellpadding="5" cellspacing="0" width="100%">
105
			<tr class="subpanel">
106
				<th	style="text-align: left">
107
					Title
108
				</th>
109
				<th	style="text-align: left">
110
					Owners[s]
111
				</th>
112
				<th	style="text-align: left">
113
					Organization[s]
114
				</th>
115
				<th	style="text-align: left">
116
					Keywords
117
				</th>
118
			</tr>
119
	
120
			<xsl:for-each
121
				select="resultset/document[docname='eml']">
122
				<xsl:sort
123
					select="./param[@name='dataset/title']" />
124
				<tr valign="top" class="subpanel">
125
					<xsl:attribute name="class">
126
	              			<xsl:choose>
127
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
128
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
129
						</xsl:choose>
130
					</xsl:attribute>
131
	
132
					<td class="text_plain">
133
						<a>
134
							<xsl:attribute name="href">
135
								<xsl:value-of select="$tripleURI"/><xsl:value-of select="./docid"/>
136
							</xsl:attribute>
137
							<b>
138
								<xsl:text>&#187;&#160;</xsl:text>
139
								<xsl:value-of select="./param[@name='dataset/title']"/>
140
							</b>
141
						</a>
142
						
143
						<pre>ID: <xsl:value-of select="./docid" /></pre>
144
					
145
						<!-- render the annotation -->
146
						<xsl:for-each select="./*[local-name()='annotation']">
147
							<xsl:call-template name="annotation">
148
								 <xsl:with-param name="showAll" select="false"/>
149
							</xsl:call-template>	
150
						</xsl:for-each>
151

    
152
					</td>
153
					
154
					<td class="text_plain">
155
						<xsl:for-each
156
							select="./param[@name='creator/individualName/surName']">
157
							<xsl:value-of select="." />
158
							<br />
159
						</xsl:for-each>
160
					</td>
161
					
162
					<td class="text_plain">
163
						<xsl:for-each
164
							select="./param[@name='creator/organizationName']">
165
							<xsl:value-of select="." />
166
							<br />
167
						</xsl:for-each>
168
					</td>
169
	
170
					<td class="text_plain">
171
						<xsl:for-each
172
							select="./param[@name='keyword']">
173
							<xsl:value-of select="." />
174
							<br />
175
						</xsl:for-each>
176
					</td>
177
	
178
				</tr>
179
				
180
				<tr class="searchresultsdivider">
181
					<td colspan="5">
182
					</td>
183
				</tr>
184
	
185
			</xsl:for-each>
186
		</table>
187
	</xsl:template>
188
	
189
	<xsl:template name="annotationResults">
190
		<table align="left" border="0" cellpadding="5" cellspacing="0" width="100%">		
191
				
192
			<tr class="subpanel">
193
				<th	style="text-align: left">
194
					Identifier
195
				</th>
196
				<th	style="text-align: left">
197
					Datapackage
198
				</th>
199
				<th	style="text-align: left">
200
					Entities
201
				</th>
202
			</tr>
203

    
204
			<xsl:for-each select="resultset/document[docname='annotation']">
205
				<xsl:sort select="./param[@name='@id']" />
206
				<tr valign="top">
207
					<xsl:attribute name="class">
208
						<xsl:choose>
209
							<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
210
							<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
211
						</xsl:choose>
212
					</xsl:attribute>
213

    
214
					<td class="text_plain">
215
						<a>
216
							<xsl:attribute name="href">
217
								<xsl:value-of select="$tripleURI"/><xsl:value-of select="./docid"/>
218
							</xsl:attribute>
219
							<xsl:text>&#187;&#160;</xsl:text>
220
							<xsl:value-of select="./docid" />
221
						</a>
222
					</td>
223
					
224
					<td class="text_plain">
225
						<a>
226
							<xsl:attribute name="href">
227
								<xsl:value-of select="$tripleURI"/><xsl:value-of select="./param[@name='@emlPackage']"/>
228
							</xsl:attribute>
229
							<xsl:value-of select="./param[@name='@emlPackage']"/>
230
						</a>
231
					</td>
232
					
233
					<td class="text_plain">
234
						<xsl:for-each
235
							select="./param[@name='entity/@id']">
236
							<xsl:value-of select="." />
237
							<br />
238
						</xsl:for-each>
239
					</td>
240
							
241

    
242
				</tr>
243
				
244
				<tr class="searchresultsdivider">
245
					<td colspan="3">
246
					</td>
247
				</tr>
248

    
249
			</xsl:for-each>
250
		</table>
251
	
252
	</xsl:template>
253

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