- Timestamp:
- 2011-05-10T14:33:12+12:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/document.xsl
r23779 r24009 1 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 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:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" 6 extension-element-prefixes="java" 7 exclude-result-prefixes="java gsf"> 8 9 <!-- style includes global params interface_name, library_name --> 10 <xsl:include href="style.xsl"/> 11 <xsl:include href="service-params.xsl"/> 12 <xsl:include href="berrytools.xsl"/> 13 14 <xsl:output method="html"/> 15 16 <!-- the main page layout template is here --> 17 <xsl:template match="page"> 18 <xsl:variable name="bookswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:variable> 19 <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/></xsl:variable> 20 21 <xsl:choose> 22 <xsl:when test="$bookswitch = 'flashxml' and $a = 'd'"> 23 <html> 24 <xsl:call-template name="response" /> 25 </html> 26 </xsl:when> 27 28 <xsl:otherwise> 29 <html> 30 <head> 31 <title> 32 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title--> 33 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text> 34 </title> 35 <xsl:call-template name="globalStyle"/> 36 <xsl:call-template name="pageStyle"/> 37 </head> 38 <body> 39 <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute> 40 <div id="page-wrapper"> 41 <xsl:call-template name="response" /> 42 <xsl:call-template name="greenstoneFooter"/> 43 </div> 44 </body> 45 </html> 46 </xsl:otherwise> 47 </xsl:choose> 48 </xsl:template> 49 50 51 <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable> 52 <xsl:variable name="bookswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:variable> 53 54 <xsl:template name="pageTitle"> 55 <xsl:variable name="docID" select="/page/pageResponse/document/@selectedNode"/> 56 <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> 57 </xsl:template> 58 59 <!-- this is hard coded for GATE, should somehow do it dynamically--> 60 <xsl:template name="pageStyle"> 61 <style type="text/css"> 62 <xsl:text disable-output-escaping="yes"> 63 span.Location { display:inline; color : red } 64 span.Person { display:inline; color : green } 65 span.Organization { display:inline; color : yellow } 66 span.Date { display:inline; color : blue } 67 span.query_term {display: inline; background-color : yellow } 68 </xsl:text> 69 </style> 70 71 <!--TODO: add berry basket switch--> 72 <!--<xsl:if test="$berryBaskets = 'true'">--> 73 <xsl:if test="$berrybasketswitch = 'on'"> 74 <xsl:call-template name="berryStyleSheet"/> 75 <xsl:call-template name="js-library"/> 76 </xsl:if> 77 </xsl:template> 78 79 <xsl:template match="pageResponse"> 80 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable> 81 <xsl:choose> 82 <xsl:when test="$bookswitch = 'on' or $bookswitch = 'off'"> 83 <xsl:call-template name="standardPageBanner"> 84 <xsl:with-param name="collName" select="$collName"/> 85 </xsl:call-template> 86 <xsl:call-template name="navigationBar"> 87 <xsl:with-param name="collName" select="$collName"/> 88 </xsl:call-template> 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4 xmlns:java="http://xml.apache.org/xslt/java" 5 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" 6 extension-element-prefixes="java" 7 exclude-result-prefixes="java gsf"> 89 8 90 <!--<xsl:if test="$berryBaskets = 'true'">--> 91 <xsl:if test="$berrybasketswitch = 'on'"> 92 <xsl:call-template name="documentBerryBasket"> 93 <xsl:with-param name="collName" select="$collName"/> 94 <xsl:with-param name="selectedNode" select="/page/pageResponse/document/@selectedNode"/> 95 <xsl:with-param name="rootNode" select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/> 96 <xsl:with-param name="docType" select="/page/pageResponse/document/@docType"/> 97 </xsl:call-template> 98 </xsl:if> 99 </xsl:when> 100 </xsl:choose> 101 102 <!-- display the document --> 103 <xsl:if test="$bookswitch != 'flashxml'"> 104 <xsl:text disable-output-escaping="yes"><div id="content"></xsl:text> 105 </xsl:if> 106 <xsl:apply-templates select="document"> 107 <xsl:with-param name="collName" select="$collName"/> 108 </xsl:apply-templates> 109 <xsl:if test="$bookswitch != 'flashxml'"> 110 <xsl:text disable-output-escaping="yes"></div></xsl:text> 111 </xsl:if> 112 </xsl:template> 113 114 <xsl:template match="document"> 115 <xsl:param name="collName"/> 116 <xsl:variable name="external"><xsl:value-of select="/page/pageResponse/document/@external"/></xsl:variable> 117 <xsl:choose> 118 <xsl:when test="$external != ''"> 119 <xsl:call-template name="externalPage"> 120 <xsl:with-param name="external" select="$external"/> 121 </xsl:call-template> 122 </xsl:when> 123 <xsl:otherwise> 124 <xsl:choose> 125 <xsl:when test="$bookswitch = 'flashxml'"> 126 <xsl:call-template name="xmldocumentContentPeeling"> 127 <xsl:with-param name="collName" select="$collName"/> 128 </xsl:call-template> 129 </xsl:when> 9 <!-- style includes global params interface_name, library_name --> 10 <xsl:include href="style.xsl"/> 11 <xsl:include href="service-params.xsl"/> 12 <xsl:include href="berrytools.xsl"/> 13 14 <xsl:output method="html"/> 15 16 <!-- the main page layout template is here --> 17 <xsl:template match="page"> 18 <xsl:variable name="bookswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:variable> 19 <xsl:variable name="a"><xsl:value-of select="/page/pageRequest/paramList/param[@name='a']/@value"/></xsl:variable> 20 21 <xsl:choose> 22 <xsl:when test="$bookswitch = 'flashxml' and $a = 'd'"> 23 <html> 24 <xsl:call-template name="response" /> 25 </html> 26 </xsl:when> 27 <xsl:otherwise> 28 <html> 29 <head> 30 <title> 31 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title--> 32 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text> 33 </title> 34 <xsl:call-template name="globalStyle"/> 35 <xsl:call-template name="pageStyle"/> 36 </head> 37 <body> 38 <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute> 39 <div id="page-wrapper"> 40 <xsl:call-template name="response" /> 41 <xsl:call-template name="greenstoneFooter"/> 42 </div> 43 </body> 44 </html> 45 </xsl:otherwise> 46 </xsl:choose> 47 </xsl:template> 48 49 50 <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable> 51 <xsl:variable name="bookswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='book']/@value"/></xsl:variable> 52 53 <xsl:template name="pageTitle"> 54 <xsl:variable name="docID" select="/page/pageResponse/document/@selectedNode"/> 55 <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> 56 </xsl:template> 57 58 <!-- this is hard coded for GATE, should somehow do it dynamically--> 59 <xsl:template name="pageStyle"> 60 <style type="text/css"> 61 <xsl:text disable-output-escaping="yes"> 62 span.Location { display:inline; color : red } 63 span.Person { display:inline; color : green } 64 span.Organization { display:inline; color : yellow } 65 span.Date { display:inline; color : blue } 66 span.query_term {display: inline; background-color : yellow } 67 </xsl:text> 68 </style> 69 70 <xsl:if test="$berrybasketswitch = 'on'"> 71 <xsl:call-template name="berryStyleSheet"/> 72 <xsl:call-template name="js-library"/> 73 </xsl:if> 74 </xsl:template> 75 76 <xsl:template match="pageResponse"> 77 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable> 78 <xsl:choose> 79 <xsl:when test="$bookswitch = 'on' or $bookswitch = 'off'"> 80 <xsl:call-template name="standardPageBanner"> 81 <xsl:with-param name="collName" select="$collName"/> 82 </xsl:call-template> 83 <xsl:call-template name="navigationBar"> 84 <xsl:with-param name="collName" select="$collName"/> 85 </xsl:call-template> 130 86 131 <xsl:when test="$bookswitch = 'on'"> 132 <xsl:call-template name="documentHeading"> 133 <xsl:with-param name="collName" select="$collName"/> 134 </xsl:call-template> 135 <div id="bookdiv"></div> 136 <script type="text/javascript"> 137 <xsl:text disable-output-escaping="yes"> 138 var doc_url = document.URL; 139 doc_url = doc_url.replace(/(&amp;|\?)book=[a-z]+/gi,''); 140 doc_url += '&amp;book=flashxml'; 141 142 var flash_plug_html = "" 143 flash_plug_html += '&lt;OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n'; 144 flash_plug_html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \n'; 145 flash_plug_html += ' height="100%" id="Book" swLiveConnect="true" \n'; 146 flash_plug_html += ' width="100%"&gt;\n'; 147 flash_plug_html += ' &lt;PARAM name="allowScriptAccess" value="always" /&gt;\n'; 148 flash_plug_html += ' &lt;PARAM name="movie" value="Book.swf'; 149 flash_plug_html += '?src_image=' + escape(img_cover); 150 flash_plug_html += '&amp;doc_url=' + escape(doc_url) 151 flash_plug_html += '" /&gt;\n'; 152 flash_plug_html += ' &lt;PARAM name="quality" value="high" /&gt;\n'; 153 flash_plug_html += ' &lt;PARAM name="bgcolor" value="#FFFFFF" /&gt;\n'; 154 flash_plug_html += ' &lt;EMBED align="middle" \n'; 155 flash_plug_html += ' allowScriptAccess="always" swLiveConnect="true" \n'; 156 flash_plug_html += ' bgcolor="#FFFFFF" height="100%" name="Book" \n'; 157 flash_plug_html += ' pluginspage="http://www.macromedia.com/go/getflashplayer" \n'; 158 flash_plug_html += ' quality="high" \n'; 159 flash_plug_html += ' src="Book.swf'; 160 flash_plug_html += '?src_image=' + escape(img_cover); 161 flash_plug_html += '&amp;doc_url=' + escape(doc_url); 162 flash_plug_html += '"\n'; 163 flash_plug_html += ' type="application/x-shockwave-flash" width="100%" /&gt;\n'; 164 flash_plug_html += '&lt;/OBJECT&gt;\n'; 165 var flash_div = document.getElementById("bookdiv"); 166 flash_div.innerHTML = flash_plug_html; 167 </xsl:text> 168 </script> 169 </xsl:when> 170 <xsl:otherwise> 171 <xsl:call-template name="documentHeading"> 172 <xsl:with-param name="collName" select="$collName"/> 173 </xsl:call-template> 174 175 <xsl:call-template name="documentArrows"> 176 <xsl:with-param name="collName" select="$collName"/> 177 </xsl:call-template> 178 <xsl:call-template name="documentContent"> 179 <xsl:with-param name="collName" select="$collName"/> 180 </xsl:call-template> 181 <xsl:call-template name="documentArrows"> 182 <xsl:with-param name="collName" select="$collName"/> 183 </xsl:call-template> 184 </xsl:otherwise> 185 </xsl:choose> 87 <xsl:if test="$berrybasketswitch = 'on'"> 88 <xsl:call-template name="documentBerryBasket"> 89 <xsl:with-param name="collName" select="$collName"/> 90 <xsl:with-param name="selectedNode" select="/page/pageResponse/document/@selectedNode"/> 91 <xsl:with-param name="rootNode" select="/page/pageResponse/document/documentNode[@nodeType='root']/@nodeID"/> 92 <xsl:with-param name="docType" select="/page/pageResponse/document/@docType"/> 93 </xsl:call-template> 94 </xsl:if> 95 </xsl:when> 96 </xsl:choose> 97 98 <!-- display the document --> 99 <xsl:if test="$bookswitch != 'flashxml'"> 100 <xsl:text disable-output-escaping="yes"><div id="content"></xsl:text> 101 </xsl:if> 102 <xsl:apply-templates select="document"> 103 <xsl:with-param name="collName" select="$collName"/> 104 </xsl:apply-templates> 105 <xsl:if test="$bookswitch != 'flashxml'"> 106 <xsl:text disable-output-escaping="yes"></div></xsl:text> 107 </xsl:if> 108 </xsl:template> 109 110 <xsl:template match="document"> 111 <xsl:param name="collName"/> 112 <xsl:variable name="external"><xsl:value-of select="/page/pageResponse/document/@external"/></xsl:variable> 113 <xsl:choose> 114 <xsl:when test="$external != ''"> 115 <xsl:call-template name="externalPage"> 116 <xsl:with-param name="external" select="$external"/> 117 </xsl:call-template> 118 </xsl:when> 119 <xsl:otherwise> 120 <xsl:choose> 121 <xsl:when test="$bookswitch = 'flashxml'"> 122 <xsl:call-template name="xmldocumentContentPeeling"> 123 <xsl:with-param name="collName" select="$collName"/> 124 </xsl:call-template> 125 </xsl:when> 126 <xsl:when test="$bookswitch = 'on'"> 127 <xsl:call-template name="documentHeading"> 128 <xsl:with-param name="collName" select="$collName"/> 129 </xsl:call-template> 130 <div id="bookdiv"></div> 131 <script type="text/javascript"> 132 <xsl:text disable-output-escaping="yes"> 133 var doc_url = document.URL; 134 doc_url = doc_url.replace(/(&amp;|\?)book=[a-z]+/gi,''); 135 doc_url += '&amp;book=flashxml'; 136 137 var flash_plug_html = "" 138 flash_plug_html += '&lt;OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \n'; 139 flash_plug_html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \n'; 140 flash_plug_html += ' height="100%" id="Book" swLiveConnect="true" \n'; 141 flash_plug_html += ' width="100%"&gt;\n'; 142 flash_plug_html += ' &lt;PARAM name="allowScriptAccess" value="always" /&gt;\n'; 143 flash_plug_html += ' &lt;PARAM name="movie" value="Book.swf'; 144 flash_plug_html += '?src_image=' + escape(img_cover); 145 flash_plug_html += '&amp;doc_url=' + escape(doc_url) 146 flash_plug_html += '" /&gt;\n'; 147 flash_plug_html += ' &lt;PARAM name="quality" value="high" /&gt;\n'; 148 flash_plug_html += ' &lt;PARAM name="bgcolor" value="#FFFFFF" /&gt;\n'; 149 flash_plug_html += ' &lt;EMBED align="middle" \n'; 150 flash_plug_html += ' allowScriptAccess="always" swLiveConnect="true" \n'; 151 flash_plug_html += ' bgcolor="#FFFFFF" height="100%" name="Book" \n'; 152 flash_plug_html += ' pluginspage="http://www.macromedia.com/go/getflashplayer" \n'; 153 flash_plug_html += ' quality="high" \n'; 154 flash_plug_html += ' src="Book.swf'; 155 flash_plug_html += '?src_image=' + escape(img_cover); 156 flash_plug_html += '&amp;doc_url=' + escape(doc_url); 157 flash_plug_html += '"\n'; 158 flash_plug_html += ' type="application/x-shockwave-flash" width="100%" /&gt;\n'; 159 flash_plug_html += '&lt;/OBJECT&gt;\n'; 160 var flash_div = document.getElementById("bookdiv"); 161 flash_div.innerHTML = flash_plug_html; 162 </xsl:text> 163 </script> 164 </xsl:when> 165 <xsl:otherwise> 166 <xsl:call-template name="documentHeading"> 167 <xsl:with-param name="collName" select="$collName"/> 168 </xsl:call-template> 169 NOT CLIENT!!! 170 <xsl:call-template name="documentArrows"> 171 <xsl:with-param name="collName" select="$collName"/> 172 </xsl:call-template> 173 <xsl:call-template name="documentContent"> 174 <xsl:with-param name="collName" select="$collName"/> 175 </xsl:call-template> 176 <xsl:call-template name="documentArrows"> 177 <xsl:with-param name="collName" select="$collName"/> 178 </xsl:call-template> 179 </xsl:otherwise> 180 </xsl:choose> 181 </xsl:otherwise> 182 </xsl:choose> 183 </xsl:template> 184 185 <xsl:template name="documentHeading"> 186 <xsl:param name="collName"/> 187 <xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/> 188 <xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/> 189 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/> 190 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/> 191 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/> 192 <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> 193 <div id="documentheading"> 194 <a href="{$library_name}?a={$p.a}&amp;sa={$p.sa}&amp;s={$p.s}&amp;c={$p.c}&amp;rt=rd"> 195 <xsl:call-template name="openbookimg"> 196 <xsl:with-param name="title"><xsl:value-of select="'close_book'"/></xsl:with-param> 197 </xsl:call-template> 198 </a> 199 <xsl:choose> 200 <xsl:when test="@docType='simple'"> 201 <xsl:value-of select="metadataList/metadata[@name='Title']" disable-output-escaping="yes"/> 202 </xsl:when> 203 <xsl:otherwise> 204 <xsl:value-of select="documentNode/metadataList/metadata[@name='Title']" disable-output-escaping="yes"/> 205 </xsl:otherwise> 206 </xsl:choose> 207 </div> 208 209 <div id="docheadwrapper"> 210 <div id="documentinfo"> 186 211 187 </xsl:otherwise> 188 </xsl:choose> 189 </xsl:template> 190 191 <xsl:template name="documentHeading"> 192 <xsl:param name="collName"/> 193 <xsl:variable name="doCoverImage" select="/page/pageResponse/format/gsf:option[@name='coverImages']/@value"/> 194 <xsl:variable name="doTOC" select="/page/pageResponse/format/gsf:option[@name='documentTOC']/@value"/> 195 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/> 196 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/> 197 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/> 198 <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> 199 <div id="documentheading"> 200 <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="'close_book'"/></xsl:with-param> 201 </xsl:call-template></a> 202 <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> 203 </div> 204 205 <div id="docheadwrapper"> 206 <div id="documentinfo"> 207 208 <xsl:choose> 209 <xsl:when test="$bookswitch = 'on'"> 210 <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')"> 211 <div id="headingimage"> 212 <xsl:call-template name="coverImage"/> 213 </div> 214 </xsl:if> 215 </xsl:when> 216 <xsl:otherwise> 217 <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')"> 218 <div id="headingimage"> 219 <xsl:call-template name="coverImage"/> 220 </div> 221 </xsl:if> 212 <xsl:choose> 213 <xsl:when test="$bookswitch = 'on'"> 214 <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')"> 215 <div id="headingimage"> 216 <xsl:call-template name="coverImage"/> 217 </div> 218 </xsl:if> 219 </xsl:when> 220 <xsl:otherwise> 221 <xsl:if test="string($doCoverImage) != 'false' and (@docType='paged' or @docType='hierarchy')"> 222 <div id="headingimage"> 223 <xsl:call-template name="coverImage"/> 224 </div> 225 </xsl:if> 222 226 223 224 225 <xsl:with-param name="collName" select="$collName"/>226 227 228 229 </xsl:choose>230 231 232 233 234 235 <xsl:if test="string($doTOC) != 'false'">236 237 238 239 240 241 </xsl:if>242 243 244 245 246 247 248 249 <script type="text/javascript">250 251 </script>252 253 254 <img><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>255 256 257 258 259 260 261 262 263 264 227 <ul id="docbuttons" > 228 <xsl:call-template name="documentButtons"> 229 <xsl:with-param name="collName" select="$collName"/> 230 </xsl:call-template> 231 </ul> 232 </xsl:otherwise> 233 </xsl:choose> 234 </div> 235 <!--<div><xsl:call-template name="enrichServices"> 236 <xsl:with-param name="collName" select="$collName"/> 237 </xsl:call-template></div>--> 238 <xsl:if test="$bookswitch = 'off'"> 239 <xsl:if test="string($doTOC) != 'false'"> 240 <div id="toc"> 241 <xsl:call-template name="TOC"> 242 <xsl:with-param name="collName" select="$collName"/> 243 </xsl:call-template> 244 </div> 245 </xsl:if> 246 </xsl:if> 247 </div> 248 </xsl:template> 249 250 <xsl:template name="coverImage"> 251 <xsl:choose> 252 <xsl:when test="$bookswitch = 'on'"> 253 <script type="text/javascript"> 254 <xsl:text disable-output-escaping="yes">var img_cover = '</xsl:text><xsl:value-of select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg<xsl:text disable-output-escaping="yes">';</xsl:text> 255 </script> 256 </xsl:when> 257 <xsl:otherwise> 258 <img><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> 259 </xsl:otherwise> 260 </xsl:choose> 261 </xsl:template> 262 263 <xsl:template name="documentButtons"> 264 <xsl:param name="collName"/> 265 <xsl:variable name="docID" 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 <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/> 265 269 266 270 267 <!-- expand document --> 268 <xsl:if test="@docType = 'hierarchy' or @docType = 'paged'"> 269 <li> 270 <xsl:choose><xsl:when test="string($ed)='1'"> 271 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=0" class="getTextFor doc.contract_doc_b this.title.doc.contract_doc_tip"></a> 272 </xsl:when> 273 <xsl:otherwise> 274 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=1" class="getTextFor doc.expand_doc_b this.title.doc.expand_doc_tip"></a> 275 </xsl:otherwise> 276 </xsl:choose> 277 </li> 278 </xsl:if> 271 <!-- expand document --> 272 <xsl:if test="@docType = 'hierarchy' or @docType = 'paged'"> 273 <li> 274 <xsl:choose> 275 <xsl:when test="string($ed)='1'"> 276 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=0" class="getTextFor doc.contract_doc_b this.title.doc.contract_doc_tip"></a> 277 </xsl:when> 278 <xsl:otherwise> 279 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ed=1" class="getTextFor doc.expand_doc_b this.title.doc.expand_doc_tip"></a> 280 </xsl:otherwise> 281 </xsl:choose> 282 </li> 283 </xsl:if> 279 284 280 <!-- expand contents --> 281 <xsl:if test="@docType = 'hierarchy' and string(/page/pageResponse/format/gsf:option[@name='documentTOC']/@value) != 'false'"> 282 <li> 283 <xsl:choose><xsl:when test="string($ec)='1'"> 284 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=0" class="getTextFor doc.contract_contents_b this.title.doc.contract_contents_tip"></a> 285 </xsl:when> 286 <xsl:otherwise> 287 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=1" class="getTextFor doc.expand_contents_b this.title.doc.expand_contents_tip"></a> 288 </xsl:otherwise> 289 </xsl:choose> 290 </li> 291 </xsl:if> 292 293 <!-- detach page --> 294 <xsl:variable name="paramList" select="/page/pageRequest/paramList"/> 295 <li> 296 <a target="_blank" class="getTextFor doc.detach_page_b this.title.doc.detach_page_tip"><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></a></li> 297 </xsl:template> 298 299 <xsl:template name="TOC"> 300 <xsl:param name="collName"/> 301 <xsl:choose> 302 <xsl:when test="@docType='hierarchy'"> 303 <xsl:call-template name="hierarchicalContents"> 304 <xsl:with-param name="collName" select="$collName"/> 305 </xsl:call-template> 306 </xsl:when> 307 <xsl:when test="@docType='paged'"> 308 <xsl:call-template name="pagedContents"> 309 <xsl:with-param name="collName" select="$collName"/> 310 </xsl:call-template> 311 </xsl:when> 312 </xsl:choose> 313 </xsl:template> 314 315 <xsl:template name="hierarchicalContents"> 316 <xsl:param name="collName"/> 317 <xsl:variable name="oc" select="/page/pageRequest/paramList/param[@name='oc']/@value"/> 318 <xsl:variable name="d" select="/page/pageRequest/paramList/param[@name='d']/@value"/> 319 <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/> 320 <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/> 321 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/> 322 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/> 323 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/> 324 <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> 325 <script type="text/javascript"> 326 <xsl:text> 327 // Load up the initial document using AJAX! 328 var initialHash = '</xsl:text> 329 <xsl:value-of select="$d" /><xsl:text>'; 330 </xsl:text> 331 </script> 332 <xsl:if test="documentNode[@nodeID]"> 333 <ul id="tocnodes"> 334 <li id="tocstart"> 335 <xsl:choose><xsl:when test="string($oc)='0'"> 336 <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"><xsl:value-of select="'doc.open_toc'"/></xsl:with-param></xsl:call-template></a> 337 </xsl:when> 338 <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"><xsl:value-of select="'doc.close_toc'"/></xsl:with-param></xsl:call-template></a></xsl:otherwise></xsl:choose><span class="getTextFor doc.table_of_contents">&amp;nbsp;</span> 339 <xsl:if test="string($oc)!='0'"> 340 <ul class="tocnode"> 341 <xsl:for-each select="documentNode/documentNode[@nodeID]"> 342 <xsl:apply-templates select='.'><xsl:with-param name="collName" select="$collName"/><xsl:with-param name="ec" select="$ec"/><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"/></xsl:apply-templates> 343 </xsl:for-each> 344 </ul> 345 </xsl:if> 346 </li> 347 </ul> 348 </xsl:if> 349 </xsl:template> 350 351 <!-- each icon-title pair is a row in a table. children go in a table in another row --> 352 <xsl:template match="documentNode"> 353 <xsl:param name="collName"/> 354 <xsl:param name="ec"/> 355 <xsl:param name="p.a"/> 356 <xsl:param name="p.s"/> 357 <xsl:param name="p.sa"/> 358 <xsl:param name="p.c"/> 359 <!-- Display the appropriate image, depending on the node type --> 360 <li> 361 <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> 362 <xsl:apply-templates select="." mode="displayNodeIcon"/> 363 </a> 364 365 <!-- Display associated title, bolded if the node has content --> 366 <xsl:choose> 367 <xsl:when test="nodeContent"> 368 <span class="bold"><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span> 369 </xsl:when> 370 <xsl:otherwise> 371 <span><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span> 372 </xsl:otherwise> 373 </xsl:choose> 374 <!-- Apply recursively to the children of this node --> 375 <xsl:if test="documentNode[@nodeID]"> 376 <ul class="tocnode"> <xsl:apply-templates select="documentNode[@nodeID]"> 377 <xsl:with-param name="collName" select="$collName"/> 378 <xsl:with-param name="ec" select="$ec"/> 379 <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"/> 380 <!--<xsl:with-param name="depth" select="$depth + 1"/>--> 381 </xsl:apply-templates> 382 </ul> 383 </xsl:if> 384 </li> 385 </xsl:template> 386 387 <!-- default content is to print the title and content of any documentNodes that have nodeContent --> 388 <xsl:template name="documentContent"> 389 <div class="documenttext"> 390 <xsl:choose> 391 <xsl:when test="@docType='simple'"><xsl:apply-templates select="nodeContent"/></xsl:when> 392 <xsl:otherwise> 393 <!--<xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/>--> 394 </xsl:otherwise> 395 </xsl:choose> 396 </div> 397 </xsl:template> 398 399 <xsl:template match="documentNode" mode="content"> 400 <xsl:if test="nodeContent"> 401 <xsl:if test="metadataList/metadata[@name='Title']"> 402 <h3><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></h3> 403 </xsl:if> 404 <xsl:apply-templates select="nodeContent"/> 405 </xsl:if> 406 </xsl:template> 407 408 <!-- the actual text/content --> 409 <xsl:template match="nodeContent"> 410 <xsl:for-each select="node()"> 411 <xsl:choose> 412 <xsl:when test="not(name())"> 413 <xsl:value-of select="." disable-output-escaping="yes" /> 414 </xsl:when> 415 <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise> 416 </xsl:choose> 417 </xsl:for-each> 418 </xsl:template> 419 420 <xsl:template name="xmldocumentContentPeeling"> 421 <xsl:choose> 422 <xsl:when test="@docType='simple'"> 423 <xsl:apply-templates select="nodeContent"/> 424 </xsl:when> 425 <xsl:otherwise> 426 <xsl:call-template name="xmlpeelingContents" /> 427 </xsl:otherwise> 428 </xsl:choose> 429 </xsl:template> 430 431 <xsl:template name="xmlpeelingContents"> 432 <xsl:if test="documentNode"> 433 <xsl:apply-templates select="documentNode" mode="xmlpeeling" /> 434 </xsl:if> 435 </xsl:template> 436 437 <xsl:template match="documentNode" mode="xmlpeeling"> 438 <!-- get title --> 439 <xsl:choose> 440 <xsl:when test="nodeContent"> 441 <xsl:text disable-output-escaping="yes"> 442 &lt;Section&gt; 443 &lt;Description&gt; 444 &lt;Metadata name="Title"&gt; 445 </xsl:text> 446 <xsl:value-of select="normalize-space(metadataList/metadata[@name='Title'])"/> 447 <xsl:text disable-output-escaping="yes"> 448 &lt;/Metadata&gt; 449 &lt;/Description&gt; 450 </xsl:text> 451 <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/> 452 <xsl:text disable-output-escaping="yes">&lt;/Sec&gt;</xsl:text> 453 </xsl:when> 454 </xsl:choose> 455 456 <!-- recurse to the children --> 457 <xsl:if test="documentNode"> 458 <xsl:apply-templates select="documentNode" mode="xmlpeeling" /> 459 </xsl:if> 460 461 <!-- end the section --> 462 <xsl:text disable-output-escaping="yes"> 463 &lt;/Section&gt; 464 </xsl:text> 465 </xsl:template> 466 467 <!-- match any file nodes --> 468 <xsl:template match="file"> 469 <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/> 470 <xsl:choose> 471 <xsl:when test="starts-with(@mimeType, 'image/')"> 472 <img src="{$httpPath}/{@href}"/> 473 </xsl:when> 474 <xsl:otherwise> 475 <a href="{$httpPath}/{@href}"><xsl:value-of select="@href"/></a> 476 </xsl:otherwise> 477 </xsl:choose> 478 </xsl:template> 479 480 <!-- match any link nodes --> 481 <xsl:template match="link"> 482 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/> 483 <xsl:variable name="actionargs"> 484 <xsl:choose> 485 <xsl:when test="@type='document'">a=d</xsl:when> 486 <xsl:when test="@type='query'">a=q&amp;s=<xsl:value-of select="@service"/>&amp;rt=rd</xsl:when> 487 <xsl:otherwise> 488 p 489 </xsl:otherwise> 490 </xsl:choose> 491 </xsl:variable> 492 <xsl:variable name="serviceargs"> 493 <xsl:for-each select="param">&amp;s1.<xsl:value-of select="@name"/>=<xsl:value-of select="@value"/></xsl:for-each> 494 </xsl:variable> 495 <a href="{$library_name}?{$actionargs}&amp;c={$collName}{$serviceargs}"><xsl:value-of disable-output-escaping="yes" select="."/></a> 496 </xsl:template> 497 498 <!-- match any annotations and make them span elements --> 499 <xsl:template match="annotation"> 500 <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span> 501 </xsl:template> 502 503 <!-- paged naviagtion : INCOMPLETE!!--> 504 <xsl:template name="pagedContents"> 505 <xsl:param name="collName"/> 506 <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/> 507 <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/> 508 <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/> 509 <table> 510 <xsl:choose> 511 <xsl:when test="$pos=-1"><!-- a doc --> 512 <tr valign="top"> 513 <td align="left"> 514 </td> 515 <td align="center"><center> 516 <b class="getTextFor doc.pages"></b> 517 </center></td> 518 <td align="right"> 519 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a> 520 </td> 521 </tr> 522 </xsl:when> 523 524 <xsl:otherwise> <!-- an internal node --> 525 <tr valign="top"> 526 <td align="left"> 527 <xsl:if test=" not ( $pos = 1 )"> 528 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps"><img src="interfaces/default/images/less.gif" border="0" align="absbottom" /></a> 529 </xsl:if> 530 </td> 531 <td align="center"><center> 532 <b><xsl:attribute name="class"><xsl:value-of select="concat('getTextFor null this.innerText.doc.pageof|', $pos, ';', $length)"/></xsl:attribute></b> 533 </center></td> 534 <td align="right"> 535 <xsl:if test=" not($pos = $length)"> 536 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a> 537 </xsl:if> 538 </td> 539 </tr> 540 </xsl:otherwise> 541 </xsl:choose> 542 <tr valign="middle"> 543 <td align='center' valign='top' colspan='3'> 544 <form name="GotoForm" method="get" action="{$library_name}"> 545 <input type='hidden' name='a' value='d'/> 546 <input type='hidden' name='c' value='{$collName}'/> 547 <input type='hidden' name='d' value='{@selectedNode}'/> 548 <input type="text" name="gp" size="3" maxlength="4"/> 549 <input type="submit" class="getTextFor null this.value.doc.gotopage"></input> 550 </form> 551 </td> 552 </tr> 553 </table> 554 </xsl:template> 555 556 <xsl:template name="enrichServices"> 557 <xsl:param name="collName"/> 558 <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/> 559 <xsl:variable name="request-params" select="/page/pageRequest/paramList"/> 560 <xsl:for-each select="../serviceList/service"> 561 <table border='1' cellspacing='0'> 562 <tr><td> 563 <p /><xsl:value-of select="displayItem[@name='name']"/><p/> 564 <form name="EnrichForm" method="get" action="{$library_name}"> 565 <xsl:apply-templates select="paramList"/> 566 <input type="hidden" name="a" value="d"/> 567 <input type="hidden" name="d" value="{$docID}"/> 568 <input type="hidden" name="c" value="{$collName}"/> 569 <xsl:if test="$request-params/param[@name='sib']"> 570 <input type="hidden" name="sib"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='sib']/@value"/></xsl:attribute></input></xsl:if> 571 <input type="hidden" name="s" value="{@name}"/> 572 <input type="hidden" name="p.a"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='p.a']"/></xsl:attribute></input> 573 <input type="hidden" name="p.sa"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='p.sa']"/></xsl:attribute></input> 574 <input type="hidden" name="p.s"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='p.s']"/></xsl:attribute></input> 575 <input type="hidden" name="end" value='1'/> 576 <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input> 577 </form> 578 </td></tr> 579 </table> 580 </xsl:for-each> 581 </xsl:template> 582 583 <xsl:template match="paramList" mode="hidden"> 584 <xsl:for-each select="param"> 585 <input type='hidden' name='{@name}' value='{@value}'/><xsl:text> 586 </xsl:text> 587 </xsl:for-each> 588 </xsl:template> 589 590 <xsl:template name="documentArrows"> 591 <xsl:param name="collName"/> 592 <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/> 593 594 <div class="documentarrows"> 595 <xsl:if test="not(string($ed)='1')"> 596 <xsl:call-template name="documentArrow"> 597 <xsl:with-param name="collName" select="$collName"/> 598 <xsl:with-param name="direction">back</xsl:with-param> 599 </xsl:call-template> 600 <xsl:call-template name="documentArrow"> 601 <xsl:with-param name="collName" select="$collName"/> 602 <xsl:with-param name="direction">forward</xsl:with-param> 603 </xsl:call-template> 604 </xsl:if> 605 </div> 606 607 </xsl:template> 608 609 <xsl:template name="documentArrow"> 610 <xsl:param name="collName"/> 611 <xsl:param name="direction"/> 612 <xsl:variable name="request-params" select="/page/pageRequest/paramList"/> 613 <xsl:if test="$request-params/param[@name='dt']/@value != 'simple'"> 614 <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><xsl:when test="$direction='back'"><img class="lessarrow" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow" src="interfaces/default/images/more.gif" /></xsl:otherwise></xsl:choose></a> 615 </xsl:if> 616 </xsl:template> 617 618 <xsl:template name="externalPage"> 619 <xsl:param name="external"/> 620 <xsl:variable name="go_forward_link"><a class="getTextfor external.go_forward"><xsl:attribute name="href"><xsl:value-of select="$external"/></xsl:attribute></a></xsl:variable> 621 <h2 class="getTextFor external.title"></h2> 622 <p><xsl:attribute name="class"><xsl:value-of select="concat('getTextFor null this.innerText.external.text|', $go_forward_link)" /></xsl:attribute> 623 </p> 624 </xsl:template> 285 <!-- expand contents --> 286 <xsl:if test="@docType = 'hierarchy' and string(/page/pageResponse/format/gsf:option[@name='documentTOC']/@value) != 'false'"> 287 <li> 288 <xsl:choose> 289 <xsl:when test="string($ec)='1'"> 290 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=0" class="getTextFor doc.contract_contents_b this.title.doc.contract_contents_tip"></a> 291 </xsl:when> 292 <xsl:otherwise> 293 <a href="{$library_name}?a=d&amp;d={$docID}&amp;c={$collName}&amp;sib={$sib}&amp;ec=1" class="getTextFor doc.expand_contents_b this.title.doc.expand_contents_tip"></a> 294 </xsl:otherwise> 295 </xsl:choose> 296 </li> 297 </xsl:if> 298 299 <!-- detach page --> 300 <xsl:variable name="paramList" select="/page/pageRequest/paramList"/> 301 <li> 302 <a target="_blank" class="getTextFor doc.detach_page_b this.title.doc.detach_page_tip"> 303 <xsl:attribute name="href"> 304 <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"/> 305 </xsl:attribute> 306 </a> 307 </li> 308 </xsl:template> 309 310 <xsl:template name="TOC"> 311 <xsl:param name="collName"/> 312 <xsl:choose> 313 <xsl:when test="@docType='hierarchy'"> 314 <xsl:call-template name="hierarchicalContents"> 315 <xsl:with-param name="collName" select="$collName"/> 316 </xsl:call-template> 317 </xsl:when> 318 <xsl:when test="@docType='paged'"> 319 <xsl:call-template name="pagedContents"> 320 <xsl:with-param name="collName" select="$collName"/> 321 </xsl:call-template> 322 </xsl:when> 323 </xsl:choose> 324 </xsl:template> 325 326 <xsl:template name="hierarchicalContents"> 327 <xsl:param name="collName"/> 328 <xsl:variable name="oc" select="/page/pageRequest/paramList/param[@name='oc']/@value"/> 329 <xsl:variable name="d" select="/page/pageRequest/paramList/param[@name='d']/@value"/> 330 <xsl:variable name="sib" select="/page/pageRequest/paramList/param[@name='sib']/@value"/> 331 <xsl:variable name="ec" select="/page/pageRequest/paramList/param[@name='ec']/@value"/> 332 <xsl:variable name="p.s" select="/page/pageRequest/paramList/param[@name='p.s']/@value"/> 333 <xsl:variable name="p.sa" select="/page/pageRequest/paramList/param[@name='p.sa']/@value"/> 334 <xsl:variable name="p.a" select="/page/pageRequest/paramList/param[@name='p.a']/@value"/> 335 <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> 336 <script type="text/javascript"> 337 <xsl:text> 338 // Load up the initial document using AJAX! 339 var initialHash = '</xsl:text> 340 <xsl:value-of select="$d" /><xsl:text>'; 341 </xsl:text> 342 </script> 343 <xsl:if test="documentNode[@nodeID]"> 344 <ul id="tocnodes"> 345 <li id="tocstart"> 346 <xsl:choose> 347 <xsl:when test="string($oc)='0'"> 348 <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"><xsl:value-of select="'doc.open_toc'"/></xsl:with-param></xsl:call-template></a> 349 </xsl:when> 350 <xsl:otherwise> 351 <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"><xsl:value-of select="'doc.close_toc'"/></xsl:with-param></xsl:call-template></a> 352 </xsl:otherwise> 353 </xsl:choose> 354 <span class="getTextFor doc.table_of_contents">&amp;nbsp;</span> 355 <xsl:if test="string($oc)!='0'"> 356 <ul class="tocnode"> 357 <xsl:for-each select="documentNode/documentNode[@nodeID]"> 358 <xsl:apply-templates select='.'><xsl:with-param name="collName" select="$collName"/><xsl:with-param name="ec" select="$ec"/><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"/></xsl:apply-templates> 359 </xsl:for-each> 360 </ul> 361 </xsl:if> 362 </li> 363 </ul> 364 </xsl:if> 365 </xsl:template> 366 367 <!-- each icon-title pair is a row in a table. children go in a table in another row --> 368 <xsl:template match="documentNode"> 369 <xsl:param name="collName"/> 370 <xsl:param name="ec"/> 371 <xsl:param name="p.a"/> 372 <xsl:param name="p.s"/> 373 <xsl:param name="p.sa"/> 374 <xsl:param name="p.c"/> 375 <!-- Display the appropriate image, depending on the node type --> 376 <li> 377 <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> 378 <xsl:apply-templates select="." mode="displayNodeIcon"/> 379 </a> 380 381 <!-- Display associated title, bolded if the node has content --> 382 <xsl:choose> 383 <xsl:when test="nodeContent"> 384 <span class="bold"><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span> 385 </xsl:when> 386 <xsl:otherwise> 387 <span><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></span> 388 </xsl:otherwise> 389 </xsl:choose> 390 <!-- Apply recursively to the children of this node --> 391 <xsl:if test="documentNode[@nodeID]"> 392 <ul class="tocnode"> 393 <xsl:apply-templates select="documentNode[@nodeID]"> 394 <xsl:with-param name="collName" select="$collName"/> 395 <xsl:with-param name="ec" select="$ec"/> 396 <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"/> 397 <!--<xsl:with-param name="depth" select="$depth + 1"/>--> 398 </xsl:apply-templates> 399 </ul> 400 </xsl:if> 401 </li> 402 </xsl:template> 403 404 <!-- default content is to print the title and content of any documentNodes that have nodeContent --> 405 <xsl:template name="documentContent"> 406 <div class="documenttext"> 407 <xsl:choose> 408 <xsl:when test="@docType='simple'"><xsl:apply-templates select="nodeContent"/></xsl:when> 409 <xsl:otherwise> 410 <!--<xsl:apply-templates select="descendant-or-self::node()/documentNode" mode="content"/>--> 411 </xsl:otherwise> 412 </xsl:choose> 413 </div> 414 </xsl:template> 415 416 <xsl:template match="documentNode" mode="content"> 417 <xsl:if test="nodeContent"> 418 <xsl:if test="metadataList/metadata[@name='Title']"> 419 <h3><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/></h3> 420 </xsl:if> 421 <xsl:apply-templates select="nodeContent"/> 422 </xsl:if> 423 </xsl:template> 424 425 <!-- the actual text/content --> 426 <xsl:template match="nodeContent"> 427 <xsl:for-each select="node()"> 428 <xsl:choose> 429 <xsl:when test="not(name())"> 430 <xsl:value-of select="." disable-output-escaping="yes" /> 431 </xsl:when> 432 <xsl:otherwise><xsl:apply-templates select="."/></xsl:otherwise> 433 </xsl:choose> 434 </xsl:for-each> 435 </xsl:template> 436 437 <xsl:template name="xmldocumentContentPeeling"> 438 <xsl:choose> 439 <xsl:when test="@docType='simple'"> 440 <xsl:apply-templates select="nodeContent"/> 441 </xsl:when> 442 <xsl:otherwise> 443 <xsl:call-template name="xmlpeelingContents" /> 444 </xsl:otherwise> 445 </xsl:choose> 446 </xsl:template> 447 448 <xsl:template name="xmlpeelingContents"> 449 <xsl:if test="documentNode"> 450 <xsl:apply-templates select="documentNode" mode="xmlpeeling" /> 451 </xsl:if> 452 </xsl:template> 453 454 <xsl:template match="documentNode" mode="xmlpeeling"> 455 <!-- get title --> 456 <xsl:if test="nodeContent"> 457 <xsl:text disable-output-escaping="yes"> 458 <Section> 459 <Description> 460 <Metadata name="Title"> 461 </xsl:text> 462 <xsl:value-of select="normalize-space(metadataList/metadata[@name='Title'])"/> 463 <xsl:text disable-output-escaping="yes"> 464 </Metadata> 465 </Description> 466 </xsl:text> 467 <xsl:value-of select="normalize-space(nodeContent)" disable-output-escaping="yes"/> 468 <xsl:text disable-output-escaping="yes"> 469 </Section> 470 </xsl:text> 471 </xsl:if> 472 473 <!-- recurse to the children --> 474 <xsl:if test="documentNode"> 475 <xsl:apply-templates select="documentNode" mode="xmlpeeling" /> 476 </xsl:if> 477 478 <xsl:if test="nodeContent"> 479 <!-- end the section --> 480 <xsl:text disable-output-escaping="yes"> 481 &lt;/Section&gt; 482 </xsl:text> 483 </xsl:if> 484 </xsl:template> 485 486 <!-- match any file nodes --> 487 <xsl:template match="file"> 488 <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/> 489 <xsl:choose> 490 <xsl:when test="starts-with(@mimeType, 'image/')"> 491 <img src="{$httpPath}/{@href}"/> 492 </xsl:when> 493 <xsl:otherwise> 494 <a href="{$httpPath}/{@href}"><xsl:value-of select="@href"/></a> 495 </xsl:otherwise> 496 </xsl:choose> 497 </xsl:template> 498 499 <!-- match any link nodes --> 500 <xsl:template match="link"> 501 <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/> 502 <xsl:variable name="actionargs"> 503 <xsl:choose> 504 <xsl:when test="@type='document'">a=d</xsl:when> 505 <xsl:when test="@type='query'">a=q&amp;s=<xsl:value-of select="@service"/>&amp;rt=rd</xsl:when> 506 <xsl:otherwise> 507 p 508 </xsl:otherwise> 509 </xsl:choose> 510 </xsl:variable> 511 <xsl:variable name="serviceargs"> 512 <xsl:for-each select="param">&amp;s1.<xsl:value-of select="@name"/>=<xsl:value-of select="@value"/></xsl:for-each> 513 </xsl:variable> 514 <a href="{$library_name}?{$actionargs}&amp;c={$collName}{$serviceargs}"><xsl:value-of disable-output-escaping="yes" select="."/></a> 515 </xsl:template> 516 517 <!-- match any annotations and make them span elements --> 518 <xsl:template match="annotation"> 519 <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span> 520 </xsl:template> 521 522 <!-- paged naviagtion : INCOMPLETE!!--> 523 <xsl:template name="pagedContents"> 524 <xsl:param name="collName"/> 525 <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/> 526 <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/> 527 <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/> 528 <table> 529 <xsl:choose> 530 <xsl:when test="$pos=-1"><!-- a doc --> 531 <tr valign="top"> 532 <td align="left"> 533 </td> 534 <td align="center"> 535 <center> 536 <b class="getTextFor doc.pages"></b> 537 </center> 538 </td> 539 <td align="right"> 540 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a> 541 </td> 542 </tr> 543 </xsl:when> 544 545 <xsl:otherwise> <!-- an internal node --> 546 <tr valign="top"> 547 <td align="left"> 548 <xsl:if test=" not ( $pos = 1 )"> 549 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps"><img src="interfaces/default/images/less.gif" border="0" align="absbottom" /></a> 550 </xsl:if> 551 </td> 552 <td align="center"> 553 <center> 554 <b><xsl:attribute name="class"><xsl:value-of select="concat('getTextFor null this.innerText.doc.pageof|', $pos, ';', $length)"/></xsl:attribute></b> 555 </center> 556 </td> 557 <td align="right"> 558 <xsl:if test=" not($pos = $length)"> 559 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns"><img src="interfaces/default/images/more.gif" border="0" align="absbottom" /></a> 560 </xsl:if> 561 </td> 562 </tr> 563 </xsl:otherwise> 564 </xsl:choose> 565 <tr valign="middle"> 566 <td align='center' valign='top' colspan='3'> 567 <form name="GotoForm" method="get" action="{$library_name}"> 568 <input type='hidden' name='a' value='d'/> 569 <input type='hidden' name='c' value='{$collName}'/> 570 <input type='hidden' name='d' value='{@selectedNode}'/> 571 <input type="text" name="gp" size="3" maxlength="4"/> 572 <input type="submit" class="getTextFor null this.value.doc.gotopage"></input> 573 </form> 574 </td> 575 </tr> 576 </table> 577 </xsl:template> 578 579 <xsl:template name="enrichServices"> 580 <xsl:param name="collName"/> 581 <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/> 582 <xsl:variable name="request-params" select="/page/pageRequest/paramList"/> 583 <xsl:for-each select="../serviceList/service"> 584 <table border='1' cellspacing='0'> 585 <tr><td> 586 <p /><xsl:value-of select="displayItem[@name='name']"/><p/> 587 <form name="EnrichForm" method="get" action="{$library_name}"> 588 <xsl:apply-templates select="paramList"/> 589 <input type="hidden" name="a" value="d"/> 590 <input type="hidden" name="d" value="{$docID}"/> 591 <input type="hidden" name="c" value="{$collName}"/> 592 <xsl:if test="$request-params/param[@name='sib']"> 593 <input type="hidden" name="sib"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='sib']/@value"/></xsl:attribute></input></xsl:if> 594 <input type="hidden" name="s" value="{@name}"/> 595 <input type="hidden" name="p.a"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='p.a']"/></xsl:attribute></input> 596 <input type="hidden" name="p.sa"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='p.sa']"/></xsl:attribute></input> 597 <input type="hidden" name="p.s"><xsl:attribute name="value"><xsl:value-of select="$request-params/param[@name='p.s']"/></xsl:attribute></input> 598 <input type="hidden" name="end" value='1'/> 599 <input type="submit"><xsl:attribute name="value"><xsl:value-of select="displayItem[@name='submit']"/></xsl:attribute></input> 600 </form> 601 </td></tr> 602 </table> 603 </xsl:for-each> 604 </xsl:template> 605 606 <xsl:template match="paramList" mode="hidden"> 607 <xsl:for-each select="param"> 608 <input type='hidden' name='{@name}' value='{@value}'/><xsl:text> 609 </xsl:text> 610 </xsl:for-each> 611 </xsl:template> 612 613 <xsl:template name="documentArrows"> 614 <xsl:param name="collName"/> 615 <xsl:variable name="ed" select="/page/pageRequest/paramList/param[@name='ed']/@value"/> 616 617 <div class="documentarrows"> 618 <xsl:if test="not(string($ed)='1')"> 619 <xsl:call-template name="documentArrow"> 620 <xsl:with-param name="collName" select="$collName"/> 621 <xsl:with-param name="direction">back</xsl:with-param> 622 </xsl:call-template> 623 <xsl:call-template name="documentArrow"> 624 <xsl:with-param name="collName" select="$collName"/> 625 <xsl:with-param name="direction">forward</xsl:with-param> 626 </xsl:call-template> 627 </xsl:if> 628 </div> 629 630 </xsl:template> 631 632 <xsl:template name="documentArrow"> 633 <xsl:param name="collName"/> 634 <xsl:param name="direction"/> 635 <xsl:variable name="request-params" select="/page/pageRequest/paramList"/> 636 <xsl:if test="$request-params/param[@name='dt']/@value != 'simple'"> 637 <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><xsl:when test="$direction='back'"><img class="lessarrow" src="interfaces/default/images/less.gif" /></xsl:when><xsl:otherwise><img class="morearrow" src="interfaces/default/images/more.gif" /></xsl:otherwise></xsl:choose></a> 638 </xsl:if> 639 </xsl:template> 640 641 <xsl:template name="externalPage"> 642 <xsl:param name="external"/> 643 <xsl:variable name="go_forward_link"><a class="getTextfor external.go_forward"><xsl:attribute name="href"><xsl:value-of select="$external"/></xsl:attribute></a></xsl:variable> 644 <h2 class="getTextFor external.title"></h2> 645 <p><xsl:attribute name="class"><xsl:value-of select="concat('getTextFor null this.innerText.external.text|', $go_forward_link)" /></xsl:attribute> 646 </p> 647 </xsl:template> 625 648 626 649 </xsl:stylesheet>
Note:
See TracChangeset
for help on using the changeset viewer.