Project

General

Profile

1 3531 leinfelder
<?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$'
10
	*     '$Date$'
11
	* '$Revision$'
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 4271 leinfelder
	<xsl:param name="contextURL"/>
38
39 3531 leinfelder
	<xsl:template match="/">
40
		<script language="JavaScript">
41
          <![CDATA[
42
          submitform = function(action,form_ref) {
43
              form_ref.action.value=action;
44
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
45
              //form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
46
              form_ref.submit();
47
          }
48
49
          ]]>
50
        </script>
51
52
        <p class="emphasis">
53
			<xsl:number value="count(resultset/document)" /> items found
54
		</p>
55
56
		<!-- This tests to see if there are returned documents,
57
			if there are not then don't show the query results -->
58
		<xsl:if test="count(resultset/document) &gt; 0">
59
60
			<table width="95%" align="left" border="0" cellpadding="0"
61
				cellspacing="0">
62
63
				<xsl:for-each select="resultset/document">
64
					<xsl:sort select="./param[@name='item/@title']" />
65
					<tr valign="top">
66
						<xsl:attribute name="class">
67
							<xsl:choose>
68
								<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
69
								<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
70
							</xsl:choose>
71
						</xsl:attribute>
72
73
						<td class="text_plain">
74
							<a>
75
								<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
76
								<xsl:text>&#187;&#160;</xsl:text>
77
								<xsl:value-of select="./param[@name='item/@title']" />
78
								<!-- <xsl:value-of select="./param[@name='item/@ident']" />-->
79
							</a>
80
							(<xsl:value-of select="./docid" />)
81 4271 leinfelder
							<form action="{$contextURL}/metacat" method="POST">
82 3531 leinfelder
								<xsl:attribute name="name">
83
									<xsl:value-of select="translate(./docid, '()-.', '____')" />
84
								</xsl:attribute>
85
86
								<input type="hidden" name="qformat" value="first"/>
87
								<input type="hidden" name="sessionid" />
88
								<xsl:if	test="$enableediting = 'true'">
89
									<input type="hidden"
90
										name="enableediting" value="{$enableediting}" />
91
								</xsl:if>
92
								<input type="hidden" name="action" value="read" />
93
								<input type="hidden" name="docid">
94
									<xsl:attribute name="value">
95
										<xsl:value-of select="./docid" />
96
									</xsl:attribute>
97
								</input>
98
								<xsl:for-each select="./relation">
99
									<input type="hidden" name="docid">
100
										<xsl:attribute name="value">
101
											<xsl:value-of select="./relationdoc" />
102
										</xsl:attribute>
103
									</input>
104
								</xsl:for-each>
105
							</form>
106
						</td>
107
108
						<td class="text_plain">
109 3564 leinfelder
							<xsl:for-each select="./param[@name='presentation/flow/material/mattext']">
110
								<xsl:value-of select="."/>
111
								<br/>
112
							</xsl:for-each>
113 3531 leinfelder
114
							<ul>
115
							<xsl:for-each
116 3918 leinfelder
								select="./param[@name='response_label/material/mattext']">
117 3531 leinfelder
								<li>
118
									<xsl:value-of select="." />
119
								</li>
120
							</xsl:for-each>
121
							</ul>
122
						</td>
123
124
						<td>
125
							<table>
126 3564 leinfelder
								<tr valign="top">
127 3531 leinfelder
									<td class="text_plain" colspan="2">
128 3927 leinfelder
										Metadata
129 3531 leinfelder
									</td>
130
								</tr>
131 3564 leinfelder
								<tr valign="top">
132 3927 leinfelder
									<td class="text_plain" colspan="2">
133
										Vocabulary:
134
										<xsl:for-each
135
											select="./param[@name='vocabulary']">
136
											<xsl:value-of select="." />
137
											<br />
138
										</xsl:for-each>
139
									</td>
140
								</tr>
141
								<tr valign="top">
142 3564 leinfelder
									<td class="text_plain" nowrap="nowrap">
143 3531 leinfelder
										<xsl:for-each
144
											select="./param[@name='fieldlabel']">
145 3927 leinfelder
											<xsl:value-of select="." />:
146 3531 leinfelder
											<br />
147
										</xsl:for-each>
148
									</td>
149
150 3564 leinfelder
									<td class="text_plain" nowrap="nowrap">
151 3531 leinfelder
										<xsl:for-each
152
											select="./param[@name='fieldentry']">
153
											<xsl:value-of select="." />
154
											<br />
155
										</xsl:for-each>
156
									</td>
157
								</tr>
158
							</table>
159
						</td>
160
161
					</tr>
162
					<!--
163
					<tr>
164
						<td class="text_plain">
165
							<xsl:for-each
166
								select="./param[@name='objectives/material/mattext']">
167
								<xsl:value-of select="." />
168
								<br />
169
							</xsl:for-each>
170
						</td>
171
					</tr>
172
					-->
173
					<tr class="searchresultsdivider">
174
						<td colspan="3">
175
							<img
176 4271 leinfelder
								src="{$contextURL}/style/skins/default/images/transparent1x1.gif"
177 3531 leinfelder
								width="1" height="1" />
178
						</td>
179
					</tr>
180
181
				</xsl:for-each>
182
			</table>
183
184
		</xsl:if>
185
	</xsl:template>
186
187
</xsl:stylesheet>