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: 2009-07-27 14:42:42 -0700 (Mon, 27 Jul 2009) $'
11
	* '$Revision: 4998 $'
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 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
32

    
33
	<xsl:output method="html" />
34
	<xsl:param name="sessid" />
35
	<xsl:param name="qformat">default</xsl:param>
36
	<xsl:param name="enableediting">false</xsl:param>
37
	<xsl:param name="contextURL"/>
38
	
39
	<xsl:template match="/">
40
		<script language="JavaScript">
41
          <![CDATA[
42
          submitItemForm = function(action,docid,formId) {
43
          		var form_ref = document.getElementById(formId);
44
              form_ref.action.value=action;
45
              form_ref.docid.value=docid;
46
              //form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
47
              //form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
48
              form_ref.qformat.value="first";
49
              form_ref.submit();
50
          }
51

    
52
          ]]>
53
        </script>
54
        
55
        <p class="emphasis">
56
			<xsl:number value="count(resultset/document)" /> items found
57
		</p>
58

    
59
		<!-- This tests to see if there are returned documents,
60
			if there are not then don't show the query results -->
61
		<xsl:if test="count(resultset/document) &gt; 0">
62

    
63
			<form action="{$contextURL}/metacat" method="POST">
64
				<xsl:attribute name="id">assessmentForm</xsl:attribute>
65
				<input type="hidden" name="qformat" value="first"/>
66
				<input type="hidden" name="sessionid">
67
					<xsl:attribute name="value">
68
						<xsl:value-of select="$sessid" />
69
					</xsl:attribute>	
70
				</input>
71
				<input type="hidden" name="action" value="read" />
72
				<input type="hidden" name="docid"/>
73
			</form>
74
			<table width="95%" align="left" border="0" cellpadding="0"
75
				cellspacing="0">
76

    
77
				<xsl:for-each select="resultset/document">
78
					<xsl:sort select="./param[@name='item/@title']" />
79
					<tr valign="top">
80
						<xsl:attribute name="class">
81
							<xsl:choose>
82
								<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
83
								<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
84
							</xsl:choose>
85
						</xsl:attribute>
86

    
87
						<td class="text_plain">
88
							<!--
89
							<a>
90
								<xsl:attribute name="href">javascript:submitItemForm('read','<xsl:value-of select="./docid" />', 'assessmentForm')</xsl:attribute>
91
								<xsl:text>&#187;&#160;</xsl:text>
92
								<xsl:value-of select="./param[@name='item/@title']" />
93
							</a>
94
							-->
95
							<a>
96
								<xsl:attribute name="href">
97
									<xsl:value-of select="$contextURL" />
98
									<xsl:text>/metacat?action=read</xsl:text>
99
									<xsl:text>&amp;docid=</xsl:text>
100
									<xsl:value-of select="./docid" />
101
									<xsl:text>&amp;qformat=first</xsl:text>
102
									<xsl:text>&amp;sessionid=</xsl:text>
103
									<xsl:value-of select="$sessid" />
104
								</xsl:attribute>	
105
								<xsl:value-of select="./param[@name='item/@title']" />
106
							</a>
107
							(<xsl:value-of select="./docid" />)
108
								
109
						</td>
110
						
111
						<td class="text_plain">
112
							<xsl:for-each select="./param[@name='presentation/flow/response_lid/render_choice/material/mattext']">
113
								<xsl:value-of select="." disable-output-escaping="yes"/>
114
								<br/>
115
							</xsl:for-each>	
116
							<xsl:for-each select="./param[@name='presentation/flow/response_str/material/mattext']">
117
								<xsl:value-of select="." disable-output-escaping="yes"/>
118
								<br/>
119
							</xsl:for-each>
120
							<xsl:for-each select="./param[@name='presentation/flow/material/mattext']">
121
								<xsl:value-of select="." disable-output-escaping="yes"/>
122
								<br/>
123
							</xsl:for-each>
124
							<ul>
125
							<xsl:for-each
126
								select="./param[@name='response_label/material/mattext']">
127
								<xsl:sort select="."/>
128
								<li>
129
									<xsl:value-of select="." disable-output-escaping="yes"/>
130
								</li>	
131
							</xsl:for-each>
132
							</ul>
133
						</td>
134
						
135
						<td>
136
							<table>
137
								<tr valign="top">
138
									<td class="text_plain" colspan="2">
139
										Metadata
140
									</td>
141
								</tr>
142
								<tr valign="top">
143
									<td class="text_plain" colspan="2">
144
										Vocabulary:
145
										<xsl:for-each
146
											select="./param[@name='vocabulary']">
147
											<xsl:value-of select="." />
148
											<br />
149
										</xsl:for-each>
150
									</td>
151
								</tr>
152
								<tr valign="top">
153
									<td class="text_plain" nowrap="nowrap">
154
										<xsl:for-each
155
											select="./param[@name='fieldlabel']">
156
											<xsl:value-of select="." />:
157
											<br />
158
										</xsl:for-each>
159
									</td>
160
									
161
									<td class="text_plain" nowrap="nowrap">
162
										<xsl:for-each
163
											select="./param[@name='fieldentry']">
164
											<xsl:value-of select="." />
165
											<br />
166
										</xsl:for-each>
167
									</td>
168
								</tr>
169
							</table>
170
						</td>
171

    
172
					</tr>
173
					<!-- 
174
					<tr>
175
						<td class="text_plain">
176
							<xsl:for-each
177
								select="./param[@name='objectives/material/mattext']">
178
								<xsl:value-of select="." />
179
								<br />
180
							</xsl:for-each>
181
						</td>
182
					</tr>
183
					-->
184
					<tr class="searchresultsdivider">
185
						<td colspan="3">
186
							<img
187
								src="{$contextURL}/style/skins/default/images/transparent1x1.gif"
188
								width="1" height="1" />
189
						</td>
190
					</tr>
191

    
192
				</xsl:for-each>
193
			</table>
194

    
195
		</xsl:if>
196
	</xsl:template>
197

    
198
</xsl:stylesheet>
(6-6/22)