source: gsdl/trunk/macros/document.dm@ 14119

Last change on this file since 14119 was 14082, checked in by lh92, 17 years ago

change the width of the book application to be variable to the size of the window

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 18.6 KB
Line 
1# this file must be UTF-8 encoded
2
3package document
4
5#######################################################################
6# macros set from within the server
7#######################################################################
8
9_imagethispage_ {}
10_httpprevarrow_ {}
11_httpnextarrow_ {}
12_pagetitle_ {}
13_phindclassifier_ {}
14_collageclassifier_ {}
15
16# custom header for individual document
17_documentheader_ {}
18
19#custom css links for individual document
20_csslink_{
21 <link rel="stylesheet" href="_cssfilelink_" type="text/css"
22 charset="UTF-8" _linktagend_
23 <link rel="alternate stylesheet" href="_httpimg_/preview-document.css"
24 type="text/css"
25 title="Preview Document" charset="UTF-8" media="screen" _linktagend_
26 <link rel="stylesheet" href="_httpimg_/print-document.css" type="text/css"
27 charset="UTF-8" media="print" _linktagend_
28}
29
30#######################################################################
31# page content
32#######################################################################
33
34_nextsearchresult_ {_If_("_cgiargsrn_" ne "0",<li id="nextresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrn_">_textnextsearchresult_</a></li>)}
35
36_prevsearchresult_ {_If_("_cgiargsrp_" ne "0",<li id="prevresult"><a href="_httpquery_&amp;ifl=1&amp;ifln=_cgiargsrp_">_textprevsearchresult_</a></li>)}
37
38_content_ {
39_optnavigationbar_
40
41_If_(_phindclassifier__collageclassifier_,
42<p style="text-align: center;">
43_phindclassifier_
44_collageclassifier_
45</p>
46)
47
48_If_("_cgiargcl_" eq "search",
49<ul id="searchresults">
50_prevsearchresult_
51_nextsearchresult_
52</div>)
53
54<div class="document">
55
56
57}
58
59# Dublin Core Metadata Element Set, Version 1.1
60_textTitlepage_ {_texticonhtitle_}
61_textCreatorpage_ {_texticonhcreat_}
62_textSubjectpage_ {_texticonhsubj_}
63_textDescriptionpage_ {_texticonhdesc_}
64_textPublisherpage_ {_texticonhpubl_}
65_textContributorpage_ {_texticonhcontr_}
66_textDatepage_ {_texticonhdate_}
67_textTypepage_ {_texticonhtype_}
68_textFormatpage_ {_texticonhform_}
69_textIdentifierpage_ {_texticonhident_}
70_textSourcepage_ {_texticonhsrc_}
71_textLanguagepage_ {_texticonhlang_}
72_textRelationpage_ {_texticonhrel_}
73_textCoveragepage_ {_texticonhcover_}
74_textRightspage_ {_texticonhright_}
75
76_textTopage_ {_texticonhto_}
77_textFrompage_ {_texticonhfrom_}
78_textSeriespage_ {_texticonhser_}
79_textHowtopage_ {_texticonhhow_}
80_textOrganizationpage_ {_texticonhorg_}
81_textBrowsepage_ {_texticonhbrwse_}
82_textCollagepage_ {_texticonhcoll_}
83_textPeoplepage_ {_texticonhpeople_}
84_textAcronympage_ {_texticonhacronym_}
85_textPhrasepage_ {_texticonhphrases_}
86_textArtistpage_ {_texticonhartist_}
87_textKeywordpage_ {_texticonhkw_}
88_textVolumepage_ {_texticonhvol_}
89_textCaptionspage_ {_texticonhcapt_}
90_textCountriespage_ {_texticonhcount_}
91
92#######################################################################
93# navigation arrows
94#
95#######################################################################
96
97# these two may be reset to "" by the server
98_navarrowsbottom_ {_navarrows_}
99_navarrowstop_ {_navarrows_}
100
101_navarrows_ {<center>
102<table width=_pagewidth_ cellpadding=0 cellspacing=0 border=0>
103<tr><td align=left valign=top>
104_prevarrow_
105</td><td align=right valign=top>
106_nextarrow_
107</td></tr></table>
108</center>
109}
110
111_prevarrow_ {_If_(_httpprevarrow_,<a href="_httpprevarrow_">_iconprev_</a>)}
112_nextarrow_ {_If_(_httpnextarrow_,<a href="_httpnextarrow_">_iconnext_</a>)}
113
114_navarrows_ [v=1] {<p>
115_prevarrow_<br>
116_nextarrow_
117}
118
119#######################################################################
120# the goto form
121#######################################################################
122
123_gotoform_ {
124<form name="GotoForm" method="get" action="_gwcgi_">
125<input type=hidden name="e" value="_decodedcompressedoptions_">
126<input type=hidden name="d" value="_cgiargd_">
127<input type=hidden name="cl" value="_cgiargcl_">
128<input type="text" name="gp" size="3" maxlength="4">
129<input type="submit" value="_textgoto_">
130</form>
131}
132
133_textnumpages_ {&nbsp;<i>(_1_ _pages_)</i>}
134_parentarrow_ {}
135
136
137#######################################################################
138# the phind applet
139#
140# The phind applet is only required on phind classifier pages.
141# Consequently, the _phindclassifier_ macro is not usually set. On screens
142# where it is required, _phindclassifier_ resolves to _phindapplet_, and
143# the following macro is loaded into the web page.
144#######################################################################
145
146_phindapplet_ {
147<APPLET CODEBASE="_httpprefix_/bin/java" CODE="org.nzdl.gsdl.Phind.Phind.class" ARCHIVE="Phind.jar" WIDTH=500 HEIGHT=400>
148 <PARAM NAME=library VALUE="_gwcgi_?e=_compressedoptions_">
149 <PARAM NAME=phindcgi VALUE="_gwcgi_?a=phind">
150 <PARAM NAME=collection VALUE="_cgiargc_">
151 <PARAM NAME=classifier VALUE="_phindnumber_">
152
153 <PARAM NAME=orientation VALUE="vertical">
154 <PARAM NAME=depth VALUE="2">
155 <PARAM NAME=resultorder VALUE="L,l,E,e,D,d">
156
157 <PARAM NAME=backdrop VALUE="_httpimg_/phindbg1.jpg">
158 <PARAM NAME=fontsize VALUE="10">
159 <PARAM NAME=blocksize VALUE="10">
160
161 The Phind java applet.
162</APPLET>
163}
164
165_collageapplet_ {
166 <applet CODEBASE="_httpprefix_/bin/java"
167 code="org.nzdl.gsdl.GsdlCollageApplet.GsdlCollageApplet.class"
168 archive="GsdlCollageApplet.jar"
169 width="_collagexdim_" height="_collageydim_">
170
171 <param name="gwcgi" value="_gwcgi_">
172 <param name="collection" value="_cgiargc_">
173 <param name="classifier" value="_cgiargcl_.1">
174
175 <param name="hrefMustHave" value="cl=_cgiargcl_.1">
176 <param name="imageMustNotHave" value="hl=\%x=\%gt=\%gc=\%.pr">
177
178 <param name="imageType" value="_collageimageType_">
179 <param name="verbosity" value="_collageverbosity_">
180 <param name="maxDepth" value="_collagemaxDepth_">
181 <param name="maxDisplay" value="_collagemaxDisplay_">
182 <param name="refreshDelay" value="_collagerefreshDelay_">
183 <param name="isJava2" value="_collageisJava2_">
184 <param name="bgcolor" value="_collagebgcolor_">
185 <param name="documentroot" value="_httpimg_">
186 </applet>
187
188<center>
189_collagecaption_
190</center>
191}
192
193
194_flashbook_ {
195 <div id="bookdiv">
196 </div>
197
198 <script type="text/javascript">
199 //get the height and width of the window
200 var myWidth2 = 0, myHeight = 0;
201 if (typeof(window.innerWidth) == 'number')
202 \{
203 //Non-IE
204 myWidth2 = window.innerWidth;
205 myHeight = window.innerHeight;
206 \}
207 else if (document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight))
208 \{
209 //IE 6+ in 'standards compliant mode'
210 myWidth2 = document.documentElement.clientWidth;
211 myHeight = document.documentElement.clientHeight;
212 \}
213 else if(document.body && (document.body.clientWidth || document.body.clientHeight))
214 \{
215 //IE 4 compatible
216 myWidth2 = document.body.clientWidth;
217 myHeight = document.body.clientHeight;
218 \}
219
220 var myWidth = "100%";
221 myHeight = 800;
222
223 var img_cover = '_httpcollimg_/_thisOID_/cover.jpg';
224 var doc_url = document.URL;
225 doc_url = doc_url.replace(/(&|\\?)book=[a-z]+/gi,'');
226 doc_url += '&book=flashxml';
227
228 var flash_plug_html = "";
229 flash_plug_html += '<OBJECT align="middle" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" \\n';
230 flash_plug_html += ' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" \\n';
231 flash_plug_html += ' height="';
232 flash_plug_html += myHeight + '" id="Book" swLiveConnect="true" \\n';
233 flash_plug_html += ' width="';
234 flash_plug_html += myWidth + '">\\n';
235
236 flash_plug_html += ' <PARAM name="allowScriptAccess" value="always" />\\n';
237 flash_plug_html += ' <PARAM name="movie" value="_httpimg_/Book.swf';
238 flash_plug_html += '?src_image=' + escape(img_cover);
239 flash_plug_html += '&doc_url=' + escape(doc_url);
240 flash_plug_html += '" />\\n';
241 flash_plug_html += ' <PARAM name="quality" value="high" />\\n';
242 flash_plug_html += ' <PARAM name="bgcolor" value="#FFFFFF" />\\n';
243 flash_plug_html += ' <EMBED align="middle" \\n';
244 flash_plug_html += ' allowScriptAccess="always" swLiveConnect="true" \\n';
245 flash_plug_html += ' bgcolor="#FFFFFF" height="';
246 flash_plug_html += myHeight + '" name="Book" \\n';
247 flash_plug_html += ' pluginspage="http://www.macromedia.com/go/getflashplayer" \\n';
248 flash_plug_html += ' quality="high" \\n';
249 flash_plug_html += ' src="_httpimg_/Book.swf';
250 flash_plug_html += '?src_image=' + escape(img_cover);
251 flash_plug_html += '&amp;doc_url=' + escape(doc_url);
252 flash_plug_html += '"\\n';
253 flash_plug_html += ' type="application/x-shockwave-flash" width="';
254 flash_plug_html += myWidth + '" />\\n';
255 flash_plug_html += '</OBJECT>\\n';
256
257 var flash_div = document.getElementById("bookdiv");
258 flash_div.innerHTML = flash_plug_html;
259 </script>
260}
261
262#######################################################################
263# icons
264#######################################################################
265
266_iconsmalltext_ {<img src="_httpiconsmtext_" class="icon" width=_widthsmtext_ height=_heightsmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
267_iconsmalltext_ [v=1] {<small><b>_texticonsmalltext2_</b></small>}
268
269_iconarrowsmalltext_ {<img src="_httpiconasmtext_" class="icon" width=_widthasmtext_ height=_heightasmtext_ alt="_texticonsmalltext_" title="_texticonsmalltext_">}
270_iconarrowsmalltext_ [v=1] {<small><b>->_texticonsmalltext2_</b></small>}
271
272_iconclosedfolder_ {<img src="_httpiconclsdfldr_" class="icon" width=_widthclsdfldr_ height=_heightclsdfldr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
273_iconclosedfolder_ [v=1] {<small><b>_texticonclosedfolder2_</b></small>}
274
275_iconarrowclosedfolder_ {<img src=_httpiconaclsdfdr_" class="icon" width=_widthaclsdfdr_ height=_heightaclsdfdr_ alt="_texticonclosedfolder_" title="_texticonclosedfolder_">}
276_iconarrowclosedfolder_ [v=1] {<small><b>->_texticonclosedfolder2_</b></small>}
277
278_iconopenfolder_ {<img src="_httpiconopenfldr_" class="icon" width=_widthopenfldr_ height=_heightopenfldr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
279_iconopenfolder_ [v=1] {<small><b>_texticonopenfolder2_</b></small>}
280
281_iconarrowopenfolder_ {<img src="_httpiconaopenfdr_" class="icon" width=_widthaopenfdr_ height=_heightaopenfdr_ alt="_texticonopenfolder_" title="_texticonopenfolder_">}
282_iconarrowopenfolder_ [v=1] {<small><b>->_texticonopenfolder2_</b></small>}
283
284_iconarrowclosedbook_ {<img src="_httpiconabook_" width=_widthabook_ height=_heightabook_ class="icon" alt="_texticonclosedbook_" title="_texticonclosedbook_">}
285_iconarrowclosedbook_ [v=1] {<small><b>->_texticonclosedbook_: </b></small>}
286
287_iconopenbook_ {<img src="_httpiconopenbook_" width=_widthopenbook_ height=_heightopenbook_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
288_iconopenbook_ [v=1] {<small><b>_texticonopenbook_: </b></small>}
289
290_iconarrowopenbook_ {<img src="_httpiconaopenbk_" width=_widthaopenbk_ height=_heightaopenbk_ class="icon" alt="_texticonopenbook_" title="_texticonopenbook_">}
291_iconarrowopenbook_ [v=1] {<small><b>->_texticonopenbook_: </b></small>}
292
293_iconopenbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
294_iconopenbookshelf_ [v=1] {<small><b>_texticonopenbookshelf_: </b></small>}
295
296_iconarrowopenbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonopenbookshelf_" title="_texticonopenbookshelf_">}
297_iconarrowopenbookshelf_ [v=1] {<small><b>->_texticonopenbookshelf_: </b></small>}
298
299_iconclosedbookshelf_ {<img src="_httpiconbshelf_" class="icon" width=_widthbshelf_ height=_heightbshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
300_iconclosedbookshelf_ [v=1] {<small><b>_texticonclosedbookshelf_: </b></small>}
301
302_iconarrowclosedbookshelf_ {<img src="_httpiconabshelf_" class="icon" width=_widthabshelf_ height=_heightabshelf_ alt="_texticonclosedbookshelf_" title="_texticonclosedbookshelf_">}
303_iconarrowclosedbookshelf_ [v=1] {<small><b>->_texticonclosedbookshelf_: </b></small>}
304
305_iconpointer_ {<img src="_httpiconarrrght_" class="icon" width=_widtharrrght_ height=_heightarrrght_>}
306_iconpointer_ [v=1] {<small><b>_texticonpointer_-> </b></small>}
307
308_iconwarning_ {<img src="_httpiconwarning_" width="_widthwarning_" height="_heightwarning_" class="icon" align="left">}
309_iconwarning_ [v=1] {_texticonwarning_}
310
311
312#######################################################################
313# images
314#######################################################################
315
316_coverimage_ {<img alt="Cover Image" onError="src='_httpimg_/blank.gif'" src="_httpcollimg_/_thisOID_/cover.jpg">}
317
318_docbutton_ {<div class="button"><span class="button" title="_3_"><a href="_1_">_2_</a></span></div>
319}
320
321# can't use _docbutton_ macro for detach button as we need to include target
322_imagedetach_ {<div class="button"><span class="button"><a href="_httpcurrentdocument_&amp;x=1" target="\_blank" title="_texticondetach_">_textDETACH_</a></span></div>}
323
324_imageprint_{<div class="button"><span class="button"><a href="javascript:print_preview()">_textPRINT_</a></span></div>}
325
326
327_imagehighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=1&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_textHIGHLIGHT_,_texticonhighlight_)}
328
329_imagenohighlight_ {_docbutton_(_httpcurrentdocument_&amp;hl=0&amp;gc=_cgiarggc_&amp;gt=_cgiarggt_,_document:textNOHIGHLIGHT_,_document:texticonnohighlight_)}
330
331_imagecontracttoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=0,_textCONTRACTCONTENTS_,_texticoncontracttoc_)}
332
333_imageexpandtoc_ {_docbutton_(_httpcurrentdocument_&amp;gc=1,_textEXPANDCONTENTS_,_texticonexpandtoc_)}
334
335_imagecontracttext_ {_docbutton_(_httpcurrentdocument_&amp;gt=0,_textCONTRACT_,_texticoncontracttext_)}
336
337_imageexpandtext_ {_docbutton_(_httpcurrentdocument_&amp;gt=1,_textEXPANDTEXT_,_texticonexpandtext_)}
338
339_imagecont_ {_docbutton_(_httpcurrentdocument_&amp;gt=2,_textCONTINUE_,_texticoncont_)}
340
341
342#######################################################################
343# print preview script
344#######################################################################
345
346
347_pagescriptextra_{
348
349 var style_display_old;
350 var show = true;
351 var toc_top;
352
353 function has_toc(){
354 var div_nodes = document.getElementsByTagName("div");
355 for (var i=0;i < div_nodes.length ; i++ )\{
356 var div_node = div_nodes[i];
357 if (div_node.className =="toc" && div_node.childNodes.length > 1)
358 \{
359 return true;
360 \}
361 \}
362
363 return false;
364 \}
365
366 function hide_toc()\{
367 var div_nodes = document.getElementsByTagName("div");
368 for (var i=0;i < div_nodes.length ; i++ )\{
369 var div_node = div_nodes[i];
370 if (div_node.className =="toc")
371 \{
372 style_display_old = div_node.style.display;
373 toc_top = document.getElementById("toc_top");
374 if (toc_top)
375 div_node.parentNode.insertBefore(toc_top,div_node);
376 div_node.style.display = "none";
377 \};
378 \}
379
380 \}
381
382
383 function show_toc()\{
384
385 var div_nodes = document.getElementsByTagName("div");
386 for (var i=0;i < div_nodes.length ; i++ )\{
387 var div_node = div_nodes[i];
388 if (div_node.className =="toc")
389 \{
390 div_node.style.display = style_display_old;
391 if (toc_top)
392 div_node.insertBefore(toc_top,div_node.firstChild);
393 \};
394 \}
395
396 \}
397
398
399 function switch_toc()\{
400 var toc_link = document.getElementById("toc_link");
401 while (toc_link.hasChildNodes()) \{
402 toc_link.removeChild(toc_link.firstChild);
403 \}
404 if (show)\{
405 toc_link.appendChild(document.createTextNode('_textshowcontents_'));
406 show = false;
407 hide_toc();
408 \}
409 else\{
410 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
411 show = true;
412 show_toc();
413 \}
414
415 \}
416
417 function print_preview() \{
418 // Switch the stylesheet
419 setActiveStyleSheet("Preview Document");
420 add_print_message();
421 \}
422
423 function add_print_message()\{
424 if (document.getElementById)\{
425 var print_message = document.createElement('ul');
426 print_message.id = 'print-message';
427 print_message.className = "printmessage";
428
429 var cancel_print_link = document.createElement('li');
430 cancel_print_link.className = "cancelprint"
431 cancel_print_link.onclick = function()\{ cancel_print(); return false;\};
432 cancel_print_link.appendChild(document.createTextNode('_textreturnoriginal_'));
433 print_message.appendChild(cancel_print_link);
434
435
436 var print_link = document.createElement('li');
437 print_link.onclick = function()\{ window.print(); return false;\};
438 print_link.appendChild(document.createTextNode('_textprintpage_'));
439 print_message.appendChild(print_link);
440
441 if (has_toc())\{
442 var toc_link = document.createElement('li');
443 toc_link.id = "toc_link";
444 toc_link.onclick = function()\{ switch_toc(); return false;\};
445 toc_link.appendChild(document.createTextNode('_texthidecontents_'));
446 print_message.appendChild(toc_link);
447 \}
448
449 //insert the print message node
450 var div_nodes = document.getElementsByTagName("div");
451 for (var i=0;i < div_nodes.length ; i++ )\{
452 var div_node = div_nodes[i];
453 if (div_node.className =="document")\{
454 var parent = div_node.parentNode;
455 parent.insertBefore(print_message,div_node);
456 \}
457 \}
458 \}
459
460 \}
461
462
463 function cancel_print() \{
464 // Destroy the preview message
465 var print_message = document.getElementById('print-message');
466 var parent = print_message.parentNode;
467 parent.removeChild(print_message);
468
469 show_toc();
470 // Switch back stylesheet
471 setActiveStyleSheet("default");
472 \}
473
474 function setActiveStyleSheet(title) \{
475 var i, a, main;
476 for(i=0; (a = document.getElementsByTagName("link")[i]); i++) \{
477 if(a.getAttribute("rel").indexOf("style") != -1
478 && a.getAttribute("title")) \{
479 a.disabled = true;
480 if(a.getAttribute("title") == title) a.disabled = false;
481 \}
482 \ }
483 \}
484
485}
486
487
488#######################################################################
489# headers/footers
490#######################################################################
491
492
493# header overridden for text pages
494_textheader_ {_cgihead_
495_htmlhead_
496_startspacer_
497
498<!-- document:textheader -->
499<div id="banner">
500<div class="pageinfo"><p class="bannerlinks">_globallinks_</p></div>
501<div class="collectimage">_imagecollection_</div>
502</div>
503<div class="bannerextra">_pagebannerextra_</div>
504}
505
506_textheader_ [v=1] {_cgihead_
507_htmlhead_
508_globallinks_
509}
510
511_footer_ {
512</div> <!-- document:footer -->
513
514<div class="navarrowsbottom">
515_navarrowsbottom_
516</div>
517_endspacer__htmlfooter_
518}
Note: See TracBrowser for help on using the repository browser.