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

Last change on this file since 14672 was 14672, checked in by anna, 16 years ago

Remove expand document button from paged document page.

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