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

Last change on this file since 14573 was 14573, checked in by qq6, 17 years ago

updated styles

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