Changeset 4711


Ignore:
Timestamp:
2003-06-18T12:07:03+12:00 (21 years ago)
Author:
kjdon
Message:

made a lot of changes, cant remember tham all. config stuff is now global params, translate stuff is now done on the fly using java and XSLTUtil, added in query form stuff

Location:
trunk/gsdl3/web/interfaces/nzdl/transform
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/web/interfaces/nzdl/transform/about.xsl

    r4151 r4711  
    33  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    44  xmlns:java="http://xml.apache.org/xslt/java"
    5   extension-element-prefixes="java">
    6  
     5  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
     6  extension-element-prefixes="java util"
     7  exclude-result-prefixes="java util">
     8
    79  <xsl:include href="style.xsl"/>
    810 
     
    1113  <xsl:template name="pageHead">
    1214    <head>
    13       <title><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title>
     15      <title><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/></title>
    1416    </head>
    1517    <xsl:call-template name="headScript"/>
     
    1719
    1820  <xsl:template match="pageResponse">
    19     <xsl:variable name="collName" select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/>
     21    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
    2022    <center>
    21       <xsl:apply-templates select="collection|serviceCluster"><xsl:with-param name="collName" select="$collName"/></xsl:apply-templates>
     23      <xsl:apply-templates select="collection"><xsl:with-param name="collName" select="$collName"/></xsl:apply-templates>
    2224    </center>
    2325  </xsl:template>
    24 
     26<!--
    2527  <xsl:template match="serviceCluster">
    2628    <xsl:param name="collName"/>
     
    3537    </xsl:apply-templates>
    3638  </xsl:template>
    37 
     39-->
    3840  <xsl:template match="collection">
    3941    <xsl:param name="collName"/>
     
    4345    </xsl:call-template>
    4446    <p />
    45     <h3>About this collection</h3>
     47    <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.aboutcoll')"/></h3>
    4648    <table><tr><td><xsl:value-of select="metadataList/metadata[@name='colDescription']" disable-output-escaping='yes'/></td></tr></table>
    4749    <p />
    48     <h3>How to find information in the <xsl:value-of select="metadataList/metadata[@name='colName']"/> collection</h3>
     50    <h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.howtofind', $collName)"/></h3>
    4951    some help stuff goes here
    5052  </xsl:template>
    5153
    52  
     54<!--
    5355  <xsl:template match="metadataList">
    54 <xsl:param name="collName">coll-name</xsl:param>
    55 <h2><xsl:call-template name="text"><xsl:with-param name="key">about.description</xsl:with-param></xsl:call-template></h2>
    56 <p/>
    57 <table width='537'>
    58 <xsl:for-each select="metadata">
    59 <tr valign='top'><td><b><xsl:value-of select="@name"/></b></td><td><xsl:value-of select="."/></td></tr>
    60 </xsl:for-each>
    61 </table>
    62 </xsl:template>
    63 
    64 <xsl:template match="serviceList">
    65 <xsl:param name="collName">coll-name</xsl:param>
    66 <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    67 <h2><xsl:call-template name="text"><xsl:with-param name="key">about.services</xsl:with-param></xsl:call-template></h2>
    68 <xsl:if test="count(service) > 0">
    69 <table>
    70 <xsl:for-each select="service">
    71 <xsl:variable name="action"><xsl:choose>
    72         <xsl:when test="@type='query'">q</xsl:when>
    73         <xsl:when test="@type='browse'">b</xsl:when>
    74         <xsl:when test="@type='process'">pr</xsl:when>
    75         <xsl:when test="@type='applet'">a</xsl:when>
    76         <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
    77 </xsl:choose></xsl:variable>
    78 <xsl:if test="$action !='DO_NOT_DISPLAY'">
    79 <tr><td><a href="{$library}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="@name"/></a></td></tr>
    80 </xsl:if>
    81 </xsl:for-each>
    82 </table>
    83 </xsl:if>
    84 <xsl:call-template name="greenBar"/>
    85 </xsl:template>
    86 
     56    <xsl:param name="collName"/>
     57    <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.description')"/></h2>
     58    <p/>
     59    <table width='537'>
     60      <xsl:for-each select="metadata">
     61    <tr valign='top'><td><b><xsl:value-of select="@name"/></b></td><td><xsl:value-of select="."/></td></tr>
     62      </xsl:for-each>
     63    </table>
     64  </xsl:template>
     65-->
     66<!--
     67  <xsl:template match="serviceList">
     68    <xsl:param name="collName"/>
     69    <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h2>
     70    <xsl:if test="count(service) > 0">
     71      <table>
     72    <xsl:for-each select="service">
     73      <xsl:variable name="action"><xsl:choose>
     74          <xsl:when test="@type='query'">q</xsl:when>
     75          <xsl:when test="@type='browse'">b</xsl:when>
     76          <xsl:when test="@type='process'">pr</xsl:when>
     77          <xsl:when test="@type='applet'">a</xsl:when>
     78          <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
     79        </xsl:choose></xsl:variable>
     80      <xsl:if test="$action !='DO_NOT_DISPLAY'">
     81        <tr><td><a href="{$library_name}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="@name"/></a></td></tr>
     82      </xsl:if>
     83    </xsl:for-each>
     84      </table>
     85    </xsl:if>
     86    <xsl:call-template name="greenBar"/>
     87  </xsl:template>
     88-->
    8789
    8890
  • trunk/gsdl3/web/interfaces/nzdl/transform/basicquery.xsl

    r4273 r4711  
    33  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    44  xmlns:java="http://xml.apache.org/xslt/java"
    5   extension-element-prefixes="java">
     5  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
     6  extension-element-prefixes="java util"
     7  exclude-result-prefixes="java util">
     8
    69 
    710  <xsl:include href="style.xsl"/>
     
    1316  <xsl:template name="pageHead">
    1417    <head>
    15       <title><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title>
     18      <title><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/></title>
    1619    </head>
    1720    <xsl:call-template name="headScript"/>
     
    1922
    2023  <xsl:template match="pageResponse">
    21     <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
    22     <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
     24    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
    2325
    2426    <center>
     
    3436    <xsl:if test="documentNodeList">
    3537      <xsl:call-template name="query-response">
    36     <xsl:with-param name="library" select="$library"/>
    3738    <xsl:with-param name="collName" select="$collName"/>
    3839      </xsl:call-template>
    3940    </xsl:if>
    40     <xsl:call-template name="greenBar"/>
     41    <center>
     42      <xsl:call-template name="greenBar"/>
     43    </center>
    4144  </xsl:template>
    4245 
    4346  <xsl:template name="query-response">
    44     <xsl:param name="library"/>
    4547    <xsl:param name="collName"/>
    4648    <xsl:call-template name="greenBarResults"/>
     
    5052    <xsl:if test="count(termList/term) > 0">
    5153      <small>
    52     <xsl:call-template name="text"><xsl:with-param name="key">query.wordcount</xsl:with-param></xsl:call-template>
     54    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.wordcount')"/>
    5355    <xsl:for-each select="termList/term">
    5456      <xsl:if test="position() > 1">, </xsl:if>
     
    6466      <xsl:choose>
    6567    <xsl:when test="$numDocsMatched='0'">
    66       <xsl:call-template name="text"><xsl:with-param name="key">query.nodocsmatch</xsl:with-param></xsl:call-template>
     68      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.nodocsmatch')"/>
    6769    </xsl:when>
    6870    <xsl:when test="$numDocsMatched='1'">
    69       <xsl:call-template name="text"><xsl:with-param name="key">query.onedocsmatch</xsl:with-param></xsl:call-template>
     71      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.onedocsmatch')"/>
    7072    </xsl:when>
    7173    <xsl:otherwise>
    72       <xsl:value-of select="$numDocsMatched"/> documents matched the query.
     74      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.manydocsmatch', $numDocsMatched)"/>
    7375    </xsl:otherwise>
    7476      </xsl:choose>
     
    7678   
    7779    <!-- Display the matching documents -->
    78     <xsl:variable name="hp"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
    79     <xsl:variable name="hn" select="ancestor::page/pageRequest/paramList/param[@name='hn']/@value"/>     
     80    <xsl:variable name="hp"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
     81    <xsl:variable name="hn" select="/page/pageRequest/paramList/param[@name='hn']/@value"/>     
    8082    <table>
    8183      <tr valign="top">
     
    9294    </table>
    9395    <!-- next and prev links at bottom of page -->
    94     <xsl:call-template name="result-navigation"><xsl:with-param name="library" select="$library"/></xsl:call-template>
     96    <xsl:call-template name="result-navigation"><xsl:with-param name="library" select="$library_name"/></xsl:call-template>
    9597  </xsl:template>
    9698
     
    99101    <xsl:param name="collName"/>
    100102    <xsl:variable name="subaction" select="../pageRequest/@subaction"/>
    101     <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
    102     <form name="QueryForm" method="get" action="/gsdl3/{$library}">
     103    <form name="QueryForm" method="get" action="/gsdl3/{$library_name}">
    103104      <input type="hidden" name="a" value="q"/>
    104105      <input type="hidden" name="sa" value="{$subaction}"/>
     
    115116    <table>
    116117      <tr><td>
    117       Search for <xsl:apply-templates select="param[@name='index']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='index']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates><xsl:if test="param[@name='level']">at <xsl:apply-templates select="param[@name='level']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='level']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> level</xsl:if> which contain <xsl:apply-templates select="param[@name='matchMode']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='matchMode']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> of the words
     118      Search for <xsl:apply-templates select="param[@name='index']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='index']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates><xsl:if test="param[@name='level']">at <xsl:apply-templates select="param[@name='level']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='level']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> level</xsl:if><xsl:call-template name='query_mode'/>
    118119    </td></tr>
    119120      <xsl:call-template name="query-and-submit"/>
     
    121122  </xsl:template>
    122123 
     124  <!-- new template for match mode -->
     125  <xsl:template name='query_mode'>
     126    <xsl:variable name="qt" select="/page/pageRequest/paramList/param[@name='qt']/@value"/>
     127    <xsl:choose>
     128      <xsl:when test="$qt=1">
     129    <xsl:variable name="qfm" select="/page/pageRequest/paramList/param[@name='qfm']/@value"/>
     130    <xsl:choose>
     131      <xsl:when test="$qfm=1">
     132        and display results in <xsl:apply-templates select="param[@name='sortBy']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='sortBy']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> order
     133      </xsl:when>
     134      <xsl:otherwise>
     135        which contain <xsl:apply-templates select="param[@name='matchMode']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='matchMode']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> of
     136      </xsl:otherwise>
     137    </xsl:choose>
     138      </xsl:when>
     139      <xsl:otherwise>
     140    <xsl:variable name="ct" select="/page/pageRequest/paramList/param[@name='ct']/@value"/>
     141    <xsl:variable name="qm" select="/page/pageRequest/paramList/param[@name='qm']/@value"/>
     142    <xsl:choose>
     143      <xsl:when test="$qm=1 and $ct=0">
     144        using ranked/bool query
     145      </xsl:when>
     146      <xsl:when test="$qm=1 and $ct=1">
     147        and display results in <xsl:apply-templates select="param[@name='sortBy']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='sortBy']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> order
     148      </xsl:when>
     149      <xsl:otherwise>
     150        which contain <xsl:apply-templates select="param[@name='matchMode']"><xsl:with-param name="default"><xsl:apply-templates select="param[@name='matchMode']" mode="calculate-default"/></xsl:with-param></xsl:apply-templates> of the words
     151      </xsl:otherwise>
     152    </xsl:choose>
     153      </xsl:otherwise>
     154    </xsl:choose>
     155  </xsl:template>
     156
     157  <xsl:template match="param[@name='matchMode']" mode='query1'>
     158   <xsl:param name='default'/>
     159    in query 1
     160    <xsl:variable name="qfm" select="/page/pageRequest/paramList/param[@name='qfm']/@value"/>
     161    <xsl:choose>
     162      <xsl:when test="$qfm=1">
     163    and display results in <xsl:apply-templates select="../param[@name='sortBy']"><xsl:with-param name="default" select="$default"/></xsl:apply-templates> order
     164      </xsl:when>
     165      <xsl:otherwise>
     166    which contain <xsl:apply-templates select='.'><xsl:with-param name="default" select="$default"/></xsl:apply-templates> of the words
     167      </xsl:otherwise>
     168    </xsl:choose>
     169  </xsl:template>
     170 
    123171  <xsl:template name="query-and-submit">
    124     <xsl:variable name="qb" select="ancestor::page/pageRequest/paramList/param[@name='qb']/@value"/>
     172    <xsl:variable name="qt" select="/page/pageRequest/paramList/param[@name='qt']/@value"/>
    125173    <xsl:choose>
    126       <xsl:when test="$qb=1"><!-- large query box -->
    127     <tr><td>
    128         <textarea name="q" cols='63' rows='10'>
    129           <xsl:apply-templates select="param[@name='query']" mode="calculate-default"/><xsl:text> </xsl:text><!-- put a space here just in case there is no value- mozilla craps out if have a <textarea /> element -->
    130         </textarea>
    131       </td></tr>
     174      <xsl:when test="$qt=1"> <!-- doing form query -->
     175    <xsl:variable name="qfm" select="/page/pageRequest/paramList/param[@name='qfm']/@value"/>
     176    <xsl:choose>
     177      <xsl:when test="$qfm=1">
     178        <tr><td><xsl:apply-templates select="param[@name='complexField']"/></td></tr>
     179      </xsl:when>
     180      <xsl:otherwise>
     181        <tr><td><xsl:apply-templates select="param[@name='simpleField']"/></td></tr>
     182      </xsl:otherwise>
     183    </xsl:choose>
    132184    <tr><td align='right'>
    133185        <input type="submit"><xsl:attribute name="value"><xsl:value-of select='../display/submit'/></xsl:attribute></input>
    134186      </td></tr>
    135187      </xsl:when>
    136       <xsl:otherwise>
    137     <tr><td>
    138         <xsl:variable name="qs"><xsl:apply-templates select="param[@name='query']" mode="calculate-default"/></xsl:variable>
    139         <nobr><xsl:apply-templates select="param[@name='query']"><xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs)"/></xsl:apply-templates><input type="submit"><xsl:attribute name="value"><xsl:value-of select='../display/submit'/></xsl:attribute></input></nobr>
    140       </td></tr>
     188      <xsl:otherwise> <!-- doing text query -->
     189    <xsl:variable name="qb" select="/page/pageRequest/paramList/param[@name='qb']/@value"/>
     190    <xsl:choose>
     191      <xsl:when test="$qb=1"><!-- large query box -->
     192        <tr><td>
     193        <textarea name="q" cols='63' rows='10'>
     194          <xsl:apply-templates select="param[@name='query']" mode="calculate-default"/><xsl:text> </xsl:text><!-- put a space here just in case there is no value- mozilla craps out if have a <textarea /> element -->
     195        </textarea>
     196          </td></tr>
     197        <tr><td align='right'>
     198        <input type="submit"><xsl:attribute name="value"><xsl:value-of select='../display/submit'/></xsl:attribute></input>
     199          </td></tr>
     200      </xsl:when>
     201      <xsl:otherwise>
     202        <tr><td>
     203        <xsl:variable name="qs"><xsl:apply-templates select="param[@name='query']" mode="calculate-default"/></xsl:variable>
     204        <nobr><xsl:apply-templates select="param[@name='query']"><xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs)"/></xsl:apply-templates><input type="submit"><xsl:attribute name="value"><xsl:value-of select='../display/submit'/></xsl:attribute></input></nobr>
     205          </td></tr>
     206      </xsl:otherwise>
     207    </xsl:choose>
    141208      </xsl:otherwise>
    142209    </xsl:choose>
     
    145212  <xsl:template match="param" mode="calculate-default">
    146213    <xsl:variable name="pname" select="@name"/>
    147     <xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose>
     214    <xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name=$pname]"><xsl:value-of select="/page/pageRequest/paramList/param[@name=$pname]/@value"/></xsl:when><xsl:otherwise><xsl:value-of select="@default"/></xsl:otherwise></xsl:choose>
    148215  </xsl:template>
    149216 
    150217  <xsl:template match="documentNode">
    151218    <xsl:param name="collName"/>
    152     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    153219   
    154220    <td>
    155       <a><xsl:attribute name="href"><xsl:value-of select='$library'/>?a=d&amp;c=<xsl:value-of select='$collName'/>&amp;d=<xsl:value-of select='@nodeID'/><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if></xsl:attribute>
     221      <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="@nodeType='leaf'">&amp;sib=1</xsl:if></xsl:attribute>
    156222    <xsl:apply-templates select="." mode="displayNodeIcon"/>
    157223      </a>
  • trunk/gsdl3/web/interfaces/nzdl/transform/classifier.xsl

    r4254 r4711  
    33  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    44  xmlns:java="http://xml.apache.org/xslt/java"
    5   extension-element-prefixes="java">
     5  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
     6  extension-element-prefixes="java util"
     7  exclude-result-prefixes="java util">
    68 
    79  <xsl:include href="style.xsl"/>
     
    1113  <xsl:template name="pageHead">
    1214    <head>
    13       <title><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title>
     15      <title><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/></title>
    1416    </head>
    1517    <xsl:call-template name="headScript"/>
     
    1719
    1820  <xsl:template match="pageResponse">
    19     <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
     21    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
    2022    <xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
    2123    <center>
     
    3941    <xsl:param name="serviceName"/>
    4042    <xsl:variable name="cl_name"><xsl:value-of select="@name"/></xsl:variable>
    41     <xsl:variable name="interleave"><xsl:value-of select="ancestor::page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@documentInterleave"/></xsl:variable>
    42     <xsl:variable name="orientation"><xsl:value-of select="ancestor::page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@orientation"/></xsl:variable>
     43    <xsl:variable name="interleave"><xsl:value-of select="/page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@documentInterleave"/></xsl:variable>
     44    <xsl:variable name="orientation"><xsl:value-of select="/page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@orientation"/></xsl:variable>
    4345    <xsl:variable name='mode'><xsl:value-of select='$orientation'/>-<xsl:value-of select='$interleave'/></xsl:variable>
    4446    <!-- cant seem to do this any other way, ie mode='{$mode}' doesn't work -->
     
    7779  <!--vertical and interleave = false: process all classifier nodes, recursively, then do the document ones separately -->
    7880  <xsl:template match="classifier" mode="vertical-false">
    79     <xsl:param name="collName">coll-name</xsl:param>
    80     <xsl:param name="serviceName">service-name</xsl:param>
     81    <xsl:param name="collName"/>
     82    <xsl:param name="serviceName"/>
    8183    <!-- process the nodes and documents separately-->
    8284    <table width='537'>
     
    9597
    9698  <xsl:template match="classifier" mode="horizontal-true">
    97     <xsl:param name="collName">coll-name</xsl:param>
    98     <xsl:param name="serviceName">service-name</xsl:param>
     99    <xsl:param name="collName"/>
     100    <xsl:param name="serviceName"/>
    99101    <!-- process the nodes and documents together -->
    100102   
     
    122124
    123125  <xsl:template match="classifier" mode="horizontal-false">
    124     <xsl:param name="collName">coll-name</xsl:param>
    125     <xsl:param name="serviceName">service-name</xsl:param>
     126    <xsl:param name="collName"/>
     127    <xsl:param name="serviceName"/>
    126128    <!-- process the nodes and documents separately-->
    127129   
     
    144146<xsl:template match="documentNode">
    145147<xsl:param name="collName">coll-name</xsl:param>
    146 <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
    147 <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>
     148<td><a href="{$library_name}?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>
    148149</xsl:template>
    149150 
    150151  <!-- icon + title -->
    151152  <xsl:template match="classifierNode">
    152     <xsl:param name="collName">coll-name</xsl:param>
    153     <xsl:param name="serviceName">service-name</xsl:param>
    154     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    155     <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:if test="parent::node()[@orientation='horizontal']">&amp;sib=1</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>
     153    <xsl:param name="collName"/>
     154    <xsl:param name="serviceName"/>
     155    <td><a><xsl:attribute name='href'><xsl:value-of select='$library_name'/>?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:if test="parent::node()[@orientation='horizontal']">&amp;sib=1</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>
    156156  </xsl:template>
    157157 
     
    161161    <xsl:param name="collName">coll-name</xsl:param>
    162162    <xsl:param name="serviceName">service-name</xsl:param>
    163     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    164     <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>
     163    <td><a><xsl:attribute name='href'><xsl:value-of select='$library_name'/>?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>
    165164  </xsl:template>
    166165  -->
     
    171170
    172171  <xsl:template match="classifierNode" mode="process-all-children">
    173     <xsl:param name="collName">coll-name</xsl:param>
    174     <xsl:param name="serviceName">service-name</xsl:param>
     172    <xsl:param name="collName"/>
     173    <xsl:param name="serviceName"/>
    175174    <td><p/>
    176175    <!-- only do this if there are children -->
     
    205204
    206205  <xsl:template match="classifierNode" mode="process-node-children">
    207     <xsl:param name="collName">coll-name</xsl:param>
    208     <xsl:param name="serviceName">ClassifierBrowse</xsl:param>
     206    <xsl:param name="collName"/>
     207    <xsl:param name="serviceName"/>
    209208    <td><p/>
    210209      <xsl:if test='classifierNode'><!-- only do this if there are child nodes - netscape craps out at an empty table like <table  /> -->
  • trunk/gsdl3/web/interfaces/nzdl/transform/gsdl.xsl

    r4151 r4711  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    22<xsl:stylesheet version="1.0"
    3   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     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  extension-element-prefixes="java util"
     7  exclude-result-prefixes="java util">
    48
    59  <xsl:include href="style.xsl"/>
     
    1216 <xsl:template name="pageHead">
    1317    <head>
    14       <title><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title>
     18      <title><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/></title>
    1519    </head>
    1620    <xsl:call-template name="headScript"/>
  • trunk/gsdl3/web/interfaces/nzdl/transform/help.xsl

    r4151 r4711  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    22<xsl:stylesheet version="1.0"
    3   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     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  extension-element-prefixes="java util"
     7  exclude-result-prefixes="java util">
    48
    59  <xsl:include href="style.xsl"/>
     
    1115  <xsl:template name="pageHead">
    1216    <head>
    13       <title>Help</title>
     17      <title><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'help')"/></title>
    1418    </head>
    1519    <xsl:call-template name="headScript"/>
     
    1721
    1822  <xsl:template match="pageResponse">
    19     <xsl:variable name="collName" select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/>
     23    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
    2024    <center>
    2125      <xsl:call-template name="collectionPageBanner">
  • trunk/gsdl3/web/interfaces/nzdl/transform/home.xsl

    r4277 r4711  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    22<xsl:stylesheet version="1.0"
    3   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     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  extension-element-prefixes="java util"
     7  exclude-result-prefixes="java util">
    48
    59  <xsl:include href="style.xsl"/>
     
    1115 <xsl:template name="pageHead">
    1216    <head>
    13       <title><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title>
     17      <title>
     18    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/>
     19      </title>
    1420      <xsl:call-template name="headScript"/>
    1521    </head>
     
    5763    <tr valign='top'>
    5864      <td>
    59     <table><tr valign='middle'><td><img src="interfaces/nzdl/images/gbull.gif"/></td><td><a><xsl:attribute name="href"><xsl:value-of select="ancestor::page/pageExtra/config/library_name"/>?a=p&amp;sa=gsdl</xsl:attribute>About<br />Greenstone</a></td></tr></table>
     65    <table><tr valign='middle'><td><img src="interfaces/nzdl/images/gbull.gif"/></td><td><a href="{$library_name}?a=p&amp;sa=gsdl">About<br />Greenstone</a></td></tr></table>
    6066   
    6167      </td>
     
    104110<!-- the ancestor axis contains the parent of the context node, and its parent and so on. to pick one node among these: ancestor::elem-name. I dont know how this works if there are two nodes with the same name in the axis. -->
    105111  <xsl:template match="collection">
     112    <xsl:variable name="ct"><xsl:choose><xsl:when test="metadataList/metadata[@name='buildType']='mgpp'">1</xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
    106113    <p />
    107     <a>
    108       <xsl:attribute name='href'>
    109     <xsl:value-of select="ancestor::page/pageExtra/config/library_name"/>?a=p&amp;sa=about&amp;c=<xsl:value-of select='@name'/>
    110       </xsl:attribute>
     114    <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}&amp;ct={$ct}">
    111115      <img width="150" border="1">
    112116    <xsl:attribute name="src">
  • trunk/gsdl3/web/interfaces/nzdl/transform/home_text.xsl

    r4151 r4711  
    55  extension-element-prefixes="java">
    66
     7  <!--<xsl:include href="style.xsl"/>-->
    78<xsl:template name="textpagetitle">New Zealand Digital Library</xsl:template>
    89<xsl:template name="textprojhead">The New Zealand Digital Library Project</xsl:template>
     
    4546
    4647<p align='right'/>
    47 <a><xsl:attribute name="href"><xsl:value-of select="ancestor::page/pageExtra/config/library_name"/>?a=p&amp;sa=gsdl</xsl:attribute>More...</a>
     48<a href="{$library_name}?a=p&amp;sa=gsdl">More...</a>
    4849</xsl:template>
    4950
     
    119120Waikato</b>, and developed and distributed in cooperation with
    120121<b>UNESCO</b> and the <b>Human Info NGO</b>.  It is open-source
    121 software, available from <a
    122 href="http://greenstone.org">http://greenstone.org</a> under the terms of
     122software, available from <a href="http://greenstone.org">http://greenstone.org</a> under the terms of
    123123the GNU General Public License.
    124124
     
    160160tool in this context.
    161161</td>
    162 <td><a href="http://www.unesco.org"><img src="_httpimg_/unesco.gif" border="0"/></a></td>
     162<td><a href="http://www.unesco.org"><img src="interfaces/nzdl/images/unesco.gif" border="0"/></a></td>
    163163</tr>
    164164<tr valign="top">
     
    176176</xsl:template>
    177177
    178     <xsl:template name="textimagegreenstone">Greenstone Digital Library Software</xsl:template>
    179    
    180     <xsl:template name="nzdlpagefooter">
     178  <xsl:template name="textimagegreenstone">Greenstone Digital Library Software</xsl:template>
     179 
     180  <xsl:template name="nzdlpagefooter">
    181181      <p /><xsl:call-template name="iconblankbar"/>
    182182      <p /><a href="http://www.nzdl.org">New Zealand Digital Library Project</a>
  • trunk/gsdl3/web/interfaces/nzdl/transform/pref.xsl

    r4274 r4711  
    11<?xml version="1.0" encoding="ISO-8859-1"?>
    22<xsl:stylesheet version="1.0"
    3   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
     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  extension-element-prefixes="java util"
     7  exclude-result-prefixes="java util">
    48
    59  <xsl:include href="style.xsl"/>
     
    1115  <xsl:template name="pageHead">
    1216    <head>
    13       <title>Preferences</title>
     17      <title><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref')"/></title>
    1418    </head>
    1519    <xsl:call-template name="headScript"/>
     
    1721
    1822  <xsl:template match="pageResponse">
    19     <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>   
    20     <xsl:variable name="collName" select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/>
     23    <xsl:variable name="collName" select="/page/pageRequest/paramList/param[@name='c']/@value"/>
    2124    <center>
    2225      <xsl:call-template name="collectionPageBanner">
     
    2528      </xsl:call-template>
    2629
    27       <form name="PrefForm" method="get" action="/gsdl3/{$library}">
     30      <form name="PrefForm" method="get" action="/gsdl3/{$library_name}">
    2831    <input type='hidden' name='a' value='p'/>
    2932    <input type='hidden' name='sa' value='pref'/>
    3033    <table>
    31       <tr><td><h3>Presentation preferences</h3></td></tr>
     34      <tr><td><h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.prespref')"/></h3></td></tr>
    3235      <tr><td><xsl:call-template name="pres-prefs"/></td></tr>
    3336      <tr><td><xsl:call-template name="greenBar"/></td></tr>
    34       <tr><td><h3>Search Preferences</h3></td></tr>
     37      <tr><td><h3><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.searchpref')"/></h3></td></tr>
    3538      <tr><td><xsl:call-template name="search-prefs"/></td></tr>
    3639      <tr><td><xsl:call-template name="greenBar"/></td></tr>
     
    4346  <xsl:template name="pres-prefs">
    4447    <table>
    45       <tr><td>Interface language:</td><td align='left'>x</td></tr>
    46       <tr><td>Encoding:</td><td align='left'>x</td></tr>
    47       <tr><td>Interface format:</td><td align='left'>x</td></tr>
     48      <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.interfacelang')"/></td><td align='left'>x</td></tr>
     49      <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.encoding')"/></td><td align='left'>x</td></tr>
     50      <tr><td><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'pref.interfaceformat')"/></td><td align='left'>x</td></tr>
    4851    </table>
    4952  </xsl:template>
    5053 
    5154  <xsl:template name="search-prefs">
     55    <xsl:variable name="ct"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='ct']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='ct']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
     56    ct=<xsl:value-of select='$ct'/>
    5257    <table>
    53       <tr><td></td><td align='right'><input type='submit' value='set prefs'/></td></tr>
    54       <!-- query box size -->
    55       <xsl:variable name="boxsize"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='qb']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='qb']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
    56       <tr><td valign='baseline'>Query box size:</td><td><input type='radio' name='qb' value='0'><xsl:if test="$boxsize=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> regular query box<br />
    57       <input type='radio' name='qb' value='1'><xsl:if test="$boxsize=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> large query box</td></tr>
     58      <tr><td> </td><td> </td><td align='right'><input type='submit' value='set prefs'/></td></tr>
     59      <xsl:choose>
     60    <xsl:when test="$ct=0">
     61      <xsl:call-template name='text-search-prefs'/>
     62    </xsl:when>
     63    <xsl:otherwise>
     64      <!-- search type -->
     65      <xsl:variable name='querytype'><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qt']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qt']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
     66      <tr><td  rowspan='2' valign='baseline'>Type of search:</td><td><input type='radio' name='qt' value='0'><xsl:if test="$querytype=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td align='left'> text search</td></tr>
     67      <tr><td></td><td>
     68          <table>
     69        <xsl:call-template name='text-search-prefs'/>
     70          </table></td></tr>
     71     
     72      <tr><td> </td><td><input type='radio' name='qt' value='1'><xsl:if test="$querytype=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> form search<br /></td></tr>
     73      <tr><td></td><td></td><td>
     74          <table>
     75        <!-- query form mode -->
     76        <xsl:variable name="queryfmode"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfm']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qfm']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
     77        <tr><td valign='baseline'>Form type:</td><td><input type='radio' name='qfm' value='0'><xsl:if test="$queryfmode=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> simple <br />
     78            <input type='radio' name='qfm' value='1'><xsl:if test="$queryfmode=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> advanced</td></tr>
     79        <!-- query form num boxes -->
     80        <xsl:variable name="numbox"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qfn']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qfn']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
     81        <tr><td colspan='2'>with <select name="qfn">
     82              <option value="2"><xsl:if test="$numbox=2"><xsl:attribute name="selected"></xsl:attribute></xsl:if>2</option>
     83              <option value="4"><xsl:if test="$numbox=4"><xsl:attribute name="selected"></xsl:attribute></xsl:if>4</option>
     84              <option value="6"><xsl:if test="$numbox=6"><xsl:attribute name="selected"></xsl:attribute></xsl:if>6</option>
     85              <option value="8"><xsl:if test="$numbox=8"><xsl:attribute name="selected"></xsl:attribute></xsl:if>8</option>
     86            </select> fields</td></tr>
     87          </table></td></tr>
     88    </xsl:otherwise>
     89      </xsl:choose>
    5890      <!-- case folding -->
    59       <xsl:variable name="case"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='case']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='case']/@value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable>
    60       <tr><td valign='baseline'>Case differences:</td><td><input type='radio' name='ca' value='1'><xsl:if test="$case=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> ignore case differences<br />
    61       <input type='radio' name='ca' value='0'><xsl:if test="$case=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> upper/lower case must match</td></tr>
     91      <xsl:variable name="case"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='case']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='case']/@value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable>
     92      <tr><td rowspan='2' valign='baseline'>Case differences:</td><td><input type='radio' name='ca' value='1'><xsl:if test="$case=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> ignore case differences</td></tr>
     93      <tr><td><input type='radio' name='ca' value='0'><xsl:if test="$case=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> upper/lower case must match</td></tr>
    6294      <!-- stemming -->
    63       <xsl:variable name="stem"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='stem']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='stem']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
    64       <tr><td valign='baseline'>Word endings:</td><td><input type='radio' name='st' value='1'><xsl:if test="$stem=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> ignore word endings<br />
    65       <input type='radio' name='st' value='0'><xsl:if test="$stem=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> whole word must match</td></tr>
    66       <!-- query mode -->
    67       <xsl:variable name="querymode"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='qm']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='qm']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
    68       <tr><td valign='baseline'>Query mode:</td><td><input type='radio' name='qm' value='0'><xsl:if test="$querymode=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> simple query mode<br />
    69           <input type='radio' name='qm' value='1'><xsl:if test="$querymode=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input> advanced query mode (allows boolean searching using !, &amp;, |, and parentheses)</td></tr>
     95      <xsl:variable name="stem"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='stem']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='stem']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
     96      <tr><td  rowspan='2' valign='baseline'>Word endings:</td><td><input type='radio' name='st' value='1'><xsl:if test="$stem=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> ignore word endings</td></tr>
     97      <tr><td><input type='radio' name='st' value='0'><xsl:if test="$stem=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> whole word must match</td></tr>
    7098      <!-- hit display -->
    71       <xsl:variable name="maxdocs"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='maxDocs']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='maxDocs']/@value"/></xsl:when><xsl:otherwise>50</xsl:otherwise></xsl:choose></xsl:variable>
    72       <xsl:variable name="hits"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
    73       <tr><td colspan='2'>Return up to
     99      <xsl:variable name="maxdocs"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='maxDocs']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='maxDocs']/@value"/></xsl:when><xsl:otherwise>50</xsl:otherwise></xsl:choose></xsl:variable>
     100      <xsl:variable name="hits"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hp']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hp']/@value"/></xsl:when><xsl:otherwise>20</xsl:otherwise></xsl:choose></xsl:variable>
     101      <tr><td colspan='3'>Return up to
    74102      <select name="md">
    75103        <option value="50"><xsl:if test="$maxdocs=50"><xsl:attribute name="selected"></xsl:attribute></xsl:if>50</option>
     
    90118  </xsl:template>
    91119
     120  <xsl:template name="text-search-prefs">
     121    <!-- query mode -->
     122    <xsl:variable name="querymode"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qm']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qm']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
     123    <tr><td rowspan='2' valign='baseline'>Query mode:</td><td><input type='radio' name='qm' value='0'><xsl:if test="$querymode=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> simple query mode</td></tr>
     124    <tr><td><input type='radio' name='qm' value='1'><xsl:if test="$querymode=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> advanced query mode (allows boolean searching using !, &amp;, |, and parentheses)</td></tr>
     125   
     126    <!-- query box size -->
     127    <xsl:variable name="boxsize"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='qb']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='qb']/@value"/></xsl:when><xsl:otherwise>0</xsl:otherwise></xsl:choose></xsl:variable>
     128    <tr><td rowspan='2' valign='baseline'>Query box size:</td><td><input type='radio' name='qb' value='0'><xsl:if test="$boxsize=0"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> regular query box</td></tr>
     129    <tr><td><input type='radio' name='qb' value='1'><xsl:if test="$boxsize=1"><xsl:attribute name="checked"></xsl:attribute></xsl:if></input></td><td> large query box</td></tr>
     130  </xsl:template>
    92131</xsl:stylesheet>
  • trunk/gsdl3/web/interfaces/nzdl/transform/style.xsl

    r4278 r4711  
    33  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    44  xmlns:java="http://xml.apache.org/xslt/java"
    5   extension-element-prefixes="java">
    6  
     5  xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
     6  extension-element-prefixes="java util"
     7  exclude-result-prefixes="java util">
     8 
     9  <!-- some global parameters - these are set by whoever is invoking the transformation -->
     10  <xsl:param name="interface_name"/>
     11  <xsl:param name="library_name"/>
     12
    713  <!-- the main page layout template is here -->
    814  <xsl:template match="page">
     
    6066
    6167  <xsl:template name="genericPageBanner">
    62     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    63     <xsl:variable name="lang" select="ancestor::page/@lang"/>
     68    <xsl:variable name="library" select="/page/pageExtra/config/library_name"/>
     69    <xsl:variable name="lang" select="/page/@lang"/>
    6470    <center>
    6571      <table width="537">
    6672    <tr><td align="left"></td>
    6773      <td align="right">
    68         <a href="{$library}?a=p&amp;sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
     74        <a href="{$library_name}?a=p&amp;sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
    6975      </td>
    7076    </tr>
     
    7985    <xsl:param name="collName"/>
    8086    <xsl:param name="pageType"/>
    81     <xsl:variable name="httpPath" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
    82     <xsl:variable name="colIcon" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='colIcon']"/>
    83     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    84     <xsl:variable name="lang" select="ancestor::page/@lang"/>
     87    <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
     88    <xsl:variable name="colIcon" select="/page/pageResponse/collection/metadataList/metadata[@name='colIcon']"/>
     89    <xsl:variable name="library" select="/page/pageExtra/config/library_name"/>
     90    <xsl:variable name="lang" select="/page/@lang"/>
    8591    <table width="537">
    8692      <tr>
    8793    <td align="left" rowspan="2">
    88       <a href="{$library}?a=p&amp;sa=about&amp;c={$collName}">
     94      <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
    8995        <img border="1" src="{$httpPath}/images/{$colIcon}">
    9096          <xsl:attribute name="alt">
    91         <xsl:call-template name="text">
    92           <xsl:with-param name="key">aboutpage</xsl:with-param>
    93         </xsl:call-template>
     97        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
    9498          </xsl:attribute>
    9599        </img>
     
    97101    </td>
    98102    <td align="right">
    99       <a href="{$library}?a=p&amp;sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
    100       <a href="{$library}?a=p&amp;sa=help&amp;c={$collName}" onMouseover="roll('help',1);" onMouseOut="roll('help',0);"><img name="help" src="interfaces/nzdl/images/{$lang}/chelpof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chelpon.gif');" border="0" alt="Help page"/></a>
    101       <a href="{$library}?a=p&amp;sa=pref&amp;c={$collName}" onMouseover="roll('pref',1);" onMouseOut="roll('pref',0);"><img name="pref" src="interfaces/nzdl/images/{$lang}/cprefof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/cprefon.gif');" border="0" alt="Preferences page"/></a>
     103      <a href="{$library_name}?a=p&amp;sa=home" onMouseover="roll('homer',1);" onMouseOut="roll('homer',0);"><img name="homer" src="interfaces/nzdl/images/{$lang}/chomeof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chomeon.gif');" border="0" alt="Home page"/></a>
     104      <a href="{$library_name}?a=p&amp;sa=help&amp;c={$collName}" onMouseover="roll('help',1);" onMouseOut="roll('help',0);"><img name="help" src="interfaces/nzdl/images/{$lang}/chelpof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/chelpon.gif');" border="0" alt="Help page"/></a>
     105      <a href="{$library_name}?a=p&amp;sa=pref&amp;c={$collName}" onMouseover="roll('pref',1);" onMouseOut="roll('pref',0);"><img name="pref" src="interfaces/nzdl/images/{$lang}/cprefof.gif" onLoad="gbutton(this, 'interfaces/nzdl/images/{$lang}/cprefon.gif');" border="0" alt="Preferences page"/></a>
    102106    </td>
    103107      </tr>
     
    118122  <xsl:template name="navigationBar">
    119123    <xsl:param name="collName"/>
    120     <xsl:variable name="classifiers" select="ancestor::page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList"/>
    121     <xsl:variable name="action" select="ancestor::page/pageRequest/@action"/>
    122     <xsl:variable name="classifier" select="ancestor::page/pageRequest/paramList/param[@name='cl']/@value"/>
    123     <xsl:variable name="lang" select="ancestor::page/@lang"/>
     124    <xsl:variable name="classifiers" select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList"/>
     125    <xsl:variable name="action" select="/page/pageRequest/@action"/>
     126    <xsl:variable name="classifier" select="/page/pageRequest/paramList/param[@name='cl']/@value"/>
     127    <xsl:variable name="lang" select="/page/@lang"/>
    124128    <!--action=<xsl:value-of select="$action"/>, classifier=<xsl:value-of select="$classifier"/>-->
    125129    <xsl:text disable-output-escaping='yes'>
     
    153157    <xsl:param name="name"/>
    154158    <xsl:param name="alt"/>
    155     <xsl:variable name="lang" select="ancestor::page/@lang"/>
     159    <xsl:variable name="lang" select="/page/@lang"/>
    156160    <a href="{$url}" onMouseOver="roll('{$name}', 1);" onMouseOut="roll('{$name}', 0);"><img name="{$name}" src="interfaces/nzdl/images/{$lang}/t{$name}of.gif" onLoad="gbutton(this,'interfaces/nzdl/images/{$lang}/t{$name}on.gif');" border='0' alt="{$alt}" title="{alt}"/></a>
    157161  </xsl:template>
     
    160164    <xsl:param name="collName"/>
    161165    <xsl:param name="action"/>
    162     <xsl:variable name="lang" select="ancestor::page/@lang"/>
     166    <xsl:variable name="lang" select="/page/@lang"/>
    163167    <xsl:choose>
    164168      <xsl:when test="$action='q'">
     
    166170      </xsl:when>
    167171      <xsl:otherwise>
     172    <!-- need to check for form search -->
     173    <xsl:variable name="query-service">
     174      <xsl:choose>
     175        <xsl:when test="not(/page/pageRequest/paramList/param[@name='ct'])">TextQuery</xsl:when>
     176        <xsl:when test="/page/pageRequest/paramList/param[@name='ct']/@value='0'">TextQuery</xsl:when>
     177        <xsl:when test="/page/pageRequest/paramList/param[@name='qt']/@value='0'">TextQuery</xsl:when>
     178        <xsl:when test="/page/pageRequest/paramList/param[@name='qfm']/@value='0'">FieldQuery</xsl:when>
     179        <xsl:otherwise>AdvancedFieldQuery</xsl:otherwise>
     180      </xsl:choose>
     181    </xsl:variable>
    168182    <xsl:call-template name="navBarImage">
    169       <xsl:with-param name="url">nzdl?a=q&amp;rt=d&amp;s=TextQuery&amp;c=<xsl:value-of select="$collName"/></xsl:with-param>
     183      <xsl:with-param name="url">nzdl?a=q&amp;rt=d&amp;s=<xsl:value-of select="$query-service"/>&amp;c=<xsl:value-of select="$collName"/></xsl:with-param>
    170184      <xsl:with-param name="name">Search</xsl:with-param>
    171185      <xsl:with-param name="alt">Search</xsl:with-param>
     
    178192    <xsl:param name="collName"/>
    179193    <xsl:param name="action"/>
    180     <xsl:variable name="lang" select="ancestor::page/@lang"/>
    181     <xsl:if test="ancestor::page/pageResponse/collection/serviceList/service[@name='PhindApplet']">
     194    <xsl:variable name="lang" select="/page/@lang"/>
     195    <xsl:if test="/page/pageResponse/collection/serviceList/service[@name='PhindApplet']">
    182196      <xsl:choose>
    183197    <xsl:when test="$action='a'"><!-- note, this assumes that the phind applet is the only applet -->
     
    199213    <xsl:param name="classifier"/>
    200214    <xsl:variable name="buttonname"><xsl:choose><xsl:when test="@buttonname"><xsl:value-of select="@buttonname"/></xsl:when><xsl:otherwise><xsl:value-of select="@content"/></xsl:otherwise></xsl:choose></xsl:variable>
    201     <xsl:variable name="lang" select="ancestor::page/@lang"/>
     215    <xsl:variable name="lang" select="/page/@lang"/>
    202216    <xsl:choose>
    203217      <xsl:when test="$classifier=@name">
     
    214228  </xsl:template>
    215229   
    216 
    217 <!-- Navigation Bar
    218 <nobr>
    219 <img
    220 src="/gsdl/images/tsrchgr.gif" width=87 border=0><img
    221 src="/gsdl/images/tspace.gif" width="19" height="17"><a href="/cgi-bin/library?e=&a=d&cl=CL1" onMouseover="roll('titles',1);" onMouseOut="roll('titles',0);"><img
    222 name="titles" src="/gsdl/images/ttitlof.gif" onLoad="gbutton(this,'/gsdl/images/ttitlon.gif');" border=0 alt="Browse alphabetical list of titles"></a><img
    223 src="/gsdl/images/tspace.gif" width="19" height="17"><a href="/cgi-bin/library?e=&a=d&cl=CL2" onMouseover="roll('authors',1);" onMouseOut="roll('authors',0);"><img
    224 name="authors" src="/gsdl/images/tauthof.gif" onLoad="gbutton(this,'/gsdl/images/tauthon.gif');" border=0 alt="Browse alphabetical list of authors"></a><img
    225 src="/gsdl/images/tspace.gif" width="19" height="17"><a href="/cgi-bin/library?e=&a=d&cl=CL3" onMouseover="roll('dates',1);" onMouseOut="roll('dates',0);"><img
    226 name="dates" src="/gsdl/images/tdateof.gif" onLoad="gbutton(this,'/gsdl/images/tdateon.gif');" border=0 alt="Browse by date"></a><img
    227 src="/gsdl/images/tspace.gif" width="19" height="17"><a href="/cgi-bin/library?e=&a=d&cl=CL4" onMouseover="roll('phrase',1);" onMouseOut="roll('phrase',0);"><img
    228 name="phrase" src="/gsdl/images/tphrseof.gif" onLoad="gbutton(this,'/gsdl/images/tphrseon.gif');" border=0 alt="Browse phrases"></a>
    229 </nobr>
    230  End of Navigation Bar -->
    231 
    232230  <!-- do we want different stuff for cluster or same as collection -->
    233231  <xsl:template name="clusterPageBanner">
    234232    <xsl:param name="clusterName"/>
    235     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
     233    <xsl:variable name="library" select="/page/pageExtra/config/library_name"/>
    236234    <table width="537">
    237       <tr><td align="left"><a href="{$library}?a=p&amp;sa=about&amp;c={$clusterName}"><xsl:value-of select="$clusterName"/></a></td><td align="right"><a href="{$library}?a=p&amp;sa=home"><xsl:call-template name="text"><xsl:with-param name="key">home</xsl:with-param></xsl:call-template></a></td></tr></table>
     235      <tr><td align="left"><a href="{$library_name}?a=p&amp;sa=about&amp;c={$clusterName}"><xsl:value-of select="$clusterName"/></a></td><td align="right"><a href="{$library_name}?a=p&amp;sa=home"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home')"/></a></td></tr></table>
    238236   
    239237    <xsl:call-template name="greenBar"/>
     
    255253      <table width="537" cellspacing="0" cellpadding="0">
    256254    <tr valign="top">
    257       <td rowspan="2" align="left"><center><img src="interfaces/nzdl/images/nzdl2gr.gif" width="457" height="181" ><xsl:attribute name="alt"><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></xsl:attribute></img></center></td>
     255      <td rowspan="2" align="left"><center><img src="interfaces/nzdl/images/nzdl2gr.gif" width="457" height="181" ><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'nzdl')"/></xsl:attribute></img></center></td>
    258256      <td align="right"></td>
    259257    </tr>
     
    338336
    339337
    340 
    341 
    342 <!-- text stuff. can be called via xsl:call-template: 
    343 
    344 <xsl:call-template name="text"><xsl:with-param name="key">your text name here</xsl:with-param></xsl:call-template>
    345 
    346 otherwise can be selected by :
    347 
    348 <xsl:apply-templates select="text"/> 
    349 
    350 the text elem to be processed must be in the form
    351 <text name="query/about"/>
    352 
    353 -->
    354 
    355 <xsl:template name="text" match="text">
    356 <xsl:param name="key"><xsl:value-of select="@name"/></xsl:param>
    357 <xsl:variable name="path">ancestor::page/pageExtra/display/<xsl:value-of select='$key'/></xsl:variable>
    358 <xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path)"/></xsl:variable>
    359 <xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
    360 <xsl:otherwise>
    361 
    362 <!-- no match found, output the name of the text string -->
    363 _<xsl:value-of select="$key"/>_</xsl:otherwise>
    364 </xsl:choose>
    365 </xsl:template>
    366 
    367 
    368 <!-- may not have to use this anymore-->
    369 <xsl:template name="text-old" match="text-old">
    370 
    371 <xsl:param name="key"><xsl:value-of select="@name"/></xsl:param>
    372 
    373 <!-- try the current language -->
    374 
    375 <xsl:variable name="path1">ancestor::page/translate/current/text/<xsl:value-of select="$key"/></xsl:variable>
    376 <xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path1)"/></xsl:variable>
    377 <xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
    378 <xsl:otherwise>
    379 
    380 <!-- try the default language -->
    381 <xsl:variable name="path2">ancestor::page/translate/default/text/<xsl:value-of select="$key"/></xsl:variable>
    382 <xsl:variable name="string2"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path2)"/></xsl:variable>
    383 <xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
    384 <xsl:otherwise>
    385 
    386 <!-- no match found, output the name of the text string -->
    387 _<xsl:value-of select="$key"/>_</xsl:otherwise>
    388 </xsl:choose>
    389 </xsl:otherwise>
    390 </xsl:choose>
    391 </xsl:template>
    392 
    393338</xsl:stylesheet> 
Note: See TracChangeset for help on using the changeset viewer.