Revision 3178
Added by sledge over 16 years ago
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" version="1.0"> |
|
31 |
<xsl:stylesheet |
|
32 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
33 |
xmlns="http://www.w3.org/1999/xhtml" |
|
34 |
version="1.0"> |
|
32 | 35 |
|
33 |
<xsl:output method="html"/> |
|
36 |
<xsl:output method="xml" encoding="utf-8" |
|
37 |
doctype-public="-//W3C//DTD XHTML 1.1//EN" |
|
38 |
doctype-system="http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd" |
|
39 |
indent="yes" /> |
|
40 |
|
|
34 | 41 |
<xsl:param name="sessid"/> |
35 | 42 |
<xsl:param name="qformat">default</xsl:param> |
36 | 43 |
<xsl:param name="enableediting">false</xsl:param> |
44 |
|
|
37 | 45 |
<xsl:template match="/"> |
38 |
<html>
|
|
46 |
<html xml:lang="en-US">
|
|
39 | 47 |
<head> |
40 |
<link rel="stylesheet" type="text/css" |
|
41 |
href="@style-skins-path@/{$qformat}/{$qformat}.css" /> |
|
48 |
<title>Components Search Results</title> |
|
49 |
<link rel="stylesheet" type="text/css" |
|
50 |
href="@style-skins-path@/{$qformat}/{$qformat}.css" /> |
|
42 | 51 |
<script language="Javascript" type="text/JavaScript" |
43 |
src="@style-skins-path@/{$qformat}/{$qformat}.js" />
|
|
52 |
src="@style-skins-path@/{$qformat}/{$qformat}.js" /> |
|
44 | 53 |
<script language="Javascript" type="text/JavaScript" |
45 |
src="@style-common-path@/branding.js" /> |
|
46 |
<script language="JavaScript"> |
|
47 |
<![CDATA[ |
|
48 |
function submitform(action,form_ref) { |
|
49 |
form_ref.action.value=action; |
|
50 |
form_ref.sessionid.value="]]><xsl:value-of select="$sessid" /><![CDATA["; |
|
51 |
form_ref.qformat.value="]]><xsl:value-of select="$qformat" /><![CDATA["; |
|
52 |
form_ref.submit(); |
|
53 |
} |
|
54 |
src="@style-common-path@/branding.js" /> |
|
55 |
<style type="text/css"> |
|
54 | 56 |
|
55 |
]]> |
|
56 |
</script> |
|
57 |
a |
|
58 |
{ |
|
59 |
color: inherit; |
|
60 |
font-weight: inherit; |
|
61 |
font-size: inherit; |
|
62 |
text-decoration: underline; |
|
63 |
} |
|
64 |
|
|
65 |
|
|
66 |
div.body |
|
67 |
{ |
|
68 |
margin-left: 2em; |
|
69 |
margin-right: 2em; |
|
70 |
} |
|
71 |
|
|
72 |
th.tablehead |
|
73 |
{ |
|
74 |
text-align: left; |
|
75 |
} |
|
76 |
|
|
77 |
th.tablehead, |
|
78 |
td.text_plain |
|
79 |
{ |
|
80 |
padding: 0 0.75em; |
|
81 |
} |
|
82 |
|
|
83 |
th.tablehead:first-child, |
|
84 |
td.text_plain:first-child |
|
85 |
{ |
|
86 |
padding: 0 0.375em; |
|
87 |
} |
|
88 |
|
|
89 |
td.text_plain |
|
90 |
{ |
|
91 |
vertical-align: top; |
|
92 |
} |
|
93 |
|
|
94 |
tr.entry td |
|
95 |
{ |
|
96 |
border-bottom: 1px solid #ddd; |
|
97 |
} |
|
98 |
|
|
99 |
tr.entry + tr + tr td |
|
100 |
{ |
|
101 |
border-bottom: 1px solid #066; |
|
102 |
padding-top: 0.375em; |
|
103 |
padding-bottom: 0.375em; |
|
104 |
} |
|
105 |
|
|
106 |
tr.entry + tr + tr td a |
|
107 |
{ |
|
108 |
background: #eeeeee url(download.png) 2px center no-repeat; |
|
109 |
border: 1px solid black; |
|
110 |
font-weight: bold; |
|
111 |
text-decoration: none; |
|
112 |
padding: 0.063em 0.375em 0.063em 20px; |
|
113 |
} |
|
114 |
|
|
115 |
</style> |
|
57 | 116 |
</head> |
58 | 117 |
|
59 | 118 |
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> |
60 |
<script language="JavaScript"> |
|
61 |
insertTemplateOpening(); |
|
62 |
insertSearchBox(); |
|
63 |
</script> |
|
64 |
<table width="100%" align="center" border="0" cellpadding="5" cellspacing="0"> |
|
65 |
<tr> |
|
66 |
<td align="left"><br></br><p class="emphasis"><xsl:number value="count(resultset/document)" /> components found</p></td> |
|
67 |
</tr></table> |
|
68 |
<!-- This tests to see if there are returned documents, |
|
69 |
if there are not then don't show the query results --> |
|
119 |
<script language="JavaScript"> |
|
120 |
insertTemplateOpening(); |
|
121 |
insertSearchBox(); |
|
122 |
</script> |
|
70 | 123 |
|
71 |
<xsl:if test="count(resultset/document) > 0"> |
|
124 |
<div class="body"> |
|
125 |
<p class="emphasis"> |
|
126 |
<xsl:number value="count(resultset/document)" /> components found |
|
127 |
</p> |
|
72 | 128 |
|
73 |
<table width="95%" align="center" border="0" cellpadding="0" cellspacing="0"> |
|
74 |
<tr> |
|
75 |
<th class="tablehead_lcorner" align="right" valign="top"><img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></th> |
|
76 |
<th class="tablehead" style="text-align: left">Component Name</th> |
|
77 |
<!--<th width="15%" class="tablehead" style="text-align: left">Class</th> |
|
78 |
<th width="15%" class="tablehead" style="text-align: left">Organization</th> |
|
79 |
<th width="15%" class="tablehead" style="text-align: left">Keywords</th> |
|
80 |
<xsl:if test="$enableediting = 'true'"> |
|
81 |
<th width="10%" class="tablehead" style="text-align: middle">Actions</th> |
|
82 |
</xsl:if> |
|
83 |
<th class="tablehead_rcorner" align="right" valign="top"><img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></th> |
|
84 |
--> |
|
85 |
</tr> |
|
129 |
<!-- This tests to see if there are returned documents, |
|
130 |
if there are not then don't show the query results --> |
|
86 | 131 |
|
87 |
<xsl:for-each select="resultset/document"> |
|
88 |
<xsl:sort select="./param[@name='/entity/@name']"/> |
|
89 |
<tr valign="top" class="subpanel"> |
|
90 |
<xsl:attribute name="class"> |
|
91 |
<xsl:choose> |
|
92 |
<xsl:when test="position() mod 2 = 1">rowodd</xsl:when> |
|
93 |
<xsl:when test="position() mod 2 = 0">roweven</xsl:when> |
|
94 |
</xsl:choose> |
|
95 |
</xsl:attribute> |
|
132 |
<xsl:if test="count(resultset/document) > 0"> |
|
133 |
<table cellspacing="0" cellpadding="0" style="width: 100%;"> |
|
134 |
<tr> |
|
135 |
<th class="tablehead" style="width: 1px;"></th> |
|
136 |
<th class="tablehead" style="width: 1px;">Component</th> |
|
137 |
<th class="tablehead" style="width: 15em;">Author</th> |
|
138 |
<th class="tablehead">Version</th> |
|
139 |
</tr> |
|
96 | 140 |
|
97 |
<td width="10"> </td> |
|
98 |
<td class="text_plain"> |
|
99 |
<form action="@servlet-path@" method="POST"> |
|
100 |
<xsl:attribute name="name"> |
|
101 |
<xsl:value-of select="translate(./docid, '()-.', '____')" /> |
|
102 |
</xsl:attribute> |
|
141 |
<xsl:for-each select="resultset/document"> |
|
142 |
<xsl:sort select="./param[@name='/entity/@name']"/> |
|
143 |
<tr class="entry"> |
|
103 | 144 |
|
104 |
<input type="hidden" name="qformat" /> |
|
105 |
<input type="hidden" name="sessionid" /> |
|
106 |
<xsl:if test="$enableediting = 'true'"> |
|
107 |
<input type="hidden" name="enableediting" value="{$enableediting}"/> |
|
108 |
</xsl:if> |
|
109 |
<input type="hidden" name="action" value="read"/> |
|
110 |
<input type="hidden" name="docid"> |
|
111 |
<xsl:attribute name="value"> |
|
112 |
<xsl:value-of select="./docid"/> |
|
113 |
</xsl:attribute> |
|
114 |
</input> |
|
115 |
<xsl:for-each select="./relation"> |
|
116 |
<input type="hidden" name="docid"> |
|
117 |
<xsl:attribute name="value" > |
|
118 |
<xsl:value-of select="./relationdoc" /> |
|
119 |
</xsl:attribute> |
|
120 |
</input> |
|
121 |
</xsl:for-each> |
|
145 |
<td class="text_plain"> |
|
146 |
<xsl:value-of select="position()"/>. |
|
147 |
</td> |
|
122 | 148 |
|
123 |
<a> |
|
124 |
<xsl:attribute name="href">javascript:submitform('read',document.<xsl:value-of select="translate(./docid, '()-.', '____')"/>)</xsl:attribute> |
|
125 |
<xsl:text>» </xsl:text> |
|
126 |
<xsl:choose> |
|
127 |
<xsl:when test="./param[@name='entity/@name']!=''"> |
|
149 |
<td class="text_plain" style="white-space: nowrap;"> |
|
150 |
<xsl:if test="./param[@name='entity/@name']!=''"> |
|
151 |
<b> |
|
128 | 152 |
<xsl:value-of select="./param[@name='entity/@name']"/> |
129 |
</xsl:when> |
|
130 |
</xsl:choose> |
|
131 |
</a><br /> |
|
132 |
<br/> |
|
133 |
<p><pre>ID: <xsl:value-of select="./docid"/></pre></p> |
|
153 |
</b> |
|
154 |
</xsl:if> |
|
155 |
</td> |
|
134 | 156 |
|
135 |
</form> |
|
136 |
</td> |
|
157 |
<td class="text_plain"> |
|
158 |
<xsl:value-of select="./param[@name='entity/property/@name'][text()='documentation']/following-sibling::param[@name='entity/property/property/@name'][text()='author']/following-sibling::param[@name='entity/property/property/configure'][position()=1]"/> |
|
159 |
</td> |
|
137 | 160 |
|
138 |
<!--<td class="text_plain"> |
|
139 |
<xsl:for-each select="./param[@name='entity/property[@name=semanticType]']" > |
|
140 |
<xsl:value-of select="./param" /> |
|
141 |
<br/> |
|
142 |
</xsl:for-each> |
|
143 |
</td>--> |
|
144 |
|
|
145 |
<xsl:if test="$enableediting = 'true'"> |
|
146 |
<td class="text_plain"> |
|
147 |
<form action="@servlet-path@" method="POST"> |
|
148 |
<input type="hidden" name="action" value="read"/> |
|
149 |
<input type="hidden" name="qformat" value="{$qformat}"/> |
|
150 |
<input type="hidden" name="sessionid" value="{$sessid}"/> |
|
151 |
<input type="hidden" name="docid"> |
|
152 |
<xsl:attribute name="value"> |
|
153 |
<xsl:value-of select="./docid"/> |
|
154 |
</xsl:attribute> |
|
155 |
</input> |
|
156 |
<center> |
|
157 |
<input type="SUBMIT" value=" View " name="View"> |
|
158 |
</input> |
|
159 |
</center> |
|
160 |
</form> |
|
161 |
<form action="@cgi-prefix@/register-dataset.cgi" |
|
162 |
method="POST"> |
|
163 |
<input type="hidden" name="stage" value="modify"/> |
|
164 |
<input type="hidden" name="cfg" value="{$qformat}"/> |
|
165 |
<input type="hidden" name="sessionid" value="{$sessid}"/> |
|
166 |
<input type="hidden" name="docid"> |
|
167 |
<xsl:attribute name="value"> |
|
168 |
<xsl:value-of select="./docid"/> |
|
169 |
</xsl:attribute> |
|
170 |
</input> |
|
171 |
<center> |
|
172 |
<input type="SUBMIT" value=" Edit " name="Edit"> |
|
173 |
</input> |
|
174 |
</center> |
|
175 |
</form> |
|
176 |
<form action="@cgi-prefix@/register-dataset.cgi" |
|
177 |
method="POST"> |
|
178 |
<input type="hidden" name="stage" value="delete"/> |
|
179 |
<input type="hidden" name="cfg" value="{$qformat}"/> |
|
180 |
<input type="hidden" name="sessionid" value="{$sessid}"/> |
|
181 |
<input type="hidden" name="docid"> |
|
182 |
<xsl:attribute name="value"> |
|
183 |
<xsl:value-of select="./docid"/> |
|
184 |
</xsl:attribute> |
|
185 |
</input> |
|
186 |
<center> |
|
187 |
<input type="SUBMIT" value="Delete" name="Delete"> |
|
188 |
</input> |
|
189 |
</center> |
|
190 |
</form> |
|
191 |
</td> |
|
192 |
</xsl:if> |
|
193 |
<td width="10"> </td> |
|
194 |
</tr> |
|
195 |
<tr class="searchresultsdivider"><td colspan="6"> |
|
196 |
<img src="@style-skins-path@/default/images/transparent1x1.gif" width="1" height="1" /></td></tr> |
|
161 |
<td class="text_plain"> |
|
162 |
<xsl:value-of select="./param[@name='entity/property/@name'][text()='documentation']/following-sibling::param[@name='entity/property/property/@name'][text()='version']/following-sibling::param[@name='entity/property/property/configure'][position()=1]"/> |
|
163 |
</td> |
|
197 | 164 |
|
198 |
</xsl:for-each> |
|
199 |
</table> |
|
165 |
<xsl:if test="$enableediting = 'true'"> |
|
166 |
<td class="text_plain"> |
|
167 |
<form action="@servlet-path@" method="get"> |
|
168 |
<input type="hidden" name="action" value="read"/> |
|
169 |
<input type="hidden" name="qformat" value="{$qformat}"/> |
|
170 |
<input type="hidden" name="sessionid" value="{$sessid}"/> |
|
200 | 171 |
|
201 |
</xsl:if> |
|
202 |
<script language="JavaScript"> |
|
203 |
insertTemplateClosing(); |
|
204 |
</script> |
|
205 |
</body> |
|
172 |
<input type="hidden" name="docid"> |
|
173 |
<xsl:attribute name="value"> |
|
174 |
<xsl:value-of select="./docid"/> |
|
175 |
</xsl:attribute> |
|
176 |
</input> |
|
177 |
|
|
178 |
<center> |
|
179 |
<input type="SUBMIT" value=" View " name="View"></input> |
|
180 |
</center> |
|
181 |
</form> |
|
182 |
|
|
183 |
<form action="@cgi-prefix@/register-dataset.cgi" method="get"> |
|
184 |
<input type="hidden" name="stage" value="modify"/> |
|
185 |
<input type="hidden" name="cfg" value="{$qformat}"/> |
|
186 |
<input type="hidden" name="sessionid" value="{$sessid}"/> |
|
187 |
|
|
188 |
<input type="hidden" name="docid"> |
|
189 |
<xsl:attribute name="value"> |
|
190 |
<xsl:value-of select="./docid"/> |
|
191 |
</xsl:attribute> |
|
192 |
</input> |
|
193 |
|
|
194 |
<center> |
|
195 |
<input type="SUBMIT" value=" Edit " name="Edit"></input> |
|
196 |
</center> |
|
197 |
</form> |
|
198 |
|
|
199 |
<form action="@cgi-prefix@/register-dataset.cgi" method="get"> |
|
200 |
<input type="hidden" name="stage" value="delete"/> |
|
201 |
<input type="hidden" name="cfg" value="{$qformat}"/> |
|
202 |
<input type="hidden" name="sessionid" value="{$sessid}"/> |
|
203 |
|
|
204 |
<input type="hidden" name="docid"> |
|
205 |
<xsl:attribute name="value"> |
|
206 |
<xsl:value-of select="./docid"/> |
|
207 |
</xsl:attribute> |
|
208 |
</input> |
|
209 |
|
|
210 |
<center> |
|
211 |
<input type="SUBMIT" value="Delete" name="Delete"></input> |
|
212 |
</center> |
|
213 |
</form> |
|
214 |
</td> |
|
215 |
</xsl:if> |
|
216 |
</tr> |
|
217 |
|
|
218 |
<tr> |
|
219 |
<td class="text_plain"></td> |
|
220 |
<td class="text_plain" colspan="6"> |
|
221 |
First X words of the actor's description... |
|
222 |
<xsl:text> [</xsl:text> |
|
223 |
|
|
224 |
<a> |
|
225 |
<xsl:attribute name="href"> |
|
226 |
<xsl:text>metacat?qformat=</xsl:text> |
|
227 |
<xsl:value-of select="$qformat"/> |
|
228 |
<xsl:text>&sessionid=</xsl:text> |
|
229 |
<xsl:value-of select="$sessid"/> |
|
230 |
<xsl:text>&action=read&docid=</xsl:text> |
|
231 |
<xsl:value-of select="./docid"/> |
|
232 |
|
|
233 |
<xsl:if test="$enableediting = 'true'"> |
|
234 |
<xsl:text>&enableediting=</xsl:text> |
|
235 |
<xsl:value-of select="$enableediting"/> |
|
236 |
</xsl:if> |
|
237 |
</xsl:attribute> |
|
238 |
|
|
239 |
<xsl:text>more</xsl:text> |
|
240 |
</a> |
|
241 |
|
|
242 |
<xsl:text>]</xsl:text> |
|
243 |
</td> |
|
244 |
</tr> |
|
245 |
|
|
246 |
<tr> |
|
247 |
<td class="text_plain"></td> |
|
248 |
<td class="text_plain" colspan="6"> |
|
249 |
<a> |
|
250 |
<xsl:attribute name="href"> |
|
251 |
<xsl:text>http://@server@/authority/data?lsid=</xsl:text> |
|
252 |
<xsl:value-of select="./param[@name='entity/property/@name'][text()='karId']/following-sibling::param[@name='entity/property/@value'][position()=1]"/> |
|
253 |
</xsl:attribute> |
|
254 |
|
|
255 |
<xsl:text>Download</xsl:text> |
|
256 |
</a> |
|
257 |
</td> |
|
258 |
</tr> |
|
259 |
</xsl:for-each> |
|
260 |
</table> |
|
261 |
</xsl:if> |
|
262 |
</div> |
|
263 |
<script language="JavaScript"> |
|
264 |
insertTemplateClosing(); |
|
265 |
</script> |
|
266 |
</body> |
|
206 | 267 |
</html> |
207 |
</xsl:template> |
|
268 |
</xsl:template> |
|
269 |
</xsl:stylesheet> |
|
208 | 270 |
|
209 |
</xsl:stylesheet> |
Also available in: Unified diff
Kepler Repository Skin