source: trunk/gsdl3/interfaces/default/transform/about.xsl@ 3597

Last change on this file since 3597 was 3597, checked in by kjdon, 21 years ago

the sa param no longer uses lower case names, eg a=q&sa=text is now a=q&sa=Text

the Text bit is determined from the service name

  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4xmlns:java="http://xml.apache.org/xslt/java"
5extension-element-prefixes="java">
6
7<xsl:include href="style.xsl"/>
8
9<xsl:output method="html"/>
10
11<xsl:template match="page">
12<xsl:variable name="collName" select="response/@from"/>
13<html>
14<xsl:call-template name="greenstoneHead"/>
15<body xsl:use-attribute-sets="body-style">
16<center>
17<xsl:apply-templates select="response/collection|response/serviceCluster"><xsl:with-param name="collName" select="$collName"/></xsl:apply-templates>
18</center>
19<xsl:call-template name="greenstoneFooter"/>
20</body>
21</html>
22</xsl:template>
23
24<xsl:template match="collection">
25<xsl:param name="collName">x</xsl:param>
26<xsl:call-template name="collectionPageBanner">
27<xsl:with-param name="collName"><xsl:value-of select="$collName"/></xsl:with-param>
28<xsl:with-param name="collIcon"><xsl:value-of select="metadataList/metadata[@name='iconCollection']"/></xsl:with-param>
29</xsl:call-template>
30<p/><xsl:apply-templates select="metadataList">
31<xsl:with-param name="collName"><xsl:value-of select="$collName"/></xsl:with-param>
32</xsl:apply-templates>
33<p/><xsl:apply-templates select="serviceList" mode="collection">
34<xsl:with-param name="collName"><xsl:value-of select="$collName"/></xsl:with-param>
35</xsl:apply-templates>
36</xsl:template>
37
38<xsl:template match="serviceCluster">
39<xsl:param name="collName">x</xsl:param>
40<xsl:call-template name="clusterPageBanner">
41<xsl:with-param name="clusterName"><xsl:value-of select="$collName"/></xsl:with-param></xsl:call-template>
42<p/><xsl:apply-templates select="metadataList">
43<xsl:with-param name="collName"><xsl:value-of select="$collName"/></xsl:with-param>
44</xsl:apply-templates>
45<p/><xsl:apply-templates select="serviceList" mode="cluster">
46<xsl:with-param name="collName"><xsl:value-of select="$collName"/></xsl:with-param>
47</xsl:apply-templates>
48</xsl:template>
49
50
51
52<xsl:template match="metadataList">
53<xsl:param name="collName">coll-name</xsl:param>
54<h2><xsl:call-template name="text"><xsl:with-param name="key">about.description</xsl:with-param></xsl:call-template></h2>
55<p/>
56<table>
57<xsl:for-each select="metadata">
58<tr><td><b><xsl:value-of select="@name"/></b></td><td><xsl:value-of select="."/></td></tr>
59</xsl:for-each>
60</table>
61</xsl:template>
62
63<xsl:template match="serviceList" mode="collection">
64<xsl:param name="collName">coll-name</xsl:param>
65<xsl:variable name="library" select="ancestor::page/config/library_name"/>
66<h2><xsl:call-template name="text"><xsl:with-param name="key">about.services</xsl:with-param></xsl:call-template></h2>
67<table>
68<xsl:for-each select="service[@type='query']">
69<xsl:variable name="serviceName"><xsl:value-of select="@name"/></xsl:variable>
70<tr>
71<xsl:if test="contains($serviceName, 'Query')">
72<xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Query')"/></xsl:variable>
73<xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.XSLTUtil.toLower($orig-type)"/>
74<td><a href="{$library}?a=q&amp;sa={$orig-type}&amp;c={$collName}"><xsl:value-of select="$serviceName"/></a></td>
75</xsl:if>
76<xsl:if test="contains($serviceName, 'Browse')">
77<xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Browse')"/></xsl:variable>
78<xsl:variable name="lower-type" select="java:org.greenstone.gsdl3.util.XSLTUtil.toLower($orig-type)"/>
79<td><a href="{$library}?a=b&amp;sa={$orig-type}&amp;c={$collName}"><xsl:value-of select="$serviceName"/></a></td>
80</xsl:if>
81<xsl:if test="contains($serviceName, 'Applet')">
82<xsl:variable name="orig-type"><xsl:value-of select="substring-before($serviceName, 'Applet')"/></xsl:variable>
83<td><a href="{$library}?a=a&amp;sa=d&amp;sn={$orig-type}&amp;c={$collName}"><xsl:value-of select="$serviceName"/></a></td>
84</xsl:if>
85</tr>
86</xsl:for-each>
87</table>
88<xsl:call-template name="greenBar"/>
89</xsl:template>
90
91
92<xsl:template match="serviceList" mode="cluster">
93<xsl:param name="collName">coll-name</xsl:param>
94<xsl:variable name="library" select="ancestor::page/config/library_name"/>
95<h2><xsl:call-template name="text"><xsl:with-param name="key">about.services</xsl:with-param></xsl:call-template></h2>
96<table>
97<xsl:for-each select="service">
98<tr><td><a href="{$library}?a={$collName}&amp;sa={@name}"><xsl:value-of select="@name"/></a></td></tr>
99</xsl:for-each>
100</table>
101<xsl:call-template name="greenBar"/>
102</xsl:template>
103
104</xsl:stylesheet>
105
Note: See TracBrowser for help on using the repository browser.