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

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

Getting a normal hierarchical classifier view to work in oran skin: this will be the look for the the default format statements that are present in collectionconfig.xml. Remove those format statements and Sam's much better interface will be displayed. To get things to work, needed to include some template match statements from default/gs3library as these were missing for dev/oran, including lots of elements from classifiertools.xsl. Dev therefore has a new file now: its own classifiertools.xsl.

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 <ul 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 </ul>
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">XXXX
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'>
81 <xsl:choose>
82 <xsl:when test="name()='documentNode'">
83 <li><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 </li>
90 </xsl:when>
91 <xsl:otherwise>
92 <!--<li>--><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 <!--</li>-->
99 <xsl:if test="child::classifierNode or child::documentNode">
100 <!--recurse into the children-->
101 <!--<li>--><ul 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 </ul>
107 <!--</li>-->
108 </xsl:if>
109 </xsl:otherwise>
110 </xsl:choose>
111 </xsl:for-each>
112 </xsl:template>
113
114
115 <xsl:template name="bookshelfimg">
116 <xsl:param name="alt"/>
117 <xsl:param name="title"/>
118 <img border="0" width="20" height="16"
119 src="interfaces/default/images/bshelf.gif"
120 alt="{$alt}" title="{$title}"/>
121 </xsl:template>
122
123</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.