[4047] | 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"
|
---|
[4712] | 5 | xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
|
---|
| 6 | extension-element-prefixes="java util"
|
---|
| 7 | exclude-result-prefixes="java util">
|
---|
| 8 |
|
---|
| 9 | <!-- some global parameters - these are set by whoever is invoking the transformation -->
|
---|
| 10 | <xsl:param name="interface_name"/>
|
---|
| 11 | <xsl:param name="library_name"/>
|
---|
[12015] | 12 | <!-- global style info goes here -->
|
---|
[8526] | 13 | <xsl:template name="globalStyle">
|
---|
[8530] | 14 | <link rel="stylesheet" href="interfaces/default/style/core.css" type="text/css"/>
|
---|
[8526] | 15 | </xsl:template>
|
---|
[8530] | 16 |
|
---|
[4047] | 17 | <!-- the main page layout template is here -->
|
---|
| 18 | <xsl:template match="page">
|
---|
| 19 | <html>
|
---|
[12015] | 20 | <xsl:call-template name="pageHead"/>
|
---|
| 21 |
|
---|
[13267] | 22 | <body class="bgimage">
|
---|
| 23 | <div id="page">
|
---|
| 24 | <xsl:apply-templates select="pageResponse"/>
|
---|
[9874] | 25 | <xsl:if test="descendant::error">
|
---|
| 26 | <script language="Javascript">
|
---|
| 27 | <xsl:text disable-output-escaping="yes">
|
---|
| 28 | function removeAllChildren(node) {
|
---|
| 29 | while (node.hasChildNodes()) {
|
---|
| 30 | node.removeChild(node.firstChild);
|
---|
| 31 | }
|
---|
| 32 | }
|
---|
| 33 |
|
---|
| 34 | function toggleHideError(obj) {
|
---|
| 35 | if (obj.style.display == "none") {
|
---|
| 36 | obj.style.display = "";
|
---|
| 37 | hide_link = document.getElementById("hide");
|
---|
| 38 | removeAllChildren(hide_link);
|
---|
| 39 | hide_link.appendChild(document.createTextNode("Hide Error"));
|
---|
| 40 | } else {
|
---|
| 41 | obj.style.display = "none";
|
---|
| 42 | hide_link = document.getElementById("hide");
|
---|
| 43 | removeAllChildren(hide_link);
|
---|
| 44 | hide_link.appendChild(document.createTextNode("Show Error"));
|
---|
| 45 |
|
---|
| 46 | }
|
---|
| 47 | }
|
---|
| 48 | </xsl:text>
|
---|
| 49 | </script>
|
---|
| 50 | <p align='right'><a id="hide" href="javascript:toggleHideError(error);">Show Error</a></p>
|
---|
| 51 | <div id="error" style="display: none;">
|
---|
| 52 | <xsl:apply-templates select="descendant::error"/>
|
---|
| 53 | </div>
|
---|
| 54 | </xsl:if>
|
---|
[5119] | 55 | <xsl:call-template name="greenstoneFooter"/>
|
---|
[13267] | 56 | </div>
|
---|
[4047] | 57 | </body>
|
---|
| 58 | </html>
|
---|
| 59 | </xsl:template>
|
---|
| 60 |
|
---|
[8526] | 61 | <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
|
---|
| 62 | <xsl:template name="pageHead">
|
---|
| 63 | <head>
|
---|
| 64 | <title>
|
---|
| 65 | <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
|
---|
| 66 | </title>
|
---|
| 67 | <xsl:call-template name="globalStyle"/>
|
---|
| 68 | <xsl:call-template name="pageStyle"/>
|
---|
| 69 | </head>
|
---|
| 70 | </xsl:template>
|
---|
| 71 |
|
---|
| 72 |
|
---|
[4047] | 73 | <xsl:template name="greenstonePageBanner">
|
---|
[13267] | 74 | <div id="banner">
|
---|
| 75 | <div class="collectimage">
|
---|
| 76 | <img src="interfaces/classic/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:attribute>
|
---|
| 77 | </img>
|
---|
| 78 | </div>
|
---|
| 79 | </div>
|
---|
| 80 | <div class="bannerextra"></div>
|
---|
| 81 | <div id="content">
|
---|
| 82 | <xsl:call-template name="dividerBar">
|
---|
| 83 | <xsl:with-param name="text" select="'select a collection'"/>
|
---|
| 84 | </xsl:call-template>
|
---|
| 85 | </div>
|
---|
[4047] | 86 | </xsl:template>
|
---|
| 87 |
|
---|
| 88 | <xsl:template name="greenstoneFooter">
|
---|
[13267] | 89 | <div class="divbar"><p class="navbar"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gs3power')"/></p>
|
---|
| 90 | </div>
|
---|
[4047] | 91 | </xsl:template>
|
---|
| 92 |
|
---|
[9274] | 93 | <xsl:template match="error">
|
---|
| 94 | Error: <xsl:value-of select="."/>
|
---|
| 95 | </xsl:template>
|
---|
[9874] | 96 |
|
---|
[5119] | 97 | <xsl:template name="standardPageBanner">
|
---|
[4047] | 98 | <xsl:param name="collName"/>
|
---|
[5132] | 99 | <xsl:param name="pageType"/>
|
---|
[5119] | 100 | <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
|
---|
[13267] | 101 | <div id="bannar">
|
---|
| 102 | <div class="collectimage">
|
---|
[4712] | 103 | <a href="{$library_name}?a=p&sa=about&c={$collName}">
|
---|
[5119] | 104 | <xsl:choose>
|
---|
| 105 | <xsl:when test="$this-element/displayItem[@name='icon']">
|
---|
| 106 | <img border="0">
|
---|
| 107 | <xsl:attribute name="src">
|
---|
| 108 | <xsl:value-of select="$this-element/metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="$this-element/displayItem[@name='icon']"/>
|
---|
| 109 | </xsl:attribute>
|
---|
| 110 | <xsl:attribute name="alt">
|
---|
| 111 | <xsl:value-of select="$this-element/displayItem[@name='name']"/>
|
---|
| 112 | </xsl:attribute>
|
---|
| 113 | <xsl:attribute name="title">
|
---|
| 114 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
|
---|
| 115 | </xsl:attribute>
|
---|
| 116 | </img>
|
---|
| 117 | </xsl:when>
|
---|
| 118 | <xsl:otherwise>
|
---|
| 119 | <b><xsl:value-of select="$this-element/displayItem[@name='name']"/></b>
|
---|
| 120 | </xsl:otherwise>
|
---|
| 121 | </xsl:choose>
|
---|
[4047] | 122 | </a>
|
---|
[13267] | 123 | </div>
|
---|
| 124 |
|
---|
| 125 | <div class="pageinfo">
|
---|
[8659] | 126 | <xsl:call-template name="top-buttons">
|
---|
| 127 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 128 | <xsl:with-param name="pageType" select="$pageType"/>
|
---|
| 129 | </xsl:call-template>
|
---|
[13267] | 130 | </div>
|
---|
| 131 | </div>
|
---|
| 132 | <div class="bannerextra"></div>
|
---|
[4047] | 133 | </xsl:template>
|
---|
[8659] | 134 |
|
---|
| 135 | <xsl:template name="top-buttons">
|
---|
| 136 | <xsl:param name="collName"/>
|
---|
| 137 | <xsl:param name="pageType"/>
|
---|
[13267] | 138 | <p class="bannerlinks">
|
---|
| 139 | <a class="navlink" href="{$library_name}?a=p&sa=home"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_tip')"/></xsl:attribute>
|
---|
[8659] | 140 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home_b')"/>
|
---|
| 141 | </a>
|
---|
| 142 | <xsl:choose>
|
---|
| 143 | <xsl:when test="$pageType='help'">
|
---|
[13267] | 144 | <a class="navlink_sel"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/></a>
|
---|
[8659] | 145 | </xsl:when>
|
---|
| 146 | <xsl:otherwise>
|
---|
[13267] | 147 | <a class="navlink" href="{$library_name}?a=p&sa=help&c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_tip')"/></xsl:attribute>
|
---|
[8659] | 148 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help_b')"/>
|
---|
| 149 | </a>
|
---|
[13267] | 150 | </xsl:otherwise>
|
---|
[8659] | 151 | </xsl:choose>
|
---|
| 152 | <xsl:choose>
|
---|
| 153 | <xsl:when test="$pageType='pref'">
|
---|
[13267] | 154 | <a class="navlink_sel"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/></a>
|
---|
| 155 | </xsl:when>
|
---|
[8659] | 156 | <xsl:otherwise>
|
---|
[13267] | 157 | <a class="navlink" href="{$library_name}?a=p&sa=pref&c={$collName}"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_tip')"/></xsl:attribute>
|
---|
[8659] | 158 | <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref_b')"/>
|
---|
| 159 | </a>
|
---|
[13267] | 160 |
|
---|
[8659] | 161 | </xsl:otherwise>
|
---|
| 162 | </xsl:choose>
|
---|
[13267] | 163 | </p>
|
---|
[8659] | 164 | </xsl:template>
|
---|
[4047] | 165 |
|
---|
[5119] | 166 | <xsl:template name="navigationBar">
|
---|
| 167 | <xsl:param name="collName"/>
|
---|
| 168 | <xsl:variable name="this-element" select="/page/pageResponse/collection|/page/pageResponse/serviceCluster"/>
|
---|
| 169 | <xsl:variable name="this-service" select="/page/pageResponse/service/@name"/>
|
---|
[8526] | 170 | <xsl:choose>
|
---|
[13267] | 171 | <xsl:when test="$this-element/serviceList/service">
|
---|
| 172 | <div class="navbar">
|
---|
| 173 | <p class="navbar">
|
---|
[8526] | 174 | <xsl:for-each select="$this-element/serviceList/service">
|
---|
| 175 | <xsl:variable name="action"><xsl:choose>
|
---|
| 176 | <xsl:when test="@name=$this-service">CURRENT</xsl:when>
|
---|
| 177 | <xsl:when test="@type='query'">q</xsl:when>
|
---|
| 178 | <xsl:when test="@type='browse'">b</xsl:when>
|
---|
| 179 | <xsl:when test="@type='process'">pr</xsl:when>
|
---|
| 180 | <xsl:when test="@type='applet'">a</xsl:when>
|
---|
| 181 | <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
|
---|
| 182 | </xsl:choose></xsl:variable>
|
---|
| 183 | <xsl:choose>
|
---|
| 184 | <xsl:when test="$action='CURRENT'">
|
---|
[13267] | 185 | <a class="navlink_sel"><xsl:value-of select="displayItem[@name='name']"/></a>
|
---|
[8526] | 186 | </xsl:when>
|
---|
| 187 | <xsl:when test="$action !='DO_NOT_DISPLAY'">
|
---|
[13267] | 188 | <a class="navlink" href="{$library_name}?a={$action}&rt=d&s={@name}&c={$collName}"><xsl:if test="displayItem[@name='description']"><xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute></xsl:if><xsl:value-of select="displayItem[@name='name']"/></a>
|
---|
[8526] | 189 | </xsl:when>
|
---|
| 190 | </xsl:choose>
|
---|
| 191 | </xsl:for-each>
|
---|
[13267] | 192 | </p>
|
---|
| 193 | </div>
|
---|
[7473] | 194 | </xsl:when>
|
---|
| 195 | <xsl:otherwise>
|
---|
[13267] | 196 | <xsl:call-template name="dividerBar">
|
---|
| 197 | <xsl:with-param name="text" select="' '"/>
|
---|
| 198 | </xsl:call-template>
|
---|
[7473] | 199 | </xsl:otherwise>
|
---|
| 200 | </xsl:choose>
|
---|
[4047] | 201 | </xsl:template>
|
---|
| 202 |
|
---|
[5119] | 203 |
|
---|
| 204 | <xsl:template name="dividerBar">
|
---|
[13267] | 205 | <xsl:param name='text'/>
|
---|
| 206 | <xsl:choose>
|
---|
| 207 | <xsl:when test="$text">
|
---|
| 208 | <div class="divbar"><p class="navbar"><xsl:value-of select="$text"/></p></div>
|
---|
| 209 | </xsl:when>
|
---|
| 210 | <xsl:otherwise>
|
---|
| 211 | <div class="divbar"><xsl:text disable-output-escaping="yes">&nbsp;</xsl:text></div>
|
---|
| 212 | </xsl:otherwise>
|
---|
| 213 | </xsl:choose>
|
---|
[4047] | 214 | </xsl:template>
|
---|
| 215 |
|
---|
| 216 | <!-- Display the appropriate image, depending on the node type -->
|
---|
| 217 | <xsl:template match="documentNode" mode="displayNodeIcon">
|
---|
[13267] | 218 |
|
---|
[4253] | 219 | <!-- Root node: book icon (open or closed) -->
|
---|
[5119] | 220 | <xsl:choose>
|
---|
| 221 | <xsl:when test="@nodeType='root'">
|
---|
[5686] | 222 | <xsl:choose>
|
---|
| 223 | <xsl:when test="documentNode">
|
---|
| 224 | <xsl:call-template name="openbookimg">
|
---|
| 225 | <xsl:with-param name="title">Close this book</xsl:with-param>
|
---|
| 226 | </xsl:call-template>
|
---|
| 227 | </xsl:when>
|
---|
| 228 | <xsl:otherwise>
|
---|
| 229 | <xsl:call-template name="closedbookimg">
|
---|
| 230 | <xsl:with-param name="title">Open this document and view contents</xsl:with-param>
|
---|
| 231 | </xsl:call-template>
|
---|
| 232 | </xsl:otherwise>
|
---|
| 233 | </xsl:choose>
|
---|
[5119] | 234 | </xsl:when>
|
---|
[5686] | 235 |
|
---|
[8964] | 236 | <!-- Internal node: folder icon (open or closed) -->
|
---|
| 237 | <xsl:when test="@nodeType='internal'">
|
---|
[5686] | 238 | <xsl:choose>
|
---|
| 239 | <xsl:when test="documentNode">
|
---|
| 240 | <xsl:call-template name="openfolderimg">
|
---|
| 241 | <xsl:with-param name="title">Close this folder</xsl:with-param>
|
---|
| 242 | </xsl:call-template>
|
---|
| 243 | </xsl:when>
|
---|
| 244 | <xsl:otherwise>
|
---|
| 245 | <xsl:call-template name="closedfolderimg">
|
---|
| 246 | <xsl:with-param name="title">Open this folder and view contents</xsl:with-param>
|
---|
| 247 | </xsl:call-template>
|
---|
| 248 | </xsl:otherwise>
|
---|
| 249 | </xsl:choose>
|
---|
| 250 | </xsl:when>
|
---|
| 251 |
|
---|
| 252 | <!-- Leaf node: page icon, and this is the default -->
|
---|
| 253 | <xsl:otherwise>
|
---|
| 254 | <xsl:call-template name="textpageimg">
|
---|
| 255 | <xsl:with-param name="title">View the document</xsl:with-param>
|
---|
| 256 | </xsl:call-template>
|
---|
[5119] | 257 | </xsl:otherwise>
|
---|
| 258 | </xsl:choose>
|
---|
[4712] | 259 | </xsl:template>
|
---|
[4047] | 260 |
|
---|
[5686] | 261 | <xsl:template name="openbookimg">
|
---|
| 262 | <xsl:param name="alt"/>
|
---|
| 263 | <xsl:param name="title"/>
|
---|
[13267] | 264 | <img class="displayicon" border="0" width="28" height="23"
|
---|
[5686] | 265 | src="interfaces/default/images/openbook.gif"
|
---|
| 266 | alt="{$alt}" title="{$title}"/>
|
---|
| 267 | </xsl:template>
|
---|
| 268 |
|
---|
| 269 | <xsl:template name="closedbookimg">
|
---|
| 270 | <xsl:param name="alt"/>
|
---|
| 271 | <xsl:param name="title"/>
|
---|
[13267] | 272 | <img class="displayicon" border="0" width="18" height="11"
|
---|
[5686] | 273 | src="interfaces/default/images/book.gif"
|
---|
| 274 | alt="{$alt}" title="{$title}"/>
|
---|
| 275 | </xsl:template>
|
---|
| 276 |
|
---|
| 277 | <xsl:template name="openfolderimg">
|
---|
| 278 | <xsl:param name="alt"/>
|
---|
| 279 | <xsl:param name="title"/>
|
---|
[13267] | 280 | <img class="displayicon" border="0" width="23" height="15"
|
---|
[5686] | 281 | src="interfaces/default/images/openfldr.gif"
|
---|
| 282 | alt="{$alt}" title="{$title}"/>
|
---|
| 283 | </xsl:template>
|
---|
| 284 |
|
---|
| 285 | <xsl:template name="closedfolderimg">
|
---|
| 286 | <xsl:param name="alt"/>
|
---|
| 287 | <xsl:param name="title"/>
|
---|
[13267] | 288 | <img class="displayicon" border="0" width="23" height="15"
|
---|
[5686] | 289 | src="interfaces/default/images/clsdfldr.gif"
|
---|
| 290 | alt="{$alt}" title="{$title}"/>
|
---|
| 291 | </xsl:template>
|
---|
| 292 |
|
---|
| 293 | <xsl:template name="textpageimg">
|
---|
| 294 | <xsl:param name="alt"/>
|
---|
| 295 | <xsl:param name="title"/>
|
---|
[13267] | 296 | <img class="displayicon" border="0" width="16" height="21"
|
---|
[5686] | 297 | src="interfaces/default/images/itext.gif"
|
---|
| 298 | alt="{$alt}" title="{$title}"/>
|
---|
| 299 | </xsl:template>
|
---|
| 300 |
|
---|
| 301 | <xsl:template name="bookshelfimg">
|
---|
| 302 | <xsl:param name="alt"/>
|
---|
| 303 | <xsl:param name="title"/>
|
---|
[13267] | 304 | <img class="displayicon" border="0" width="20" height="16"
|
---|
[5686] | 305 | src="interfaces/default/images/bshelf.gif"
|
---|
| 306 | alt="{$alt}" title="{$title}"/>
|
---|
| 307 | </xsl:template>
|
---|
[4047] | 308 | </xsl:stylesheet>
|
---|
[5119] | 309 |
|
---|
| 310 |
|
---|