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

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

Fixed broken bookicon link after clicking the document buttons.

  • Property svn:keywords set to Author Date Id Revision
File size: 24.7 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="dir"><xsl:call-template name="direction"/></xsl:variable>
85 <xsl:variable name="firstDir"><xsl:choose><xsl:when test="$dir='rtl'">forward</xsl:when><xsl:otherwise>back</xsl:otherwise></xsl:choose></xsl:variable>
86 <xsl:variable name="secondDir"><xsl:choose><xsl:when test="$dir='rtl'">back</xsl:when><xsl:otherwise>forward</xsl:otherwise></xsl:choose></xsl:variable>
87
88 <div class="documentarrows">
89 <xsl:call-template name="documentArrow">
90 <xsl:with-param name="collName" select="$collName"/>
91 <xsl:with-param name="direction" select="$firstDir"/>
92 <xsl:with-param name="pageDir" select="$dir"/>
93 </xsl:call-template>
94 <xsl:call-template name="documentArrow">
95 <xsl:with-param name="collName" select="$collName"/>
96 <xsl:with-param name="direction" select="$secondDir"/>
97 <xsl:with-param name="pageDir" select="$dir"/>
98 </xsl:call-template>
99 </div>
100 </xsl:template>
101
102 <xsl:template name="documentArrow">
103 <xsl:param name="collName"/>
104 <xsl:param name="direction"/>
105 <xsl:param name="pageDir"/>
106
107 <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
108 <xsl:if test='$request-params/param[@name="dt"]/@value != "simple"'>
109 <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>
110 <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>
111 </xsl:if>
112 </xsl:template>
113
114
115 <xsl:template name="documentHeading">
116 <xsl:param name="collName"/>
117 <xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/>
118 <xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/>
119 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
120 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
121 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
122 <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>
123
124
125 <div class="heading_image">
126 <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')">
127 <xsl:call-template name="coverImage"/>
128 </xsl:if>
129 </div>
130
131 <div class="buttons" id="toc_buttons">
132 <xsl:call-template name="documentButtons">
133 <xsl:with-param name="collName" select="$collName"/>
134 </xsl:call-template>
135 </div>
136
137 <!--<div><xsl:call-template name="enrichServices">
138 <xsl:with-param name="collName" select="$collName"/>
139 </xsl:call-template></div>-->
140
141 <div class="toc">
142 <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>
143 </xsl:call-template></a></td><td valign="top"></td>
144 <td valign="top">
145 <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>
146 </td></tr>
147 </table>
148 <xsl:if test="string($doTOC) != 'false'">
149 <table><tr valign="top"><td><img alt="" src="/gsdl/images/space.gif" width="25"/></td><td><table class="v_list">
150 <xsl:call-template name="TOC">
151 <xsl:with-param name="collName" select="$collName"/>
152 </xsl:call-template>
153 </table>
154 </td></tr></table>
155 </xsl:if>
156 </div>
157 </xsl:template>
158
159 <xsl:template name="coverImage">
160 <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>
161 </xsl:template>
162
163 <xsl:template name="documentButtons">
164 <xsl:param name="collName"/>
165 <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
166 <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
167 <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
168 <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/>
169
170 <!-- added params, otherwise the bookicon link becomes broken after click one of these buttons -->
171 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
172 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
173 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
174 <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>
175
176
177 <!-- expand document -->
178 <!-- this doesn't work with MG so comment it out for now -->
179 <xsl:if test="@docType = 'hierarchy' or @docType = 'paged'">
180 <div class="button">
181 <span class="button">
182 <xsl:choose><xsl:when test="string($ed)='1'">
183 <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>
184 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_b')"/>
185 </a>
186 </xsl:when>
187 <xsl:otherwise>
188 <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>
189 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_b')"/>
190 </a>
191 </xsl:otherwise>
192 </xsl:choose>
193 </span>
194 </div>
195 </xsl:if>
196
197 <!-- expand contents -->
198 <xsl:if test="@docType = 'hierarchy' and string(/page/pageResponse/format/gsf:option[@name='documentTOC']/@value) != 'false'">
199 <div class="button">
200 <span class="button">
201 <xsl:choose><xsl:when test="string($ec)='1'">
202 <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>
203 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_b')"/>
204 </a>
205 </xsl:when>
206 <xsl:otherwise>
207 <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>
208 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_b')"/>
209 </a>
210 </xsl:otherwise>
211 </xsl:choose>
212 </span>
213 </div>
214 </xsl:if>
215 <!-- detach page -->
216 <xsl:variable name="paramList" select="/page/pageRequest/paramList"/>
217 <div class="button">
218 <span class="button">
219 <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>
220 <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_b')"/>
221 </a>
222 </span>
223 </div>
224 </xsl:template>
225
226 <xsl:template name="TOC">
227 <xsl:param name="collName"/>
228 <xsl:choose>
229 <xsl:when test="@docType='hierarchy'">
230 <xsl:call-template name="hierarchicalContents">
231 <xsl:with-param name="collName" select="$collName"/>
232 </xsl:call-template>
233 </xsl:when>
234 <xsl:when test="@docType='paged'">
235 <xsl:call-template name="pagedContents">
236 <xsl:with-param name="collName" select="$collName"/>
237 </xsl:call-template>
238 </xsl:when>
239 </xsl:choose>
240 </xsl:template>
241
242 <xsl:template name="hierarchicalContents">
243 <xsl:param name="collName"/>
244 <xsl:variable name="oc" select="/page/pageRequest/paramList/param[@name='oc']/@value"/>
245 <xsl:variable name="d" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
246 <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
247 <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
248
249 <!-- added parameters -->
250 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
251 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
252 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
253 <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>
254
255 <xsl:if test="documentNode[@nodeID]">
256 <tr valign='top'><td>
257 <xsl:choose><xsl:when test="string($oc)='0'">
258 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=1"><xsl:call-template name="closedfolderimg"><xsl:with-param name="title">open the table of contents</xsl:with-param></xsl:call-template></a>
259 </xsl:when>
260 <xsl:otherwise><a href="{$library_name}?a=d&amp;c={$collName}&amp;d={$d}&amp;sib={$sib}&amp;oc=0"><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>
261 </td><td>Table of Contents</td></tr>
262 <xsl:if test="string($oc)!='0'">
263 <tr><td>&#160;</td><td>
264 <table>
265 <xsl:for-each select="documentNode/documentNode[@nodeID]">
266 <xsl:apply-templates select='.'>
267 <xsl:with-param name="collName" select="$collName"/><xsl:with-param name="ec" select="$ec"/>
268
269 <!-- added parameters -->
270 <xsl:with-param name="p.a" select="$p.a"/>
271 <xsl:with-param name="p.s" select="$p.s"/>
272 <xsl:with-param name="p.sa" select="$p.sa"/>
273 <xsl:with-param name="p.c" select="$p.c"/>
274
275 </xsl:apply-templates>
276 </xsl:for-each>
277 </table>
278 </td></tr>
279 </xsl:if>
280 </xsl:if>
281 </xsl:template>
282
283 <!-- each icon-title pair is a row in a table. children go in a table in another row -->
284 <xsl:template match="documentNode">
285 <xsl:param name="collName"/>
286 <xsl:param name="ec"/>
287
288 <!-- added these parameters to be carried when changing in toc -->
289 <xsl:param name="p.a"/>
290 <xsl:param name="p.s"/>
291 <xsl:param name="p.sa"/>
292 <xsl:param name="p.c"/>
293 <!-- Display the appropriate image, depending on the node type -->
294
295 <tr><td valign="top">
296 <!--
297 <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>
298 -->
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>&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>
301
302 <xsl:apply-templates select="." mode="displayNodeIcon"/>
303 </a>
304 </td>
305
306 <!-- Display associated title, bolded if the node has content -->
307 <td valign="top">
308 <xsl:choose>
309 <xsl:when test="nodeContent">
310 <b><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></b>
311 </xsl:when>
312 <xsl:otherwise>
313 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
314 </xsl:otherwise>
315 </xsl:choose>
316 </td>
317 </tr>
318 <!-- Apply recursively to the children of this node -->
319 <xsl:if test="documentNode[@nodeID]">
320 <tr><td>&#160;</td><td><table>
321 <xsl:apply-templates select="documentNode[@nodeID]">
322 <xsl:with-param name="collName" select="$collName"/>
323 <xsl:with-param name="ec" select="$ec"/>
324
325 <!-- added parameters -->
326 <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"/>
327 <!--<xsl:with-param name="depth" select="$depth + 1"/>-->
328 </xsl:apply-templates>
329 </table>
330 </td></tr>
331 </xsl:if>
332 </xsl:template>
333
334 <!-- default content is to print the title and content of any documentNodes that have nodeContent -->
335 <xsl:template name="documentContent">
336 <div class="documenttext">
337 <xsl:choose>
338 <xsl:when test="@docType='simple'">
339 <xsl:apply-templates select="nodeContent"/>
340 </xsl:when>
341 <xsl:otherwise>
342 <xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/>
343 </xsl:otherwise>
344 </xsl:choose>
345 </div>
346 </xsl:template>
347
348 <xsl:template match="documentNode" mode="content">
349 <xsl:if test="nodeContent and string(nodeContent)">
350 <xsl:if test="metadataList/metadata[@name='Title']">
351 <h3><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></h3>
352 </xsl:if>
353 <xsl:apply-templates select="nodeContent"/>
354 </xsl:if>
355
356 </xsl:template>
357
358 <!-- the actual text/content -->
359 <xsl:template match="nodeContent">
360 <p/>
361 <xsl:for-each select="node()">
362 <xsl:choose>
363 <xsl:when test="not(name())"><xsl:value-of select="." disable-output-escaping="yes"/></xsl:when>
364 <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
365 </xsl:choose>
366 </xsl:for-each>
367 </xsl:template>
368
369 <!-- match any file nodes -->
370 <xsl:template match="file">
371 <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
372 <xsl:choose>
373 <xsl:when test="util:isImage(@mimeType)">
374 <img src="{$httpPath}/{@href}"/>
375 </xsl:when>
376 <xsl:otherwise>
377 <a href="{$httpPath}/{@href}"><xsl:value-of select="@href"/></a>
378 </xsl:otherwise>
379 </xsl:choose>
380 </xsl:template>
381
382 <!-- match any link nodes -->
383 <xsl:template match="link">
384 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
385 <xsl:variable name="actionargs">
386 <xsl:choose>
387 <xsl:when test="@type='document'">a=d</xsl:when>
388 <xsl:when test="@type='query'">a=q&amp;s=<xsl:value-of select="@service"/>&amp;rt=r</xsl:when>
389 <xsl:otherwise>
390 p
391 </xsl:otherwise>
392 </xsl:choose>
393 </xsl:variable>
394 <xsl:variable name="serviceargs">
395 <xsl:for-each select="param">&amp;s1.<xsl:value-of select="@name"/>=<xsl:value-of select="@value"/></xsl:for-each>
396 </xsl:variable>
397 <a href="{$library_name}?{$actionargs}&amp;c={$collName}{$serviceargs}"><xsl:value-of disable-output-escaping="yes" select="."/></a>
398 </xsl:template>
399
400 <!-- match any annotations and make them span elements -->
401 <xsl:template match="annotation">
402 <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span>
403 </xsl:template>
404
405 <!-- paged naviagtion : INCOMPLETE!!-->
406 <xsl:template name="pagedContents">
407 <xsl:param name="collName"/>
408 <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/>
409 <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/>
410 <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/>
411 <xsl:choose>
412 <xsl:when test="$pos=-1"><!-- a doc -->
413 <tr valign="top">
414 <td align="left">
415 </td>
416 <td align="center"><center>
417 <b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.pages', $children)"/></b>
418 </center></td>
419 <td align="right">
420 <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>
421 </td>
422 </tr>
423 </xsl:when>
424
425 <xsl:otherwise> <!-- an internal node -->
426 <tr valign="top">
427 <td align="left">
428 <xsl:if test=" not ( $pos = 1 )">
429 <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>
430 </xsl:if>
431 </td>
432 <td align="center"><center>
433 <b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.pageof', concat($pos, ';', $length))"/></b>
434 </center></td>
435 <td align="right">
436 <xsl:if test=" not($pos = $length)">
437 <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>
438 </xsl:if>
439 </td>
440 </tr>
441 </xsl:otherwise>
442 </xsl:choose>
443 <tr valign="middle">
444 <td align='center' valign='top' colspan='3'>
445 <form name="GotoForm" method="get" action="{$library_name}">
446 <input type='hidden' name='a' value='d'/>
447 <input type='hidden' name='c' value='{$collName}'/>
448 <input type='hidden' name='d' value='{@selectedNode}'/>
449 <input type="text" name="gp" size="3" maxlength="4"/>
450 <input type="submit"><xsl:attribute name='value'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.gotopage')"/></xsl:attribute></input>
451 </form>
452 </td>
453 </tr>
454 </xsl:template>
455
456 <xsl:template name="enrichServices">
457 <xsl:param name="collName"/>
458 <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
459 <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
460 <xsl:for-each select="../serviceList/service">
461 <table border='1' cellspacing='0'>
462 <tr><td>
463 <p /><xsl:value-of select="displayItem[@name='name']"/><p/>
464 <form name="EnrichForm" method="get" action="{$library_name}">
465 <xsl:apply-templates select="paramList"/>
466 <input type='hidden' name='a' value='d'/>
467 <input type='hidden' name='d' value='{$docID}'/>
468 <input type='hidden' name='c' value='{$collName}'/>
469 <xsl:if test='$request-params/param[@name="sib"]'>
470 <input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
471 <input type='hidden' name='s' value='{@name}'/>
472 <input type='hidden' name='p.a'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.a"]'/></xsl:attribute></input>
473 <input type='hidden' name='p.sa'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.sa"]'/></xsl:attribute></input>
474 <input type='hidden' name='p.s'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.s"]'/></xsl:attribute></input>
475 <input type='hidden' name='end' value='1'/>
476 <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
477 </form>
478 </td></tr>
479 </table>
480 </xsl:for-each>
481 </xsl:template>
482
483 <xsl:template match="paramList" mode="hidden">
484 <xsl:for-each select="param">
485 <input type='hidden' name='{@name}' value='{@value}'/><xsl:text>
486 </xsl:text>
487 </xsl:for-each>
488 </xsl:template>
489
490</xsl:stylesheet>
491
492
493
494
Note: See TracBrowser for help on using the repository browser.