[8637] | 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"
|
---|
[9874] | 6 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
[8637] | 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"/>
|
---|
[13254] | 19 | <body>
|
---|
| 20 | <div id="page">
|
---|
| 21 | <xsl:apply-templates select="pageResponse"/>
|
---|
| 22 | <xsl:call-template name="greenstoneFooter"/>
|
---|
| 23 | </div>
|
---|
| 24 | </body>
|
---|
[8637] | 25 | </html>
|
---|
| 26 | </xsl:template>
|
---|
| 27 |
|
---|
| 28 | <xsl:template name="pageTitle">
|
---|
| 29 | <xsl:variable name="docID" select="/page/pageResponse/document/@selectedNode"/>
|
---|
| 30 | <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>
|
---|
| 31 | </xsl:template>
|
---|
| 32 |
|
---|
| 33 | <!-- this is hard coded for GATE, should somehow do it dynamically-->
|
---|
| 34 | <xsl:template name="pageStyle">
|
---|
| 35 | <style type="text/css">
|
---|
| 36 | <xsl:text disable-output-escaping="yes">
|
---|
| 37 | span.Location { display:inline; color : red }
|
---|
| 38 | span.Person { display:inline; color : green }
|
---|
| 39 | span.Organization { display:inline; color : yellow }
|
---|
| 40 | span.Date { display:inline; color : blue }
|
---|
| 41 | span.query_term {display: inline; background-color : yellow }
|
---|
| 42 | </xsl:text>
|
---|
| 43 | </style>
|
---|
| 44 | </xsl:template>
|
---|
| 45 |
|
---|
| 46 | <xsl:template match="pageResponse">
|
---|
| 47 | <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
|
---|
| 48 | <xsl:call-template name="standardPageBanner">
|
---|
| 49 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 50 | </xsl:call-template>
|
---|
| 51 | <xsl:call-template name="navigationBar">
|
---|
| 52 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 53 | </xsl:call-template>
|
---|
[13254] | 54 | <div class="document">
|
---|
[8637] | 55 | <!-- display the document -->
|
---|
| 56 | <xsl:apply-templates select="document">
|
---|
| 57 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 58 | </xsl:apply-templates>
|
---|
[13254] | 59 | </div>
|
---|
[8637] | 60 | </xsl:template>
|
---|
| 61 |
|
---|
| 62 | <xsl:template match="document">
|
---|
| 63 | <xsl:param name="collName"/>
|
---|
[13254] | 64 |
|
---|
[8637] | 65 | <xsl:call-template name="documentHeading">
|
---|
| 66 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 67 | </xsl:call-template>
|
---|
[13254] | 68 |
|
---|
[8637] | 69 | <xsl:call-template name="documentContent">
|
---|
| 70 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 71 | </xsl:call-template>
|
---|
| 72 | </xsl:template>
|
---|
| 73 |
|
---|
| 74 | <xsl:template name="documentHeading">
|
---|
| 75 | <xsl:param name="collName"/>
|
---|
| 76 | <xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/>
|
---|
| 77 | <xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/>
|
---|
| 78 | <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
|
---|
| 79 | <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
|
---|
| 80 | <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
|
---|
[14379] | 81 | <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>
|
---|
| 82 |
|
---|
| 83 |
|
---|
[13254] | 84 | <div class="heading_image">
|
---|
[14379] | 85 | <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')">
|
---|
[13254] | 86 | <xsl:call-template name="coverImage"/>
|
---|
| 87 | </xsl:if>
|
---|
| 88 | </div>
|
---|
[14379] | 89 |
|
---|
[13254] | 90 | <div class="buttons" id="toc_buttons">
|
---|
| 91 | <xsl:call-template name="documentButtons">
|
---|
| 92 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 93 | </xsl:call-template>
|
---|
| 94 | </div>
|
---|
[8637] | 95 |
|
---|
[13254] | 96 | <!--<div><xsl:call-template name="enrichServices">
|
---|
[8637] | 97 | <xsl:with-param name="collName" select="$collName"/>
|
---|
[13254] | 98 | </xsl:call-template></div>-->
|
---|
| 99 |
|
---|
| 100 | <div class="toc">
|
---|
| 101 | <table class="v_list"><tr valign="top"><td valign="top"> <a href="{$library_name}?a={$p.a}&sa={$p.sa}&s={$p.s}&c={$collName}&rt=r"><xsl:call-template name="openbookimg"><xsl:with-param name="title">Close this book and return to search/browse</xsl:with-param>
|
---|
| 102 | </xsl:call-template></a></td><td valign="top"></td>
|
---|
| 103 | <td valign="top">
|
---|
| 104 | <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>
|
---|
| 105 | </td></tr>
|
---|
| 106 | </table>
|
---|
| 107 | <xsl:if test="string($doTOC) != 'false'">
|
---|
| 108 | <table><tr valign="top"><td><img alt="" src="/gsdl/images/space.gif" width="25"/></td><td><table class="v_list">
|
---|
[8637] | 109 | <xsl:call-template name="TOC">
|
---|
| 110 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 111 | </xsl:call-template>
|
---|
[13254] | 112 | </table>
|
---|
| 113 | </td></tr></table>
|
---|
| 114 | </xsl:if>
|
---|
| 115 | </div>
|
---|
| 116 | </xsl:template>
|
---|
[8637] | 117 |
|
---|
| 118 | <xsl:template name="coverImage">
|
---|
[13984] | 119 | <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>
|
---|
[8637] | 120 | </xsl:template>
|
---|
| 121 |
|
---|
| 122 | <xsl:template name="documentButtons">
|
---|
| 123 | <xsl:param name="collName"/>
|
---|
| 124 | <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
|
---|
| 125 | <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
|
---|
| 126 | <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
|
---|
| 127 | <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/>
|
---|
[13254] | 128 |
|
---|
| 129 |
|
---|
[8637] | 130 | <!-- expand document -->
|
---|
[13254] | 131 | <!-- this doesn't work with MG so comment it out for now -->
|
---|
[8637] | 132 | <xsl:if test="@docType = 'hierarchy' or @docType = 'paged'">
|
---|
[13254] | 133 | <div class="button">
|
---|
| 134 | <span class="button">
|
---|
[8637] | 135 | <xsl:choose><xsl:when test="string($ed)='1'">
|
---|
[13254] | 136 | <a href="{$library_name}?a=d&d={$docID}&c={$collName}&sib={$sib}&ed=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_tip')"/></xsl:attribute>
|
---|
| 137 | <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_doc_b')"/>
|
---|
[8637] | 138 | </a>
|
---|
| 139 | </xsl:when>
|
---|
| 140 | <xsl:otherwise>
|
---|
[13254] | 141 | <a href="{$library_name}?a=d&d={$docID}&c={$collName}&sib={$sib}&ed=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_tip')"/></xsl:attribute>
|
---|
| 142 | <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_doc_b')"/>
|
---|
| 143 | </a>
|
---|
[8637] | 144 | </xsl:otherwise>
|
---|
| 145 | </xsl:choose>
|
---|
[13254] | 146 | </span>
|
---|
| 147 | </div>
|
---|
[8637] | 148 | </xsl:if>
|
---|
| 149 |
|
---|
| 150 | <!-- expand contents -->
|
---|
| 151 | <xsl:if test="@docType = 'hierarchy' and string(/page/pageResponse/format/gsf:option[@name='documentTOC']/@value) != 'false'">
|
---|
[13254] | 152 | <div class="button">
|
---|
| 153 | <span class="button">
|
---|
[8637] | 154 | <xsl:choose><xsl:when test="string($ec)='1'">
|
---|
[13254] | 155 | <a href="{$library_name}?a=d&d={$docID}&c={$collName}&sib={$sib}&ec=0"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_tip')"/></xsl:attribute>
|
---|
| 156 | <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.contract_contents_b')"/>
|
---|
[8637] | 157 | </a>
|
---|
| 158 | </xsl:when>
|
---|
| 159 | <xsl:otherwise>
|
---|
[13254] | 160 | <a href="{$library_name}?a=d&d={$docID}&c={$collName}&sib={$sib}&ec=1"><xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_tip')"/></xsl:attribute>
|
---|
| 161 | <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.expand_contents_b')"/>
|
---|
[8637] | 162 | </a>
|
---|
| 163 | </xsl:otherwise>
|
---|
| 164 | </xsl:choose>
|
---|
[13254] | 165 | </span>
|
---|
| 166 | </div>
|
---|
[8637] | 167 | </xsl:if>
|
---|
| 168 | <!-- detach page -->
|
---|
| 169 | <xsl:variable name="paramList" select="/page/pageRequest/paramList"/>
|
---|
[13254] | 170 | <div class="button">
|
---|
| 171 | <span class="button">
|
---|
| 172 | <a target="_blank"><xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&d=<xsl:value-of select="$docID"/>&c=<xsl:value-of select="$collName"/>&sib=<xsl:value-of select="$sib"/>&dt=<xsl:value-of select="$paramList/param[@name='dt']/@value"/>&ec=<xsl:value-of select="$paramList/param[@name='ec']/@value"/>&et=<xsl:value-of select="$paramList/param[@name='et']/@value"/>&p.a=<xsl:value-of select="$paramList/param[@name='p.a']/@value"/>&p.s=<xsl:value-of select="$paramList/param[@name='p.s']/@value"/>&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>
|
---|
| 173 | <xsl:value-of disable-output-escaping='yes' select="util:getInterfaceText($interface_name, /page/@lang, 'doc.detach_page_b')"/>
|
---|
| 174 | </a>
|
---|
| 175 | </span>
|
---|
| 176 | </div>
|
---|
| 177 | </xsl:template>
|
---|
[8637] | 178 |
|
---|
| 179 | <xsl:template name="TOC">
|
---|
| 180 | <xsl:param name="collName"/>
|
---|
| 181 | <xsl:choose>
|
---|
| 182 | <xsl:when test="@docType='hierarchy'">
|
---|
| 183 | <xsl:call-template name="hierarchicalContents">
|
---|
| 184 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 185 | </xsl:call-template>
|
---|
| 186 | </xsl:when>
|
---|
| 187 | <xsl:when test="@docType='paged'">
|
---|
| 188 | <xsl:call-template name="pagedContents">
|
---|
| 189 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 190 | </xsl:call-template>
|
---|
| 191 | </xsl:when>
|
---|
| 192 | </xsl:choose>
|
---|
| 193 | </xsl:template>
|
---|
| 194 |
|
---|
| 195 | <xsl:template name="hierarchicalContents">
|
---|
| 196 | <xsl:param name="collName"/>
|
---|
| 197 | <xsl:variable name="oc" select="/page/pageRequest/paramList/param[@name='oc']/@value"/>
|
---|
| 198 | <xsl:variable name="d" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
|
---|
| 199 | <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/>
|
---|
| 200 | <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/>
|
---|
[14379] | 201 |
|
---|
| 202 | <!-- added parameters -->
|
---|
| 203 | <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/>
|
---|
| 204 | <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/>
|
---|
| 205 | <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/>
|
---|
| 206 | <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>
|
---|
| 207 |
|
---|
[8637] | 208 | <xsl:if test="documentNode[@nodeID]">
|
---|
| 209 | <tr valign='top'><td>
|
---|
| 210 | <xsl:choose><xsl:when test="string($oc)='0'">
|
---|
| 211 | <a href="{$library_name}?a=d&c={$collName}&d={$d}&sib={$sib}&oc=1"><xsl:call-template name="closedfolderimg"><xsl:with-param name="title">open the table of contents</xsl:with-param></xsl:call-template></a>
|
---|
| 212 | </xsl:when>
|
---|
| 213 | <xsl:otherwise><a href="{$library_name}?a=d&c={$collName}&d={$d}&sib={$sib}&oc=0"><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>
|
---|
| 214 | </td><td>Table of Contents</td></tr>
|
---|
| 215 | <xsl:if test="string($oc)!='0'">
|
---|
| 216 | <tr><td> </td><td>
|
---|
| 217 | <table>
|
---|
| 218 | <xsl:for-each select="documentNode/documentNode[@nodeID]">
|
---|
[14379] | 219 | <xsl:apply-templates select='.'>
|
---|
| 220 | <xsl:with-param name="collName" select="$collName"/><xsl:with-param name="ec" select="$ec"/>
|
---|
| 221 |
|
---|
| 222 | <!-- added parameters -->
|
---|
| 223 | <xsl:with-param name="p.a" select="$p.a"/>
|
---|
| 224 | <xsl:with-param name="p.s" select="$p.s"/>
|
---|
| 225 | <xsl:with-param name="p.sa" select="$p.sa"/>
|
---|
| 226 | <xsl:with-param name="p.c" select="$p.c"/>
|
---|
| 227 |
|
---|
| 228 | </xsl:apply-templates>
|
---|
[8637] | 229 | </xsl:for-each>
|
---|
| 230 | </table>
|
---|
| 231 | </td></tr>
|
---|
| 232 | </xsl:if>
|
---|
| 233 | </xsl:if>
|
---|
| 234 | </xsl:template>
|
---|
| 235 |
|
---|
| 236 | <!-- each icon-title pair is a row in a table. children go in a table in another row -->
|
---|
| 237 | <xsl:template match="documentNode">
|
---|
| 238 | <xsl:param name="collName"/>
|
---|
| 239 | <xsl:param name="ec"/>
|
---|
[14379] | 240 |
|
---|
| 241 | <!-- added these parameters to be carried when changing in toc -->
|
---|
| 242 | <xsl:param name="p.a"/>
|
---|
| 243 | <xsl:param name="p.s"/>
|
---|
| 244 | <xsl:param name="p.sa"/>
|
---|
| 245 | <xsl:param name="p.c"/>
|
---|
[8637] | 246 | <!-- Display the appropriate image, depending on the node type -->
|
---|
[14379] | 247 |
|
---|
[8637] | 248 | <tr><td valign="top">
|
---|
[14379] | 249 | <!--
|
---|
[8637] | 250 | <a><xsl:attribute name="href"><xsl:value-of select='$library_name'/>?a=d&c=<xsl:value-of select='$collName'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&sib=1</xsl:if><xsl:if test="string($ec) = '1'">&ec=1</xsl:if></xsl:attribute>
|
---|
[14379] | 251 | -->
|
---|
| 252 |
|
---|
| 253 | <a><xsl:attribute name="href"><xsl:value-of select='$library_name'/>?a=d&c=<xsl:value-of select='$collName'/>&d=<xsl:value-of select='@nodeID'/><xsl:if test="documentNode">.pr</xsl:if>&sib=1<xsl:if test="string($ec) = '1'">&ec=1</xsl:if>&p.a=<xsl:value-of select="$p.a"/>&p.sa=<xsl:value-of select="$p.sa"/>&p.s=<xsl:value-of select="$p.s"/>&p.c=<xsl:value-of select="$p.c"/></xsl:attribute>
|
---|
| 254 |
|
---|
[8637] | 255 | <xsl:apply-templates select="." mode="displayNodeIcon"/>
|
---|
| 256 | </a>
|
---|
| 257 | </td>
|
---|
| 258 |
|
---|
| 259 | <!-- Display associated title, bolded if the node has content -->
|
---|
| 260 | <td valign="top">
|
---|
| 261 | <xsl:choose>
|
---|
| 262 | <xsl:when test="nodeContent">
|
---|
| 263 | <b><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></b>
|
---|
| 264 | </xsl:when>
|
---|
| 265 | <xsl:otherwise>
|
---|
| 266 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
|
---|
| 267 | </xsl:otherwise>
|
---|
| 268 | </xsl:choose>
|
---|
| 269 | </td>
|
---|
| 270 | </tr>
|
---|
| 271 | <!-- Apply recursively to the children of this node -->
|
---|
| 272 | <xsl:if test="documentNode[@nodeID]">
|
---|
| 273 | <tr><td> </td><td><table>
|
---|
| 274 | <xsl:apply-templates select="documentNode[@nodeID]">
|
---|
| 275 | <xsl:with-param name="collName" select="$collName"/>
|
---|
| 276 | <xsl:with-param name="ec" select="$ec"/>
|
---|
[14379] | 277 |
|
---|
| 278 | <!-- added parameters -->
|
---|
| 279 | <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"/>
|
---|
[8637] | 280 | <!--<xsl:with-param name="depth" select="$depth + 1"/>-->
|
---|
| 281 | </xsl:apply-templates>
|
---|
| 282 | </table>
|
---|
| 283 | </td></tr>
|
---|
| 284 | </xsl:if>
|
---|
| 285 | </xsl:template>
|
---|
| 286 |
|
---|
| 287 | <!-- default content is to print the title and content of any documentNodes that have nodeContent -->
|
---|
| 288 | <xsl:template name="documentContent">
|
---|
[13254] | 289 | <div class="documenttext">
|
---|
[8637] | 290 | <xsl:choose>
|
---|
| 291 | <xsl:when test="@docType='simple'">
|
---|
| 292 | <xsl:apply-templates select="nodeContent"/>
|
---|
| 293 | </xsl:when>
|
---|
| 294 | <xsl:otherwise>
|
---|
| 295 | <xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/>
|
---|
| 296 | </xsl:otherwise>
|
---|
| 297 | </xsl:choose>
|
---|
| 298 | </div>
|
---|
| 299 | </xsl:template>
|
---|
| 300 |
|
---|
| 301 | <xsl:template match="documentNode" mode="content">
|
---|
| 302 | <xsl:if test="nodeContent and string(nodeContent)">
|
---|
| 303 | <xsl:if test="metadataList/metadata[@name='Title']">
|
---|
| 304 | <h3><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></h3>
|
---|
| 305 | </xsl:if>
|
---|
| 306 | <xsl:apply-templates select="nodeContent"/>
|
---|
| 307 | </xsl:if>
|
---|
| 308 |
|
---|
| 309 | </xsl:template>
|
---|
| 310 |
|
---|
| 311 | <!-- the actual text/content -->
|
---|
| 312 | <xsl:template match="nodeContent">
|
---|
| 313 | <p/>
|
---|
| 314 | <xsl:for-each select="node()">
|
---|
| 315 | <xsl:choose>
|
---|
| 316 | <xsl:when test="not(name())"><xsl:value-of select="." disable-output-escaping="yes"/></xsl:when>
|
---|
| 317 | <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise>
|
---|
| 318 | </xsl:choose>
|
---|
| 319 | </xsl:for-each>
|
---|
| 320 | </xsl:template>
|
---|
| 321 |
|
---|
| 322 | <!-- match any file nodes -->
|
---|
| 323 | <xsl:template match="file">
|
---|
| 324 | <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
|
---|
| 325 | <xsl:choose>
|
---|
| 326 | <xsl:when test="util:isImage(@mimeType)">
|
---|
| 327 | <img src="{$httpPath}/{@href}"/>
|
---|
| 328 | </xsl:when>
|
---|
| 329 | <xsl:otherwise>
|
---|
| 330 | <a href="{$httpPath}/{@href}"><xsl:value-of select="@href"/></a>
|
---|
| 331 | </xsl:otherwise>
|
---|
| 332 | </xsl:choose>
|
---|
| 333 | </xsl:template>
|
---|
| 334 |
|
---|
| 335 | <!-- match any link nodes -->
|
---|
| 336 | <xsl:template match="link">
|
---|
| 337 | <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
|
---|
| 338 | <xsl:variable name="actionargs">
|
---|
| 339 | <xsl:choose>
|
---|
| 340 | <xsl:when test="@type='document'">a=d</xsl:when>
|
---|
| 341 | <xsl:when test="@type='query'">a=q&s=<xsl:value-of select="@service"/>&rt=r</xsl:when>
|
---|
| 342 | <xsl:otherwise>
|
---|
| 343 | p
|
---|
| 344 | </xsl:otherwise>
|
---|
| 345 | </xsl:choose>
|
---|
| 346 | </xsl:variable>
|
---|
| 347 | <xsl:variable name="serviceargs">
|
---|
| 348 | <xsl:for-each select="param">&s1.<xsl:value-of select="@name"/>=<xsl:value-of select="@value"/></xsl:for-each>
|
---|
| 349 | </xsl:variable>
|
---|
| 350 | <a href="{$library_name}?{$actionargs}&c={$collName}{$serviceargs}"><xsl:value-of disable-output-escaping="yes" select="."/></a>
|
---|
| 351 | </xsl:template>
|
---|
| 352 |
|
---|
| 353 | <!-- match any annotations and make them span elements -->
|
---|
| 354 | <xsl:template match="annotation">
|
---|
| 355 | <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span>
|
---|
| 356 | </xsl:template>
|
---|
| 357 |
|
---|
| 358 | <!-- paged naviagtion : INCOMPLETE!!-->
|
---|
| 359 | <xsl:template name="pagedContents">
|
---|
| 360 | <xsl:param name="collName"/>
|
---|
| 361 | <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/>
|
---|
| 362 | <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/>
|
---|
| 363 | <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/>
|
---|
| 364 | <xsl:choose>
|
---|
| 365 | <xsl:when test="$pos=-1"><!-- a doc -->
|
---|
| 366 | <tr valign="top">
|
---|
| 367 | <td align="left">
|
---|
| 368 | </td>
|
---|
| 369 | <td align="center"><center>
|
---|
| 370 | <b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.pages', $children)"/></b>
|
---|
| 371 | </center></td>
|
---|
| 372 | <td align="right">
|
---|
| 373 | <a href="{$library_name}?a=d&c={$collName}&d={@selectedNode}.fc"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
|
---|
| 374 | </td>
|
---|
| 375 | </tr>
|
---|
| 376 | </xsl:when>
|
---|
| 377 |
|
---|
| 378 | <xsl:otherwise> <!-- an internal node -->
|
---|
| 379 | <tr valign="top">
|
---|
| 380 | <td align="left">
|
---|
| 381 | <xsl:if test=" not ( $pos = 1 )">
|
---|
| 382 | <a href="{$library_name}?a=d&c={$collName}&d={@selectedNode}.ps"><img src="interfaces/default/images/less.gif" border="0" align="absbottom" /></a>
|
---|
| 383 | </xsl:if>
|
---|
| 384 | </td>
|
---|
| 385 | <td align="center"><center>
|
---|
| 386 | <b><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.pageof', concat($pos, ';', $length))"/></b>
|
---|
| 387 | </center></td>
|
---|
| 388 | <td align="right">
|
---|
| 389 | <xsl:if test=" not($pos = $length)">
|
---|
| 390 | <a href="{$library_name}?a=d&c={$collName}&d={@selectedNode}.ns"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a>
|
---|
| 391 | </xsl:if>
|
---|
| 392 | </td>
|
---|
| 393 | </tr>
|
---|
| 394 | </xsl:otherwise>
|
---|
| 395 | </xsl:choose>
|
---|
| 396 | <tr valign="middle">
|
---|
| 397 | <td align='center' valign='top' colspan='3'>
|
---|
| 398 | <form name="GotoForm" method="get" action="{$library_name}">
|
---|
| 399 | <input type='hidden' name='a' value='d'/>
|
---|
| 400 | <input type='hidden' name='c' value='{$collName}'/>
|
---|
| 401 | <input type='hidden' name='d' value='{@selectedNode}'/>
|
---|
| 402 | <input type="text" name="gp" size="3" maxlength="4"/>
|
---|
| 403 | <input type="submit"><xsl:attribute name='value'><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'document.gotopage')"/></xsl:attribute></input>
|
---|
| 404 | </form>
|
---|
| 405 | </td>
|
---|
| 406 | </tr>
|
---|
[13254] | 407 | </xsl:template>
|
---|
[8637] | 408 |
|
---|
| 409 | <xsl:template name="enrichServices">
|
---|
| 410 | <xsl:param name="collName"/>
|
---|
| 411 | <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
|
---|
| 412 | <xsl:variable name="request-params" select="/page/pageRequest/paramList"/>
|
---|
| 413 | <xsl:for-each select="../serviceList/service">
|
---|
| 414 | <table border='1' cellspacing='0'>
|
---|
| 415 | <tr><td>
|
---|
| 416 | <p /><xsl:value-of select="displayItem[@name='name']"/><p/>
|
---|
| 417 | <form name="EnrichForm" method="get" action="{$library_name}">
|
---|
| 418 | <xsl:apply-templates select="paramList"/>
|
---|
| 419 | <input type='hidden' name='a' value='d'/>
|
---|
| 420 | <input type='hidden' name='d' value='{$docID}'/>
|
---|
| 421 | <input type='hidden' name='c' value='{$collName}'/>
|
---|
| 422 | <xsl:if test='$request-params/param[@name="sib"]'>
|
---|
| 423 | <input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
|
---|
| 424 | <input type='hidden' name='s' value='{@name}'/>
|
---|
| 425 | <input type='hidden' name='p.a'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.a"]'/></xsl:attribute></input>
|
---|
| 426 | <input type='hidden' name='p.sa'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.sa"]'/></xsl:attribute></input>
|
---|
| 427 | <input type='hidden' name='p.s'><xsl:attribute name='value'><xsl:value-of select='$request-params/param[@name="p.s"]'/></xsl:attribute></input>
|
---|
| 428 | <input type='hidden' name='end' value='1'/>
|
---|
| 429 | <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input>
|
---|
| 430 | </form>
|
---|
| 431 | </td></tr>
|
---|
| 432 | </table>
|
---|
| 433 | </xsl:for-each>
|
---|
| 434 | </xsl:template>
|
---|
| 435 |
|
---|
| 436 | <xsl:template match="paramList" mode="hidden">
|
---|
| 437 | <xsl:for-each select="param">
|
---|
| 438 | <input type='hidden' name='{@name}' value='{@value}'/><xsl:text>
|
---|
| 439 | </xsl:text>
|
---|
| 440 | </xsl:for-each>
|
---|
| 441 | </xsl:template>
|
---|
| 442 |
|
---|
| 443 | </xsl:stylesheet>
|
---|
| 444 |
|
---|
| 445 |
|
---|
| 446 |
|
---|
| 447 |
|
---|