Changeset 25005
- Timestamp:
- 2012-01-26T14:22:29+13:00 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/oran/transform/classifiertools.xsl
r24557 r25005 1 1 <?xml version="1.0" encoding="ISO-8859-1"?> 2 2 <xsl:stylesheet version="1.0" 3 4 5 6 7 8 3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 4 xmlns:java="http://xml.apache.org/xslt/java" 5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil" 6 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" 7 extension-element-prefixes="java util" 8 exclude-result-prefixes="java util gsf"> 9 9 10 10 11 12 13 14 15 <xsl:variable name="cl_name"><xsl:value-of select="@name"/></xsl:variable>16 <xsl:apply-templates select="." mode="default">17 18 19 </xsl:apply-templates>20 21 11 <xsl:template match="classifier"> 12 <xsl:param name="collName"/> 13 <xsl:param name="serviceName"/> 14 <div id="classifiers"> 15 <xsl:variable name="cl_name"><xsl:value-of select="@name"/></xsl:variable> 16 <xsl:apply-templates select="." mode="default"> 17 <xsl:with-param name="collName" select="$collName"/> 18 <xsl:with-param name="serviceName" select="$serviceName"/> 19 </xsl:apply-templates> 20 </div> 21 </xsl:template> 22 22 23 23 24 25 26 27 28 29 <xsl:with-param name='collName' select='$collName'/>30 <xsl:with-param name='serviceName' select='$serviceName'/>31 32 33 24 <xsl:template match="classifier" mode="default"> <!-- the default --> 25 <xsl:param name="collName"/> 26 <xsl:param name="serviceName"/> 27 <table id="classifiernodelist"> 28 <xsl:call-template name="processNodeChildren"> 29 <xsl:with-param name='collName' select='$collName'/> 30 <xsl:with-param name='serviceName' select='$serviceName'/> 31 </xsl:call-template> 32 </table> 33 </xsl:template> 34 34 35 35 36 <!-- this is a wrapper node, which the interface can use to add stuff into the query results that isn't part of and doesn't depend on the documentNode template which may come from the collection --> 37 <xsl:template name="documentNodeWrapper"> 38 <xsl:param name="collName"/> 39 <xsl:param name="serviceName"/> 40 <xsl:apply-templates select="."> 41 <xsl:with-param name="collName" select="$collName"/> 42 <xsl:with-param name="serviceName" select="$serviceName"/> 43 </xsl:apply-templates> 44 </xsl:template> 36 <!-- this is a wrapper node, which the interface can use to add stuff into the query results that isn't part of and doesn't depend on the documentNode template which may come from the collection --> 37 <xsl:template name="documentNodeWrapper"> 38 <xsl:param name="collName"/> 39 <xsl:param name="serviceName"/> 40 <xsl:apply-templates select="."> 41 <xsl:with-param name="collName" select="$collName"/> 42 <xsl:with-param name="serviceName" select="$serviceName"/> 43 </xsl:apply-templates> 44 <xsl:call-template name="documentNodePost"/> 45 </xsl:template> 45 46 46 47 47 48 49 50 51 52 53 54 55 56 48 <xsl:template match="documentNode"> 49 <xsl:param name="collName"/> 50 <xsl:param name="serviceName"/> 51 <a href="{$library_name}?a=d&c={$collName}&d={@nodeID}&dt={@docType}&p.a=b&p.s={$serviceName}"><xsl:apply-templates select="." mode="displayNodeIcon"/></a><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/> 52 53 <!-- The berry (optional) --> 54 <td> 55 <xsl:call-template name="documentBerryForClassifierOrSearchPage"/> 56 </td> 57 </xsl:template> 57 58 58 59 59 60 61 62 63 64 60 <!-- icon + title template--> 61 <xsl:template match="classifierNode"> 62 <xsl:param name="collName"/> 63 <xsl:param name="serviceName"/> 64 <a><xsl:attribute name='href'><xsl:value-of select='$library_name'/>?a=b&rt=r&s=<xsl:value-of select='$serviceName'/>&c=<xsl:value-of select='$collName'/>&cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:call-template name="bookshelfimg"/></a><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/> 65 </xsl:template> 65 66 66 67 67 68 69 70 71 72 73 74 75 68 <!-- processing for the recursive bit --> 69 <xsl:template match="classifierNode" mode="process-all-children"> 70 <xsl:param name="collName"/> 71 <xsl:param name="serviceName"/> 72 <xsl:call-template name="processNodeChildren"> 73 <xsl:with-param name='collName' select='$collName'/> 74 <xsl:with-param name='serviceName' select='$serviceName'/> 75 </xsl:call-template> 76 </xsl:template> 76 77 77 78 78 <xsl:template name="processNodeChildren"> 79 <xsl:param name="collName"/> 80 <xsl:param name="serviceName"/> 81 <xsl:for-each select='classifierNode|documentNode'><tr> 82 <xsl:choose> 83 <xsl:when test="name()='documentNode'"> 84 <td><table id="div{@nodeID}"><tr> 85 <xsl:call-template name="documentNodeWrapper"> 86 <xsl:with-param name='collName' select='$collName'/> 87 <xsl:with-param name='serviceName' select='$serviceName'/> 88 </xsl:call-template> 89 </tr></table> 90 </td> 91 </xsl:when> 92 <xsl:otherwise> 93 <td><table id="title{@nodeID}"><tr> 94 <xsl:if test="not(/page/pageResponse/format[@type='browse']/gsf:option[@name='turnstyleClassifiers']) or /page/pageResponse/format[@type='browse']/gsf:option[@name='turnstyleClassifiers']/@value='true'"> 95 <td class="headerTD"> 96 <img id="toggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon"> 97 <xsl:attribute name="src"> 98 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/> 99 </xsl:attribute> 100 </img> 101 </td> 79 <xsl:template name="processNodeChildren"> 80 <xsl:param name="collName"/> 81 <xsl:param name="serviceName"/> 82 <xsl:for-each select='classifierNode|documentNode'> 83 <tr> 84 <xsl:choose> 85 <xsl:when test="name()='documentNode'"> 86 <td> 87 <table id="div{@nodeID}"><tr> 88 <xsl:call-template name="documentNodeWrapper"> 89 <xsl:with-param name='collName' select='$collName'/> 90 <xsl:with-param name='serviceName' select='$serviceName'/> 91 </xsl:call-template> 92 </tr></table> 93 </td> 94 </xsl:when> 95 <xsl:otherwise> 96 <td> 97 <table id="title{@nodeID}"><tr> 98 <xsl:if test="not(/page/pageResponse/format[@type='browse']/gsf:option[@name='turnstyleClassifiers']) or /page/pageResponse/format[@type='browse']/gsf:option[@name='turnstyleClassifiers']/@value='true'"> 99 <td class="headerTD"> 100 <img id="toggle{@nodeID}" onclick="toggleSection('{@nodeID}');" class="icon"> 101 <xsl:attribute name="src"> 102 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'expand_image')"/> 103 </xsl:attribute> 104 </img> 105 </td> 106 </xsl:if> 107 <xsl:apply-templates select='.'> 108 <xsl:with-param name='collName' select='$collName'/> 109 <xsl:with-param name='serviceName' select='$serviceName'/> 110 </xsl:apply-templates> 111 </tr></table> 112 </td> 113 <xsl:if test="child::classifierNode or child::documentNode"> 114 <!--recurse into the children--> 115 <tr><td><table class="childrenlist" id="div{@nodeID}"> 116 <xsl:apply-templates select='.' mode='process-all-children'> 117 <xsl:with-param name='collName' select='$collName'/> 118 <xsl:with-param name='serviceName' select='$serviceName'/> 119 </xsl:apply-templates> 120 </table></td></tr> 121 </xsl:if> 122 </xsl:otherwise> 123 </xsl:choose> 124 </tr> 125 </xsl:for-each> 126 </xsl:template> 127 128 <xsl:template name="bookshelfimg"> 129 <xsl:param name="alt"/> 130 <xsl:param name="title"/> 131 <img border="0" width="20" height="16" src="interfaces/default/images/bshelf.gif" alt="{$alt}" title="{$title}"/> 132 </xsl:template> 133 134 <xsl:template name="documentNodePost"> 135 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'"> 136 <xsl:call-template name="mapFeatures"/> 102 137 </xsl:if> 103 <xsl:apply-templates select='.'> 104 <xsl:with-param name='collName' select='$collName'/> 105 <xsl:with-param name='serviceName' select='$serviceName'/> 106 </xsl:apply-templates> 107 </tr></table> 108 </td> 109 <xsl:if test="child::classifierNode or child::documentNode"> 110 <!--recurse into the children--> 111 <tr><td><table class="childrenlist" id="div{@nodeID}"> 112 <xsl:apply-templates select='.' mode='process-all-children'> 113 <xsl:with-param name='collName' select='$collName'/> 114 <xsl:with-param name='serviceName' select='$serviceName'/> 115 </xsl:apply-templates> 116 </table></td></tr> 117 </xsl:if> 118 </xsl:otherwise> 119 </xsl:choose> 120 </tr></xsl:for-each> 121 </xsl:template> 122 123 124 <xsl:template name="bookshelfimg"> 125 <xsl:param name="alt"/> 126 <xsl:param name="title"/> 127 <img border="0" width="20" height="16" 128 src="interfaces/default/images/bshelf.gif" 129 alt="{$alt}" title="{$title}"/> 130 </xsl:template> 131 138 </xsl:template> 139 140 <xsl:template name="mapFeatures"> 141 <td style="padding-left:5px; padding-right:5px;" valign="top"> 142 <a href="javascript:focusDocument('{@nodeID}');"><img src="sites/localsite/collect/tipple-paradise-gardens/images/map_marker.png"/></a> 143 </td> 144 </xsl:template> 132 145 </xsl:stylesheet>
Note:
See TracChangeset
for help on using the changeset viewer.