source: main/trunk/greenstone3/web/interfaces/oran/transform/classifiertools.xsl@ 24359

Last change on this file since 24359 was 24359, checked in by ak19, 13 years ago

Corrections to commits of revision 24339 and 24340: better layout for oran skin when the default contents of collectionconfig.xml are present (if there's nothing in collectionconfig.xml, it will use Sam's better interface). Uses table and table rows and cells instead of unordered list and listitems.

File size: 4.6 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
10 <xsl:template match="classifier">
11 <xsl:param name="collName"/>
12 <xsl:param name="serviceName"/>
13 <div id="classifiers">
14 <xsl:variable name="cl_name"><xsl:value-of select="@name"/></xsl:variable>
15 <xsl:apply-templates select="." mode="default">
16 <xsl:with-param name="collName" select="$collName"/>
17 <xsl:with-param name="serviceName" select="$serviceName"/>
18 </xsl:apply-templates>
19 </div>
20 </xsl:template>
21
22
23 <xsl:template match="classifier" mode="default"> <!-- the default -->
24 <xsl:param name="collName"/>
25 <xsl:param name="serviceName"/>
26 <table id="classifiernodelist">
27 <xsl:call-template name="processNodeChildren">
28 <xsl:with-param name='collName' select='$collName'/>
29 <xsl:with-param name='serviceName' select='$serviceName'/>
30 </xsl:call-template>
31 </table>
32 </xsl:template>
33
34
35 <!-- this is a wrapper node, which the interface can use to add stuff into the query results that isn't part of and doesn't depend on the documentNode template which may come from the collection -->
36 <xsl:template name="documentNodeWrapper">
37 <xsl:param name="collName"/>
38 <xsl:param name="serviceName"/>
39 <xsl:apply-templates select=".">
40 <xsl:with-param name="collName" select="$collName"/>
41 <xsl:with-param name="serviceName" select="$serviceName"/>
42 </xsl:apply-templates>
43 </xsl:template>
44
45
46 <xsl:template match="documentNode">
47 <xsl:param name="collName"/>
48 <xsl:param name="serviceName"/>
49 <a href="{$library_name}?a=d&amp;c={$collName}&amp;d={@nodeID}&amp;dt={@docType}&amp;p.a=b&amp;p.s={$serviceName}"><xsl:apply-templates select="." mode="displayNodeIcon"/></a><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
50
51 <!-- The berry (optional) -->
52 <td>
53 <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
54 </td>
55 </xsl:template>
56
57
58 <!-- icon + title template-->
59 <xsl:template match="classifierNode">
60 <xsl:param name="collName"/>
61 <xsl:param name="serviceName"/>
62 <a><xsl:attribute name='href'><xsl:value-of select='$library_name'/>?a=b&amp;rt=r&amp;s=<xsl:value-of select='$serviceName'/>&amp;c=<xsl:value-of select='$collName'/>&amp;cl=<xsl:value-of select='@nodeID'/><xsl:if test="classifierNode|documentNode">.pr</xsl:if></xsl:attribute><xsl:call-template name="bookshelfimg"/></a><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
63 </xsl:template>
64
65
66 <!-- processing for the recursive bit -->
67 <xsl:template match="classifierNode" mode="process-all-children">
68 <xsl:param name="collName"/>
69 <xsl:param name="serviceName"/>
70 <xsl:call-template name="processNodeChildren">
71 <xsl:with-param name='collName' select='$collName'/>
72 <xsl:with-param name='serviceName' select='$serviceName'/>
73 </xsl:call-template>
74 </xsl:template>
75
76
77 <xsl:template name="processNodeChildren">
78 <xsl:param name="collName"/>
79 <xsl:param name="serviceName"/>
80 <xsl:for-each select='classifierNode|documentNode'><tr>
81 <xsl:choose>
82 <xsl:when test="name()='documentNode'">
83 <td><table><tr>
84 <xsl:call-template name="documentNodeWrapper">
85 <xsl:with-param name='collName' select='$collName'/>
86 <xsl:with-param name='serviceName' select='$serviceName'/>
87 </xsl:call-template>
88 </tr></table>
89 </td>
90 </xsl:when>
91 <xsl:otherwise>
92 <td><table><tr>
93 <xsl:apply-templates select='.'>
94 <xsl:with-param name='collName' select='$collName'/>
95 <xsl:with-param name='serviceName' select='$serviceName'/>
96 </xsl:apply-templates>
97 </tr></table>
98 </td>
99 <xsl:if test="child::classifierNode or child::documentNode">
100 <!--recurse into the children-->
101 <tr><td><table class="childrenlist">
102 <xsl:apply-templates select='.' mode='process-all-children'>
103 <xsl:with-param name='collName' select='$collName'/>
104 <xsl:with-param name='serviceName' select='$serviceName'/>
105 </xsl:apply-templates>
106 </table></td></tr>
107 </xsl:if>
108 </xsl:otherwise>
109 </xsl:choose>
110 </tr></xsl:for-each>
111 </xsl:template>
112
113
114 <xsl:template name="bookshelfimg">
115 <xsl:param name="alt"/>
116 <xsl:param name="title"/>
117 <img border="0" width="20" height="16"
118 src="interfaces/default/images/bshelf.gif"
119 alt="{$alt}" title="{$title}"/>
120 </xsl:template>
121
122</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.