Project

General

Profile

« Previous | Next » 

Revision 3531

get the ajax-specific first skins organized with some better naming.
these essentially provide a pointer to custom resultset style sheets so that we can just use Ajax.Updater from prototype and inject the returned html.
they do rely on the first skin (which makes it nice for changing the look and feel - not a bunch of css files lying around messing things up, etc...).

View differences:

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>
16 0

  
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>
204 0

  
lib/style/skins/first-item/first-item.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-item-resultset.xsl</target>
8
  </doctype>
9
  
10
</style-set>
0 11

  
lib/style/skins/first/first-item-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
        <p class="emphasis">
51
			<xsl:number value="count(resultset/document)" /> items found
52
		</p>
53

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

  
58
			<table width="95%" align="left" border="0" cellpadding="0"
59
				cellspacing="0">
60

  
61
				<xsl:for-each select="resultset/document">
62
					<xsl:sort select="./param[@name='item/@title']" />
63
					<tr valign="top">
64
						<xsl:attribute name="class">
65
							<xsl:choose>
66
								<xsl:when test="position() mod 2 = 1">rowodd</xsl:when>
67
								<xsl:when test="position() mod 2 = 0">roweven</xsl:when>
68
							</xsl:choose>
69
						</xsl:attribute>
70

  
71
						<td class="text_plain">
72
							<a>
73
								<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
74
								<xsl:text>&#187;&#160;</xsl:text>
75
								<xsl:value-of select="./param[@name='item/@title']" />
76
								<!-- <xsl:value-of select="./param[@name='item/@ident']" />-->
77
							</a>
78
							(<xsl:value-of select="./docid" />)
79
							<form action="/knb/metacat" method="POST">
80
								<xsl:attribute name="name">
81
									<xsl:value-of select="translate(./docid, '()-.', '____')" />
82
								</xsl:attribute>
83

  
84
								<input type="hidden" name="qformat" value="first"/>
85
								<input type="hidden" name="sessionid" />
86
								<xsl:if	test="$enableediting = 'true'">
87
									<input type="hidden"
88
										name="enableediting" value="{$enableediting}" />
89
								</xsl:if>
90
								<input type="hidden" name="action" value="read" />
91
								<input type="hidden" name="docid">
92
									<xsl:attribute name="value">
93
										<xsl:value-of select="./docid" />
94
									</xsl:attribute>
95
								</input>
96
								<xsl:for-each select="./relation">
97
									<input type="hidden" name="docid">
98
										<xsl:attribute name="value">
99
											<xsl:value-of select="./relationdoc" />
100
										</xsl:attribute>
101
									</input>
102
								</xsl:for-each>
103
							</form>	
104
						</td>
105
						
106
						<td class="text_plain">
107
							<xsl:value-of select="./param[@name='presentation/flow/material/mattext']"/>
108
							
109
							<ul>
110
							<xsl:for-each
111
								select="./param[@name='response_label/flow_mat/material/mattext']">
112
								<li>
113
									<xsl:value-of select="." />
114
								</li>	
115
							</xsl:for-each>
116
							</ul>
117
						</td>
118
						
119
						<td>
120
							<table>
121
								<tr>
122
									<td class="text_plain" colspan="2">
123
										Metadata:
124
									</td>
125
								</tr>
126
								<tr>
127
									<td class="text_plain">
128
										<xsl:for-each
129
											select="./param[@name='fieldlabel']">
130
											<xsl:value-of select="." />
131
											<br />
132
										</xsl:for-each>
133
									</td>
134
									
135
									<td class="text_plain">
136
										<xsl:for-each
137
											select="./param[@name='fieldentry']">
138
											<xsl:value-of select="." />
139
											<br />
140
										</xsl:for-each>
141
									</td>
142
								</tr>
143
							</table>
144
						</td>
145

  
146
					</tr>
147
					<!-- 
148
					<tr>
149
						<td class="text_plain">
150
							<xsl:for-each
151
								select="./param[@name='objectives/material/mattext']">
152
								<xsl:value-of select="." />
153
								<br />
154
							</xsl:for-each>
155
						</td>
156
					</tr>
157
					-->
158
					<tr class="searchresultsdivider">
159
						<td colspan="3">
160
							<img
161
								src="/knb/style/skins/default/images/transparent1x1.gif"
162
								width="1" height="1" />
163
						</td>
164
					</tr>
165

  
166
				</xsl:for-each>
167
			</table>
168

  
169
		</xsl:if>
170
	</xsl:template>
171

  
172
</xsl:stylesheet>
0 173

  
lib/style/skins/first/first-assessment-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
		<p class="emphasis"><xsl:number value="count(resultset/document)" /> found</p>      
51
      
52
		<!-- This tests to see if there are returned documents,
53
            if there are not then don't show the query results -->
54

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

  
57
			<table width="95%" align="left" border="0" cellpadding="0"
58
				cellspacing="0">
59
				<tr>
60
					<th style="text-align: left">
61
						Assessment Title
62
					</th>
63
					<th style="text-align: left">
64
						Course Title
65
					</th>
66
					<th	style="text-align: left">
67
						Instructor[s]
68
					</th>
69
					<th	style="text-align: left">
70
						Organization[s]
71
					</th>
72
					<th	style="text-align: left">
73
						Keywords
74
					</th>
75
				</tr>
76

  
77
				<xsl:for-each select="resultset/document">
78
					<xsl:sort select="./param[@name='assessment/@assessmentId']" />
79
					<tr valign="top" class="subpanel">
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
							<form action="/knb/metacat" method="POST">
89
								<xsl:attribute name="name">
90
                   <xsl:value-of
91
										select="translate(./docid, '()-.', '____')" />
92
                 </xsl:attribute>
93

  
94
								<input type="hidden" name="qformat" value="first" />
95
								<input type="hidden" name="sessionid" />
96
								<xsl:if
97
									test="$enableediting = 'true'">
98
									<input type="hidden"
99
										name="enableediting" value="{$enableediting}" />
100
								</xsl:if>
101
								<input type="hidden" name="action"
102
									value="read" />
103
								<input type="hidden" name="docid">
104
									<xsl:attribute name="value">
105
                     <xsl:value-of select="./docid" />
106
                   </xsl:attribute>
107
								</input>
108
								<xsl:for-each select="./relation">
109
									<input type="hidden" name="docid">
110
										<xsl:attribute name="value">
111
                       <xsl:value-of select="./relationdoc" />
112
                     </xsl:attribute>
113
									</input>
114
								</xsl:for-each>
115

  
116
								<a>
117
									<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')" />)</xsl:attribute>
118
									<xsl:text>&#187;&#160;</xsl:text>
119
									<xsl:value-of select="./param[@name='assessment/@assessmentTitle']" />
120
									<!-- <xsl:value-of select="./param[@name='assessment/@assessmentId']" />) -->
121
								</a>
122
								(<xsl:value-of select="./docid" />)
123
							</form>
124
						</td>
125

  
126
						<td class="text_plain">
127
							<xsl:for-each
128
								select="./param[@name='lom/general/title/string']">
129
								<xsl:value-of select="." />
130
								<br />
131
							</xsl:for-each>
132
						</td>
133
						<td class="text_plain">
134
							<xsl:for-each
135
								select="./param[@name='individualName/surName']">
136
								<xsl:value-of select="." />
137
								<br />
138
							</xsl:for-each>
139
						</td>
140
						<td class="text_plain">
141
							<xsl:for-each
142
								select="./param[@name='organizationName']">
143
								<xsl:value-of select="." />
144
								<br />
145
							</xsl:for-each>
146
						</td>
147

  
148
						<td class="text_plain">
149
							<xsl:for-each
150
								select="./param[@name='keyword']">
151
								<xsl:value-of select="." />
152
								<br />
153
							</xsl:for-each>
154
							<xsl:for-each
155
								select="./param[@name='lom/general/keyword/string']">
156
								<xsl:value-of select="." />
157
								<br />
158
							</xsl:for-each>
159

  
160
						</td>
161

  
162
					</tr>
163
					<tr class="searchresultsdivider">
164
						<td colspan="5">
165
							<img
166
								src="/knb/style/skins/default/images/transparent1x1.gif"
167
								width="1" height="1" />
168
						</td>
169
					</tr>
170

  
171
				</xsl:for-each>
172
			</table>
173

  
174
		</xsl:if>
175
	</xsl:template>
176

  
177
</xsl:stylesheet>
0 178

  
lib/style/skins/first-assessment/first-assessment.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-assessment-resultset.xsl</target>
8
  </doctype>
9

  
10
</style-set>
0 11

  

Also available in: Unified diff