source: main/trunk/greenstone3/web/interfaces/oran/transform/pages/document.xsl@ 23813

Last change on this file since 23813 was 23813, checked in by sjm84, 13 years ago

Lots of upgrades to the oran skin, getting it ready to be the default skin for Greenstone3

File size: 6.2 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:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
8 extension-element-prefixes="java util"
9 exclude-result-prefixes="java util gsf">
10
11 <!-- style includes global params interface_name, library_name -->
12 <xsl:include href=".old/berrytools.xsl"/>
13
14 <!-- use the 'main' layout -->
15 <xsl:include href="layouts/main.xsl"/>
16
17 <!-- set page title -->
18 <xsl:template name="pageTitle"><gslib:documentTitle/></xsl:template>
19
20 <!-- set page breadcrumbs -->
21 <xsl:template name="breadcrumbs">
22 <gslib:siteLink/><gslib:rightArrow/>
23 <gslib:collectionNameLinked/><gslib:rightArrow/>
24 <a>
25 <xsl:attribute name="href">
26 <xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="$collName"/>&amp;d=<xsl:value-of select="/page/pageResponse/document/documentNode[1]/@nodeID"/>&amp;dt=<xsl:value-of select="/page/pageResponse/document/documentNode/@docType"/>&amp;p.a=b&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>
27 </xsl:attribute>
28 <xsl:variable name="documentTitleVar">
29 <gslib:documentTitle/>
30 </xsl:variable>
31 Document
32 </a>
33 </xsl:template>
34
35 <!-- the page content -->
36 <xsl:template match="/page/pageResponse/document">
37
38 <!-- show the little berries for this document -->
39 <xsl:call-template name="documentBerryForDocumentPage"/>
40
41 <!-- the sidebar -->
42 <div id="rightSidebar">
43
44 <!-- show the berry basket if it's turned on -->
45 <gslib:berryBasket/>
46
47 <!-- the book's cover image -->
48 <div id="coverImage"><gslib:coverImage/></div>
49 <br/>
50
51 <!-- the contents -->
52 <ul id="tableOfContents">
53 <xsl:apply-templates select="documentNode/documentNode"/>
54 </ul>
55
56 </div>
57
58 <!-- display the document -->
59 <xsl:choose>
60 <xsl:when test="@external != ''">
61 <xsl:call-template name="externalPage">
62 <xsl:with-param name="external" select="@external"/>
63 </xsl:call-template>
64 </xsl:when>
65
66 <xsl:otherwise>
67 <!-- document heading -->
68 <xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/>
69 <xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/>
70 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
71 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
72 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
73 <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>
74
75 <!--
76 <div id="documentheading">
77
78 <!- -<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"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'close_book')"/></xsl:with-param></xsl:call-template></a>- ->
79
80 <xsl:choose>
81 <xsl:when test="@docType='simple'"><xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:when>
82 <xsl:otherwise><xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/></xsl:otherwise>
83 </xsl:choose>
84
85 </div>
86 -->
87
88 <div id="gs-document-text" class="documenttext">
89 <xsl:for-each select="descendant-or-self::node()/nodeContent">
90 <h3><xsl:value-of disable-output-escaping="yes" select="../metadataList/metadata[@name='Title']"/></h3>
91 <xsl:for-each select="node()">
92 <xsl:choose>
93 <xsl:when test="not(name())">
94 <xsl:value-of select="." disable-output-escaping="yes"/>
95 </xsl:when>
96 <xsl:otherwise>
97 <xsl:apply-templates select="."/>
98 </xsl:otherwise>
99 </xsl:choose>
100 </xsl:for-each>
101 </xsl:for-each>
102 </div>
103
104 <gslib:previousNextButtons/>
105
106 </xsl:otherwise>
107 </xsl:choose>
108
109 <div class="clear"><xsl:text> </xsl:text></div>
110
111 </xsl:template>
112
113 <xsl:template match="documentNode">
114
115 <!-- check if this is the currently selected table of contents item -->
116 <xsl:variable name="isCurrent" select="nodeContent"/>
117
118 <!-- formulate the link -->
119 <xsl:variable name="contentsLink">
120 <xsl:value-of select='$library_name'/>?a=d&amp;c=<gslib:collectionNameShort/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&amp;sib=1<!--&amp;<xsl:if test="string($ec) = '1'">ec=1&amp;</xsl:if>
121 p.a=<xsl:value-of select="$p.a"/>&amp;
122 p.sa=<xsl:value-of select="$p.sa"/>&amp;
123 p.s=<xsl:value-of select="$p.s"/>&amp;
124 p.c=<xsl:value-of select="$p.c"/>-->
125 </xsl:variable>
126
127 <li>
128 <!-- display this item from the table of contents -->
129 <xsl:if test="$isCurrent"><xsl:attribute name="class">current</xsl:attribute></xsl:if>
130 <a>
131 <xsl:attribute name="href"><xsl:value-of select="translate( $contentsLink , ' ', '' )"/></xsl:attribute>
132 <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
133 </a>
134
135 <!-- display any child items -->
136 <xsl:if test="documentNode">
137 <ul>
138 <xsl:apply-templates select="documentNode"/>
139 </ul>
140 </xsl:if>
141
142 </li>
143
144 </xsl:template>
145
146 <xsl:template name="externalPage">
147 <xsl:param name="external"/>
148 <xsl:variable name="go_forward_link">
149 <a>
150 <xsl:attribute name="href">
151 <xsl:value-of select="$external"/>
152 </xsl:attribute>
153 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.go_forward')"/>
154 </a>
155 </xsl:variable>
156 <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'external.title')"/></h2>
157 <p><xsl:value-of select="util:getInterfaceTextWithDOM($interface_name, /page/@lang, 'external.text', $go_forward_link)" disable-output-escaping="yes"/></p>
158 </xsl:template>
159
160 <xsl:template match="/page"><xsl:apply-templates select="/page/pageResponse/document"/></xsl:template> <!-- this to be deleted eventually -->
161
162</xsl:stylesheet>
163
Note: See TracBrowser for help on using the repository browser.