source: main/trunk/greenstone3/web/interfaces/basic/transform/classifier.xsl

Last change on this file was 38056, checked in by kjdon, 8 months ago

made this interface work again with current greenstone. didn't do any prettying, just wanted to make it functional

File size: 4.1 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 <xsl:include href="classifiertools.xsl"/>
12 <xsl:include href="berrytools.xsl"/>
13
14 <xsl:output method="html"/>
15
16 <!-- the main page layout template is here -->
17 <xsl:template match="page">
18 <html>
19 <head>
20 <xsl:call-template name="baseHref"/>
21 <title>
22 <!-- put a space in the title in case the actual value is missing - mozilla will not display a page with no title-->
23 <xsl:call-template name="pageTitle"/><xsl:text> </xsl:text>
24 </title>
25 <xsl:call-template name="globalStyle"/>
26 <xsl:call-template name="pageStyle"/>
27 </head>
28 <body>
29 <xsl:attribute name="dir"><xsl:call-template name="direction"/></xsl:attribute>
30 <div id="page-wrapper">
31 <xsl:call-template name="response" />
32 <xsl:call-template name="greenstoneFooter"/>
33 </div>
34 </body>
35 </html>
36 </xsl:template>
37
38 <xsl:variable name="berrybasketswitch"><xsl:value-of select="/page/pageRequest/paramList/param[@name='berrybasket']/@value"/></xsl:variable>
39
40 <xsl:template name="pageTitle">
41 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'gsdl')"/>
42 </xsl:template>
43
44 <!-- page specific style goes here -->
45 <xsl:template name="pageStyle">
46 <xsl:if test="$berrybasketswitch = 'on'">
47 <xsl:call-template name="berryStyleSheet"/>
48 <xsl:call-template name="js-library"/>
49 </xsl:if>
50 </xsl:template>
51
52
53 <xsl:template match="pageResponse">
54 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
55 <xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
56 <xsl:call-template name="standardPageBanner">
57 <xsl:with-param name="collName" select="$collName"/>
58 </xsl:call-template>
59
60 <xsl:call-template name="navigationBar">
61 <xsl:with-param name="collName" select="$collName"/>
62 </xsl:call-template>
63
64 <!-- Sam's div code -->
65
66 <!-- <xsl:if test="/page/pageRequest[@name='output']='debug'"> -->
67
68 <xsl:variable name="fmt">
69 <xsl:call-template name="xml-to-string">
70 <xsl:with-param name="node-set" select="//format[@type='browse']"/>
71 </xsl:call-template>
72 </xsl:variable>
73
74 <!-- <xsl:variable name="tok" select="fn:tokenize($fmt,'/s+')"/> -->
75
76 <!--<div id="format">
77 <p>
78 <b>Format string here</b>
79 <i>
80 <xsl:value-of select="$fmt"/>-->
81 <!-- <xsl:value-of select="$tok"/> -->
82 <!--</i>
83 </p>
84 </div>-->
85 <!-- </xsl:if> -->
86
87
88 <div id="content">
89 <xsl:apply-templates select="service/classifierList">
90 <xsl:with-param name="collName" select="$collName"/>
91 <xsl:with-param name="serviceName" select="$serviceName"/>
92 </xsl:apply-templates>
93
94 <xsl:if test="$berrybasketswitch = 'on'">
95 <xsl:call-template name="berrybasket" />
96 </xsl:if>
97 <xsl:apply-templates select="classifier">
98 <xsl:with-param name="collName" select="$collName"/>
99 <xsl:with-param name="serviceName" select="$serviceName"/>
100 </xsl:apply-templates>
101 </div>
102 </xsl:template>
103
104 <xsl:template match="classifierList">
105 <xsl:param name="collName"/>
106 <xsl:param name="serviceName"/>
107 <xsl:variable name="selected" select="/page/pageResponse/classifier/@name"/>
108 <ul id="classifierlist">
109 <xsl:for-each select="classifier">
110 <xsl:choose>
111 <xsl:when test="@name=$selected">
112 <li id="activeclassifier"><xsl:value-of select="displayItem[@name='name']"/></li>
113 </xsl:when>
114 <xsl:otherwise>
115 <li><a href="{$library_name}?a=b&amp;rt=r&amp;s={$serviceName}&amp;c={$collName}&amp;cl={@name}"><xsl:value-of select="displayItem[@name='name']"/></a></li></xsl:otherwise></xsl:choose>
116
117 </xsl:for-each>
118 </ul>
119 </xsl:template>
120
121</xsl:stylesheet>
122
123
124
125
126
127
Note: See TracBrowser for help on using the repository browser.