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

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

rearranged metadata table

File size: 15.5 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="documentNodeTextOld">
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="sectionContentForEditing">
143 <xsl:call-template name="wrappedSectionImage"/>
144 <xsl:call-template name="imageDownloadLink"/>
145 <xsl:call-template name="wrappedSectionTextForEditing"/>
146 </xsl:template>
147
148 <xsl:template name="imageDownloadLink">
149 <xsl:if test="$collName = 'written-works'">
150 <gsf:if-metadata-exists>
151 <gsf:metadata name="Image" hidden="true"/>
152 <gsf:if>
153 <gsf:link type="source" source_meta="Source">download tif image</gsf:link>
154 </gsf:if>
155 </gsf:if-metadata-exists>
156 </xsl:if>
157 </xsl:template>
158
159 <xsl:template name="pjMetadataDisplayTable">
160 <table cellpadding="1" cellspacing="0" class="alternating" hspace="5" style="margin-top: 15px; border: 1px solid #000; border-collapse: collapse;" vspace="5">
161 <gsf:switch>
162 <gsf:metadata name="pj.Title"/>
163 <gsf:when test="exists">
164 <tr>
165 <td class="heading">
166 <p rect="norect">Title</p>
167 </td>
168 <td>
169 <p data="Title" rect="norect">
170 <gsf:metadata name="pj.Title"/>
171 </p>
172 </td>
173 </tr>
174 </gsf:when>
175 </gsf:switch>
176 <gsf:switch>
177 <gsf:metadata name="pj.Date"/>
178 <gsf:when test="exists">
179 <tr>
180 <td class="heading">
181 <p rect="norect">Date</p>
182 </td>
183 <td>
184 <p data="Date" rect="norect">
185 <gsf:metadata name="pj.Date" format="formatDate"/>
186 </p>
187 </td>
188 </tr>
189 </gsf:when>
190 </gsf:switch>
191 <gsf:switch>
192 <gsf:metadata name="pj.Author"/>
193 <gsf:when test="exists">
194 <tr>
195 <td class="heading">
196 <p rect="norect">Author</p>
197 </td>
198 <td>
199 <p data="Author" rect="norect">
200 <gsf:metadata name="pj.Author"/>
201 </p>
202 </td>
203 </tr>
204 </gsf:when>
205 </gsf:switch>
206 <gsf:switch>
207 <gsf:metadata name="pj.Correspondent"/>
208 <gsf:when test="exists">
209 <tr>
210 <td class="heading">
211 <p rect="norect">Correspondent</p>
212 </td>
213 <td>
214 <p data="Correspondent" rect="norect">
215 <gsf:metadata name="pj.Correspondent"/>
216 </p>
217 </td>
218 </tr>
219 </gsf:when>
220 </gsf:switch>
221 <gsf:switch>
222 <gsf:metadata name="pj.Description"/>
223 <gsf:when test="exists">
224 <tr>
225 <td class="heading">
226 <p rect="norect" style="font-weight: bold;">Description</p>
227 </td>
228 <td>
229 <p data="Description" rect="norect">
230 <gsf:metadata name="pj.Description"/>
231 </p>
232 </td>
233 </tr>
234 </gsf:when>
235 </gsf:switch>
236 <gsf:switch>
237 <gsf:metadata name="pj.Subject"/>
238 <gsf:when test="exists">
239 <tr>
240 <td class="heading">
241 <p rect="norect" style="font-weight: bold;">Subject</p>
242 </td>
243 <td>
244 <p data="Subject" rect="norect">
245 <gsf:metadata name="pj.Subject"/>
246 </p>
247 </td>
248 </tr>
249 </gsf:when>
250 </gsf:switch>
251 <gsf:switch>
252 <gsf:metadata name="pj.PersonOfInterest"/>
253 <gsf:when test="exists">
254 <tr>
255 <td class="heading">
256 <p rect="norect">Person of Interest</p>
257 </td>
258 <td>
259 <p data="PersonOfInterest" rect="norect">
260 <gsf:metadata name="pj.PersonOfInterest"/>
261 </p>
262 </td>
263 </tr>
264 </gsf:when>
265 </gsf:switch>
266 <gsf:switch>
267 <gsf:metadata name="pj.Event"/>
268 <gsf:when test="exists">
269 <tr>
270 <td class="heading">
271 <p rect="norect">Event</p>
272 </td>
273 <td>
274 <p data="Event" rect="norect">
275 <gsf:metadata name="pj.Event"/>
276 </p>
277 </td>
278 </tr>
279 </gsf:when>
280 </gsf:switch>
281 <gsf:switch>
282 <gsf:metadata name="pj.Location"/>
283 <gsf:when test="exists">
284 <tr>
285 <td class="heading">
286 <p rect="norect">Location</p>
287 </td>
288 <td>
289 <p data="Location" rect="norect">
290 <gsf:metadata name="pj.Location"/>
291 </p>
292 </td>
293 </tr>
294 </gsf:when>
295 </gsf:switch>
296 <gsf:switch>
297 <gsf:metadata name="pj.Access"/>
298 <gsf:when test="exists">
299 <tr>
300 <td class="heading">
301 <p rect="norect" style="font-weight: bold;">Access</p>
302 </td>
303 <td>
304 <p data="MSAccess" rect="norect">
305 <gsf:metadata name="pj.Access"/>
306 </p>
307 </td>
308 </tr>
309 </gsf:when>
310 </gsf:switch>
311 <gsf:switch>
312 <gsf:metadata name="pj.MSHeading"/>
313 <gsf:when test="exists">
314 <tr>
315 <td class="heading">
316 <p rect="norect" style="font-weight: bold;">Maori Subject Heading</p>
317 </td>
318 <td>
319 <p data="MSHeading" rect="norect">
320 <gsf:metadata name="pj.MSHeading"/>
321 </p>
322 </td>
323 </tr>
324 </gsf:when>
325 </gsf:switch>
326 <gsf:switch>
327 <gsf:metadata name="pj.Document-Type"/>
328 <gsf:when test="exists">
329 <tr>
330 <td class="heading">
331 <p rect="norect" style="font-weight: bold;">Document-Type</p>
332 </td>
333 <td>
334 <p data="Document-Type" rect="norect">
335 <gsf:metadata name="pj.Document-Type"/>
336 </p>
337 </td>
338 </tr>
339 </gsf:when>
340 </gsf:switch>
341 <gsf:switch>
342 <gsf:metadata name="pj.Notes"/>
343 <gsf:when test="exists">
344 <tr>
345 <td class="heading">
346 <p rect="norect" style="font-weight: bold;">Notes</p>
347 </td>
348 <td>
349 <p data="Notes" rect="norect">
350 <gsf:metadata name="pj.Notes"/>
351 </p>
352 </td>
353 </tr>
354 </gsf:when>
355 </gsf:switch>
356 <gsf:switch>
357 <gsf:metadata name="pj.Provenance"/>
358 <gsf:when test="exists">
359 <tr>
360 <td class="heading">
361 <p rect="norect" style="font-weight:bold;">Provenance</p>
362 </td>
363 <td>
364 <p data="Provenance" rect="norect">
365 <gsf:metadata name="pj.Provenance"/>
366 </p>
367 </td>
368 </tr>
369 </gsf:when>
370 </gsf:switch>
371 <gsf:switch>
372 <gsf:metadata name="pj.Tags"/>
373 <gsf:when test="exists">
374 <tr>
375 <td class="heading">
376 <p rect="norect" style="font-weight: bold;">Tags</p>
377 </td>
378 <td>
379 <p data="Tags" rect="norect">
380 <gsf:metadata name="pj.Tags"/>
381 </p>
382 </td>
383 </tr>
384 </gsf:when>
385 </gsf:switch>
386 <gsf:switch>
387 <gsf:metadata name="pj.Catalogue-Number"/>
388 <gsf:when test="exists">
389 <tr>
390 <td class="heading">
391 <p rect="norect">Catalogue-Number</p>
392 </td>
393 <td>
394 <p data="Catalogue-Number" rect="norect">
395 <gsf:metadata name="pj.Catalogue-Number"/>
396 </p>
397 </td>
398 </tr>
399 </gsf:when>
400 </gsf:switch>
401<!-- <gsf:switch>
402 <gsf:metadata name="pj.Catalogue-Short"/>
403 <gsf:when test="exists">
404 <tr>
405 <td class="heading">
406 <p rect="norect">Catalogue-Short</p>
407 </td>
408 <td>
409 <p data="Catalogue-Short" rect="norect">
410 <gsf:metadata name="pj.Catalogue-Short"/>
411 </p>
412 </td>
413 </tr>
414 </gsf:when>
415 </gsf:switch>-->
416 <gsf:switch>
417 <gsf:metadata name="pj.Physical-Location"/>
418 <gsf:when test="exists">
419 <tr>
420 <td class="heading">
421 <p rect="norect">Physical Location</p>
422 </td>
423 <td>
424 <p data="Physical-Location" rect="norect">
425 <gsf:metadata name="pj.Physical-Location"/>
426 </p>
427 </td>
428 </tr>
429 </gsf:when>
430 </gsf:switch>
431 <gsf:switch>
432 <gsf:metadata name="pj.Physical-Description"/>
433 <gsf:when test="exists">
434 <tr>
435 <td class="heading">
436 <p rect="norect">Physical Description</p>
437 </td>
438 <td>
439 <p data="Physical-Location" rect="norect">
440 <gsf:metadata name="pj.Physical-Description"/>
441 </p>
442 </td>
443 </tr>
444 </gsf:when>
445 </gsf:switch>
446 <gsf:switch>
447 <gsf:metadata name="pj.Year"/>
448 <gsf:when test="exists">
449 <tr>
450 <td class="heading">
451 <p rect="norect">Year</p>
452 </td>
453 <td>
454 <p data="Year" rect="norect">
455 <gsf:metadata name="pj.Year"/>
456 </p>
457 </td>
458 </tr>
459 </gsf:when>
460 </gsf:switch>
461 <gsf:switch>
462 <gsf:metadata name="pj.Format"/>
463 <gsf:when test="exists">
464 <tr>
465 <td class="heading">
466 <p rect="norect">Format</p>
467 </td>
468 <td>
469 <p data="Format" rect="norect">
470 <gsf:metadata name="pj.Format"/>
471 </p>
472 </td>
473 </tr>
474 </gsf:when>
475 </gsf:switch>
476 <tr><td></td></tr>
477 </table>
478
479 </xsl:template>
480
481 <!-- these are some old templates from collectionConfig.xmls -->
482 <xsl:template name="showAssocFilePath">
483 <xsl:if test="/page/pageRequest/paramList/param[@name='p.showAssocFilePath']/@value='1'">
484 <span data="gsdl.Metadata: assocfilepath" id="assocfilepath" rect="norect">@assocfilepath<gsf:metadata name="assocfilepath"/></span>
485 </xsl:if>
486 </xsl:template>
487
488 <xsl:template name="showExpediteeAttributes">
489 <xsl:variable name="ScreenName">Screen</xsl:variable>
490 <xsl:variable name="ThumbName">Thumb</xsl:variable>
491 <xsl:if test="/page/pageRequest/paramList/param[@name='p.showExpediteeAttributes']/@value='1'">
492 <table attr="norect" cellpadding="1" cellspacing="0" width="100%">
493 <tr attr="norect">
494 <td attr="norect" colspan="2">
495 <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>
496 </td>
497 </tr>
498 <tr attr="norect">
499 <td attr="norect" colspan="2">
500 <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>
501 </td>
502 </tr>
503 <tr attr="norect">
504 <td attr="norect" colspan="2">
505 <span data="gsdl.Metadata: Catalogue-Number" rect="norect">@Catalogue-Number:<gsf:metadata name="Catalogue-Number"/></span>
506 </td>
507 </tr>
508 </table>
509 </xsl:if>
510 </xsl:template>
511
512
513</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.