source: greenstone3/trunk/web/interfaces/classic/transform/document.xsl@ 14541

Last change on this file since 14541 was 14541, checked in by anna, 17 years ago

Added missing params(p.s, p.sa, p.a, p.c) in the TOC links.

  • Property svn:keywords set to Author Date Id Revision
File size: 25.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
7 extension-element-prefixes="java util"
8 exclude-result-prefixes="java util gsf">
9
10 <xsl:include href="style.xsl"/>
11 <xsl:include href="service-params.xsl"/>
12 <xsl:output method="html"/>
13
14 <!-- the main page layout template is here -->
15 <!-- override the one in style so we can display the doc over the whole page and get rid of the green bar down the side -->
16 <xsl:template match="page" priority='2'>
17 <html>
18 <xsl:call-template name="pageHead"/>
19 <body>
20 <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
21 <div id="page">
22 <xsl:apply-templates select="pageResponse"/>
23 <xsl:call-template name="greenstoneFooter"/>
24 </div>
25 </body>
26 </html>
27 </xsl:template>
28
29 <xsl:template name="pageTitle">
30 <xsl:variable name="docID" select="/page/pageResponse/document/@selectedNode"/>
31 <xsl:for-each select='/page/pageResponse/document/descendant::documentNode[@nodeID=$docID]/ancestor-or-self::documentNode'><xsl:if test='position()!=1'>::</xsl:if><xsl:value-of select="metadataList/metadata[@name='Title']"/></xsl:for-each>
32 </xsl:template>
33
34 <!-- this is hard coded for GATE, should somehow do it dynamically-->
35 <xsl:template name="pageStyle">
36 <style type="text/css">
37 <xsl:text disable-output-escaping="yes">
38 span.Location { display:inline; color : red }
39 span.Person { display:inline; color : green }
40 span.Organization { display:inline; color : yellow }
41 span.Date { display:inline; color : blue }
42 span.query_term {display: inline; background-color : yellow }
43 </xsl:text>
44 </style>
45 </xsl:template>
46
47 <xsl:template match="pageResponse">
48 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
49 <xsl:call-template name="standardPageBanner">
50 <xsl:with-param name="collName" select="$collName"/>
51 </xsl:call-template>
52 <xsl:call-template name="navigationBar">
53 <xsl:with-param name="collName" select="$collName"/>
54 </xsl:call-template>
55 <div class="document">
56 <!-- display the document -->
57 <xsl:apply-templates select="document">
58 <xsl:with-param name="collName" select="$collName"/>
59 </xsl:apply-templates>
60 </div>
61 </xsl:template>
62
63 <xsl:template match="document">
64 <xsl:param name="collName"/>
65
66 <xsl:call-template name="documentHeading">
67 <xsl:with-param name="collName" select="$collName"/>
68 </xsl:call-template>
69
70 <xsl:call-template name="documentArrows">
71 <xsl:with-param name="collName" select="$collName"/>
72 </xsl:call-template>
73 <xsl:call-template name="documentContent">
74 <xsl:with-param name="collName" select="$collName"/>
75 </xsl:call-template>
76 <xsl:call-template name="documentArrows">
77 <xsl:with-param name="collName" select="$collName"/>
78 </xsl:call-template>
79 <br/>
80 </xsl:template>
81
82 <xsl:template name="documentArrows">
83 <xsl:param name="collName"/>
84 <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/>
85 <xsl:variable name="dir"><xsl:call-template name="direction"/></xsl:variable>
86 <xsl:variable name="firstDir"><xsl:choose><xsl:when test="$dir='rtl'">forward</xsl:when><xsl:otherwise>back</xsl:otherwise></xsl:choose></xsl:variable>
87 <xsl:variable name="secondDir"><xsl:choose><xsl:when test="$dir='rtl'">back</xsl:when><xsl:otherwise>forward</xsl:otherwise></xsl:choose></xsl:variable>
88
89 <div class="documentarrows">
90 <xsl:if test="not(string($ed)='1')">
91 <xsl:call-template name="documentArrow">
92 <xsl:with-param name="collName" select="$collName"/>
93 <xsl:with-param name="direction" select="$firstDir"/>
94 <xsl:with-param name="pageDir" select="$dir"/>
95 </xsl:call-template>
96 <xsl:call-template name="documentArrow">
97 <xsl:with-param name="collName" select="$collName"/>
98 <xsl:with-param name="direction" select="$secondDir"/>
99 <xsl:with-param name="pageDir" select="$dir"/>
100 </xsl:call-template>
101 </xsl:if>
102 </div>
103 </xsl:template>
104
105 <xsl:template name="documentArrow">
106 <xsl:param name="collName"/>
107 <xsl:param name="direction"/>
108 <xsl:param name="pageDir"/>
109
110 <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
111 <xsl:if test='$request-params/param[@name="dt"]/@value != "simple"'>
112 <a><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="$collName"/>&amp;d=<xsl:value-of select="@selectedNode"/><xsl:choose><xsl:when test="$direction='back'">.pp</xsl:when><xsl:otherwise>.np</xsl:otherwise></xsl:choose>&amp;sib=1&amp;p.s=<xsl:value-of select='$request-params/param[@name="p.s"]/@value'/>&amp;p.sa=<xsl:value-of select='$request-params/param[@name="p.sa"]/@value'/>&amp;p.a=<xsl:value-of select='$request-params/param[@name="p.a"]/@value'/></xsl:attribute><xsl:choose>
113 <xsl:when test="$direction='back'"><img class="lessarrow{$pageDir}" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow{$pageDir}" src="interfaces/default/images/more.gif" /></xsl:otherwise></xsl:choose></a>
114 </xsl:if>
115 </xsl:template>
116
117
118 <xsl:template name="documentHeading">
119 <xsl:param name="collName"/>
120 <xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/>
121 <xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/>
122 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
123 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
124 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
125 <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
126
127
128 <div class="heading_image">
129 <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')">
130 <xsl:call-template name="coverImage"/>
131 </xsl:if>
132 </div>
133
134 <div class="buttons" id="toc_buttons">
135 <xsl:call-template name="documentButtons">
136 <xsl:with-param name="collName" select="$collName"/>
137 </xsl:call-template>
138 </div>
139
140 <!--<div><xsl:call-template name="enrichServices">
141 <xsl:with-param name="collName" select="$collName"/>
142 </xsl:call-template></div>-->
143
144 <div class="toc">
145 <table class="v_list"><tr valign="top"><td valign="top"> <a href="{$library_name}?a={$p.a}&amp;sa={$p.sa}&amp;s={$p.s}&amp;c={$collName}&amp;rt=r"><xsl:call-template name="openbookimg"><xsl:with-param name="title">Close this book and return to search/browse</xsl:with-param>
146 </xsl:call-template></a></td><td valign="top"></td>
147 <td valign="top">
148 <xsl:choose><xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when><xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise></xsl:choose>
149 </td></tr>
150 </table>
151 <xsl:if test="string($doTOC) != 'false'">
152 <table><tr valign="top"><td><img alt="" src="/gsdl/images/space.gif" width="25"/></td><td><table class="v_list">
153 <xsl:call-template name="TOC">
154 <xsl:with-param name="collName" select="$collName"/>
155 </xsl:call-template>
156 </table>
157 </td></tr></table>
158 </xsl:if>
159 </div>
160 </xsl:template>
161
162 <xsl:template name="coverImage">
163 <img alt="" onError="src='interfaces/classic/images/blank.gif'"><xsl:attribute name='src'><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
164 </xsl:template>
165
166 <xsl:template name="documentButtons">
167 <xsl:param name="collName"/>
168 <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
169 <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
170 <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
171 <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/>
172
173 <!-- added params, otherwise the bookicon link becomes broken after click one of these buttons -->
174 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
175 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
176 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
177 <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
178
179
180 <!-- expand document -->
181 <!-- this doesn't work with MG so comment it out for now -->
182 <xsl:if test="@docType = 'hierarchy' or @docType = 'paged'">
183 <div class="button">
184 <span class="button">
185 <xsl:choose><xsl:when test="string($ed)='1'">
186 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=0&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_tip')"/></xsl:attribute>
187 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_b')"/>
188 </a>
189 </xsl:when>
190 <xsl:otherwise>
191 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=1&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_tip')"/></xsl:attribute>
192 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_b')"/>
193 </a>
194 </xsl:otherwise>
195 </xsl:choose>
196 </span>
197 </div>
198 </xsl:if>
199
200 <!-- expand contents -->
201 <xsl:if test="@docType = 'hierarchy' and string(/page/pageResponse/format/gsf:option[@name='documentTOC']/@value) != 'false'">
202 <div class="button">
203 <span class="button">
204 <xsl:choose><xsl:when test="string($ec)='1'">
205 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=0&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_tip')"/></xsl:attribute>
206 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_b')"/>
207 </a>
208 </xsl:when>
209 <xsl:otherwise>
210 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=1&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_tip')"/></xsl:attribute>
211 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_b')"/>
212 </a>
213 </xsl:otherwise>
214 </xsl:choose>
215 </span>
216 </div>
217 </xsl:if>
218 <!-- detach page -->
219 <xsl:variable name="paramList" select="/page/pageRequest/paramList"/>
220 <div class="button">
221 <span class="button">
222 <a target="_blank"><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;d=<xsl:value-of select="$docID"/>&amp;c=<xsl:value-of select="$collName"/>&amp;sib=<xsl:value-of select="$sib"/>&amp;dt=<xsl:value-of select="$paramList/param[@name='dt']/@value"/>&amp;ec=<xsl:value-of select="$paramList/param[@name='ec']/@value"/>&amp;et=<xsl:value-of select="$paramList/param[@name='et']/@value"/>&amp;p.a=<xsl:value-of select="$paramList/param[@name='p.a']/@value"/>&amp;p.s=<xsl:value-of select="$paramList/param[@name='p.s']/@value"/>&amp;p.sa=<xsl:value-of select="$paramList/param[@name='p.sa']/@value"/></xsl:attribute><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_tip')"/></xsl:attribute>
223 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_b')"/>
224 </a>
225 </span>
226 </div>
227 </xsl:template>
228
229 <xsl:template name="TOC">
230 <xsl:param name="collName"/>
231 <xsl:choose>
232 <xsl:when test="@docType='hierarchy'">
233 <xsl:call-template name="hierarchicalContents">
234 <xsl:with-param name="collName" select="$collName"/>
235 </xsl:call-template>
236 </xsl:when>
237 <xsl:when test="@docType='paged'">
238 <xsl:call-template name="pagedContents">
239 <xsl:with-param name="collName" select="$collName"/>
240 </xsl:call-template>
241 </xsl:when>
242 </xsl:choose>
243 </xsl:template>
244
245 <xsl:template name="hierarchicalContents">
246 <xsl:param name="collName"/>
247 <xsl:variable name="oc" select="/page/pageRequest/paramList/param[@name='oc']/@value"/>
248 <xsl:variable name="d" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
249 <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
250 <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
251
252 <!-- added parameters -->
253 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
254 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
255 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
256 <xsl:variable name="p.c"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='p.c']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='p.c']/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="$collName"/></xsl:otherwise></xsl:choose></xsl:variable>
257
258 <xsl:if test="documentNode[@nodeID]">
259 <tr valign='top'><td>
260 <xsl:choose><xsl:when test="string($oc)='0'">
261 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=1&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:call-template name="closedfolderimg"><xsl:with-param name="title">open the table of contents</xsl:with-param></xsl:call-template></a>
262 </xsl:when>
263 <xsl:otherwise><a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=0&amp;p.s={$p.s}&amp;p.sa={$p.sa}&amp;p.a={$p.a}&amp;p.c={$p.c}"><xsl:call-template name="openfolderimg"><xsl:with-param name="title">close the table of contents</xsl:with-param></xsl:call-template></a></xsl:otherwise></xsl:choose>
264 </td><td>Table of Contents</td></tr>
265 <xsl:if test="string($oc)!='0'">
266 <tr><td>&#160;</td><td>
267 <table>
268 <xsl:for-each select="documentNode/documentNode[@nodeID]">
269 <xsl:apply-templates select='.'>
270 <xsl:with-param name="collName" select="$collName"/><xsl:with-param name="ec" select="$ec"/>
271
272 <!-- added parameters -->
273 <xsl:with-param name="p.a" select="$p.a"/>
274 <xsl:with-param name="p.s" select="$p.s"/>
275 <xsl:with-param name="p.sa" select="$p.sa"/>
276 <xsl:with-param name="p.c" select="$p.c"/>
277
278 </xsl:apply-templates>
279 </xsl:for-each>
280 </table>
281 </td></tr>
282 </xsl:if>
283 </xsl:if>
284 </xsl:template>
285
286 <!-- each icon-title pair is a row in a table. children go in a table in another row -->
287 <xsl:template match="documentNode">
288 <xsl:param name="collName"/>
289 <xsl:param name="ec"/>
290
291 <!-- added these parameters to be carried when changing in toc -->
292 <xsl:param name="p.a"/>
293 <xsl:param name="p.s"/>
294 <xsl:param name="p.sa"/>
295 <xsl:param name="p.c"/>
296 <!-- Display the appropriate image, depending on the node type -->
297
298 <tr><td valign="top">
299 <!--
300 <a><xsl:attribute name="href"><xsl:value-of select='$library_name'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if><xsl:if test="string($ec) = '1'">&amp;ec=1</xsl:if></xsl:attribute>
301 -->
302
303 <a><xsl:attribute name="href"><xsl:value-of select='$library_name'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&amp;sib=1<xsl:if test="string($ec) = '1'">&amp;ec=1</xsl:if>&amp;p.a=<xsl:value-of select="$p.a"/>&amp;p.sa=<xsl:value-of select="$p.sa"/>&amp;p.s=<xsl:value-of select="$p.s"/>&amp;p.c=<xsl:value-of select="$p.c"/></xsl:attribute>
304
305 <xsl:apply-templates select="." mode="displayNodeIcon"/>
306 </a>
307 </td>
308
309 <!-- Display associated title, bolded if the node has content -->
310 <td valign="top">
311 <xsl:choose>
312 <xsl:when test="nodeContent">
313 <b><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></b>
314 </xsl:when>
315 <xsl:otherwise>
316 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
317 </xsl:otherwise>
318 </xsl:choose>
319 </td>
320 </tr>
321 <!-- Apply recursively to the children of this node -->
322 <xsl:if test="documentNode[@nodeID]">
323 <tr><td>&#160;</td><td><table>
324 <xsl:apply-templates select="documentNode[@nodeID]">
325 <xsl:with-param name="collName" select="$collName"/>
326 <xsl:with-param name="ec" select="$ec"/>
327
328 <!-- added parameters -->
329 <xsl:with-param name="p.a" select="$p.a"/><xsl:with-param name="p.s" select="$p.s"/><xsl:with-param name="p.sa" select="$p.sa"/><xsl:with-param name="p.c" select="$p.c"/>
330 <!--<xsl:with-param name="depth" select="$depth + 1"/>-->
331 </xsl:apply-templates>
332 </table>
333 </td></tr>
334 </xsl:if>
335 </xsl:template>
336
337 <!-- default content is to print the title and content of any documentNodes that have nodeContent -->
338 <xsl:template name="documentContent">
339 <div class="documenttext">
340 <xsl:choose>
341 <xsl:when test="@docType='simple'">
342 <xsl:apply-templates select="nodeContent"/>
343 </xsl:when>
344 <xsl:otherwise>
345 <xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/>
346 </xsl:otherwise>
347 </xsl:choose>
348 </div>
349 </xsl:template>
350
351 <xsl:template match="documentNode" mode="content">
352 <xsl:if test="nodeContent and string(nodeContent)">
353 <xsl:if test="metadataList/metadata[@name='Title']">
354 <h3><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></h3>
355 </xsl:if>
356 <xsl:apply-templates select="nodeContent"/>
357 </xsl:if>
358
359 </xsl:template>
360
361 <!-- the actual text/content -->
362 <xsl:template match="nodeContent">
363 <p/>
364 <xsl:for-each select="node()">
365 <xsl:choose>
366 <xsl:when test="not(name())"><xsl:value-of select="." disable-output-escaping="yes"/></xsl:when>
367 <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
368 </xsl:choose>
369 </xsl:for-each>
370 </xsl:template>
371
372 <!-- match any file nodes -->
373 <xsl:template match="file">
374 <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
375 <xsl:choose>
376 <xsl:when test="util:isImage(@mimeType)">
377 <img src="{$httpPath}/{@href}"/>
378 </xsl:when>
379 <xsl:otherwise>
380 <a href="{$httpPath}/{@href}"><xsl:value-of select="@href"/></a>
381 </xsl:otherwise>
382 </xsl:choose>
383 </xsl:template>
384
385 <!-- match any link nodes -->
386 <xsl:template match="link">
387 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
388 <xsl:variable name="actionargs">
389 <xsl:choose>
390 <xsl:when test="@type='document'">a=d</xsl:when>
391 <xsl:when test="@type='query'">a=q&amp;s=<xsl:value-of select="@service"/>&amp;rt=r</xsl:when>
392 <xsl:otherwise>
393 p
394 </xsl:otherwise>
395 </xsl:choose>
396 </xsl:variable>
397 <xsl:variable name="serviceargs">
398 <xsl:for-each select="param">&amp;s1.<xsl:value-of select="@name"/>=<xsl:value-of select="@value"/></xsl:for-each>
399 </xsl:variable>
400 <a href="{$library_name}?{$actionargs}&amp;c={$collName}{$serviceargs}"><xsl:value-of disable-output-escaping="yes" select="."/></a>
401 </xsl:template>
402
403 <!-- match any annotations and make them span elements -->
404 <xsl:template match="annotation">
405 <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span>
406 </xsl:template>
407
408 <!-- paged naviagtion : INCOMPLETE!!-->
409 <xsl:template name="pagedContents">
410 <xsl:param name="collName"/>
411 <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/>
412 <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/>
413 <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/>
414 <xsl:choose>
415 <xsl:when test="$pos=-1"><!-- a doc -->
416 <tr valign="top">
417 <td align="left">
418 </td>
419 <td align="center"><center>
420 <b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.pages', $children)"/></b>
421 </center></td>
422 <td align="right">
423 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
424 </td>
425 </tr>
426 </xsl:when>
427
428 <xsl:otherwise> <!-- an internal node -->
429 <tr valign="top">
430 <td align="left">
431 <xsl:if test=" not ( $pos = 1 )">
432 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps"><img src="interfaces/default/images/less.gif" border="0" align="absbottom" /></a>
433 </xsl:if>
434 </td>
435 <td align="center"><center>
436 <b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.pageof', concat($pos, ';', $length))"/></b>
437 </center></td>
438 <td align="right">
439 <xsl:if test=" not($pos = $length)">
440 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
441 </xsl:if>
442 </td>
443 </tr>
444 </xsl:otherwise>
445 </xsl:choose>
446 <tr valign="middle">
447 <td align='center' valign='top' colspan='3'>
448 <form name="GotoForm" method="get" action="{$library_name}">
449 <input type='hidden' name='a' value='d'/>
450 <input type='hidden' name='c' value='{$collName}'/>
451 <input type='hidden' name='d' value='{@selectedNode}'/>
452 <input type="text" name="gp" size="3" maxlength="4"/>
453 <input type="submit"><xsl:attribute name='value'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.gotopage')"/></xsl:attribute></input>
454 </form>
455 </td>
456 </tr>
457 </xsl:template>
458
459 <xsl:template name="enrichServices">
460 <xsl:param name="collName"/>
461 <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
462 <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
463 <xsl:for-each select="../serviceList/service">
464 <table border='1' cellspacing='0'>
465 <tr><td>
466 <p /><xsl:value-of select="displayItem[@name='name']"/><p/>
467 <form name="EnrichForm" method="get" action="{$library_name}">
468 <xsl:apply-templates select="paramList"/>
469 <input type='hidden' name='a' value='d'/>
470 <input type='hidden' name='d' value='{$docID}'/>
471 <input type='hidden' name='c' value='{$collName}'/>
472 <xsl:if test='$request-params/param[@name="sib"]'>
473 <input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
474 <input type='hidden' name='s' value='{@name}'/>
475 <input type='hidden' name='p.a'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.a"]'/></xsl:attribute></input>
476 <input type='hidden' name='p.sa'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.sa"]'/></xsl:attribute></input>
477 <input type='hidden' name='p.s'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.s"]'/></xsl:attribute></input>
478 <input type='hidden' name='end' value='1'/>
479 <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
480 </form>
481 </td></tr>
482 </table>
483 </xsl:for-each>
484 </xsl:template>
485
486 <xsl:template match="paramList" mode="hidden">
487 <xsl:for-each select="param">
488 <input type='hidden' name='{@name}' value='{@value}'/><xsl:text>
489 </xsl:text>
490 </xsl:for-each>
491 </xsl:template>
492
493</xsl:stylesheet>
494
495
496
497
Note: See TracBrowser for help on using the repository browser.