Changeset 3360


Ignore:
Timestamp:
2002-08-20T10:21:20+12:00 (22 years ago)
Author:
kjdon
Message:

stylesheet improvements

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

Legend:

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

    r3335 r3360  
    99<xsl:output method="html"/> 
    1010
    11 <xsl:variable name="translate" select="document('en.xml')"/>
    12 
    13 <xsl:template match="message">
    14 
     11<xsl:template match="page">
    1512<html>
    1613<xsl:call-template name="greenstoneHead"/>
     
    5956<xsl:if test="contains($serviceName, 'Query')">
    6057<xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Query')"/></xsl:variable>
    61 <xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.Util.toLower($orig-type)"/>
    62 <td><xsl:value-of select="$translate/text/about/search"/></td>
     58<xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.XSLTUtil.toLower($orig-type)"/>
     59<td><xsl:call-template name="text"><xsl:with-param name="key">common/search</xsl:with-param></xsl:call-template></td>
    6360<td><a><xsl:attribute name="href">library?a=q&amp;sa=<xsl:value-of select="$lower-type"/>&amp;c=<xsl:value-of select="$collName"/></xsl:attribute><xsl:value-of select="substring-before($serviceName, 'Query')"/></a></td>
    6461</xsl:if>
    6562<xsl:if test="contains($serviceName, 'Browse')">
    6663<xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Browse')"/></xsl:variable>
    67 <xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.Util.toLower($orig-type)"/>
    68 <td><xsl:value-of select="$translate/text/about/browse"/></td>
     64<xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.XSLTUtil.toLower($orig-type)"/>
     65<td><xsl:call-template name="text"><xsl:with-param name="key">common/browse</xsl:with-param></xsl:call-template></td>
    6966<td><a><xsl:attribute name="href">library?a=b&amp;sa=<xsl:value-of select="$lower-type"/>&amp;c=<xsl:value-of select="$collName"/></xsl:attribute><xsl:value-of select="substring-before($serviceName, 'Browse')"/></a></td>
    7067</xsl:if>
  • trunk/gsdl3/interfaces/default/transform/home.xsl

    r3335 r3360  
    77<xsl:output method="html"/> 
    88
    9 <xsl:template match="message">
     9<xsl:template match="page">
    1010<html>
    1111<xsl:call-template name="greenstoneHead"/>
     
    2525<xsl:template match="collectionList">
    2626<xsl:for-each select="collection">
    27 <p><a href="library?a=p&amp;sa=about&amp;c={@name}"><img width="150" border="1"><xsl:attribute name="src">sites/<xsl:value-of select="ancestor::message/system/@sitename"/>/collect/<xsl:value-of select="@name"/>/images/<xsl:value-of select="metadataList/metadata[@name='iconCollection']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="metadataList/metadata[@name='colName']"/></xsl:attribute></img></a></p>
     27<p><a href="library?a=p&amp;sa=about&amp;c={@name}"><img width="150" border="1"><xsl:attribute name="src">sites/<xsl:value-of select="ancestor::page/config/site_name"/>/collect/<xsl:value-of select="@name"/>/images/<xsl:value-of select="metadataList/metadata[@name='iconCollection']"/></xsl:attribute><xsl:attribute name="alt"><xsl:value-of select="metadataList/metadata[@name='colName']"/></xsl:attribute></img></a></p>
    2828</xsl:for-each>
    2929<xsl:call-template name="greenBar"/>
    3030</xsl:template>
    3131
    32 
    33 <xsl:template match="serviceList">
    34 Services available are:
    35 
    36 Transforms:
    37 <xsl:for-each select="service[@type='transform']">
    38 <xsl:value-of select="@name"/>.
    39 </xsl:for-each>
    40 
    41 Enrichs:
    42 <xsl:for-each select="service[@type='enrich']">
    43 <xsl:value-of select="@name"/>.
    44 </xsl:for-each>
    45 
    46 Querys:
    47 <xsl:for-each select="service[@type='query']">
    48 <xsl:value-of select="@name"/>.
    49 </xsl:for-each>
    50 
    51 </xsl:template>
    52 
    53 
    5432</xsl:stylesheet> 
    5533
  • trunk/gsdl3/interfaces/default/transform/resource.xsl

    r3335 r3360  
    99<xsl:output method="html"/> 
    1010
    11 <xsl:template match="message">
     11<xsl:template match="page">
     12
     13<xsl:variable name="collName"><xsl:value-of select="request/paramList/param[@name='c']/@value"/></xsl:variable>
     14
    1215<html>
    1316<xsl:call-template name="greenstoneHead"/>
    1417<body xsl:use-attribute-sets="body-style">
    15 
    16 <xsl:variable name="collName"><xsl:value-of select="request/paramList/param[@name='c']/@value"/></xsl:variable>
    1718<center>
    18 
    1919<xsl:call-template name="collectionPageBanner">
    2020<xsl:with-param name="collName" select="$collName"/>
  • trunk/gsdl3/interfaces/default/transform/style.xsl

    r3335 r3360  
    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">
     3xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
     4xmlns:java="http://xml.apache.org/xslt/java"
     5extension-element-prefixes="java">
     6
    47
    58<xsl:output method="html"/> 
     9
    610
    711<xsl:attribute-set name="body-style">
     
    1115  <xsl:attribute name="alink">#cc9900</xsl:attribute>
    1216  <xsl:attribute name="vlink">#666633</xsl:attribute>
    13   <xsl:attribute name="background">/gsdl3/interfaces/default/images/chalk.gif</xsl:attribute>
     17  <xsl:attribute name="background">interfaces/default/images/chalk.gif</xsl:attribute>
    1418</xsl:attribute-set>
    1519
     
    1721<xsl:template name="greenstoneHead">
    1822<head>
    19 <title>New Zealand Digital Library</title>
     23<title><xsl:call-template name="text"><xsl:with-param name="key">common/nzdl</xsl:with-param></xsl:call-template></title>
    2024
    2125</head>
     
    2428<xsl:template name="greenstonePageBanner">
    2529
    26 <!-- page banner (_style:pagebanner_) -->
    2730<center>
    2831<table width="537" cellspacing="0" cellpadding="0">
    2932  <tr valign="top">
    30     <td rowspan="2" align="left"><center><img src="/gsdl3/interfaces/default/images/nzdl2gr.gif" width="457" height="181" alt="The New Zealand Digital Library"/></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">common/nzdl</xsl:with-param></xsl:call-template></xsl:attribute></img></center></td>
    3134    <td align="right"></td>
    3235  </tr>
     
    6063<xsl:param name="collIcon"><xsl:value-of select="$collName"/>.gif</xsl:param>
    6164<table width="537">
    62 <tr><td align="left"><a href="library?a=p&amp;sa=about&amp;c={$collName}"><img width="150" border="1"><xsl:attribute name="src">/gsdl3/sites/localsite/collect/<xsl:value-of select="$collName"/>/images/<xsl:value-of select="$collIcon"/></xsl:attribute><xsl:attribute name="alt">about page</xsl:attribute></img></a></td><td align="right"><a href="library?a=p&amp;sa=home">HOME</a></td></tr></table>
     65<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
    6367<xsl:call-template name="greenBar"/>
    6468</xsl:template>
     
    6670
    6771<xsl:template name="greenBar">
    68 <p/><img src="/gsdl3/interfaces/default/images/divb.gif" width="537" height="17"/>
     72<p/><img src="interfaces/default/images/divb.gif" width="537" height="17"/>
    6973</xsl:template>
     74
     75
     76
     77<!-- text stuff. can be called via xsl:call-template: 
     78
     79<xsl:call-template name="text"><xsl:with-param name="key">your text name here</xsl:with-param></xsl:call-template>
     80
     81otherwise can be selected by :
     82
     83<xsl:apply-templates select="text"/> 
     84
     85the text elem to be processed must be in the form
     86<text name="query/about"/>
     87
     88-->
     89
     90<xsl:template name="text" match="text">
     91
     92<xsl:param name="key"><xsl:value-of select="@name"/></xsl:param>
     93
     94<!-- try the current language -->
     95
     96<xsl:variable name="path1">ancestor::page/translate/current/text/<xsl:value-of select="$key"/></xsl:variable>
     97<xsl:variable name="string1"><xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path1)"/></xsl:variable>
     98<xsl:choose><xsl:when test="boolean(string($string1))"><xsl:value-of select="$string1"/></xsl:when>
     99<xsl:otherwise>
     100
     101<!-- try the default language -->
     102<xsl:variable name="path2">ancestor::page/translate/default/text/<xsl:value-of select="$key"/></xsl:variable>
     103<xsl:value-of select="java:org.apache.xalan.lib.Extensions.evaluate($path2)"/>
     104</xsl:otherwise>
     105</xsl:choose>
     106</xsl:template>
     107
    70108</xsl:stylesheet> 
  • trunk/gsdl3/interfaces/default/transform/textquery.xsl

    r3335 r3360  
    77<xsl:output method="html"/> 
    88
    9 <xsl:template match="message">
     9<xsl:template match="page">
     10
     11<xsl:variable name="collName"><xsl:value-of select="request/paramList/param[@name='c']/@value"/></xsl:variable>
     12
    1013<html>
    1114<xsl:call-template name="greenstoneHead"/>
    1215<body xsl:use-attribute-sets="body-style">
    13 
    14 <xsl:variable name="collName"><xsl:value-of select="request/paramList/param[@name='c']/@value"/></xsl:variable>
    1516<center>
    16 
    1717<xsl:call-template name="collectionPageBanner">
    1818<xsl:with-param name="collName" select="$collName"/>
     
    3131
    3232<xsl:template match="request">
     33
    3334<xsl:param name="collName">coll-name</xsl:param>
    3435<xsl:variable name="queryString"><xsl:value-of select="paramList/param[@name='q']/@value"/></xsl:variable>
     36
    3537<form name="QueryForm" method="get" action="/gsdl3/library">
    36 
     38<xsl:apply-templates select="description/paramList"/>
    3739<input type="hidden" name="a" value="q"/>
    3840<input type="hidden" name="sa" value="text"/>
    3941<input type="hidden" name="c" value="{$collName}"/>
    4042<nobr><input type="text" name="q" value="{$queryString}" size="50"/>
    41 <input type="submit" value="Begin Search"/></nobr>
     43<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>
    4244</form>
    4345<xsl:call-template name="greenBar"/>
    4446</xsl:template>
    4547
     48
     49<xsl:template match="description/paramList">
     50<p/>
     51<xsl:call-template name="text"><xsl:with-param name="key">query/queryoptions</xsl:with-param></xsl:call-template>
     52<p/><table width="537">
     53<xsl:for-each select="param">
     54<!-- boolean params -->
     55<xsl:choose>
     56<xsl:when test="@type= 'boolean'">
     57<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}">
     58    <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>
     59   <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>
     60</select></td></tr>
     61</xsl:when>
     62<!-- integer params -->
     63<xsl:when test="@type= 'integer'">
     64<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>
     65</xsl:when>
     66<!-- enum params -->
     67<xsl:when test="@type= 'enum'">
     68<xsl:variable name="param" select="@name"/>
     69<xsl:variable name="current"><xsl:value-of select="@default"/></xsl:variable>
     70<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>
     71</td><td><select name="{@shortname}">
     72    <xsl:for-each select="element">
     73
     74      <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>
     75    </xsl:for-each>
     76 </select></td></tr>
     77</xsl:when>
     78</xsl:choose>
     79</xsl:for-each>
     80</table>
     81</xsl:template>
     82
    4683<xsl:template match="response">
    4784<xsl:param name="collName">coll-name</xsl:param>
    48 <table>
     85<table width="537">
    4986<xsl:for-each select="content/resourceList/resource">
    50 <tr><td><a><xsl:attribute name="href">library?a=r&amp;c=<xsl:value-of select="$collName"/>&amp;r=<xsl:value-of select="@name"/></xsl:attribute>link</a></td><td><xsl:value-of select="metadataList/metadata[@name='Title']"/></td></tr>
     87<tr><td><a><xsl:attribute name="href">library?a=r&amp;c=<xsl:value-of select="$collName"/>&amp;r=<xsl:value-of select="@name"/></xsl:attribute>link</a></td><td><xsl:value-of  select="metadataList/metadata[@name='Title']"/></td></tr>
    5188</xsl:for-each>
    5289</table>
Note: See TracChangeset for help on using the changeset viewer.