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="interfaces/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="interfaces/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&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="pjMetadataDisplayTable"/>
|
---|
131 | <xsl:call-template name="wrappedSectionText"/>
|
---|
132 | </xsl:template>
|
---|
133 |
|
---|
134 | <xsl:template name="sectionContent">
|
---|
135 | <xsl:call-template name="wrappedSectionImage"/>
|
---|
136 | <xsl:call-template name="pjMetadataDisplayTable"/>
|
---|
137 | <xsl:call-template name="wrappedSectionText"/>
|
---|
138 | </xsl:template>
|
---|
139 |
|
---|
140 |
|
---|
141 | <xsl:template name="pjMetadataDisplayTable">
|
---|
142 | <table cellpadding="1" cellspacing="0" class="alternating" hspace="5" style="margin-top: 15px; border: 1px solid #000; border-collapse: collapse;" vspace="5">
|
---|
143 | <gsf:switch>
|
---|
144 | <gsf:metadata name="pj.Catalogue-Number"/>
|
---|
145 | <gsf:when test="exists">
|
---|
146 | <tr>
|
---|
147 | <td class="heading">
|
---|
148 | <p rect="norect">Catalogue-Number</p>
|
---|
149 | </td>
|
---|
150 | <td>
|
---|
151 | <p data="Catalogue-Number" rect="norect">
|
---|
152 | <gsf:metadata name="pj.Catalogue-Number"/>
|
---|
153 | </p>
|
---|
154 | </td>
|
---|
155 | </tr>
|
---|
156 | </gsf:when>
|
---|
157 | </gsf:switch>
|
---|
158 | <gsf:switch>
|
---|
159 | <gsf:metadata name="pj.Catalogue-Short"/>
|
---|
160 | <gsf:when test="exists">
|
---|
161 | <tr>
|
---|
162 | <td class="heading">
|
---|
163 | <p rect="norect">Catalogue-Short</p>
|
---|
164 | </td>
|
---|
165 | <td>
|
---|
166 | <p data="Catalogue-Short" rect="norect">
|
---|
167 | <gsf:metadata name="pj.Catalogue-Short"/>
|
---|
168 | </p>
|
---|
169 | </td>
|
---|
170 | </tr>
|
---|
171 | </gsf:when>
|
---|
172 | </gsf:switch>
|
---|
173 | <gsf:switch>
|
---|
174 | <gsf:metadata name="pj.Title"/>
|
---|
175 | <gsf:when test="exists">
|
---|
176 | <tr>
|
---|
177 | <td class="heading">
|
---|
178 | <p rect="norect">Title</p>
|
---|
179 | </td>
|
---|
180 | <td>
|
---|
181 | <p data="Title" rect="norect">
|
---|
182 | <gsf:metadata name="pj.Title"/>
|
---|
183 | </p>
|
---|
184 | </td>
|
---|
185 | </tr>
|
---|
186 | </gsf:when>
|
---|
187 | </gsf:switch>
|
---|
188 | <gsf:switch>
|
---|
189 | <gsf:metadata name="pj.Date"/>
|
---|
190 | <gsf:when test="exists">
|
---|
191 | <tr>
|
---|
192 | <td class="heading">
|
---|
193 | <p rect="norect">Date</p>
|
---|
194 | </td>
|
---|
195 | <td>
|
---|
196 | <p data="Date" rect="norect">
|
---|
197 | <gsf:metadata name="pj.Date"/>
|
---|
198 | </p>
|
---|
199 | </td>
|
---|
200 | </tr>
|
---|
201 | </gsf:when>
|
---|
202 | </gsf:switch>
|
---|
203 | <gsf:switch>
|
---|
204 | <gsf:metadata name="pj.Year"/>
|
---|
205 | <gsf:when test="exists">
|
---|
206 | <tr>
|
---|
207 | <td class="heading">
|
---|
208 | <p rect="norect">Year</p>
|
---|
209 | </td>
|
---|
210 | <td>
|
---|
211 | <p data="Year" rect="norect">
|
---|
212 | <gsf:metadata name="pj.Year"/>
|
---|
213 | </p>
|
---|
214 | </td>
|
---|
215 | </tr>
|
---|
216 | </gsf:when>
|
---|
217 | </gsf:switch>
|
---|
218 | <gsf:switch>
|
---|
219 | <gsf:metadata name="pj.Author"/>
|
---|
220 | <gsf:when test="exists">
|
---|
221 | <tr>
|
---|
222 | <td class="heading">
|
---|
223 | <p rect="norect">Author</p>
|
---|
224 | </td>
|
---|
225 | <td>
|
---|
226 | <p data="Author" rect="norect">
|
---|
227 | <gsf:metadata name="pj.Author"/>
|
---|
228 | </p>
|
---|
229 | </td>
|
---|
230 | </tr>
|
---|
231 | </gsf:when>
|
---|
232 | </gsf:switch>
|
---|
233 | <gsf:switch>
|
---|
234 | <gsf:metadata name="pj.Physical-Location"/>
|
---|
235 | <gsf:when test="exists">
|
---|
236 | <tr>
|
---|
237 | <td class="heading">
|
---|
238 | <p rect="norect">Physical Location</p>
|
---|
239 | </td>
|
---|
240 | <td>
|
---|
241 | <p data="Physical-Location" rect="norect">
|
---|
242 | <gsf:metadata name="pj.Physical-Location"/>
|
---|
243 | </p>
|
---|
244 | </td>
|
---|
245 | </tr>
|
---|
246 | </gsf:when>
|
---|
247 | </gsf:switch>
|
---|
248 | <gsf:switch>
|
---|
249 | <gsf:metadata name="pj.Location"/>
|
---|
250 | <gsf:when test="exists">
|
---|
251 | <tr>
|
---|
252 | <td class="heading">
|
---|
253 | <p rect="norect">Location</p>
|
---|
254 | </td>
|
---|
255 | <td>
|
---|
256 | <p data="Location" rect="norect">
|
---|
257 | <gsf:metadata name="pj.Location"/>
|
---|
258 | </p>
|
---|
259 | </td>
|
---|
260 | </tr>
|
---|
261 | </gsf:when>
|
---|
262 | </gsf:switch>
|
---|
263 | <gsf:switch>
|
---|
264 | <gsf:metadata name="pj.Provenance"/>
|
---|
265 | <gsf:when test="exists">
|
---|
266 | <tr>
|
---|
267 | <td class="heading">
|
---|
268 | <p rect="norect" style="font-weight:bold;">Provenance</p>
|
---|
269 | </td>
|
---|
270 | <td>
|
---|
271 | <p data="Provenance" rect="norect">
|
---|
272 | <gsf:metadata name="pj.Provenance"/>
|
---|
273 | </p>
|
---|
274 | </td>
|
---|
275 | </tr>
|
---|
276 | </gsf:when>
|
---|
277 | </gsf:switch>
|
---|
278 | <gsf:switch>
|
---|
279 | <gsf:metadata name="pj.Description"/>
|
---|
280 | <gsf:when test="exists">
|
---|
281 | <tr>
|
---|
282 | <td class="heading">
|
---|
283 | <p rect="norect" style="font-weight: bold;">Description</p>
|
---|
284 | </td>
|
---|
285 | <td>
|
---|
286 | <p data="Description" rect="norect">
|
---|
287 | <gsf:metadata name="pj.Description"/>
|
---|
288 | </p>
|
---|
289 | </td>
|
---|
290 | </tr>
|
---|
291 | </gsf:when>
|
---|
292 | </gsf:switch>
|
---|
293 | <gsf:switch>
|
---|
294 | <gsf:metadata name="pj.Document-Type"/>
|
---|
295 | <gsf:when test="exists">
|
---|
296 | <tr>
|
---|
297 | <td class="heading">
|
---|
298 | <p rect="norect" style="font-weight: bold;">Document-Type</p>
|
---|
299 | </td>
|
---|
300 | <td>
|
---|
301 | <p data="Document-Type" rect="norect">
|
---|
302 | <gsf:metadata name="pj.Document-Type"/>
|
---|
303 | </p>
|
---|
304 | </td>
|
---|
305 | </tr>
|
---|
306 | </gsf:when>
|
---|
307 | </gsf:switch>
|
---|
308 | <gsf:switch>
|
---|
309 | <gsf:metadata name="pj.Subject"/>
|
---|
310 | <gsf:when test="exists">
|
---|
311 | <tr>
|
---|
312 | <td class="heading">
|
---|
313 | <p rect="norect" style="font-weight: bold;">Subject</p>
|
---|
314 | </td>
|
---|
315 | <td>
|
---|
316 | <p data="Subject" rect="norect">
|
---|
317 | <gsf:metadata name="pj.Subject"/>
|
---|
318 | </p>
|
---|
319 | </td>
|
---|
320 | </tr>
|
---|
321 | </gsf:when>
|
---|
322 | </gsf:switch>
|
---|
323 | <gsf:switch>
|
---|
324 | <gsf:metadata name="pj.Tags"/>
|
---|
325 | <gsf:when test="exists">
|
---|
326 | <tr>
|
---|
327 | <td class="heading">
|
---|
328 | <p rect="norect" style="font-weight: bold;">Tags</p>
|
---|
329 | </td>
|
---|
330 | <td>
|
---|
331 | <p data="Tags" rect="norect">
|
---|
332 | <gsf:metadata name="pj.Tags"/>
|
---|
333 | </p>
|
---|
334 | </td>
|
---|
335 | </tr>
|
---|
336 | </gsf:when>
|
---|
337 | </gsf:switch>
|
---|
338 | <gsf:switch>
|
---|
339 | <gsf:metadata name="pj.Notes"/>
|
---|
340 | <gsf:when test="exists">
|
---|
341 | <tr>
|
---|
342 | <td class="heading">
|
---|
343 | <p rect="norect" style="font-weight: bold;">Notes</p>
|
---|
344 | </td>
|
---|
345 | <td>
|
---|
346 | <p data="Notes" rect="norect">
|
---|
347 | <gsf:metadata name="pj.Notes"/>
|
---|
348 | </p>
|
---|
349 | </td>
|
---|
350 | </tr>
|
---|
351 | </gsf:when>
|
---|
352 | </gsf:switch>
|
---|
353 | <gsf:switch>
|
---|
354 | <gsf:metadata name="pj.MSHeading"/>
|
---|
355 | <gsf:when test="exists">
|
---|
356 | <tr>
|
---|
357 | <td class="heading">
|
---|
358 | <p rect="norect" style="font-weight: bold;">Maori Subject Heading</p>
|
---|
359 | </td>
|
---|
360 | <td>
|
---|
361 | <p data="MSHeading" rect="norect">
|
---|
362 | <gsf:metadata name="pj.MSHeading"/>
|
---|
363 | </p>
|
---|
364 | </td>
|
---|
365 | </tr>
|
---|
366 | </gsf:when>
|
---|
367 | </gsf:switch>
|
---|
368 | <gsf:switch>
|
---|
369 | <gsf:metadata name="pj.Access"/>
|
---|
370 | <gsf:when test="exists">
|
---|
371 | <tr>
|
---|
372 | <td class="heading">
|
---|
373 | <p rect="norect" style="font-weight: bold;">Access</p>
|
---|
374 | </td>
|
---|
375 | <td>
|
---|
376 | <p data="MSAccess" rect="norect">
|
---|
377 | <gsf:metadata name="pj.Access"/>
|
---|
378 | </p>
|
---|
379 | </td>
|
---|
380 | </tr>
|
---|
381 | </gsf:when>
|
---|
382 | </gsf:switch>
|
---|
383 | <tr><td></td></tr>
|
---|
384 | </table>
|
---|
385 |
|
---|
386 | </xsl:template>
|
---|
387 |
|
---|
388 | <!-- these are some old templates from collectionConfig.xmls -->
|
---|
389 | <xsl:template name="showAssocFilePath">
|
---|
390 | <xsl:if test="/page/pageRequest/paramList/param[@name='p.showAssocFilePath']/@value='1'">
|
---|
391 | <span data="gsdl.Metadata: assocfilepath" id="assocfilepath" rect="norect">@assocfilepath<gsf:metadata name="assocfilepath"/></span>
|
---|
392 | </xsl:if>
|
---|
393 | </xsl:template>
|
---|
394 |
|
---|
395 | <xsl:template name="showExpediteeAttributes">
|
---|
396 | <xsl:variable name="ScreenName">Screen</xsl:variable>
|
---|
397 | <xsl:variable name="ThumbName">Thumb</xsl:variable>
|
---|
398 | <xsl:if test="/page/pageRequest/paramList/param[@name='p.showExpediteeAttributes']/@value='1'">
|
---|
399 | <table attr="norect" cellpadding="1" cellspacing="0" width="100%">
|
---|
400 | <tr attr="norect">
|
---|
401 | <td attr="norect" colspan="2">
|
---|
402 | <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>
|
---|
403 | </td>
|
---|
404 | </tr>
|
---|
405 | <tr attr="norect">
|
---|
406 | <td attr="norect" colspan="2">
|
---|
407 | <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>
|
---|
408 | </td>
|
---|
409 | </tr>
|
---|
410 | <tr attr="norect">
|
---|
411 | <td attr="norect" colspan="2">
|
---|
412 | <span data="gsdl.Metadata: Catalogue-Number" rect="norect">@Catalogue-Number:<gsf:metadata name="Catalogue-Number"/></span>
|
---|
413 | </td>
|
---|
414 | </tr>
|
---|
415 | </table>
|
---|
416 | </xsl:if>
|
---|
417 | </xsl:template>
|
---|
418 |
|
---|
419 |
|
---|
420 | </xsl:stylesheet>
|
---|