Changeset 3564


Ignore:
Timestamp:
2002-11-26T13:42:55+13:00 (21 years ago)
Author:
kjdon
Message:

langauge stuff now comes from display elements. also changed the page structure a bit.

Location:
trunk/gsdl3/interfaces/default/transform
Files:
7 edited

Legend:

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

    r3474 r3564  
    5252<xsl:template match="metadataList">
    5353<xsl:param name="collName">coll-name</xsl:param>
    54 <h2>Description</h2>
     54<h2><xsl:call-template name="text"><xsl:with-param name="key">about.description</xsl:with-param></xsl:call-template></h2>
    5555<p/>
    5656<table>
     
    6464<xsl:param name="collName">coll-name</xsl:param>
    6565<xsl:variable name="library" select="ancestor::page/config/library_name"/>
    66 <h2>Services available</h2>
     66<h2><xsl:call-template name="text"><xsl:with-param name="key">about.services</xsl:with-param></xsl:call-template></h2>
    6767<table>
    6868<xsl:for-each select="service[@type='query']">
     
    7272<xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Query')"/></xsl:variable>
    7373<xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.XSLTUtil.toLower($orig-type)"/>
    74 <td><xsl:call-template name="text"><xsl:with-param name="key">common/search</xsl:with-param></xsl:call-template></td>
    75 <td><a href="{$library}?a=q&amp;sa={$lower-type}&amp;c={$collName}"><xsl:value-of select="$orig-type"/></a></td>
     74<td><a href="{$library}?a=q&amp;sa={$lower-type}&amp;c={$collName}"><xsl:value-of select="$serviceName"/></a></td>
    7675</xsl:if>
    7776<xsl:if test="contains($serviceName, 'Browse')">
    7877<xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Browse')"/></xsl:variable>
    7978<xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.XSLTUtil.toLower($orig-type)"/>
    80 <td><xsl:call-template name="text"><xsl:with-param name="key">common/browse</xsl:with-param></xsl:call-template></td>
    81 <td><a href="{$library}?a=b&amp;sa={$lower-type}&amp;c={$collName}"><xsl:value-of select="$orig-type"/></a></td>
     79<td><a href="{$library}?a=b&amp;sa={$lower-type}&amp;c={$collName}"><xsl:value-of select="$serviceName"/></a></td>
    8280</xsl:if>
    8381<xsl:if test="contains($serviceName, 'Applet')">
    8482<xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Applet')"/></xsl:variable>
    85 <td><xsl:call-template name="text"><xsl:with-param name="key">common/applet</xsl:with-param></xsl:call-template></td>
    86 <td><a href="{$library}?a=a&amp;sa=d&amp;sn={$orig-type}&amp;c={$collName}"><xsl:value-of select="$orig-type"/></a></td>
     83<td><a href="{$library}?a=a&amp;sa=d&amp;sn={$orig-type}&amp;c={$collName}"><xsl:value-of select="$serviceName"/></a></td>
    8784</xsl:if>
    8885</tr>
     
    9693<xsl:param name="collName">coll-name</xsl:param>
    9794<xsl:variable name="library" select="ancestor::page/config/library_name"/>
    98 <h2>Services available</h2>
     95<h2><xsl:call-template name="text"><xsl:with-param name="key">about.services</xsl:with-param></xsl:call-template></h2>
    9996<table>
    10097<xsl:for-each select="service">
  • trunk/gsdl3/interfaces/default/transform/applet.xsl

    r3436 r3564  
    99<xsl:template match="page">
    1010
    11 <xsl:variable name="collName"><xsl:value-of select="request/paramList/param[@name='c']/@value"/></xsl:variable>
     11<xsl:variable name="collName"><xsl:value-of select="request/paramList/param[@name='collection']/@value"/></xsl:variable>
    1212<html>
    1313<xsl:call-template name="greenstoneHead"/>
  • trunk/gsdl3/interfaces/default/transform/build.xsl

    r3511 r3564  
    44
    55<xsl:include href="style.xsl"/>
     6<xsl:include href="service-params.xsl"/>
    67
    78<xsl:output method="html"/> 
     
    910<xsl:template match="page">
    1011
    11 <xsl:variable name="clusterName"><xsl:value-of select="request/paramList/param[@name='action']/@value"/></xsl:variable>
    12 
     12<xsl:variable name="clusterName"><xsl:value-of select="request/@action"/></xsl:variable>
    1313<html>
    1414<xsl:call-template name="greenstoneHead"/>
     
    1818<xsl:with-param name="clusterName" select="$clusterName"/>
    1919</xsl:call-template>
    20 <xsl:apply-templates select="request">
     20<xsl:apply-templates select="service">
    2121<xsl:with-param name="clusterName" select="$clusterName"/>
    2222</xsl:apply-templates>
     
    3030</xsl:template>
    3131
    32 <xsl:template match="request">
     32<xsl:template match="service">
    3333<xsl:param name="clusterName">cluster-name</xsl:param>
    34 <xsl:variable name='library' select='ancestor::page/config/library_name'/>
    35 <xsl:variable name='subaction' select="paramList/param[@name='subaction']/@value"/>
    36 <h3><xsl:value-of select="$subaction"/></h3><p/>
     34<xsl:variable name='library' select='../config/library_name'/>
     35<xsl:variable name='subaction' select="../request/@subaction"/>
     36<xsl:variable name='lang' select="../request/@lang"/>
     37<h3><xsl:value-of select="display/name"/></h3><p/>
    3738<form name="BuildForm" method="get" action="/gsdl3/{$library}">
    38 <xsl:apply-templates select="description/paramList"/>
     39<xsl:apply-templates select="paramList"/>
    3940<input type="hidden" name="a" value="{$clusterName}"/>
    4041<input type="hidden" name="sa" value="{$subaction}"/>
    41 <input type="submit"><xsl:attribute name="value"><xsl:call-template name="text"><xsl:with-param name="key">service/go</xsl:with-param></xsl:call-template></xsl:attribute></input>
     42<input type="hidden" name='l' value='{$lang}'/>
     43<input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input>
    4244</form>
    4345<xsl:call-template name="greenBar"/>
    4446</xsl:template>
    4547
    46 <!-- need to look at generalising params between services -->
    47 <xsl:template match="description/paramList">
    48 <xsl:param name="cluster">build</xsl:param>
     48<xsl:template match="paramList">
    4949<p/><table width="537">
    5050<xsl:for-each select="param">
    51 <xsl:choose>
    52 <!-- boolean params -->
    53 <xsl:when test="@type= 'boolean'">
    54 <tr><td><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template></td><td><select name="{@shortname}">
    55     <option value="0"><xsl:if test="@default='0'"><xsl:attribute name='selected'></xsl:attribute></xsl:if><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/off</xsl:with-param></xsl:call-template></option>
    56    <option value="1"><xsl:if test="@default='1'"><xsl:attribute name='selected'></xsl:attribute></xsl:if><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/on</xsl:with-param></xsl:call-template></option>
    57 </select></td></tr>
    58 </xsl:when>
    59 <!-- integer params -->
    60 <xsl:when test="@type= 'integer'">
    61 <tr><td><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template></td><td><input type="text" name="{@shortname}" size="3" value="{@default}"/></td></tr>
    62 </xsl:when>
    63 <!-- enum params -->
    64 <xsl:when test="@type= 'enum'">
    65 <xsl:variable name="param" select="@name"/>
    66 <xsl:variable name="current"><xsl:value-of select="@default"/></xsl:variable>
    67 <tr><td><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template>
    68 </td><td><select name="{@shortname}">
    69     <xsl:for-each select="option">
    70 
    71       <option value="{@name}"><xsl:if test="@name=$current"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="$param"/>/<xsl:value-of select="@name"/></xsl:with-param></xsl:call-template></option>
    72     </xsl:for-each>
    73  </select></td></tr>
    74 </xsl:when>
    75 <!-- input params -->
    76 <xsl:when test="@type= 'input'">
    77 <tr><td><xsl:call-template name="text"><xsl:with-param name="key"><xsl:value-of select="$cluster"/>/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template></td><td><input type="text" name="{@shortname}" size="50" value="{@default}"/></td></tr>
    78 </xsl:when>
    79 </xsl:choose>
     51<tr><xsl:apply-templates select='.'/></tr>
    8052</xsl:for-each>
    8153</table>
  • trunk/gsdl3/interfaces/default/transform/classifier.xsl

    r3473 r3564  
    1010
    1111<xsl:template match="page">
    12 <xsl:variable name="collName"><xsl:value-of select="request/paramList/param[@name='collection']/@value"/></xsl:variable>
     12<xsl:variable name="collName"><xsl:value-of select="service/request/paramList/param[@name='collection']/@value"/></xsl:variable>
    1313<html>
    1414<xsl:call-template name="greenstoneHead"/>
     
    1818<xsl:with-param name="collName" select="$collName"/>
    1919</xsl:call-template>
    20 <xsl:apply-templates select="request/description/classifierList">
     20<xsl:apply-templates select="service/classifierList">
    2121<xsl:with-param name="collName" select="$collName"/>
    2222</xsl:apply-templates>
  • trunk/gsdl3/interfaces/default/transform/resource.xsl

    r3473 r3564  
    77<xsl:include href="style.xsl"/>
    88
    9 <xsl:output method="html"/> 
    10 
     9<!--
     10<xsl:output method="xml"/> 
     11-->
    1112<xsl:template match="page">
    1213
     
    2930<xsl:template match="response">
    3031<table width="537"><tr><td>
    31 <xsl:value-of disable-output-escaping="yes" select="content/resource"/>
     32<xsl:value-of disable-output-escaping="no" select="content/resource"/>
    3233</td></tr></table>
    3334<xsl:call-template name="greenBar"/>
  • trunk/gsdl3/interfaces/default/transform/style.xsl

    r3474 r3564  
    55extension-element-prefixes="java">
    66
    7 
     7<!--
    88<xsl:output method="html"/> 
    9 
     9-->
    1010
    1111<xsl:attribute-set name="body-style">
     
    2121<xsl:template name="greenstoneHead">
    2222<head>
    23 <title><xsl:call-template name="text"><xsl:with-param name="key">common/nzdl</xsl:with-param></xsl:call-template></title>
     23<title><xsl:call-template name="text"><xsl:with-param name="key">nzdl</xsl:with-param></xsl:call-template></title>
    2424
    2525</head>
     
    3131<table width="537" cellspacing="0" cellpadding="0">
    3232  <tr valign="top">
    33     <td rowspan="2" align="left"><center><img src="interfaces/default/images/nzdl2gr.gif" width="457" height="181" ><xsl:attribute name="alt"><xsl:call-template name="text"><xsl:with-param name="key">common/nzdl</xsl:with-param></xsl:call-template></xsl:attribute></img></center></td>
     33    <td rowspan="2" align="left"><center><img src="interfaces/default/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>
    3434    <td align="right"></td>
    3535  </tr>
     
    6464<xsl:variable name="library" select="ancestor::page/config/library_name"/>
    6565<table width="537">
    66 <tr><td align="left"><a href="{$library}?a=p&amp;sa=about&amp;c={$collName}"><img width="150" border="1"><xsl:attribute name="src">sites/<xsl:value-of select="ancestor::page/config/site_name"/>/collect/<xsl:value-of select="$collName"/>/images/<xsl:value-of select="$collIcon"/></xsl:attribute><xsl:attribute name="alt"><xsl:call-template name="text"><xsl:with-param name="key">common/aboutpage</xsl:with-param></xsl:call-template></xsl:attribute></img></a></td><td align="right"><a href="{$library}?a=p&amp;sa=home"><xsl:call-template name="text"><xsl:with-param name="key">common/home</xsl:with-param></xsl:call-template></a></td></tr></table>
     66<tr><td align="left"><a href="{$library}?a=p&amp;sa=about&amp;c={$collName}"><img width="150" border="1"><xsl:attribute name="src">sites/<xsl:value-of select="ancestor::page/config/site_name"/>/collect/<xsl:value-of select="$collName"/>/images/<xsl:value-of select="$collIcon"/></xsl:attribute><xsl:attribute name="alt"><xsl:call-template name="text"><xsl:with-param name="key">aboutpage</xsl:with-param></xsl:call-template></xsl:attribute></img></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>
    6767
    6868<xsl:call-template name="greenBar"/>
     
    7474<xsl:variable name="library" select="ancestor::page/config/library_name"/>
    7575<table width="537">
    76 <tr><td align="left"><a href="{$library}?a=p&amp;sa=about&amp;sc={$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">common/home</xsl:with-param></xsl:call-template></a></td></tr></table>
     76<tr><td align="left"><a href="{$library}?a=p&amp;sa=about&amp;sc={$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>
    7777
    7878<xsl:call-template name="greenBar"/>
     
    9999
    100100<xsl:template name="text" match="text">
     101<xsl:param name="key"><xsl:value-of select="@name"/></xsl:param>
     102<xsl:variable name="path">ancestor::page/display/<xsl:value-of select='$key'/></xsl:variable>
     103<xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path)"/></xsl:variable>
     104<xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
     105<xsl:otherwise>
     106
     107<!-- no match found, output the name of the text string -->
     108_<xsl:value-of select="$key"/>_</xsl:otherwise>
     109</xsl:choose>
     110</xsl:template>
     111
     112
     113<!-- may not have to use this anymore-->
     114<xsl:template name="text-old" match="text-old">
    101115
    102116<xsl:param name="key"><xsl:value-of select="@name"/></xsl:param>
  • trunk/gsdl3/interfaces/default/transform/textquery.xsl

    r3511 r3564  
    44
    55<xsl:include href="style.xsl"/>
     6<xsl:include href="service-params.xsl"/>
    67
    7 <xsl:output method="html"/> 
     8<xsl:output method="xml"/> 
    89
    910<xsl:template match="page">
     
    1819<xsl:with-param name="collName" select="$collName"/>
    1920</xsl:call-template>
    20 <xsl:apply-templates select="request">
     21<xsl:apply-templates select="service">
    2122<xsl:with-param name="collName" select="$collName"/>
    2223</xsl:apply-templates>
     
    3031</xsl:template>
    3132
    32 <xsl:template match="request">
     33<xsl:template match="service">
     34<xsl:param name="collName">coll-name</xsl:param>
     35<xsl:variable name="queryString"><xsl:value-of select="../request/paramList/param[@name='query']/@value"/></xsl:variable>
     36<xsl:variable name='library' select='ancestor::page/config/library_name'/>
     37<h3><xsl:value-of select="display/name"/></h3><p/>
     38<form name="QueryForm" method="get" action="/gsdl3/{$library}">
    3339
    34 <xsl:param name="collName">coll-name</xsl:param>
    35 <xsl:variable name="queryString"><xsl:value-of select="paramList/param[@name='q']/@value"/></xsl:variable>
    36 <xsl:variable name='library' select='ancestor::page/config/library_name'/>
    37 
    38 <form name="QueryForm" method="get" action="/gsdl3/{$library}">
    39 <xsl:apply-templates select="description/paramList"/>
     40<xsl:apply-templates select="paramList"/>
    4041<input type="hidden" name="a" value="q"/>
    4142<input type="hidden" name="sa" value="text"/>
    4243<input type="hidden" name="c" value="{$collName}"/>
    4344<nobr><input type="text" name="q" value="{$queryString}" size="50"/>
    44 <input type="submit"><xsl:attribute name="value"><xsl:call-template name="text"><xsl:with-param name="key">query/beginsearch</xsl:with-param></xsl:call-template></xsl:attribute></input></nobr>
     45<input type="submit"><xsl:attribute name="value"><xsl:value-of select='display/submit'/></xsl:attribute></input></nobr>
    4546</form>
    4647<xsl:call-template name="greenBar"/>
     
    4849
    4950
    50 <xsl:template match="description/paramList">
    51 <p/>
    52 <xsl:call-template name="text"><xsl:with-param name="key">query/queryoptions</xsl:with-param></xsl:call-template>
     51<xsl:template match="paramList">
    5352<p/><table width="537">
     53<xsl:choose>
     54<xsl:when test='count(param)>4'>
     55<xsl:for-each select="param[position() mod 2 = 1]"> <!-- select the odd numbers-->
     56<tr><xsl:apply-templates select="."/>
     57<xsl:if test="position() != last()"><xsl:apply-templates select='following-sibling::param[1]'/></xsl:if></tr>
     58</xsl:for-each>
     59</xsl:when>
     60<xsl:otherwise>
    5461<xsl:for-each select="param">
    55 <!-- boolean params -->
    56 <xsl:choose>
    57 <xsl:when test="@type= 'boolean'">
    58 <tr><td><xsl:call-template name="text"><xsl:with-param name="key">query/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template></td><td><select name="{@shortname}">
    59     <option value="0"><xsl:if test="@default='0'"><xsl:attribute name='selected'></xsl:attribute></xsl:if><xsl:call-template name="text"><xsl:with-param name="key">query/params/<xsl:value-of select="@name"/>/off</xsl:with-param></xsl:call-template></option>
    60    <option value="1"><xsl:if test="@default='1'"><xsl:attribute name='selected'></xsl:attribute></xsl:if><xsl:call-template name="text"><xsl:with-param name="key">query/params/<xsl:value-of select="@name"/>/on</xsl:with-param></xsl:call-template></option>
    61 </select></td></tr>
    62 </xsl:when>
    63 <!-- integer params -->
    64 <xsl:when test="@type= 'integer'">
    65 <tr><td><xsl:call-template name="text"><xsl:with-param name="key">query/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template></td><td><input type="text" name="{@shortname}" size="3" value="{@default}"/></td></tr>
    66 </xsl:when>
    67 <!-- enum params -->
    68 <xsl:when test="@type= 'enum'">
    69 <xsl:variable name="param" select="@name"/>
    70 <xsl:variable name="current"><xsl:value-of select="@default"/></xsl:variable>
    71 <tr><td><xsl:call-template name="text"><xsl:with-param name="key">query/params/<xsl:value-of select="@name"/>/name</xsl:with-param></xsl:call-template>
    72 </td><td><select name="{@shortname}">
    73     <xsl:for-each select="option">
    74 
    75       <option value="{@name}"><xsl:if test="@name=$current"><xsl:attribute name="selected"></xsl:attribute></xsl:if><xsl:call-template name="text"><xsl:with-param name="key">query/params/<xsl:value-of select="$param"/>/<xsl:value-of select="@name"/></xsl:with-param></xsl:call-template></option>
    76     </xsl:for-each>
    77  </select></td></tr>
    78 </xsl:when>
     62<tr><xsl:apply-templates select='.'/></tr>
     63</xsl:for-each>
     64</xsl:otherwise>
    7965</xsl:choose>
    80 </xsl:for-each>
    8166</table>
    8267</xsl:template>
     68
    8369
    8470<xsl:template match="response">
     
    9682</xsl:stylesheet> 
    9783
     84
     85
     86
     87
Note: See TracChangeset for help on using the changeset viewer.