source: greenstone3/branches/3.03/web/interfaces/classic/transform/document.xsl@ 14645

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

updated by Anna

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