source: main/trunk/model-sites-dev/pei-jones/transform/pages/document.xsl@ 31941

Last change on this file since 31941 was 31941, checked in by kjdon, 5 years ago

adding a link to download the tif image. needed for lynda for ease of reading the images

File size: 13.4 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 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
12 <!-- set page title to be collection name instead of document name -->
13 <xsl:template name="pageTitle"><gslib:collectionName/></xsl:template>
14
15 <xsl:template name="javascriptForDocumentView">
16 <script type="text/javascript" src="interfaces/default/js/document_scripts.js"><xsl:text> </xsl:text></script>
17 <script type="text/javascript" src="sites/pei-jones/js/custom-document.js"><xsl:text> </xsl:text></script>
18 </xsl:template>
19
20 <xsl:template name="javascriptForDocumentEditing">
21 <!--<script type="text/javascript" src="interfaces/default/js/combobox.js"><xsl:text> </xsl:text></script>-->
22 <script type="text/javascript" src="interfaces/default/js/documentedit_scripts.js"><xsl:text> </xsl:text></script>
23 <script type="text/javascript" src="interfaces/default/js/documentedit_scripts_util.js"><xsl:text> </xsl:text></script>
24 <script type="text/javascript" src="interfaces/default/js/hierarchy.js"><xsl:text> </xsl:text></script>
25 <!-- add in the pei-jones customisations -->
26 <script type="text/javascript" src="sites/pei-jones/js/custom-doc-editing.js"><xsl:text> </xsl:text></script>
27 <!-- add in the collection specific customisations -->
28 <script type="text/javascript" src="sites/pei-jones/collect/{$collName}/js/custom-doc-editing.js"><xsl:text> </xsl:text></script>
29 <script type="text/javascript">
30 <xsl:text disable-output-escaping="yes">
31 $(window).load(function()
32 {
33 if(gs.cgiParams.docEdit == "1")
34 {
35 readyPageForEditing();
36 }
37 });
38
39 </xsl:text>
40 <!-- download and process hierarchy files -->
41 <xsl:text disable-output-escaping="yes">$(document).ready(function(){</xsl:text>
42 <xsl:for-each select="//classifier[@hfile]">
43 <xsl:text disable-output-escaping="yes">downloadAndProcessHierarchyFile('</xsl:text>
44 <xsl:text>sites/pei-jones/collect/</xsl:text><xsl:value-of select="$collName"/><xsl:text>/etc/</xsl:text><xsl:value-of select="@hfile"/>
45 <xsl:text disable-output-escaping="yes">','</xsl:text><xsl:value-of select="@metadata"/><xsl:text disable-output-escaping="yes">');</xsl:text>
46 </xsl:for-each>
47 <xsl:text disable-output-escaping="yes">});</xsl:text>
48
49 </script>
50 </xsl:template>
51
52 <xsl:template name="editBar" >
53 <div id="editBar">
54 <div id="editBarRight" stype="width:100%; float:right; margin: 0 0 10px 20px;" >
55 <div style="text-align:center;">
56 <!-- edit content button -->
57 <div style="margin:5px;" class="ui-state-default ui-corner-all">
58 <div id="editContentButtonDiv" style="margin:3px" ><a id="editContentButton" style="padding: 3px; text-decoration:none;">
59 <xsl:attribute name="href">
60 <xsl:value-of select="$library_name"/>
61 <xsl:text>/collection/</xsl:text>
62 <xsl:value-of select="$collName"/>
63 <xsl:text>/document/</xsl:text>
64 <xsl:choose>
65 <xsl:when test="count(//documentNode) > 0">
66 <xsl:value-of select="/page/pageResponse/document/documentNode/@nodeID"/>
67 </xsl:when>
68 <xsl:otherwise>
69 <xsl:value-of select="/page/pageResponse/document/@nodeID"/>
70 </xsl:otherwise>
71 </xsl:choose>
72 <xsl:if test="not(/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1')">
73 <xsl:text>?ed=1&amp;docEdit=1</xsl:text>
74 </xsl:if>
75 </xsl:attribute>
76 <xsl:choose>
77 <xsl:when test="/page/pageRequest/paramList/param[@name = 'docEdit']/@value = '1'">
78 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.hide_editor')"/>
79 </xsl:when>
80 <xsl:otherwise>
81 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'de.edit_content')"/>
82 </xsl:otherwise>
83 </xsl:choose>
84 </a>
85 </div>
86 <!-- place holder div for editing controls -->
87 <!-- Note, we are putting these underneath instead of to the left -->
88 <div id="editBarLeft"><xsl:text> </xsl:text></div>
89 </div>
90 </div>
91 </div>
92 </div>
93 </xsl:template>
94
95
96 <!-- The default template for displaying the document node text -->
97 <!-- equivalent to gsf:text -->
98 <xsl:template name="documentNodeText">
99 <!-- Hides the "This document has no text." message -->
100 <xsl:variable name="noText">0</xsl:variable>
101 <xsl:choose>
102 <xsl:when test="not($noText = '1')">
103
104 <!-- Section text -->
105 <xsl:for-each select="nodeContent">
106 <xsl:for-each select="node()">
107 <xsl:choose>
108 <xsl:when test="not(name())">
109 <xsl:value-of select="." disable-output-escaping="yes"/>
110 </xsl:when>
111 <xsl:when test="name() = 'annotation'">
112 <xsl:call-template name="displayAnnotation"/>
113 </xsl:when>
114 <xsl:otherwise>
115 <xsl:apply-templates/>
116 </xsl:otherwise>
117 </xsl:choose>
118 </xsl:for-each>
119 </xsl:for-each>
120 </xsl:when>
121 <xsl:when test="$noText = '1' and not(metadataList/metadata[@name='Image'])">
122 <gsf:link type="source"><gsf:metadata name="Source"/></gsf:link>
123 </xsl:when>
124 </xsl:choose>
125 <xsl:text> </xsl:text>
126 </xsl:template>
127
128 <xsl:template name="topLevelSectionContent">
129 <xsl:call-template name="wrappedSectionImage"/>
130 <xsl:call-template name="imageDownloadLink"/>
131 <xsl:call-template name="pjMetadataDisplayTable"/>
132 <xsl:call-template name="wrappedSectionText"/>
133 </xsl:template>
134
135 <xsl:template name="sectionContent">
136 <xsl:call-template name="wrappedSectionImage"/>
137 <xsl:call-template name="imageDownloadLink"/>
138 <xsl:call-template name="pjMetadataDisplayTable"/>
139 <xsl:call-template name="wrappedSectionText"/>
140 </xsl:template>
141
142 <xsl:template name="imageDownloadLink">
143 <gsf:link type="source" source_meta="Source">download tif image</gsf:link>
144 </xsl:template>
145
146 <xsl:template name="pjMetadataDisplayTable">
147 <table cellpadding="1" cellspacing="0" class="alternating" hspace="5" style="margin-top: 15px; border: 1px solid #000; border-collapse: collapse;" vspace="5">
148 <gsf:switch>
149 <gsf:metadata name="pj.Catalogue-Number"/>
150 <gsf:when test="exists">
151 <tr>
152 <td class="heading">
153 <p rect="norect">Catalogue-Number</p>
154 </td>
155 <td>
156 <p data="Catalogue-Number" rect="norect">
157 <gsf:metadata name="pj.Catalogue-Number"/>
158 </p>
159 </td>
160 </tr>
161 </gsf:when>
162 </gsf:switch>
163 <gsf:switch>
164 <gsf:metadata name="pj.Catalogue-Short"/>
165 <gsf:when test="exists">
166 <tr>
167 <td class="heading">
168 <p rect="norect">Catalogue-Short</p>
169 </td>
170 <td>
171 <p data="Catalogue-Short" rect="norect">
172 <gsf:metadata name="pj.Catalogue-Short"/>
173 </p>
174 </td>
175 </tr>
176 </gsf:when>
177 </gsf:switch>
178 <gsf:switch>
179 <gsf:metadata name="pj.Title"/>
180 <gsf:when test="exists">
181 <tr>
182 <td class="heading">
183 <p rect="norect">Title</p>
184 </td>
185 <td>
186 <p data="Title" rect="norect">
187 <gsf:metadata name="pj.Title"/>
188 </p>
189 </td>
190 </tr>
191 </gsf:when>
192 </gsf:switch>
193 <gsf:switch>
194 <gsf:metadata name="pj.Date"/>
195 <gsf:when test="exists">
196 <tr>
197 <td class="heading">
198 <p rect="norect">Date</p>
199 </td>
200 <td>
201 <p data="Date" rect="norect">
202 <gsf:metadata name="pj.Date"/>
203 </p>
204 </td>
205 </tr>
206 </gsf:when>
207 </gsf:switch>
208 <gsf:switch>
209 <gsf:metadata name="pj.Year"/>
210 <gsf:when test="exists">
211 <tr>
212 <td class="heading">
213 <p rect="norect">Year</p>
214 </td>
215 <td>
216 <p data="Year" rect="norect">
217 <gsf:metadata name="pj.Year"/>
218 </p>
219 </td>
220 </tr>
221 </gsf:when>
222 </gsf:switch>
223 <gsf:switch>
224 <gsf:metadata name="pj.Author"/>
225 <gsf:when test="exists">
226 <tr>
227 <td class="heading">
228 <p rect="norect">Author</p>
229 </td>
230 <td>
231 <p data="Author" rect="norect">
232 <gsf:metadata name="pj.Author"/>
233 </p>
234 </td>
235 </tr>
236 </gsf:when>
237 </gsf:switch>
238 <gsf:switch>
239 <gsf:metadata name="pj.Physical-Location"/>
240 <gsf:when test="exists">
241 <tr>
242 <td class="heading">
243 <p rect="norect">Physical Location</p>
244 </td>
245 <td>
246 <p data="Physical-Location" rect="norect">
247 <gsf:metadata name="pj.Physical-Location"/>
248 </p>
249 </td>
250 </tr>
251 </gsf:when>
252 </gsf:switch>
253 <gsf:switch>
254 <gsf:metadata name="pj.Location"/>
255 <gsf:when test="exists">
256 <tr>
257 <td class="heading">
258 <p rect="norect">Location</p>
259 </td>
260 <td>
261 <p data="Location" rect="norect">
262 <gsf:metadata name="pj.Location"/>
263 </p>
264 </td>
265 </tr>
266 </gsf:when>
267 </gsf:switch>
268 <gsf:switch>
269 <gsf:metadata name="pj.Provenance"/>
270 <gsf:when test="exists">
271 <tr>
272 <td class="heading">
273 <p rect="norect" style="font-weight:bold;">Provenance</p>
274 </td>
275 <td>
276 <p data="Provenance" rect="norect">
277 <gsf:metadata name="pj.Provenance"/>
278 </p>
279 </td>
280 </tr>
281 </gsf:when>
282 </gsf:switch>
283 <gsf:switch>
284 <gsf:metadata name="pj.Description"/>
285 <gsf:when test="exists">
286 <tr>
287 <td class="heading">
288 <p rect="norect" style="font-weight: bold;">Description</p>
289 </td>
290 <td>
291 <p data="Description" rect="norect">
292 <gsf:metadata name="pj.Description"/>
293 </p>
294 </td>
295 </tr>
296 </gsf:when>
297 </gsf:switch>
298 <gsf:switch>
299 <gsf:metadata name="pj.Document-Type"/>
300 <gsf:when test="exists">
301 <tr>
302 <td class="heading">
303 <p rect="norect" style="font-weight: bold;">Document-Type</p>
304 </td>
305 <td>
306 <p data="Document-Type" rect="norect">
307 <gsf:metadata name="pj.Document-Type"/>
308 </p>
309 </td>
310 </tr>
311 </gsf:when>
312 </gsf:switch>
313 <gsf:switch>
314 <gsf:metadata name="pj.Subject"/>
315 <gsf:when test="exists">
316 <tr>
317 <td class="heading">
318 <p rect="norect" style="font-weight: bold;">Subject</p>
319 </td>
320 <td>
321 <p data="Subject" rect="norect">
322 <gsf:metadata name="pj.Subject"/>
323 </p>
324 </td>
325 </tr>
326 </gsf:when>
327 </gsf:switch>
328 <gsf:switch>
329 <gsf:metadata name="pj.Tags"/>
330 <gsf:when test="exists">
331 <tr>
332 <td class="heading">
333 <p rect="norect" style="font-weight: bold;">Tags</p>
334 </td>
335 <td>
336 <p data="Tags" rect="norect">
337 <gsf:metadata name="pj.Tags"/>
338 </p>
339 </td>
340 </tr>
341 </gsf:when>
342 </gsf:switch>
343 <gsf:switch>
344 <gsf:metadata name="pj.Notes"/>
345 <gsf:when test="exists">
346 <tr>
347 <td class="heading">
348 <p rect="norect" style="font-weight: bold;">Notes</p>
349 </td>
350 <td>
351 <p data="Notes" rect="norect">
352 <gsf:metadata name="pj.Notes"/>
353 </p>
354 </td>
355 </tr>
356 </gsf:when>
357 </gsf:switch>
358 <gsf:switch>
359 <gsf:metadata name="pj.MSHeading"/>
360 <gsf:when test="exists">
361 <tr>
362 <td class="heading">
363 <p rect="norect" style="font-weight: bold;">Maori Subject Heading</p>
364 </td>
365 <td>
366 <p data="MSHeading" rect="norect">
367 <gsf:metadata name="pj.MSHeading"/>
368 </p>
369 </td>
370 </tr>
371 </gsf:when>
372 </gsf:switch>
373 <gsf:switch>
374 <gsf:metadata name="pj.Access"/>
375 <gsf:when test="exists">
376 <tr>
377 <td class="heading">
378 <p rect="norect" style="font-weight: bold;">Access</p>
379 </td>
380 <td>
381 <p data="MSAccess" rect="norect">
382 <gsf:metadata name="pj.Access"/>
383 </p>
384 </td>
385 </tr>
386 </gsf:when>
387 </gsf:switch>
388 <tr><td></td></tr>
389 </table>
390
391 </xsl:template>
392
393 <!-- these are some old templates from collectionConfig.xmls -->
394 <xsl:template name="showAssocFilePath">
395 <xsl:if test="/page/pageRequest/paramList/param[@name='p.showAssocFilePath']/@value='1'">
396 <span data="gsdl.Metadata: assocfilepath" id="assocfilepath" rect="norect">@assocfilepath<gsf:metadata name="assocfilepath"/></span>
397 </xsl:if>
398 </xsl:template>
399
400 <xsl:template name="showExpediteeAttributes">
401 <xsl:variable name="ScreenName">Screen</xsl:variable>
402 <xsl:variable name="ThumbName">Thumb</xsl:variable>
403 <xsl:if test="/page/pageRequest/paramList/param[@name='p.showExpediteeAttributes']/@value='1'">
404 <table attr="norect" cellpadding="1" cellspacing="0" width="100%">
405 <tr attr="norect">
406 <td attr="norect" colspan="2">
407 <span data="gsdl.Metadata: Screen" rect="norect">@Screenview: greenstone3-svn/web/sites/localsite/collect/pj-catalogue/index/assoc/<xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name = 'assocfilepath']"/>/<xsl:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name = $ScreenName]"/></span>
408 </td>
409 </tr>
410 <tr attr="norect">
411 <td attr="norect" colspan="2">
412 <span data="gsdl.Metadata: Thumb" rect="norect">@Thumbnail: greenstone3-svn/web/sites/localsite/collect/pj-catalogue/index/assoc/<xsl:value-of disable-output-escaping="yes" select="/page/pageResponse/document/metadataList/metadata[@name = 'assocfilepath']"/>/<xsl:value-of disable-output-escaping="yes" select="(.//metadataList)[last()]/metadata[@name = $ThumbName]"/></span>
413 </td>
414 </tr>
415 <tr attr="norect">
416 <td attr="norect" colspan="2">
417 <span data="gsdl.Metadata: Catalogue-Number" rect="norect">@Catalogue-Number:<gsf:metadata name="Catalogue-Number"/></span>
418 </td>
419 </tr>
420 </table>
421 </xsl:if>
422 </xsl:template>
423
424
425</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.