[19856] | 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"
|
---|
[24997] | 7 | xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
|
---|
[19856] | 8 | extension-element-prefixes="java util"
|
---|
[24997] | 9 | exclude-result-prefixes="java util gsf">
|
---|
[19856] | 10 |
|
---|
[19988] | 11 | <!-- use the 'main' layout -->
|
---|
[24649] | 12 | <xsl:import href="layouts/main.xsl"/>
|
---|
[24997] | 13 | <xsl:import href="classifiertools.xsl"/>
|
---|
[19856] | 14 |
|
---|
[19988] | 15 | <!-- set page title -->
|
---|
| 16 | <xsl:template name="pageTitle"><gslib:serviceName/></xsl:template>
|
---|
[19856] | 17 |
|
---|
[19988] | 18 | <!-- set page breadcrumbs -->
|
---|
[24997] | 19 | <xsl:template name="breadcrumbs"><gslib:siteLink/><gslib:rightArrow/><gslib:collectionNameLinked/><gslib:rightArrow/></xsl:template>
|
---|
[19988] | 20 |
|
---|
[25918] | 21 | <!-- optional cgi-params for links to document pages -->
|
---|
| 22 | <xsl:variable name="opt-doc-link-args"></xsl:variable>
|
---|
[19988] | 23 | <!-- the page content -->
|
---|
[19856] | 24 | <xsl:template match="/page/pageResponse">
|
---|
[24997] | 25 | <xsl:call-template name="classifierPre"/>
|
---|
| 26 |
|
---|
[24520] | 27 | <script type="text/javascript" src="interfaces/{$interface_name}/js/classifier_scripts.js"><xsl:text> </xsl:text></script>
|
---|
[24997] | 28 | <script type="text/javascript">$(window).load(openStoredClassifiers);</script>
|
---|
[24520] | 29 |
|
---|
| 30 | <!-- this right sidebar -->
|
---|
[25144] | 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)))">
|
---|
[24520] | 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>
|
---|
[24510] | 38 |
|
---|
[24520] | 39 | <xsl:if test="$documentBasketOn">
|
---|
| 40 | <gslib:documentBasket/>
|
---|
| 41 | <xsl:text> </xsl:text>
|
---|
| 42 | </xsl:if>
|
---|
| 43 | </div>
|
---|
| 44 | </xsl:if>
|
---|
[19856] | 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 | -->
|
---|
[24512] | 51 | <div id="results">
|
---|
[24340] | 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 |
|
---|
[24997] | 55 | <xsl:call-template name="classifierResultsPre"/>
|
---|
| 56 |
|
---|
[24340] | 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>
|
---|
[24512] | 61 | </div>
|
---|
[24997] | 62 |
|
---|
[19856] | 63 | <div class="clear"><xsl:text> </xsl:text></div>
|
---|
| 64 | </xsl:template>
|
---|
| 65 |
|
---|
| 66 | <!--
|
---|
| 67 | TEMPLATE FOR DOCUMENTS
|
---|
| 68 | -->
|
---|
[24340] | 69 | <xsl:template match="documentNode"><!-- priority="3"-->
|
---|
[24115] | 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>
|
---|
[19856] | 80 | <a>
|
---|
[24997] | 81 | <xsl:choose>
|
---|
| 82 | <xsl:when test="@docType = 'paged'">
|
---|
| 83 | <xsl:attribute name="href"><xsl:value-of select="$library_name"/>?a=d&c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&d=<xsl:value-of select="@nodeID"/>&dt=<xsl:value-of select="@docType"/>&p.a=b&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&c=<xsl:value-of select="/page/pageResponse/collection/@name"/>&d=<xsl:value-of select="@nodeID"/>&dt=<xsl:value-of select="@docType"/>&p.a=b&p.s=<xsl:value-of select="/page/pageResponse/service/@name"/>&ed=1</xsl:attribute>
|
---|
| 87 | </xsl:otherwise>
|
---|
| 88 | </xsl:choose>
|
---|
[19856] | 89 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
|
---|
| 90 | </a>
|
---|
[24115] | 91 | </td>
|
---|
| 92 | <!-- The berry (optional) -->
|
---|
| 93 | <td>
|
---|
[19856] | 94 | <xsl:call-template name="documentBerryForClassifierOrSearchPage"/>
|
---|
[24115] | 95 | </td>
|
---|
[24339] | 96 | </xsl:template>
|
---|
[19856] | 97 |
|
---|
| 98 | <!--
|
---|
| 99 | TEMPLATE FOR GROUPS OF DOCUMENTS
|
---|
| 100 | -->
|
---|
[24340] | 101 | <xsl:template match="classifierNode"><!-- priority="3"-->
|
---|
[19856] | 102 |
|
---|
[24512] | 103 | <table id="title{@nodeID}"><tbody><tr>
|
---|
[24009] | 104 | <!-- Bookshelf icon -->
|
---|
| 105 | <td>
|
---|
| 106 | <img>
|
---|
| 107 | <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'bookshelf_image')"/></xsl:attribute>
|
---|
| 108 | </img>
|
---|
| 109 | </td>
|
---|
| 110 | <!-- Link title -->
|
---|
| 111 | <td>
|
---|
| 112 | <a href="javascript:toggleSection('{@nodeID}');">
|
---|
| 113 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name='Title']"/>
|
---|
| 114 | </a>
|
---|
| 115 | </td>
|
---|
[24512] | 116 | </tr></tbody></table>
|
---|
[24009] | 117 |
|
---|
| 118 | <!-- Show any documents or sub-groups in this group -->
|
---|
| 119 | <xsl:if test="documentNode|classifierNode">
|
---|
[24115] | 120 | <div id="div{@nodeID}" class="classifierContainer">
|
---|
| 121 | <table>
|
---|
| 122 | <xsl:for-each select="documentNode|classifierNode">
|
---|
| 123 | <tr>
|
---|
| 124 | <xsl:apply-templates select="."/>
|
---|
| 125 | </tr>
|
---|
| 126 | </xsl:for-each>
|
---|
| 127 | </table>
|
---|
[24009] | 128 | </div>
|
---|
| 129 | </xsl:if>
|
---|
| 130 | </xsl:template>
|
---|
[24997] | 131 |
|
---|
| 132 | <xsl:template name="classifierPre">
|
---|
| 133 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
|
---|
| 134 | <xsl:call-template name="mapFeaturesJSONNodes"/>
|
---|
| 135 | </xsl:if>
|
---|
[26871] | 136 |
|
---|
| 137 | <xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
|
---|
| 138 | <xsl:call-template name="panoramaViewerFeaturesJSONNodes"/>
|
---|
| 139 | </xsl:if>
|
---|
| 140 |
|
---|
[24997] | 141 | </xsl:template>
|
---|
| 142 |
|
---|
| 143 | <xsl:template name="classifierResultsPre">
|
---|
| 144 | <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search']/gsf:option[@name='mapEnabled']/@value = 'true'">
|
---|
[26871] | 145 | <xsl:call-template name="mapFeaturesMap"/>
|
---|
[24997] | 146 | </xsl:if>
|
---|
[26871] | 147 | <xsl:if test="/page/pageResponse/format/gsf:option[@name='panoramaViewerEnabled']/@value = 'true'">
|
---|
| 148 | <xsl:call-template name="panoramaViewerFeatures"/>
|
---|
| 149 | </xsl:if>
|
---|
[24997] | 150 | </xsl:template>
|
---|
| 151 |
|
---|
| 152 | <xsl:template name="mapFeaturesJSONNodes">
|
---|
| 153 | <div id="jsonNodes" style="display:none;">
|
---|
| 154 | <xsl:text>[</xsl:text>
|
---|
| 155 | <xsl:for-each select="//documentNode">
|
---|
| 156 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude']">
|
---|
| 157 | <xsl:text>{</xsl:text>
|
---|
[27876] | 158 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text>
|
---|
| 159 | <xsl:value-of select="@nodeID"/>
|
---|
| 160 | <xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
| 161 |
|
---|
| 162 | <xsl:text disable-output-escaping="yes">"title":"</xsl:text>
|
---|
| 163 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Title']"/>
|
---|
| 164 | <xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
| 165 |
|
---|
| 166 | <xsl:text disable-output-escaping="yes">"lat":</xsl:text>
|
---|
| 167 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Latitude']"/>
|
---|
| 168 | <xsl:text>,</xsl:text>
|
---|
| 169 |
|
---|
| 170 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text>
|
---|
| 171 | <xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
| 172 |
|
---|
| 173 |
|
---|
[24997] | 174 | <xsl:text>}</xsl:text>
|
---|
| 175 | <xsl:if test="not(position() = count(//documentNode))">
|
---|
| 176 | <xsl:text>,</xsl:text>
|
---|
| 177 | </xsl:if>
|
---|
| 178 | </xsl:if>
|
---|
| 179 | </xsl:for-each>
|
---|
| 180 | <xsl:text>]</xsl:text>
|
---|
| 181 | </div>
|
---|
| 182 |
|
---|
| 183 | <!-- Although these aren't visible, they are necessary because it forces Greenstone to include this metadata in the page xml -->
|
---|
[26091] | 184 | <gsf:metadata name="Latitude" hidden="true"/>
|
---|
| 185 | <gsf:metadata name="Longitude" hidden="true"/>
|
---|
[24997] | 186 | </xsl:template>
|
---|
| 187 |
|
---|
| 188 | <xsl:template name="mapFeaturesMap">
|
---|
[26871] | 189 | <div id="map_canvas" class="map_canvas_half"><xsl:text> </xsl:text></div>
|
---|
[24997] | 190 | </xsl:template>
|
---|
[26871] | 191 |
|
---|
| 192 | <xsl:template name="panoramaViewerFeaturesJSONNodes">
|
---|
| 193 | <div id="jsonPanoNodes" style="display:none;">
|
---|
| 194 | <xsl:text>[</xsl:text>
|
---|
| 195 | <xsl:for-each select="//documentNode">
|
---|
| 196 | <xsl:if test="metadataList/metadata[@name = 'Latitude'] and metadataList/metadata[@name = 'Longitude'] and metadataList/metadata[@name = 'PhotoType']='Panorama'">
|
---|
| 197 | <xsl:text>{</xsl:text>
|
---|
| 198 | <xsl:text disable-output-escaping="yes">"nodeID":"</xsl:text><xsl:value-of select="@nodeID"/><xsl:text disable-output-escaping="yes">",</xsl:text>
|
---|
| 199 | <xsl:text disable-output-escaping="yes">"source":"</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Source']"/>"<xsl:text>,</xsl:text>
|
---|
| 200 | <xsl:text disable-output-escaping="yes">"lat":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Latitude']"/><xsl:text>,</xsl:text>
|
---|
| 201 | <xsl:text disable-output-escaping="yes">"lng":</xsl:text><xsl:value-of disable-output-escaping="yes" select="metadataList/metadata[@name = 'Longitude']"/>
|
---|
| 202 | <xsl:text>}</xsl:text>
|
---|
| 203 | <xsl:if test="not(position() = count(//documentNode))">
|
---|
| 204 | <xsl:text>,</xsl:text>
|
---|
| 205 | </xsl:if>
|
---|
| 206 | </xsl:if>
|
---|
| 207 | </xsl:for-each>
|
---|
| 208 | <xsl:text>]</xsl:text>
|
---|
| 209 | </div>
|
---|
| 210 | <!-- Although these aren't visible, they are necessary because it forces Greenstone to include this metadata in the page xml -->
|
---|
| 211 | <gsf:metadata name="Latitude" hidden="true"/>
|
---|
| 212 | <gsf:metadata name="Longitude" hidden="true"/>
|
---|
[26883] | 213 | <gsf:metadata name="Image" hidden="true"/>
|
---|
[26871] | 214 | <gsf:metadata name="SourceFile" hidden="true"/>
|
---|
| 215 | <gsf:metadata name="assocfilepath" hidden="true"/>
|
---|
| 216 | <gsf:metadata name="PhotoType" hidden="true"/>
|
---|
| 217 | <gsf:metadata name="cv.rotation" hidden="true"/>
|
---|
[26883] | 218 | <gsf:metadata name="ex.Angle" hidden="true"/>
|
---|
| 219 | <gsf:metadata name="Angle" hidden="true"/>
|
---|
| 220 |
|
---|
| 221 | </xsl:template>
|
---|
[26871] | 222 |
|
---|
| 223 | <xsl:template name="panoramaViewerFeatures">
|
---|
| 224 |
|
---|
| 225 |
|
---|
| 226 | <div id="asdf">
|
---|
| 227 | <div id="pano-container" class="pano_canvas_half" style="position: relative">
|
---|
| 228 | <div style="position: absolute; top: 0px; right: 0px;"><a id="gofullscreen" style="background-color: #008000;" href="">Go Fullscreen</a></div>
|
---|
| 229 | <xsl:text> </xsl:text>
|
---|
| 230 | </div>
|
---|
| 231 | </div>
|
---|
| 232 |
|
---|
| 233 |
|
---|
| 234 |
|
---|
| 235 |
|
---|
| 236 | <gsf:script>
|
---|
| 237 | <![CDATA[
|
---|
| 238 | var cgiargs = '<xsl:template name="mainTemplate"> \
|
---|
| 239 | <html> \
|
---|
| 240 | <head> \
|
---|
| 241 | <xsl:call-template name="create-html-header"/> \
|
---|
| 242 | </head> \
|
---|
| 243 | \
|
---|
| 244 | <body><xsl:call-template name="textDirectionAttribute"/><xsl:call-template name="actionClass"/> \
|
---|
| 245 | <div id="containerXX"> \
|
---|
| 246 | <div id="gs_contentXX"> \
|
---|
| 247 | <xsl:apply-templates select="/page"/> \
|
---|
| 248 | </div> \
|
---|
| 249 | </div> \
|
---|
| 250 | </body> \
|
---|
| 251 | </html> \
|
---|
| 252 | </xsl:template> \
|
---|
| 253 | \
|
---|
| 254 | <xsl:template match="/page/pageResponse"> \
|
---|
| 255 | <xsl:call-template name="panoramaViewerFeaturesJSONNodes"/> \
|
---|
| 256 | <div id="asdf"> \
|
---|
| 257 | <div id="pano-container" class="pano_canvas_fullscreen"> \
|
---|
| 258 | <xsl:text> </xsl:text> \
|
---|
| 259 | </div> \
|
---|
| 260 | </div> \
|
---|
| 261 | </xsl:template>';
|
---|
| 262 |
|
---|
| 263 | // encodeURIComponent(cgiargs);
|
---|
| 264 | // cgiargs.replace(/ /g,"%20")
|
---|
| 265 |
|
---|
| 266 | var full_url = document.location + "?ilt=" + escape(cgiargs);
|
---|
| 267 | $('#gofullscreen').attr('href',full_url);
|
---|
| 268 | ]]>
|
---|
| 269 | </gsf:script>
|
---|
| 270 |
|
---|
| 271 |
|
---|
| 272 | </xsl:template>
|
---|
| 273 |
|
---|
[19856] | 274 | </xsl:stylesheet>
|
---|
| 275 |
|
---|