source: trunk/gsdl3/web/interfaces/default/transform/home.xsl@ 13581

Last change on this file since 13581 was 13581, checked in by shaoqun, 17 years ago

added the code to whether the collection image exist

  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<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 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 extension-element-prefixes="java util"
7 exclude-result-prefixes="java util">
8
9 <!-- style includes global params interface_name, library_name -->
10 <xsl:include href="style.xsl"/>
11
12 <xsl:output method="html"/>
13
14 <xsl:template name="pageTitle">
15 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
16 </xsl:template>
17
18 <!-- page specific style goes here -->
19 <xsl:template name="pageStyle"/>
20
21 <xsl:template match="pageResponse">
22 <xsl:call-template name="greenstonePageBanner"/>
23 <xsl:apply-templates select="serviceList/service[@name='TextQuery']"/>
24 <xsl:apply-templates select="collectionList"/>
25 <xsl:apply-templates select="serviceClusterList"/>
26 <xsl:apply-templates select="serviceList"/>
27 </xsl:template>
28
29 <xsl:template match="collectionList">
30 <ul id="collectionlist">
31 <xsl:for-each select="collection">
32 <li>
33 <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}">
34 <xsl:choose>
35 <xsl:when test="displayItem[@name='icon']">
36 <img>
37 <xsl:attribute name="src">
38 <xsl:value-of select="metadataList/metadata[@name='httpPath']"/>/images/<xsl:value-of select="displayItem[@name='icon']"/>
39 </xsl:attribute>
40 <xsl:attribute name="alt">
41 <xsl:value-of select="displayItem[@name='name']"/>
42 </xsl:attribute>
43 </img>
44 </xsl:when>
45 <xsl:otherwise>
46 <xsl:value-of select="displayItem[@name='name']"/>
47 </xsl:otherwise>
48 </xsl:choose>
49 </a>
50 </li>
51 </xsl:for-each>
52 </ul>
53 </xsl:template>
54
55 <xsl:template match="serviceClusterList">
56 <xsl:for-each select="serviceCluster">
57 <a href="{$library_name}?a=p&amp;sa=about&amp;c={@name}"><xsl:value-of select='@name'/><xsl:value-of select="displayItem[@name='name']"/></a>
58 </xsl:for-each>
59 </xsl:template>
60
61 <xsl:template match="service[@name='TextQuery']">
62 <div class="QuickSearch">
63 <form name="QuickSearch" method="get" action="{$library_name}">
64 <input type="hidden" name="a" value="q"/>
65 <input type="hidden" name="rt" value="rd"/>
66 <input type="hidden" name="s" value="{@name}"/>
67 <input type="hidden" name="s1.collection" value="all"/>
68 <input type="text" name="s1.query" size="20"/>
69 <input type="submit" value="Quick Search"/>
70 </form>
71 </div>
72 </xsl:template>
73
74 <xsl:template match="serviceList">
75 <xsl:call-template name="dividerBar"/>
76 <ul id="servicelist">
77 <xsl:for-each select="service[@type='query']">
78 <li><a href="{$library_name}?a=q&amp;rt=d&amp;s={@name}"><xsl:value-of select="displayItem[@name='name']"/></a><xsl:value-of select="displayItem[@name='description']"/></li>
79 </xsl:for-each>
80 </ul>
81 </xsl:template>
82</xsl:stylesheet>
83
84
Note: See TracBrowser for help on using the repository browser.