Changeset 4712


Ignore:
Timestamp:
2003-06-18T12:08:01+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, redoing the document display stuff so that it switches automatically between toc, page nav, and just displaying the text

Location:
trunk/gsdl3/web/interfaces/default/transform
Files:
12 edited

Legend:

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

    r4251 r4712  
    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 
     9  <!-- style includes global params interface_name, page_lang, library_name -->
    710  <xsl:include href="style.xsl"/>
    811 
     
    1114  <xsl:template name="pageHead">
    1215    <head>
    13       <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
     16      <title>
     17    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
     18      </title>
    1419    </head>
    1520  </xsl:template>
    1621
    1722  <xsl:template match="pageResponse">
    18     <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"/>
    1924    <xsl:apply-templates select="collection|serviceCluster"><xsl:with-param name="collName" select="$collName"/></xsl:apply-templates>
    2025  </xsl:template>
    21 
    22 <xsl:template match="collection|serviceCluster">
    23 <xsl:param name="collName">coll-name</xsl:param>
    24 <xsl:if test='name()="collection"'>
    25   <xsl:call-template name="collectionPageBanner">
    26     <xsl:with-param name="collName" select="$collName"/>
    27   </xsl:call-template>
    28 </xsl:if>
    29 <xsl:if test='name()="serviceCluster"'>
    30 <xsl:call-template name="clusterPageBanner">
    31 <xsl:with-param name="clusterName" select="$collName"/>
    32 </xsl:call-template>
    33 </xsl:if>
    34 <p/><xsl:apply-templates select="metadataList">
    35 <xsl:with-param name="collName" select="$collName"/>
    36 </xsl:apply-templates>
    37 <p/><xsl:apply-templates select="serviceList">
    38 <xsl:with-param name="collName" select="$collName"/>
    39 </xsl:apply-templates>
    40 </xsl:template>
    41 
    42 
    43 <xsl:template match="metadataList">
    44 <xsl:param name="collName">coll-name</xsl:param>
    45 <h2><xsl:call-template name="text"><xsl:with-param name="key">about.description</xsl:with-param></xsl:call-template></h2>
    46 <p/>
    47 <table width='537'>
    48 <xsl:for-each select="metadata">
    49 <tr valign='top'><td><b><xsl:value-of select="@name"/></b></td><td><xsl:value-of select="."/></td></tr>
    50 </xsl:for-each>
    51 </table>
    52 </xsl:template>
    53 
    54 <xsl:template match="serviceList">
    55 <xsl:param name="collName">coll-name</xsl:param>
    56 <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    57 <h2><xsl:call-template name="text"><xsl:with-param name="key">about.services</xsl:with-param></xsl:call-template></h2>
    58 <xsl:if test="count(service) > 0">
    59 <table>
    60 <xsl:for-each select="service">
    61 <xsl:variable name="action"><xsl:choose>
    62         <xsl:when test="@type='query'">q</xsl:when>
    63         <xsl:when test="@type='browse'">b</xsl:when>
    64         <xsl:when test="@type='process'">pr</xsl:when>
    65         <xsl:when test="@type='applet'">a</xsl:when>
    66         <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
    67 </xsl:choose></xsl:variable>
    68 <xsl:if test="$action !='DO_NOT_DISPLAY'">
    69 <tr><td><a href="{$library}?a={$action}&amp;rt=d&amp;s={@name}&amp;c={$collName}"><xsl:value-of select="@name"/></a></td></tr>
    70 </xsl:if>
    71 </xsl:for-each>
    72 </table>
    73 </xsl:if>
    74 <xsl:call-template name="greenBar"/>
    75 </xsl:template>
    76 
     26 
     27  <xsl:template match="collection|serviceCluster">
     28    <xsl:param name="collName"/>
     29    <xsl:if test='name()="collection"'>
     30      <xsl:call-template name="collectionPageBanner">
     31    <xsl:with-param name="collName" select="$collName"/>
     32      </xsl:call-template>
     33    </xsl:if>
     34    <xsl:if test='name()="serviceCluster"'>
     35      <xsl:call-template name="clusterPageBanner">
     36    <xsl:with-param name="clusterName" select="$collName"/>
     37      </xsl:call-template>
     38    </xsl:if>
     39    <p/><xsl:apply-templates select="metadataList">
     40      <xsl:with-param name="collName" select="$collName"/>
     41    </xsl:apply-templates>
     42    <p/><xsl:apply-templates select="serviceList">
     43      <xsl:with-param name="collName" select="$collName"/>
     44    </xsl:apply-templates>
     45  </xsl:template>
     46 
     47 
     48  <xsl:template match="metadataList">
     49    <xsl:param name="collName"/>
     50    <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.description')"/></h2>
     51    <p/>
     52    <table width='537'>
     53      <xsl:for-each select="metadata">
     54    <tr valign='top'><td><b><xsl:value-of select="@name"/></b></td><td><xsl:value-of select="."/></td></tr>
     55      </xsl:for-each>
     56    </table>
     57  </xsl:template>
     58 
     59  <xsl:template match="serviceList">
     60    <xsl:param name="collName"/>
     61    <h2><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'about.services')"/></h2>
     62    <xsl:if test="count(service) > 0">
     63      <table>
     64    <xsl:for-each select="service">
     65      <xsl:variable name="action"><xsl:choose>
     66          <xsl:when test="@type='query'">q</xsl:when>
     67          <xsl:when test="@type='browse'">b</xsl:when>
     68          <xsl:when test="@type='process'">pr</xsl:when>
     69          <xsl:when test="@type='applet'">a</xsl:when>
     70          <xsl:otherwise>DO_NOT_DISPLAY</xsl:otherwise>
     71        </xsl:choose></xsl:variable>
     72      <xsl:if test="$action !='DO_NOT_DISPLAY'">
     73        <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>
     74      </xsl:if>
     75    </xsl:for-each>
     76      </table>
     77    </xsl:if>
     78    <xsl:call-template name="greenBar"/>
     79  </xsl:template>
    7780
    7881
  • trunk/gsdl3/web/interfaces/default/transform/applet.xsl

    r4253 r4712  
    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"/>
     
    1014    <head>
    1115      <title>
    12     <xsl:value-of select="ancestor-or-self::page/pageResponse/applet"/>
     16    <xsl:value-of select="pageResponse/applet"/>
    1317      </title>
    1418    </head>
  • trunk/gsdl3/web/interfaces/default/transform/basicquery.xsl

    r4270 r4712  
    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 
     9  <!-- style includes global params interface_name, library_name -->
    510  <xsl:include href="style.xsl"/>
    611  <xsl:include href="service-params.xsl"/>
     
    1116  <xsl:template name="pageHead">
    1217    <head>
    13       <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
     18      <title>
     19    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
     20      </title>
    1421    </head>
    1522  </xsl:template>
    1623
    1724  <xsl:template match="pageResponse">
    18     <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
    19     <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
     25    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
    2026    <center>
    2127      <xsl:call-template name="collectionPageBanner">
     
    2935    <xsl:if test="documentNodeList">
    3036      <xsl:call-template name="query-response">
    31     <xsl:with-param name="library" select="$library"/>
    3237    <xsl:with-param name="collName" select="$collName"/>
    3338      </xsl:call-template>
     
    3540    <xsl:call-template name="greenBar"/>
    3641  </xsl:template>
     42
    3743 
    3844  <xsl:template name="query-response">
    39     <xsl:param name="library"/>
    4045    <xsl:param name="collName"/>
    4146    <xsl:call-template name="greenBarResults"/>
     
    4550    <xsl:if test="count(termList/term) > 0">
    4651      <small>
    47     <xsl:call-template name="text"><xsl:with-param name="key">query.wordcount</xsl:with-param></xsl:call-template>
     52    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.wordcount')"/>
    4853    <xsl:for-each select="termList/term">
    4954      <xsl:if test="position() > 1">, </xsl:if>
     
    5964      <xsl:choose>
    6065    <xsl:when test="$numDocsMatched='0'">
    61       <xsl:call-template name="text"><xsl:with-param name="key">query.nodocsmatch</xsl:with-param></xsl:call-template>
     66      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.nodocsmatch')"/>
    6267    </xsl:when>
    6368    <xsl:when test="$numDocsMatched='1'">
    64       <xsl:call-template name="text"><xsl:with-param name="key">query.onedocsmatch</xsl:with-param></xsl:call-template>
     69      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.onedocsmatch')"/>
    6570    </xsl:when>
    6671    <xsl:otherwise>
    67       <xsl:value-of select="$numDocsMatched"/> documents matched the query.
     72      <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.manydocsmatch', $numDocsMatched)"/>
    6873    </xsl:otherwise>
    6974      </xsl:choose>
     
    7176   
    7277    <!-- next and prev links at top of results-->
    73     <xsl:call-template name="result-navigation"><xsl:with-param name="library" select="$library"/></xsl:call-template>
     78    <xsl:call-template name="result-navigation"/>
    7479    <!-- Display the matching documents -->
    75     <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>
    76     <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"/>     
    7782    <table>
    7883      <tr valign="top">
     
    8994    </table>
    9095    <!-- next and prev links at bottom of page -->
    91     <xsl:call-template name="result-navigation"><xsl:with-param name="library" select="$library"/></xsl:call-template>
     96    <xsl:call-template name="result-navigation"/>
    9297  </xsl:template>
    9398
     
    97102    <xsl:param name="collName"/>
    98103    <xsl:variable name="subaction" select="../pageRequest/@subaction"/>
    99     <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
    100104    <h3><xsl:value-of select="display/name"/></h3><p/>
    101     <form name="QueryForm" method="get" action="/gsdl3/{$library}">
     105    <form name="QueryForm" method="get" action="/gsdl3/{$library_name}">
    102106      <input type="hidden" name="a" value="q"/>
    103107      <input type="hidden" name="sa" value="{$subaction}"/>
     
    122126      <xsl:otherwise>
    123127        <xsl:variable name="pname" select="@name"/>
    124         <xsl:variable name="pvalue"><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></xsl:variable>
     128        <xsl:variable name="pvalue"><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></xsl:variable>
    125129        <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."><xsl:with-param name="default" select="$pvalue"/></xsl:apply-templates></td></tr>
    126130      </xsl:otherwise>
     
    157161  <xsl:template match="documentNode">
    158162    <xsl:param name="collName"/>
    159     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    160    
    161163    <td>
    162       <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>
     164      <a><xsl:attribute name="href"><xsl:value-of select='/page/pageExtra/config/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>&amp;dt=<xsl:value-of select='@documentType'/></xsl:attribute>
    163165    <xsl:apply-templates select="." mode="displayNodeIcon"/>
    164166      </a>
  • trunk/gsdl3/web/interfaces/default/transform/classifier.xsl

    r4252 r4712  
    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"/>
    810
    911  <xsl:output method="html"/> 
    10 
     12 
     13 
    1114  <xsl:template name="pageHead">
    1215    <head>
    13       <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
     16      <title><xsl:value-of select="util:getInterfaceText($interface_name, page/@lang, 'gsdl')"/></title>
    1417    </head>
    1518  </xsl:template>
    1619
    1720  <xsl:template match="pageResponse">
    18     <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>
    1922    <xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
    2023    <center>
     
    3740    <xsl:param name="collName"/>
    3841    <xsl:param name="serviceName"/>
    39     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    40     <xsl:variable name="selected" select="ancestor::page/pageResponse/classifier/@name"/>
     42    <xsl:variable name="selected" select="/page/pageResponse/classifier/@name"/>
    4143    <table width='537'><tr>
    4244    <xsl:for-each select="classifier">
     
    4749        </xsl:when>
    4850        <xsl:otherwise>
    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>
    50     </xsl:for-each>
     51          <td align='center'><a href="{$library_name}?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>
     52    </xsl:for-each>
    5153      </tr></table>
    5254    <xsl:call-template name="greenBar"/>
     
    5961    <xsl:param name="serviceName"/>
    6062    <xsl:variable name="cl_name"><xsl:value-of select="@name"/></xsl:variable>
    61     <xsl:variable name="interleave"><xsl:value-of select="ancestor::page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@documentInterleave"/></xsl:variable>
    62     <xsl:variable name="orientation"><xsl:value-of select="ancestor::page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@orientation"/></xsl:variable>
     63    <xsl:variable name="interleave"><xsl:value-of select="/page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@documentInterleave"/></xsl:variable>
     64    <xsl:variable name="orientation"><xsl:value-of select="/page/pageResponse/service/classifierList/classifier[@name=$cl_name]/@orientation"/></xsl:variable>
    6365    <xsl:variable name='mode'><xsl:value-of select='$orientation'/>-<xsl:value-of select='$interleave'/></xsl:variable>
    6466    <!-- cant seem to do this any other way, ie mode='{$mode}' doesn't work -->
     
    165167  <xsl:template match="documentNode">
    166168    <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    <td><a href="{$library_name}?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>
    169170  </xsl:template>
    170171 
     
    173174    <xsl:param name="collName"/>
    174175    <xsl:param name="serviceName"/>
    175     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    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>
     176    <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: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>
    177177  </xsl:template>
    178178 
     
    180180  <!--
    181181  <xsl:template match="classifierNode">
    182     <xsl:param name="collName"/>
    183     <xsl:param name="serviceName"/>
    184     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    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>
     182  <xsl:param name="collName"/>
     183  <xsl:param name="serviceName"/>
     184  <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:attribute><xsl:value-of select="metadataList/metadata[@name='Title']"/></a></td>
    186185  </xsl:template>
    187186  -->
  • trunk/gsdl3/web/interfaces/default/transform/config_format.xsl

    r4253 r4712  
    1111    stylesheet-prefix="xslt" result-prefix="xsl"/>
    1212
    13 
    1413  <xsl:template match="format">
    1514    <format hello="yes">
     
    2322      <xsl:attribute name="priority">2</xsl:attribute>
    2423      <xsl:if test=".//gsf:link/@type">
    25     <xslt:param name="serviceName">service-name</xslt:param>
     24    <xslt:param name="serviceName"/>
    2625      </xsl:if>
    2726      <xsl:if test=".//gsf:link">
    28     <xslt:param name="collName">coll-name</xslt:param>
    29     <xslt:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
     27    <xslt:param name="collName"/>
    3028      </xsl:if>
    3129      <xsl:apply-templates/>
     
    3634    <xsl:choose>
    3735      <xsl:when test="@type='classifier'">
    38     <a><xslt:attribute name='href'><xslt:value-of select='$library'/>?a=b&amp;rt=r&amp;s=<xslt:value-of select='$serviceName'/>&amp;c=<xslt:value-of select='$collName'/>&amp;cl=<xslt:value-of select='@nodeID'/><xslt:if test="classifierNode|documentNode">.pr</xslt:if><xslt:if test="parent::node()[@orientation='horizontal']">&amp;sib=1</xslt:if></xslt:attribute>
     36    <a><xslt:attribute name='href'><xslt:value-of select='$library_name'/>?a=b&amp;rt=r&amp;s=<xslt:value-of select='$serviceName'/>&amp;c=<xslt:value-of select='$collName'/>&amp;cl=<xslt:value-of select='@nodeID'/><xslt:if test="classifierNode|documentNode">.pr</xslt:if><xslt:if test="parent::node()[@orientation='horizontal']">&amp;sib=1</xslt:if></xslt:attribute>
    3937      <xsl:apply-templates/>
    4038    </a>
    4139      </xsl:when>
    4240      <xsl:otherwise> <!-- a document link -->
    43     <a><xsl:attribute name="href">{$library}?a=d&amp;c={$collName}&amp;d={@nodeID}</xsl:attribute>
    44       <xsl:apply-templates/>
    45     </a>
     41    <xsl:choose>
     42      <xsl:when test="/format/@type = 'search'">
     43        <a><xsl:attribute name="href">{$library_name}?a=d&amp;c={$collName}&amp;d={@nodeID}&amp;dt={@documentType}</xsl:attribute><xsl:apply-templates/></a>
     44      </xsl:when>
     45      <xsl:otherwise>
     46        <a><xsl:attribute name="href">{$library_name}?a=d&amp;c={$collName}&amp;d={@nodeID}</xsl:attribute><xsl:apply-templates/></a>
     47      </xsl:otherwise>
     48    </xsl:choose>
    4649      </xsl:otherwise>
    4750    </xsl:choose>
  • trunk/gsdl3/web/interfaces/default/transform/document.xsl

    r4288 r4712  
    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"
    4         xmlns:java="http://xml.apache.org/xslt/java"
    5         extension-element-prefixes="java">
    6 
    7 <xsl:include href="style.xsl"/>
    8 <xsl:include href="service-params.xsl"/>
    9 <xsl:output method="html"/>
    10 <!--
    11 <xsl:output method="xml"/>
    12 -->
     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">
     8
     9  <xsl:include href="style.xsl"/>
     10  <xsl:include href="service-params.xsl"/>
     11  <xsl:output method="html"/>
     12  <!--
     13  <xsl:output method="xml"/>
     14  -->
    1315
    1416  <xsl:template name="pageHead">
    15     <xsl:variable name="docID" select="ancestor::page/pageResponse/document/@selectedNode"/>
     17    <xsl:variable name="docID" select="/page/pageResponse/document/@selectedNode"/>
    1618    <head>
    17       <title><xsl:for-each select='ancestor::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></title>
     19      <title><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></title>
    1820      <xsl:call-template name="css-style"/>
    1921    </head>
     
    3436 
    3537  <xsl:template match="pageResponse">
    36     <xsl:variable name="collName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
     38    <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
    3739    <center>
    3840      <xsl:call-template name="collectionPageBanner">
     
    4143     
    4244      <!-- display the document -->
    43       <xsl:call-template name="display-document">
     45      <xsl:apply-templates select="document">
    4446    <xsl:with-param name="collName" select="$collName"/>
    45       </xsl:call-template>
     47      </xsl:apply-templates>
    4648    </center>
    4749   
     
    4951  </xsl:template>
    5052   
    51   <xsl:template name="display-document">
    52     <xsl:param name="collName"/>
    53     <!-- Display table of contents -->
     53  <xsl:template match="document">
     54    <xsl:param name="collName"/>
    5455    <p/>
     56    <xsl:call-template name="documentHeading">
     57      <xsl:with-param name="collName" select="$collName"/>
     58    </xsl:call-template>
     59    <p/>
     60    <xsl:call-template name="documentContent">
     61      <xsl:with-param name="collName" select="$collName"/>
     62    </xsl:call-template>
     63  </xsl:template>
     64
     65  <!-- hierarchical document -->
     66  <xsl:template name="documentHeading">
     67    <xsl:param name="collName"/>
    5568    <table width="537" cellpadding="0" cellspacing="0">
    5669      <tr>
    57     <!--  modes are table-of-contents and  paged-naviagtion-->
    58     <!--<xsl:apply-templates select="document" mode='paged-navigation'>-->
    59     <xsl:apply-templates select="document" mode='table-of-contents'>
     70    <td valign="top" align="left" width="200">
     71      <xsl:call-template name="coverImage"/>
     72      <p/>
     73      <xsl:call-template name="enrichServices">
     74        <xsl:with-param name="collName" select="$collName"/>
     75      </xsl:call-template>
     76    </td>
     77    <td valign="top">
     78      <xsl:call-template name="TOC">
     79        <xsl:with-param name="collName" select="$collName"/>
     80      </xsl:call-template>
     81    </td>
     82      </tr>
     83    </table>
     84  </xsl:template>
     85
     86  <xsl:template name="coverImage">
     87    <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>
     88  </xsl:template>
     89
     90  <xsl:template name="TOC">
     91    <xsl:param name="collName"/>
     92    <xsl:choose>
     93      <xsl:when test="@documentType='hierarchy'">
     94    <xsl:call-template name="hierarchicalContents">
    6095      <xsl:with-param name="collName" select="$collName"/>
    61     </xsl:apply-templates>
    62       </tr>
    63     </table>
     96    </xsl:call-template>
     97      </xsl:when>
     98      <xsl:when test="@documentType='paged'">
     99    <xsl:call-template name="pagedContents">
     100      <xsl:with-param name="collName" select="$collName"/>
     101    </xsl:call-template>
     102      </xsl:when>
     103      <xsl:otherwise>
     104    <!-- just print the title of teh one and only docNode -->
     105    <xsl:value-of select="documentNode/metadataList/metadata[@name='Title']"/>
     106      </xsl:otherwise>
     107    </xsl:choose>
     108  </xsl:template>
     109 
     110  <xsl:template name="hierarchicalContents">
     111    <xsl:param name="collName"/>
     112    <xsl:apply-templates select="documentNode[@nodeID]">
     113      <xsl:with-param name="collName" select="$collName"/>
     114      <xsl:with-param name="depth" select="0"/>
     115    </xsl:apply-templates>
     116  </xsl:template>
     117 
     118  <xsl:template match="documentNode">
     119    <xsl:param name="collName"/>
     120    <xsl:param name="depth"/>
     121    <xsl:variable name="space" select="$depth * 25"/>
    64122   
    65     <!-- Display document content -->
     123    <table>
     124      <tr valign="top">
     125    <td>
     126      <xsl:if test="not($depth = '0')">
     127        <img src="interfaces/default/images/space.gif" width="{$space}"/>
     128      </xsl:if>
     129    </td>
     130   
     131    <!-- Display the appropriate image, depending on the node type -->
     132    <td valign="top">
     133      <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><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if></xsl:attribute>
     134        <xsl:apply-templates select="." mode="displayNodeIcon"/>
     135      </a>
     136    </td>
     137   
     138    <!-- Display associated title, bolded if the node has content -->
     139    <td valign="top">
     140      <xsl:choose>
     141        <xsl:when test="nodeContent">
     142          <b><xsl:value-of select="metadataList/metadata[@name='Title']"/></b>
     143        </xsl:when>
     144        <xsl:otherwise>
     145          <xsl:value-of select="metadataList/metadata[@name='Title']"/>
     146        </xsl:otherwise>
     147      </xsl:choose>
     148    </td>
     149      </tr>
     150    </table>   
     151    <!-- Apply recursively to the children of this node -->
     152    <xsl:apply-templates select="documentNode[@nodeID]">
     153      <xsl:with-param name="collName" select="$collName"/>
     154      <xsl:with-param name="depth" select="$depth + 1"/>
     155    </xsl:apply-templates>
     156  </xsl:template>
     157 
     158
     159  <!-- default content is to process any nodeContent elements and print out their text -->
     160  <xsl:template name="documentContent">
    66161    <xsl:apply-templates select="descendant::documentNode/nodeContent"/>
    67162  </xsl:template>
     163 
    68164
    69165  <!-- the actual text/content -->
     
    84180  </xsl:template>
    85181
    86 
    87   <xsl:template match="annotation"><span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span></xsl:template>
    88  
    89   <xsl:template match="document" mode="table-of-contents">
    90     <xsl:param name="collName"/>
    91     <xsl:variable name="httpPath" select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
    92     <xsl:variable name="archivedir" select="metadataList/metadata[@name='archivedir']"/>
    93     <!-- Display cover image -->
    94     <td valign="top" align="left" width="200">
    95       <img><xsl:attribute name='src'><xsl:value-of select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
    96       <p />
    97       <!-- display the enrich service options here -->
    98       <xsl:apply-templates select="../serviceList">
    99     <xsl:with-param name="collName" select="$collName"/>
    100       </xsl:apply-templates>
    101 
    102     </td>
    103     <!-- Display the hierarchical structure -->
    104     <td valign="top">
    105       <xsl:apply-templates select="documentNode[@nodeID]">
    106     <xsl:with-param name="collName" select="$collName"/>
    107     <xsl:with-param name="depth" select="0"/>
    108       </xsl:apply-templates>
    109     </td>
    110    
    111   </xsl:template>
    112 
     182  <!-- match any annotations and make them span elements -->
     183  <xsl:template match="annotation">
     184    <span class="{@type}"><xsl:value-of disable-output-escaping="yes" select="."/></span>
     185  </xsl:template>
     186
     187
     188 
    113189  <!-- paged naviagtion : INCOMPLETE!!-->
    114   <xsl:template match="document" mode="paged-navigation">
    115     <xsl:param name="collName"/>
    116     <xsl:variable name="library" select="ancestor::page/config/library_name"/>
     190  <xsl:template name="pagedContents">
     191    <xsl:param name="collName"/>
    117192    <xsl:variable name="pos" select="nodeStructureInfo/info[@name='siblingPosition']/@value"/>
    118193    <xsl:variable name="length" select="nodeStructureInfo/info[@name='numSiblings']/@value"/>
    119194    <xsl:variable name="children" select="nodeStructureInfo/info[@name='numChildren']/@value"/>
    120     <td valign="left">
    121       <table>
    122     <xsl:choose>
    123       <xsl:when test="$pos=-1"><!-- a doc -->
    124         <tr valign="top">
    125           <td align="left">
    126           </td>
    127           <td align="center"><center>
    128           <b><xsl:value-of select="$children"/> pages.</b>
    129         </center></td>
    130           <td align="right">
    131         <a href="{$library}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a>
    132           </td>
    133         </tr>
    134       </xsl:when>
    135      
    136       <xsl:otherwise> <!-- an internal node -->   
    137         <tr valign="top">
    138           <td align="left">
    139         <xsl:if test=" not ( $pos = 1 )">
    140           <a href="{$library}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps"><img src="interfaces/nzdl/images/less.gif" border="0" align="absbottom" /></a>
    141         </xsl:if>
    142           </td>
    143           <td align="center"><center>
    144           <b>Page <xsl:value-of select="$pos"/> of <xsl:value-of select="$length"/>.</b>
    145         </center></td>
    146           <td align="right">
    147         <xsl:if test=" not($pos = $length)">
    148           <a href="{$library}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a>
    149         </xsl:if>
    150           </td>
    151         </tr>
    152       </xsl:otherwise>
    153     </xsl:choose>
    154     <tr valign="middle">
    155       <td align='center' valign='top' colspan='3'> goto form
    156       </td>
    157     </tr>
     195    <table>
     196      <xsl:choose>
     197    <xsl:when test="$pos=-1"><!-- a doc -->
     198      <tr valign="top">
     199        <td align="left">
     200        </td>
     201        <td align="center"><center>
     202        <b><xsl:value-of select="$children"/> pages.</b>
     203          </center></td>
     204        <td align="right">
     205          <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.fc"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a>
     206        </td>
     207      </tr>
     208    </xsl:when>
     209   
     210    <xsl:otherwise> <!-- an internal node -->     
     211      <tr valign="top">
     212        <td align="left">
     213          <xsl:if test=" not ( $pos = 1 )">
     214        <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ps"><img src="interfaces/nzdl/images/less.gif" border="0" align="absbottom" /></a>
     215          </xsl:if>
     216        </td>
     217        <td align="center"><center>
     218        <b>Page <xsl:value-of select="$pos"/> of <xsl:value-of select="$length"/>.</b>
     219          </center></td>
     220        <td align="right">
     221          <xsl:if test=" not($pos = $length)">
     222        <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@selectedNode}.ns"><img src="interfaces/nzdl/images/more.gif" border="0" align="absbottom" /></a>
     223          </xsl:if>
     224        </td>
     225      </tr>
     226    </xsl:otherwise>
     227      </xsl:choose>
     228      <tr valign="middle">
     229    <td align='center' valign='top' colspan='3'> goto form
     230    </td>
     231      </tr>
     232    </table>
     233  </xsl:template>
     234 
     235  <xsl:template name="enrichServices">
     236    <xsl:param name="collName"/>
     237    <xsl:variable name="docID" select="/page/pageRequest/paramList/param[@name='d']/@value"/>
     238    <xsl:for-each select="../serviceList/service">
     239      <table border='1' cellspacing='0'>
     240    <tr><td>
     241        <p /><xsl:value-of select="display/name"/><p/>
     242        <form name="EnrichForm" method="get" action="/gsdl3/{$library_name}">
     243          <xsl:apply-templates select="paramList"/>
     244          <input type='hidden' name='a' value='d'/>
     245          <input type='hidden' name='d' value='{$docID}'/>
     246          <input type='hidden' name='c' value='{$collName}'/>
     247          <xsl:if test='/page/pageRequest/paramList/param[@name="sib"]'>
     248        <input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='/page/pageRequest/paramList/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
     249          <input type='hidden' name='s' value='{@name}'/>
     250          <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
     251        </form>
     252      </td></tr>
    158253      </table>
    159     </td>
    160     <td valign="top" align="right" width="200">
    161     <img><xsl:attribute name='src'><xsl:value-of select="ancestor::pageResponse/collection/metadataList/metadata[@name='httpPath']"/>/index/assoc/<xsl:value-of select="metadataList/metadata[@name='archivedir']"/>/cover.jpg</xsl:attribute></img>
    162       <p />
    163       <!-- display the enrich service options here -->
    164       <xsl:apply-templates select="../serviceList">
    165     <xsl:with-param name="collName" select="$collName"/>
    166       </xsl:apply-templates>
    167      
    168     </td>
    169   </xsl:template>
    170  
    171 
    172 
    173   <xsl:template match="documentNode">
    174     <xsl:param name="collName"/>
    175     <xsl:param name="depth"/>
    176     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    177     <xsl:variable name="space" select="$depth * 25"/>
    178    
    179     <table>
    180       <tr valign="top">
    181     <td>
    182       <xsl:if test="not($depth = '0')">
    183         <img src="interfaces/default/images/space.gif" width="{$space}"/>
    184       </xsl:if>
    185     </td>
    186    
    187     <!-- Display the appropriate image, depending on the node type -->
    188     <td valign="top">
    189       <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="documentNode">.pr</xsl:if><xsl:if test="@nodeType='leaf'">&amp;sib=1</xsl:if></xsl:attribute>
    190         <xsl:apply-templates select="." mode="displayNodeIcon"/>
    191       </a>
    192     </td>
    193    
    194     <!-- Display associated title, bolded if the node has content -->
    195     <td valign="top">
    196       <xsl:choose>
    197         <xsl:when test="nodeContent">
    198           <b><xsl:value-of select="metadataList/metadata[@name='Title']"/></b>
    199         </xsl:when>
    200         <xsl:otherwise>
    201           <xsl:value-of select="metadataList/metadata[@name='Title']"/>
    202         </xsl:otherwise>
    203       </xsl:choose>
    204     </td>
    205       </tr>
    206     </table>
    207 
    208    
    209     <!-- Apply recursively to the children of this node -->
    210     <xsl:apply-templates select="documentNode[@nodeID]">
    211       <xsl:with-param name="collName" select="$collName"/>
    212       <xsl:with-param name="depth" select="$depth + 1"/>
    213     </xsl:apply-templates>
    214   </xsl:template>
    215  
    216 
    217 
    218   <xsl:template match="serviceList">
    219     <xsl:param name="collName"/>
    220     <xsl:variable name="docID" select="ancestor::page/pageRequest/paramList/param[@name='d']/@value"/>
    221     <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
    222     <xsl:for-each select="service">
    223       <table border='1' cellspacing='0'><tr><td>
    224       <p /><xsl:value-of select="display/name"/><p/>
    225       <form name="EnrichForm" method="get" action="/gsdl3/{$library}">
    226     <xsl:apply-templates select="paramList"/>
    227     <input type='hidden' name='a' value='d'/>
    228     <input type='hidden' name='d' value='{$docID}'/>
    229     <input type='hidden' name='c' value='{$collName}'/>
    230     <xsl:if test='ancestor::page/pageRequest/paramList/param[@name="sib"]'>
    231     <input type='hidden' name='sib'><xsl:attribute name='value'><xsl:value-of select='ancestor::page/pageRequest/paramList/param[@name="sib"]/@value'/></xsl:attribute></input></xsl:if>
    232           <input type='hidden' name='s' value='{@name}'/>
    233     <input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
    234       </form>
    235       </td></tr></table>
    236254    </xsl:for-each>
    237255  </xsl:template>
     
    240258    <xsl:for-each select="param">
    241259      <input type='hidden' name='{@name}' value='{@value}'/><xsl:text>
    242     </xsl:text>
     260      </xsl:text>
    243261    </xsl:for-each>
    244262  </xsl:template>
    245 
     263 
    246264  <xsl:template match="paramList">
    247   <p/><table>
    248   <xsl:for-each select="param">
    249     <xsl:choose>
    250       <xsl:when test="@type='multi'">
    251         <tr><td colspan='2'>
    252         <xsl:apply-templates select='.'/></td></tr>
    253       </xsl:when>
    254       <xsl:otherwise>
    255         <xsl:variable name="pname" select="@name"/>
    256         <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."/></td></tr>
    257       </xsl:otherwise>
    258     </xsl:choose>
    259   </xsl:for-each>
    260   </table>
    261 </xsl:template>
    262 
     265    <p/><table>
     266      <xsl:for-each select="param">
     267    <xsl:choose>
     268      <xsl:when test="@type='multi'">
     269        <tr><td colspan='2'>
     270        <xsl:apply-templates select='.'/></td></tr>
     271      </xsl:when>
     272      <xsl:otherwise>
     273        <xsl:variable name="pname" select="@name"/>
     274        <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."/></td></tr>
     275      </xsl:otherwise>
     276    </xsl:choose>
     277      </xsl:for-each>
     278    </table>
     279  </xsl:template>
     280 
    263281</xsl:stylesheet>
    264282
  • trunk/gsdl3/web/interfaces/default/transform/home.xsl

    r4251 r4712  
    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
    5 <xsl:include href="style.xsl"/>
     9  <!-- style includes global params interface_name, page_lang, library_name -->
     10  <xsl:include href="style.xsl"/>
    611
    7 <xsl:output method="html"/> 
     12  <xsl:output method="html"/> 
    813
    914  <xsl:template name="pageHead">
    1015    <head>
    11       <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
     16      <title>
     17    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
     18      </title>
    1219    </head>
    1320  </xsl:template>
    14 
     21 
    1522  <xsl:template match="pageResponse">
    1623    <xsl:call-template name="greenstonePageBanner"/>
     
    2734    <xsl:for-each select="collection">
    2835      <p>
    29     <a>
    30       <xsl:attribute name='href'>
    31         <xsl:value-of select="ancestor::page/pageExtra/config/library_name"/>?a=p&amp;sa=about&amp;c=<xsl:value-of select='@name'/>
    32       </xsl:attribute>
     36    <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
    3337      <img width="150" border="1">
    3438        <xsl:attribute name="src">
     
    5155  </xsl:template>
    5256 
    53 <xsl:template match="serviceClusterList">
    54 <xsl:for-each select="serviceCluster">
    55 <p/><a><xsl:attribute name='href'><xsl:value-of select="ancestor::page/pageExtra/config/library_name"/>?a=p&amp;sa=about&amp;c=<xsl:value-of select='@name'/></xsl:attribute><xsl:value-of select='@name'/></a>
    56 </xsl:for-each>
    57 <xsl:call-template name="greenBar"/>
    58 </xsl:template>
     57  <xsl:template match="serviceClusterList">
     58    <xsl:for-each select="serviceCluster">
     59      <p/><a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}"><xsl:value-of select='@name'/></a>
     60    </xsl:for-each>
     61    <xsl:call-template name="greenBar"/>
     62  </xsl:template>
    5963
    6064</xsl:stylesheet> 
  • trunk/gsdl3/web/interfaces/default/transform/process.xsl

    r4253 r4712  
    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:value-of select="ancestor-or-self::page/pageResponse/serviceCluster/metadataList/metadata[@name='Titles']"/><xsl:text> </xsl:text></title>
     17      <title><xsl:value-of select="/page/pageResponse/serviceCluster/metadataList/metadata[@name='Title']"/><xsl:text> </xsl:text></title>
    1418    </head>
    1519  </xsl:template>
    1620
    1721  <xsl:template match="pageResponse">
    18     <xsl:variable name="clusterName"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
     22    <xsl:variable name="clusterName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
    1923    <center>
    2024      <xsl:call-template name="clusterPageBanner">
     
    3236  <xsl:template match="service">
    3337    <xsl:param name="clusterName"/>
    34     <xsl:variable name='library' select='ancestor::page/pageExtra/config/library_name'/>
    35     <xsl:variable name='subaction' select="ancestor::page/pageRequest/@subaction"/>
    36     <xsl:variable name='action' select="ancestor::page/pageRequest/@action"/>
    37     <xsl:variable name='lang' select="ancestor::page/pageRequest/@lang"/>
     38    <xsl:variable name='subaction' select="/page/pageRequest/@subaction"/>
     39    <xsl:variable name='action' select="/page/pageRequest/@action"/>
     40    <xsl:variable name='lang' select="/page/@lang"/>
    3841    <h3><xsl:value-of select="display/name"/></h3><p/>
    39     <form name="BuildForm" method="get" action="/gsdl3/{$library}">
     42    <form name="BuildForm" method="get" action="/gsdl3/{$library_name}">
    4043      <xsl:apply-templates select="paramList"/>
    4144      <input type="hidden" name="a" value="{$action}"/>
     
    6164      <xsl:otherwise>
    6265        <xsl:variable name="pname" select="@name"/>
    63         <xsl:variable name="pvalue"><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></xsl:variable>
     66        <xsl:variable name="pvalue"><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></xsl:variable>
    6467        <tr><td><xsl:value-of select='ancestor::service/display/param[@name=$pname]/name'/></td><td align="right"><xsl:apply-templates select="."><xsl:with-param name="default" select="$pvalue"/></xsl:apply-templates></td></tr>
    6568      </xsl:otherwise>
     
    7376    <center/>
    7477    <applet code="org.greenstone.gsdl3.build.StatusDisplay.class" codebase='lib/java' archive='gsdl3.jar, xercesImpl.jar, jaxp.jar, xml-apis.jar' width='537' height='100'>The status display applet.
    75       <param name='library'><xsl:attribute name="value"><xsl:value-of select='ancestor::page/pageExtra/config/library_name'/>?a=pr&amp;rt=s&amp;c=<xsl:value-of select='$clusterName'/>&amp;s=<xsl:value-of select='ancestor::page/pageResponse/service/@name'/>&amp;o=xml&amp;ro=1&amp;l=<xsl:value-of select='ancestor::page/pageRequest/@lang'/>&amp;pid=<xsl:value-of select="@pid"/><xsl:apply-templates select="ancestor::page/pageResponse/service/paramList" mode="cgi"/></xsl:attribute></param>
     78      <param name='library'><xsl:attribute name="value"><xsl:value-of select='$library_name'/>?a=pr&amp;rt=s&amp;c=<xsl:value-of select='$clusterName'/>&amp;s=<xsl:value-of select='/page/pageResponse/service/@name'/>&amp;o=xml&amp;ro=1&amp;l=<xsl:value-of select='/page/@lang'/>&amp;pid=<xsl:value-of select="@pid"/><xsl:apply-templates select="/page/pageResponse/service/paramList" mode="cgi"/></xsl:attribute></param>
    7679      <param name='initial_text'><xsl:attribute name="value"><xsl:value-of select="."/></xsl:attribute></param>
    7780      <param name='initial_code'><xsl:attribute name="value"><xsl:value-of  select="@code"/></xsl:attribute></param></applet>
     
    8487    <xsl:for-each select="param">
    8588      <xsl:variable name='pname' select="@name"/>
    86       <xsl:text>&amp;</xsl:text><xsl:value-of select="@shortname"/>=<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></xsl:for-each>
     89      <xsl:text>&amp;</xsl:text><xsl:value-of select="@shortname"/>=<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></xsl:for-each>
    8790  </xsl:template>
    8891 
  • trunk/gsdl3/web/interfaces/default/transform/querytools.xsl

    r4270 r4712  
    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:template name="result-navigation">
    6     <xsl:param name="library"/>
    7     <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>
     10   <!-- <xsl:param name="library_name"/>-->
     11    <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>
    812    <xsl:if test="not($hp=-1)">
    9       <xsl:variable name="hn"><xsl:choose><xsl:when test="ancestor::page/pageRequest/paramList/param[@name='hn']"><xsl:value-of select="ancestor::page/pageRequest/paramList/param[@name='hn']/@value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable>
    10       <xsl:variable name="sa" select="ancestor::page/pageRequest/@subaction"/>
     13      <xsl:variable name="hn"><xsl:choose><xsl:when test="/page/pageRequest/paramList/param[@name='hn']"><xsl:value-of select="/page/pageRequest/paramList/param[@name='hn']/@value"/></xsl:when><xsl:otherwise>1</xsl:otherwise></xsl:choose></xsl:variable>
     14      <xsl:variable name="sa" select="/page/pageRequest/@subaction"/>
    1115      <xsl:variable name="prev" select="$hn - 1"/>
    1216      <xsl:variable name="next" select="$hn + 1"/>
     
    1721      <tr>
    1822        <td align='left'>
    19           <xsl:if test="$hn &gt; 1"><a href="{$library}?a=q&amp;rt=r&amp;hn={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:call-template name="text"><xsl:with-param name="key">query.matches</xsl:with-param></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hp + 1)"/> - <xsl:value-of select="number(($prev * $hp))"/></a></xsl:if>
     23          <xsl:if test="$hn &gt; 1"><a href="{$library_name}?a=q&amp;rt=r&amp;hn={$prev}"><img src="interfaces/default/images/less.gif" width='30' height='16' border='0' align='top'/><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($prev - 1)*$hp + 1)"/> - <xsl:value-of select="number(($prev * $hp))"/></a></xsl:if>
    2024        </td>
    2125        <td align='right'>
     
    2327        <xsl:variable name='m' select="number($next * $hp)"/>
    2428        <xsl:variable name='mm'><xsl:choose><xsl:when test="$m &lt; $count"><xsl:value-of select='$m'/></xsl:when><xsl:otherwise><xsl:value-of select='$count'/></xsl:otherwise></xsl:choose></xsl:variable>
    25         <a href="{$library}?a=q&amp;sa={$sa}&amp;rt=r&amp;hn={$next}"><xsl:call-template name="text"><xsl:with-param name="key">query.matches</xsl:with-param></xsl:call-template><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></td> </tr>
     29        <a href="{$library_name}?a=q&amp;sa={$sa}&amp;rt=r&amp;hn={$next}"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.matches')"/><xsl:text> </xsl:text><xsl:value-of select="number(($next - 1)*$hp + 1)"/> - <xsl:value-of select="$mm"/><img src="interfaces/default/images/more.gif" width='30' height='16' border='0' align='top'/></a></xsl:if></td> </tr>
    2630    </table>
    2731      </center>
  • trunk/gsdl3/web/interfaces/default/transform/service-params.xsl

    r4256 r4712  
    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"
    4 xmlns:java="http://xml.apache.org/xslt/java"
    5 extension-element-prefixes="java">
     3  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     4  xmlns:java="http://xml.apache.org/xslt/java"
     5  extension-element-prefixes="java">
    66
    77<!-- handling of the different types of params on a service form
     
    3333      <xsl:when test="count(option) = 1">
    3434    <xsl:value-of select='$pdisplay/option'/>
     35    <input type='hidden' name='{@shortname}'><xsl:attribute name='value'><xsl:value-of  select='option/@name'/></xsl:attribute></input>
    3536      </xsl:when>
    3637      <xsl:otherwise>
     
    9293    <tr><xsl:for-each select="param">
    9394    <xsl:variable name="pname" select="@name"/>
    94     <xsl:variable name="values" select="ancestor::page/pageRequest/paramList/param[@name=$pname]/@value"/>
     95    <xsl:variable name="values" select="/page/pageRequest/paramList/param[@name=$pname]/@value"/>
    9596    <td><xsl:choose>
    9697        <xsl:when test="not(@ignore) or  @ignore != $pos">     
     
    9899        </xsl:when>
    99100        <xsl:otherwise><!-- put in a hidden placeholder -->
    100           <input type="hidden" name='{$pname}' value=''/>
     101          <input type="hidden" name='{@shortname}' value=''/>
    101102        </xsl:otherwise>
    102103      </xsl:choose></td>
  • trunk/gsdl3/web/interfaces/default/transform/style.xsl

    r4253 r4712  
    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  
    7   <!--
    8   <xsl:output method="html"/> 
    9   -->
    10  
     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
    1113  <!-- the main page layout template is here -->
    1214  <xsl:template match="page">
     
    4648      <table width="537" cellspacing="0" cellpadding="0">
    4749    <tr valign="top">
    48       <td rowspan="2" align="left"><center><img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></xsl:attribute></img></center></td>
     50      <td rowspan="2" align="left"><center><img src="interfaces/default/images/gsdlhead.gif"><xsl:attribute name="alt"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></xsl:attribute></img></center></td>
    4951      <td align="right"></td>
    5052    </tr>
     
    7678  <xsl:template name="collectionPageBanner">
    7779    <xsl:param name="collName"/>
    78     <xsl:variable name="httpPath" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
    79     <xsl:variable name="colIcon" select="ancestor::page/pageResponse/collection/metadataList/metadata[@name='colIcon']"/>
    80     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
     80    <xsl:variable name="httpPath" select="/page/pageResponse/collection/metadataList/metadata[@name='httpPath']"/>
     81    <xsl:variable name="colIcon" select="/page/pageResponse/collection/metadataList/metadata[@name='colIcon']"/>
    8182    <table width="537">
    8283      <tr>
    8384    <td align="left">
    84       <a href="{$library}?a=p&amp;sa=about&amp;c={$collName}">
     85      <a href="{$library_name}?a=p&amp;sa=about&amp;c={$collName}">
    8586        <img width="150" border="0">
    8687          <xsl:attribute name="src">
     
    8889          </xsl:attribute> 
    8990          <xsl:attribute name="alt">
    90         <xsl:call-template name="text">
    91           <xsl:with-param name="key">aboutpage</xsl:with-param>
    92         </xsl:call-template>
     91        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'aboutpage')"/>
    9392          </xsl:attribute>
    9493        </img>
     
    9695    </td>
    9796    <td align="right">
    98       <a href="{$library}?a=p&amp;sa=home">
    99         <xsl:call-template name="text">
    100           <xsl:with-param name="key">home</xsl:with-param>
    101         </xsl:call-template>
     97      <a href="{$library_name}?a=p&amp;sa=home">
     98        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'home')"/>
    10299      </a>
    103100    </td>
     
    112109  <xsl:template name="clusterPageBanner">
    113110    <xsl:param name="clusterName"/>
    114     <xsl:variable name="library" select="ancestor::page/pageExtra/config/library_name"/>
    115111    <table width="537">
    116       <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>
     112      <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>
    117113   
    118114    <xsl:call-template name="greenBar"/>
     
    166162     alt="View the document"/>
    167163  </xsl:if>
    168 </xsl:template>
     164  </xsl:template>
    169165
    170 
    171 
    172 
    173 <!-- text stuff. can be called via xsl:call-template: 
    174 
    175 <xsl:call-template name="text"><xsl:with-param name="key">your text name here</xsl:with-param></xsl:call-template>
    176 
    177 otherwise can be selected by :
    178 
    179 <xsl:apply-templates select="text"/> 
    180 
    181 the text elem to be processed must be in the form
    182 <text name="query.about"/>
    183 
    184 -->
    185 
    186   <!-- should we look in the display element, or dynamically get from resource bundles - would  this mean they are reloaded everytime??-->
    187   <xsl:template name="text" match="text">
    188     <xsl:param name="key"><xsl:value-of select="@name"/></xsl:param>
    189     <xsl:variable name="path">ancestor::page/pageExtra/display/<xsl:value-of select='$key'/></xsl:variable>
    190     <xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path)"/></xsl:variable>
    191     <xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
    192       <xsl:otherwise>
    193     <!-- no match found, output the name of the text string -->
    194     _<xsl:value-of select="$key"/>_</xsl:otherwise>
    195     </xsl:choose>
    196   </xsl:template>
    197  
    198166</xsl:stylesheet> 
  • trunk/gsdl3/web/interfaces/default/transform/system.xsl

    r4253 r4712  
    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  extension-element-prefixes="java">
    46 
    57  <xsl:include href="style.xsl"/>
     
    79    <xsl:template name="pageHead">
    810    <head>
    9       <title><xsl:call-template name="text"><xsl:with-param name="key">gsdl</xsl:with-param></xsl:call-template></title>
     11      <title>
     12    <xsl:value-of select="java:org.greenstone.gsdl3.util.XSLTUtil.getInterfaceText($interface_name, /page/@lang, 'gsdl')"/></title>
    1013    </head>
    1114  </xsl:template>
Note: See TracChangeset for help on using the changeset viewer.