Changeset 4252


Ignore:
Timestamp:
2003-05-08T13:54:03+12:00 (21 years ago)
Author:
kjdon
Message:

lots of changes but I dont remember what they are for

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/web/interfaces/default/transform/classifier.xsl

    r4146 r4252  
    1111  <xsl:template name="pageHead">
    1212    <head>
    13       <title><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title>
     13      <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
    1414    </head>
    1515  </xsl:template>
     
    4747        </xsl:when>
    4848        <xsl:otherwise>
    49           <td align='center'><a href="{$library}?a=b&amp;s={$serviceName}&amp;c={$collName}&amp;cl={@name}"><xsl:value-of select="ancestor::service/display/classifier[@name=$cname]/name"/></a></td></xsl:otherwise></xsl:choose>
     49          <td align='center'><a href="{$library}?a=b&amp;rt=r&amp;s={$serviceName}&amp;c={$collName}&amp;cl={@name}"><xsl:value-of select="ancestor::service/display/classifier[@name=$cname]/name"/></a></td></xsl:otherwise></xsl:choose>
    5050    </xsl:for-each>
    5151      </tr></table>
     
    6262    <xsl:variable name="orientation"><xsl:value-of select="ancestor::page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@orientation"/></xsl:variable>
    6363    <xsl:variable name='mode'><xsl:value-of select='$orientation'/>-<xsl:value-of select='$interleave'/></xsl:variable>
     64    <!-- cant seem to do this any other way, ie mode='{$mode}' doesn't work -->
    6465    <xsl:choose>
    6566      <xsl:when test="$mode='horizontal-true'">
     
    8081  <!-- vertical and interleave = true: process all document and classifier children together, recursively -->
    8182  <xsl:template match="classifier" mode="vertical-true">
    82     <xsl:param name="collName">coll-name</xsl:param>
    83     <xsl:param name="serviceName">service-name</xsl:param>
     83    <xsl:param name="collName"/>
     84    <xsl:param name="serviceName"/>
    8485    <table width='537'>
    8586      <xsl:for-each select='classifierNode|documentNode'>
     
    9697  <!--vertical and interleave = false: process all classifier nodes, recursively, then do the document ones separately -->
    9798  <xsl:template match="classifier" mode="vertical-false">
    98     <xsl:param name="collName">coll-name</xsl:param>
    99     <xsl:param name="serviceName">service-name</xsl:param>
     99    <xsl:param name="collName"/>
     100    <xsl:param name="serviceName"/>
    100101    <!-- process the nodes and documents separately-->
    101102    <table width='537'>
     
    114115
    115116  <xsl:template match="classifier" mode="horizontal-true">
    116     <xsl:param name="collName">coll-name</xsl:param>
    117     <xsl:param name="serviceName">service-name</xsl:param>
     117    <xsl:param name="collName"/>
     118    <xsl:param name="serviceName"/>
    118119    <!-- process the nodes and documents together -->
    119120   
     
    141142
    142143  <xsl:template match="classifier" mode="horizontal-false">
    143     <xsl:param name="collName">coll-name</xsl:param>
    144     <xsl:param name="serviceName">service-name</xsl:param>
     144    <xsl:param name="collName"/>
     145    <xsl:param name="serviceName"/>
    145146    <!-- process the nodes and documents separately-->
    146147   
     
    161162  </xsl:template>
    162163
    163 <xsl:template match="documentNode">
    164 <xsl:param name="collName">coll-name</xsl:param>
    165 <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
    166 <td><a href="{$library}?a=d&amp;c={$collName}&amp;d={@nodeID}"><img src='interfaces/default/images/book.gif' width='18' height='11' border='0'/></a></td><td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
    167 </xsl:template>
    168 <!--
    169   <xslt:template xmlns:xslt="http://www.w3.org/1999/XSL/Transform" match="documentNode" priority="4">
    170     <xslt:param name="collName">coll-name</xslt:param>
    171  
    172     <xslt:variable name="library" select="ancestor::page/pageExtra/config/library_name" />    <td>
    173       <a href="{$library}?a=d&amp;c={$collName}&amp;d={@nodeID}">
    174         <img border="0" height="11" src="interfaces/default/images/book.gif" width="18" /></a>
    175     </td>
    176  
    177     <td>
    178       <xslt:value-of select="metadataList/metadata[@name='Source']" /></td>
    179   </xslt:template>
    180 -->
    181   <!-- icon + title -->
     164  <!-- default doc node template: icon and title -->
     165  <xsl:template match="documentNode">
     166    <xsl:param name="collName"/>
     167    <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
     168    <td><a href="{$library}?a=d&amp;c={$collName}&amp;d={@nodeID}"><xsl:apply-templates select="." mode="displayNodeIcon"/></a></td><td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
     169  </xsl:template>
     170 
     171  <!-- default classifier node template: icon + title -->
    182172  <xsl:template match="classifierNode">
    183     <xsl:param name="collName">coll-name</xsl:param>
    184     <xsl:param name="serviceName">service-name</xsl:param>
     173    <xsl:param name="collName"/>
     174    <xsl:param name="serviceName"/>
    185175    <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    186     <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><img src='interfaces/default/images/bshelf.gif' border='0' width='20' height='16' /></a></td><td align='left'><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
    187   </xsl:template>
    188  
    189   <!-- the title is a link: an alternative template -->
     176    <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><img src='interfaces/default/images/bshelf.gif' border='0' width='20' height='16' /></a></td><td align='left'><xsl:value-of select="metadataList/metadata[@name='Title']"/></td>
     177  </xsl:template>
     178 
     179  <!-- an alternative classifier node template: the title is a link -->
    190180  <!--
    191181  <xsl:template match="classifierNode">
    192     <xsl:param name="collName">coll-name</xsl:param>
    193     <xsl:param name="serviceName">service-name</xsl:param>
     182    <xsl:param name="collName"/>
     183    <xsl:param name="serviceName"/>
    194184    <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    195     <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:value-of select="metadataList/metadata[@name='Title']"/></a></td>
     185    <td><a><xsl:attribute name='href'><xsl:value-of select='$library'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:value-of select="metadataList/metadata[@name='Title']"/></a></td>
    196186  </xsl:template>
    197187  -->
     
    200190<!-- if interleave=true, process all child nodes and documents, else just do nodes -->
    201191
    202 
    203192  <xsl:template match="classifierNode" mode="process-all-children">
    204     <xsl:param name="collName">coll-name</xsl:param>
    205     <xsl:param name="serviceName">service-name</xsl:param>
     193    <xsl:param name="collName"/>
     194    <xsl:param name="serviceName"/>
    206195    <td><p/>
    207     <!-- only do this if there are children -->
    208     <xsl:if test="classifierNode|documentNode">
    209       <xsl:choose>
    210     <xsl:when test='@orientation="vertical"'>
    211       <table> 
    212         <xsl:for-each select='classifierNode|documentNode'>
    213           <tr valign='top'><xsl:apply-templates select='.'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates></tr>
    214           <xsl:if test='name()="classifierNode"'>
    215         <tr valign='top'><td><xsl:text> </xsl:text></td><xsl:apply-templates select='.' mode='process-all-children'><xsl:with-param name='collName' select='$collName'/></xsl:apply-templates></tr>
    216           </xsl:if>       
    217         </xsl:for-each>
    218       </table>
    219     </xsl:when>
    220     <xsl:otherwise> <!-- horizontal -->
    221       <table>
    222         <tr valign='top'>
     196      <!-- only do this if there are children -->
     197      <xsl:if test="classifierNode|documentNode">
     198    <xsl:choose>
     199      <xsl:when test='@orientation="vertical"'>
     200        <table> 
    223201          <xsl:for-each select='classifierNode|documentNode'>
    224         <xsl:apply-templates select='.'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates>
     202        <tr valign='top'><xsl:apply-templates select='.'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates></tr>
    225203        <xsl:if test='name()="classifierNode"'>
    226           <xsl:apply-templates select='.' mode='process-all-children'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates>
    227         </xsl:if>
     204          <tr valign='top'><td><xsl:text> </xsl:text></td><xsl:apply-templates select='.' mode='process-all-children'><xsl:with-param name='collName' select='$collName'/></xsl:apply-templates></tr>
     205        </xsl:if>         
    228206          </xsl:for-each>
    229         </tr>
    230       </table>
    231     </xsl:otherwise>
    232       </xsl:choose>
    233     </xsl:if>
     207        </table>
     208      </xsl:when>
     209      <xsl:otherwise> <!-- horizontal -->
     210        <table>
     211          <tr valign='top'>
     212        <xsl:for-each select='classifierNode|documentNode'>
     213          <xsl:apply-templates select='.'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates>
     214          <xsl:if test='name()="classifierNode"'>
     215            <xsl:apply-templates select='.' mode='process-all-children'><xsl:with-param name='collName' select='$collName'/><xsl:with-param name='serviceName' select='$serviceName'/></xsl:apply-templates>
     216          </xsl:if>
     217        </xsl:for-each>
     218          </tr>
     219        </table>
     220      </xsl:otherwise>
     221    </xsl:choose>
     222      </xsl:if>
    234223    </td>
    235224  </xsl:template>
    236225
    237226  <xsl:template match="classifierNode" mode="process-node-children">
    238     <xsl:param name="collName">coll-name</xsl:param>
    239     <xsl:param name="serviceName">ClassifierBrowse</xsl:param>
     227    <xsl:param name="collName"/>
     228    <xsl:param name="serviceName"/>
    240229    <td><p/>
    241230      <xsl:if test='classifierNode'><!-- only do this if there are child nodes - netscape craps out at an empty table like <table  /> -->
Note: See TracChangeset for help on using the changeset viewer.