Project

General

Profile

« Previous | Next » 

Revision 3529

add very minimal skin for transforming ajax search resultset for 'first' skin

View differences:

lib/style/skins/first/first-ajax-resultset.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$'
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
	<xsl:template match="/">
38
		<script language="JavaScript">
39
          <![CDATA[
40
          submitform = function(action,form_ref) {
41
              form_ref.action.value=action;
42
              form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA[";
43
              form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA[";
44
              form_ref.submit();
45
          }
46

  
47
          ]]>
48
        </script>
49

  
50
		<table width="100%" align="center" border="0" cellpadding="5"
51
			cellspacing="0">
52
			<tr>
53
				<td align="left">
54
					<br></br>
55
					<p class="emphasis">
56
						<xsl:number value="count(resultset/document)" />
57
						records found
58
					</p>
59
				</td>
60
			</tr>
61
		</table>
62
		<!-- This tests to see if there are returned documents,
63
			if there are not then don't show the query results -->
64

  
65
		<xsl:if test="count(resultset/document) &gt; 0">
66

  
67
			<table width="95%" align="center" border="0" cellpadding="0"
68
				cellspacing="0">
69
				<tr>
70
					<th width="15%" class="tablehead"
71
						style="text-align: left">
72
						Question Identifiers
73
					</th>
74
					<th width="15%" class="tablehead"
75
						style="text-align: left">
76
						Metadata Entries
77
					</th>
78
					<th width="15%" class="tablehead"
79
						style="text-align: left">
80
						Metadata Values
81
					</th>
82
					<th width="15%" class="tablehead"
83
						style="text-align: left">
84
						Objectives
85
					</th>
86
					<xsl:if test="$enableediting = 'true'">
87
						<th width="10%" class="tablehead"
88
							style="text-align: middle">
89
							Actions
90
						</th>
91
					</xsl:if>
92
				</tr>
93

  
94
				<xsl:for-each select="resultset/document">
95
					<xsl:sort select="./param[@name='item/@title']" />
96
					<tr valign="top" class="subpanel">
97
						<xsl:attribute name="class">
98
							<xsl:choose>
99
								<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
100
								<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
101
							</xsl:choose>
102
						</xsl:attribute>
103

  
104
						<td class="text_plain">
105
							<form action="/knb/metacat" method="POST">
106
								<xsl:attribute name="name">
107
									<xsl:value-of select="translate(./docid, '()-.', '____')" />
108
								</xsl:attribute>
109

  
110
								<input type="hidden" name="qformat" />
111
								<input type="hidden" name="sessionid" />
112
								<xsl:if	test="$enableediting = 'true'">
113
									<input type="hidden"
114
										name="enableediting" value="{$enableediting}" />
115
								</xsl:if>
116
								<input type="hidden" name="action" value="read" />
117
								<input type="hidden" name="docid">
118
									<xsl:attribute name="value">
119
										<xsl:value-of select="./docid" />
120
									</xsl:attribute>
121
								</input>
122
								<xsl:for-each select="./relation">
123
									<input type="hidden" name="docid">
124
										<xsl:attribute name="value">
125
											<xsl:value-of select="./relationdoc" />
126
										</xsl:attribute>
127
									</input>
128
								</xsl:for-each>
129
							</form>	
130

  
131
							<a>
132
								<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
133
								<xsl:text>&#187;&#160;</xsl:text>
134
								<xsl:value-of select="./param[@name='item/@title']" />
135
							</a>
136
							<br />
137
							<br />
138
							<xsl:value-of select="./docid" />
139
							
140
						</td>
141

  
142
						<td class="text_plain">
143
							<xsl:for-each
144
								select="./param[@name='fieldlabel']">
145
								<xsl:value-of select="." />
146
								<br />
147
							</xsl:for-each>
148
						</td>
149
						
150
						<td class="text_plain">
151
							<xsl:for-each
152
								select="./param[@name='fieldentry']">
153
								<xsl:value-of select="." />
154
								<br />
155
							</xsl:for-each>
156
						</td>
157

  
158
						<td class="text_plain">
159
							<xsl:for-each
160
								select="./param[@name='objectives/material/mattext']">
161
								<xsl:value-of select="." />
162
								<br />
163
							</xsl:for-each>
164
						</td>
165

  
166
						<xsl:if test="$enableediting = 'true'">
167
							<td class="text_plain">
168
								<form action="/knb/metacat"
169
									method="POST">
170
									<input type="hidden" name="action"
171
										value="read" />
172
									<input type="hidden" name="qformat"
173
										value="{$qformat}" />
174
									<input type="hidden"
175
										name="sessionid" value="{$sessid}" />
176
									<input type="hidden" name="docid">
177
										<xsl:attribute name="value">
178
											<xsl:value-of select="./docid" />
179
										</xsl:attribute>
180
									</input>
181
									<center>
182
										<input type="SUBMIT" value=" View " name="View" />
183
									</center>
184
								</form>
185
							</td>
186
						</xsl:if>
187
					</tr>
188
					
189
					<tr class="searchresultsdivider">
190
						<td colspan="5">
191
							<img
192
								src="/knb/style/skins/default/images/transparent1x1.gif"
193
								width="1" height="1" />
194
						</td>
195
					</tr>
196

  
197
				</xsl:for-each>
198
			</table>
199

  
200
		</xsl:if>
201
	</xsl:template>
202

  
203
</xsl:stylesheet>
0 204

  
lib/style/skins/first-ajax/first-ajax.xml
1
<?xml version="1.0"?>
2
<style-set name="first">
3
<!-- general login & search -->
4
  <default-style>@systemidserver@@style-common-path@/ascii-treeview.xsl</default-style>
5

  
6
  <doctype publicid="-//NCEAS//resultset//EN">
7
    <target publicid="-//W3C//HTML//EN">@systemidserver@@style-skins-path@/first/first-ajax-resultset.xsl</target>
8
  </doctype>
9
  
10
  <!-- EdML doctype -->
11
  <doctype publicid="edml://ecoinformatics.org/edml">
12
    <target publicid="-//W3C//HTML//EN">@systemidserver@@style-skins-path@/first/xsl/edml.xsl</target>
13
  </doctype>
14

  
15
</style-set>
0 16

  

Also available in: Unified diff