Project

General

Profile

« Previous | Next » 

Revision 5536

include annotation display in the search results - NOTE using XPath 2.0 function for accessing the ontology URIs that are included as namespaces in the annotation. adding Saxon jar for this.

View differences:

lib/style/skins/semtools/annotation.xsl
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-08-30 23:34:14 +0000 (Mon, 30 Aug 2010) $'
11
	* '$Revision: 5533 $'
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
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
35
	version="2.0">
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:template name="annotation">
44
		<table align="center" border="0" cellpadding="5" cellspacing="0" width="100%">
45
			<tr>
46
				<th class="tablehead" colspan="2">
47
					Annotation
48
				</th>
49
			</tr>
50
			<tr class="subpanel">
51
				<th	style="text-align: left" colspan="2">Details</th>
52
			</tr>
53
			<tr class="subpanel">	
54
				<td class="text_plain" colspan="2">
55
					ID: <xsl:value-of select="./@id"/>
56
					<br />
57
					Data Package: <xsl:value-of select="./@emlPackage"/>
58
					<br />
59
					Data Table: <xsl:value-of select="./@dataTable"/>
60
				</td>
61
			</tr>
62
			<tr class="subpanel">
63
				<th	style="text-align: left">
64
					Entity
65
				</th>
66
				<th	style="text-align: left"> 	
67
					Measurement
68
				</th>
69
			</tr>
70
	
71
			<xsl:for-each select="./*[local-name()='observation']">
72
				<tr valign="top" class="subpanel">
73
					<xsl:attribute name="class">
74
	              			<xsl:choose>
75
						    <xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
76
						    <xsl:when test="position() mod 2 = 0">roweven</xsl:when>
77
						</xsl:choose>
78
					</xsl:attribute>
79
	
80
					<!-- observation entity -->
81
					<td class="text_plain">
82
						Class: <xsl:value-of select="substring-after(./*[local-name()='entity']/@id, ':')"/>
83
						<br/>
84
						Ontology: <xsl:value-of select="fn:namespace-uri-for-prefix(substring-before(./*[local-name()='entity']/@id, ':'), .)"/>
85
						<br />
86
						(Label: <xsl:value-of select="./@label"/>)
87
					</td>
88
					<!-- measurement -->
89
					<td class="text_plain">
90
						<xsl:for-each select="./*[local-name()='measurement']">
91
							<!-- 
92
							<xsl:value-of select="./@label" />
93
							<br />
94
							-->
95
							Characteristic[s]: 
96
							<xsl:for-each select="./*[local-name()='characteristic']">
97
								<xsl:value-of select="./@id" />
98
							</xsl:for-each>
99
							<br/>
100
							Standard: <xsl:value-of select="./*[local-name()='standard']/@id" />
101
							<br/>
102
							Protocol: <xsl:value-of select="./*[local-name()='protocol']/@id" />
103
							<hr/>
104
						</xsl:for-each>
105
					</td>
106
					
107
				</tr>
108
				<tr class="searchresultsdivider">
109
					<td colspan="5">
110
					</td>
111
				</tr>
112
	
113
			</xsl:for-each>
114
		</table>
115
	</xsl:template>
116

  
117
</xsl:stylesheet>
0 118

  
lib/style/skins/semtools/resultset.xsl
28 28
	* convert an XML file showing the resultset of a query
29 29
	* into an HTML format suitable for rendering with modern web browsers.
30 30
-->
31
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
31
<xsl:stylesheet 
32
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
33
	xmlns:sms="http://ecoinformatics.org/sms/annotation.0.9"
32 34
	version="1.0">
35
	<xsl:import href="annotation.xsl"/>
33 36

  
34 37
	<xsl:output method="html" />
35 38
	<xsl:param name="sessid" />
......
77 80
					</tr>
78 81
				</table>
79 82

  
80
				<table align="left" border="0" cellpadding="0" cellspacing="5">
83
				<table align="left" border="0" cellpadding="0" cellspacing="5" width="100%">
81 84
					<tr valign="top">
82 85
						
83 86
						<!-- ANNOTATIONS HERE  -->
......
85 88
							<td>
86 89
								<xsl:call-template name="annotationResults"/>
87 90
							</td>	
88
						</xsl:if>
89
						
90
						<xsl:if test="count(resultset/document[docname='annotation']) &gt; 0">
91
							<xsl:if test="count(resultset/document[docname='eml']) &gt; 0">
92
								<td width="10%"></td>
93
							</xsl:if>
94
						</xsl:if>		
91
						</xsl:if>	
95 92
							
96 93
						<!-- EML HERE  -->
97 94
						<xsl:if test="count(resultset/document[docname='eml']) &gt; 0">
......
111 108
	</xsl:template>
112 109
	
113 110
	<xsl:template name="emlResults">
114
		<table align="center" border="0" cellpadding="5" cellspacing="0">
115
			<tr>
111
		<table align="center" border="0" cellpadding="5" cellspacing="0" width="100%">
112
			<tr class="subpanel">
116 113
				<th class="tablehead" colspan="4">
117 114
					Datapackages
118 115
				</th>
119 116
			</tr>	
120
			<tr>
117
			<tr class="subpanel">
121 118
				<th	style="text-align: left">
122 119
					Title
123 120
				</th>
......
202 199
					</td>
203 200
	
204 201
				</tr>
202
				
203
				<!-- annotation content -->
204
				<tr>
205
					<td colspan="5">
206
						<xsl:for-each select="./*[local-name()='annotation']">
207
							<xsl:call-template name="annotation" />	
208
						</xsl:for-each>
209
					</td>
210
				</tr>
211
				
205 212
				<tr class="searchresultsdivider">
206 213
					<td colspan="5">
207 214
					</td>
......
212 219
	</xsl:template>
213 220
	
214 221
	<xsl:template name="annotationResults">
215
		<table align="left" border="0" cellpadding="5" cellspacing="0">		
222
		<table align="left" border="0" cellpadding="5" cellspacing="0" width="100%">		
216 223
			<tr>
217 224
				<th class="tablehead" colspan="3">
218 225
					Annotations
219 226
				</th>
220 227
			</tr>
221 228
				
222
			<tr>
229
			<tr class="subpanel">
223 230
				<th	style="text-align: left">
224 231
					Identifier
225 232
				</th>

Also available in: Unified diff