root/main/trunk/greenstone3/web/interfaces/default/transform/pages/classifier.xsl @ 31551

Revision 31551, 6.0 KB (checked in by kjdon, 2 years ago)

tidying up the default classifierNode template. This gets used when there is not one specified in collectionConfig.xml. we don't want the table, or process the children, as this happens outside of this template

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    xmlns:gslib="http://www.greenstone.org/skinning"
7    xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
8    extension-element-prefixes="java util"
9    exclude-result-prefixes="java util gsf">
10   
11    <!-- use the 'main' layout -->
12    <xsl:import href="layouts/main.xsl"/>
13    <xsl:import href="classifiertools.xsl"/>
14
15    <!-- set page title -->
16    <xsl:template name="pageTitle"><gslib:serviceName/></xsl:template>
17
18    <!-- set page breadcrumbs -->
19    <xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/><gslib:collectionNameLinked/><gslib:rightArrow/></xsl:template>
20
21    <!-- optional cgi-params for links to document pages -->
22    <xsl:variable name="opt-doc-link-args"></xsl:variable>
23    <!-- the page content -->
24    <xsl:template match="/page/pageResponse">
25        <xsl:call-template name="classifierPre"/>
26       
27        <script type="text/javascript" src="interfaces/{$interface_name}/js/classifier_scripts.js"><xsl:text> </xsl:text></script>
28        <script type="text/javascript">$(window).load(openStoredClassifiers);</script>
29       
30        <!-- this right sidebar -->
31        <xsl:if test="$berryBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))">
32            <div id="rightSidebar">
33                <xsl:if test="$berryBasketOn">
34                    <!-- show the berry basket if it's turned on -->
35                    <gslib:berryBasket/>
36                    <xsl:text> </xsl:text>
37                </xsl:if>
38
39                <xsl:if test="$documentBasketOn">
40                    <gslib:documentBasket/>
41                    <xsl:text> </xsl:text>
42                </xsl:if>
43            </div>
44        </xsl:if>
45   
46        <!--
47            show the clasifier results -
48            you can change the appearance of the results by editing
49            the two templates at the bottom of this file
50        -->
51        <div id="results">
52            <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
53            <xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
54
55            <xsl:call-template name="classifierResultsPre"/>
56           
57            <xsl:apply-templates select="classifier">
58                <xsl:with-param name="collName" select="$collName"/>
59                <xsl:with-param name="serviceName" select="$serviceName"/>
60            </xsl:apply-templates>
61        </div>
62
63        <div class="clear"><xsl:text> </xsl:text></div>
64    </xsl:template>
65
66    <!--
67    TEMPLATE FOR DOCUMENTS
68    -->
69    <xsl:template match="documentNode"><!-- priority="3"-->
70        <!-- The book icon -->
71        <td>
72            <img>           
73                <xsl:attribute name="src">
74                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'book_image')"/>
75                </xsl:attribute>
76            </img>
77        </td>
78        <!-- The document link -->
79        <td>
80            <a>
81                <xsl:choose>
82                    <xsl:when test="@docType = 'paged'">
83                        <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;d=<xsl:value-of select="@nodeID"/>&amp;dt=<xsl:value-of select="@docType"/>&amp;p.a=b&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/></xsl:attribute>
84                    </xsl:when>
85                    <xsl:otherwise>
86                        <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&amp;c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&amp;d=<xsl:value-of select="@nodeID"/>&amp;dt=<xsl:value-of select="@docType"/>&amp;p.a=b&amp;p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&amp;ed=1</xsl:attribute>
87                    </xsl:otherwise>
88                </xsl:choose>
89                <xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
90            </a>
91        </td>
92        <!-- The berry (optional) -->
93        <td>
94            <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
95        </td>
96    </xsl:template>
97
98    <!--
99    TEMPLATE FOR GROUPS OF DOCUMENTS
100    -->
101    <xsl:template match="classifierNode[@classifierStyle = 'HList']" >
102      <gsf:link type="classifier">
103        <xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
104      </gsf:link>
105    </xsl:template>
106
107    <xsl:template match="classifierNode"><!-- priority="3"-->
108
109        <!--<table id="title{@nodeID}"><tbody><tr>-->
110            <!-- Bookshelf icon -->
111            <td>
112                <img>
113                    <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'bookshelf_image')"/></xsl:attribute>
114                </img>
115            </td>
116            <!-- Link title -->
117            <td>
118                <a href="javascript:toggleSection('{@nodeID}');">
119                    <xsl:value-of disable-output-escaping="yes"  select="metadataList/metadata[@name='Title']"/>
120                </a>
121            </td>
122        <!--</tr></tbody></table>-->
123   
124        <!-- Show any documents or sub-groups in this group -->
125    <!--    <xsl:if test="documentNode|classifierNode">
126            <div id="div{@nodeID}" class="classifierContainer">
127                <table>
128                    <xsl:for-each select="documentNode|classifierNode">
129                        <tr>
130                            <xsl:apply-templates select="."/>
131                        </tr>
132                    </xsl:for-each>
133                </table>
134            </div>
135        </xsl:if>-->
136    </xsl:template>
137   
138    <xsl:template name="classifierPre">
139        <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
140            <xsl:call-template name="mapFeaturesJSONNodes"/>
141        </xsl:if>
142       
143        <xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
144            <xsl:call-template name="panoramaViewerFeaturesJSONNodes"/>
145        </xsl:if>
146       
147    </xsl:template>
148   
149    <xsl:template name="classifierResultsPre">
150        <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
151          <xsl:call-template name="mapFeaturesMap"/>
152        </xsl:if>
153        <xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
154          <xsl:call-template name="panoramaViewerFeatures"/>
155        </xsl:if>
156    </xsl:template>
157   
158   
159
160
161    <xsl:template match="/page/xsltparams">
162      <!-- suppress xsltparam block in page -->
163    </xsl:template>
164</xsl:stylesheet>
165
Note: See TracBrowser for help on using the browser.