source: main/trunk/greenstone2/macros/deposit.dm@ 29403

Last change on this file since 29403 was 29403, checked in by kjdon, 6 years ago

added custommetadataconf macro - can define this to override GLI's depositormetadata array. Do this if you want multiple fields, or a different order to what GLI gives you.

  • 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 depositor
4
5_imagethispage_ {_If_("_cgiargdi1local_" eq "1",<a href="_httppagedepositorcurrentcollection_">_textdepositorlocal_</a>,<a href="_httppagedepositor_">_textdepositor_</a>)}
6
7# _pagescriptextra_ will be set to the appropriate _***scriptextra_
8# macro from within the server
9_pagescriptextra_ {}
10
11# a plain header for those pages that need it (the _pagebanner_ macro
12# will be set to this by the server for those pages.
13_plainbanner_ {}
14
15# dont want links to help" or "preferences" pages from within
16# collector
17_globallinks_ {_homelink_}
18
19# metadata fields that will be displayed in the step1 page,
20# this is determined by the depositormetadata array defined in the collection's collect.cfg
21_metadataconf_ {var DepositorMDFields = new Array();}
22# If you are using GLI, and want to modify the depositormetadata, then define
23# the custommetadataconf macrco in exta.dm or collectionmacro in collect.cfg
24
25_custommetadataconf_ {}
26
27# store any existing metadata values
28_cachedmetadatavalues_ {var CachedMDValues = new Array();}
29# set the following to 0 if you don't want to cache metadata values
30_cacheoption_{1}
31#######################################################################
32# steps
33
34_numsteps_ {3}
35
36# clashes with general text (in english2.dm) about what to do at this stage
37# now it doesn't appear in wizard bar, is it needed?
38##_textselect_ {The Depositor}
39_textstep1_ {_textmeta_}
40_textstep2_ {_textintro_}
41_textstep3_ {_textconfirm_}
42
43# set laststep to depositonly if you don't want the item to be indexed
44_laststep_ {bild}
45_textlaststep_ {_textbild_}
46
47
48#######################################################################
49# icons
50
51_iconcross_ {<img src="_httpimg_/cross.gif">}
52_iconcross_ [v=1] {<b>no</b>}
53_icontick_ {<img src="_httpimg_/tick.gif">}
54_icontick_ [v=1] {<b>yes</b>}
55_iconblank_ {<img src="_httpimg_/blank.gif">}
56_iconblank_ [v=1] {}
57
58_imagemore_ {<a href="javascript:more()" onMouseover="roll('more',1);" onMouseOut="roll('more',0);"><img
59name="more" src="_httpimg_/moreof.gif" onLoad="gbutton(this,'_httpimg_/moreon.gif');" border=0 alt="_textmore_"
60title="_textmore_" align=top></a>}
61_imagemore_ [v=1] {_textmore_}
62
63_icongreyarrow_ {<img src="_httpimg_/grarrow.gif">}
64_icongreyuparrow_ {<img src="_httpimg_/guarrow.gif">}
65_iconstop_ {<img src="_httpimg_/stop.gif" border=0>}
66
67
68#######################################################################
69# http macros
70
71_httpinfo_ {_gwcgi_?e=_compressedoptions_&p=info}
72_httpsrce_ {_gwcgi_?e=_compressedoptions_&p=srce}
73_httpconf_ {_gwcgi_?e=_compressedoptions_&p=conf}
74_httpbild_ {_gwcgi_?e=_compressedoptions_&p=bild}
75_httpview_ {_gwcgi_?e=_compressedoptions_&a=p&p=about&c=_cgiargdi1dirnameUrlsafe_}
76_httpdel_ {javascript:do\_delete();}
77_httpexpt_ {_gwcgi_?e=_compressedoptions_&p=expt}
78
79
80#######################################################################
81# select // this really should be intro
82#######################################################################
83
84# _fullnamemenu_ has previous collection selected. Since there is no button
85# on this page to proceed, we reset the drop down box to have no collection
86# selected.
87_selectheader_ {_cgihead_
88_htmlhead_(class="bgimage" onLoad="initialize();")_startspacer_
89}
90
91
92_selectscriptextra_ {
93
94function initialize() \{
95 document.depositorform.di1dirname.value = "";
96\}
97
98function check\_submit (gotopage) \{
99 var form = document.depositorform;
100 form.p.value = gotopage;
101
102 // if 'dirname' given, then link to cgiarg c so collection specific macros work
103 if (form.di1dirname) \{
104 form.c.value = form.di1dirname.value;
105 \}
106
107 form.submit();
108\}
109
110function menuchange() \{
111
112 _buildtypearray_
113
114 var form = document.depositorform;
115
116 if (form.di1dirname.value == "") \{
117 alert("Please choose a collection first");
118 \}
119 else \{
120 var pos = form.di1dirname.selectedIndex;
121 var bt = buildtype[pos];
122 if (bt=="") \{ bt = "mg"; \}
123 form.di1buildtype.value = bt;
124
125 check\_submit('step1');
126 \}
127\}
128
129}
130
131_selectcontent_ {
132<form name="depositorform" method=post action="_gwcgi_">
133<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
134<input type=hidden name="p" value="intro">
135<input type=hidden name="c" value="">
136<input type=hidden name="di1buildtype" value="">
137
138<center>
139<table width=_pagewidth_>
140<tr><td>
141<div class="divbar">&nbsp;</div>
142<center><h2>_textselect_</h2></center>
143<div class="divbar">&nbsp;</div>
144
145<p> <em>_textselectcol_</em>
146
147<p>_fullnamemenu_<br><br>
148<div class="divbar">&nbsp;</div>
149</td></tr>
150</table>
151</center>
152</form>
153}
154
155
156#######################################################################
157# step 1
158#######################################################################
159
160#here goes the "memorization" macros for each form field.
161#_di1md.Title_ {_If_("_:cgiargdi1md.Title_" eq "_cgiargdi1md.Title_",_cgiargdi1md.Title_,)}
162#_di1md.Creator_ {_If_("_:cgiargdi1md.Creator_" eq "_cgiargdi1md.Creator_",_cgiargdi1md.Creator_,)}
163#_di1md.Description_ {_If_("_:cgiargdi1md.Description_" eq "_cgiargdi1md.Description_",_cgiargdi1md.Description_,)}
164#_di1md.Subject_ {_If_("_:cgiargdi1md.Subject_" eq "_cgiargdi1md.Subject_",_cgiargdi1md.Subject_,)}
165
166_step1scriptextra_ {
167
168_If_("_custommetadataconf_" ne "",_custommetadataconf_,_metadataconf_)
169_cachedmetadatavalues_
170
171function loadForm() \{
172
173 var formcontainer = document.getElementById('formcontainer');
174
175 if (!formcontainer) \{
176 return;
177 \}
178
179 for (i=0; i < DepositorMDFields.length; i++) \{
180 if (DepositorMDFields[i]==null) \{
181 continue;
182 \}
183 metadataField = DepositorMDFields[i];
184
185 var labelCell = document.createElement("td");
186 labelCell.innerHTML = metadataField.label + ": ";
187 labelCell.setAttribute("title", metadataField.tooltip);
188
189 var cachedValue;
190 if(CachedMDValues[0] !=null && CachedMDValues[0]["di1md." + metadataField.name])\{
191 cachedValue = CachedMDValues[0]["di1md." + metadataField.name];
192 \} else \{
193 cachedValue = "";
194 \}
195
196 var inputObj;
197 if (metadataField.type=="text") \{
198 inputObj = document.createElement("input");
199 inputObj.setAttribute("type","text");
200 inputObj.setAttribute("size","74");
201 inputObj.setAttribute("value", cachedValue);
202 \}
203 else if (metadataField.type=="textarea") \{
204 inputObj = document.createElement("textarea");
205 inputObj.setAttribute("rows","5");
206 inputObj.setAttribute("cols", "40");
207 inputObj.innerHTML = cachedValue;
208 \}
209 inputObj.setAttribute("name", "di1md."+ metadataField.name);
210
211 var inputCell = document.createElement("td");
212 inputCell.appendChild(inputObj);
213
214 var entry = document.createElement("tr");
215 entry.appendChild(labelCell);
216 entry.appendChild(inputCell);
217
218 formcontainer.appendChild(entry);
219 \}
220\}
221
222function check\_submit (gotopage) \{
223 var form = document.depositorform;
224 form.p.value = gotopage;
225 form.submit();
226\}
227
228if (window.addEventListener) window.addEventListener("load", loadForm, false);
229else if (window.attachEvent) window.attachEvent("onload", loadForm);
230
231}
232
233_step1content_ {
234
235<form name="depositorform" method=post action="_gwcgi_" enctype="multipart/form-data">
236
237<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
238<input type=hidden name="p" value="_cgiargpAttrsafe_">
239
240
241<center>
242<table width=_pagewidth_>
243<tr><td>
244<div class="divbar">&nbsp;</div>
245<center>
246<h2>_textstep1_</h2>
247<p>_textdepositorblurb_
248</center>
249<div class="divbar">&nbsp;</div>
250<ul>
251
252<!--input goes here-->
253<!--dynamic load the metadata elements as configured in the collection's collect.cfg-->
254<p><table><tbody id="formcontainer"></tbody></table>
255
256<div class="divbar">&nbsp;</div>
257</td></tr>
258<tr><td>_depositorbar_</td></tr>
259</table></center>
260
261</form>
262
263}
264
265#######################################################################
266# step 2
267#######################################################################
268
269_userfile_ {_If_("_:cgiargdi1userfile_" eq "_cgiargdi1userfile_",_cgiargdi1userfileAttrsafe_,)}
270
271_step2scriptextra_ {
272
273function check\_submit (gotopage) \{
274 var form = document.depositorform;
275 form.p.value = gotopage;
276 form.submit();
277\}
278}
279
280_step2content_ {
281<form name="depositorform" method=post action="_gwcgi_" enctype="multipart/form-data">
282<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
283<input type=hidden name="p" value="_cgiargpAttrsafe_">
284<center>
285<table width=_pagewidth_>
286<tr><td>
287<div class="divbar">&nbsp;</div>
288<center><h2>_textstep2_</h2></center>
289<div class="divbar">&nbsp;</div>
290<p>_textfilename_: <input type=file name=di1userfileinfo value="_userfile_"></p>
291<div class="divbar">&nbsp;</div>
292</td></tr>
293<tr><td>_depositorbar_</td></tr>
294</table>
295</center>
296</form>
297}
298
299#######################################################################
300# step 3
301#######################################################################
302
303#here goes the "memorization" macros for each form field.
304#_di1_ {_If_("_:cgiargdi1md.Title_" eq "_cgiargdi1md.Title_",_cgiargdi1md.Title_,)}
305#_di1md.Creator_ {_If_("_:cgiargdi1md.Creator_" eq "_cgiargdi1md.Creator_",_cgiargdi1md.Creator_,)}
306
307_step3scriptextra_ {
308
309function check\_submit (gotopage) \{
310 var form = document.depositorform;
311 form.p.value = gotopage;
312 form.submit();
313\}
314}
315
316_step3content_ {
317<form name="depositorform" method=post action="_gwcgi_" enctype="multipart/form-data">
318<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
319<input type=hidden name="p" value="_cgiargpAttrsafe_">
320<center>
321<table width=_pagewidth_>
322<tr><td>
323<div class="divbar">&nbsp;</div>
324<center><h2>_textstep3_</h2></center>
325<div class="divbar">&nbsp;</div>
326<p>_textfilename_: _di1userfile_ </p>
327<p>_textfilesize_: _di1userfilesize_ </p>
328<div class="divbar">&nbsp;</div>
329</td></tr>
330<tr><td>_depositorbar_</td></tr>
331</table>
332</center>
333</form>
334}
335
336#######################################################################
337# bild (main frameset for build page)
338#######################################################################
339
340_bildcontent_ {
341<html>
342<head>
343<!--
344<script>
345function check\_submit (gotopage) \{
346 var form = document.depositorform;
347 form.p.value = gotopage;
348 form.submit();
349\}
350</script>
351-->
352</head>
353
354<form name="depositorform" method=post action="_gwcgi_">
355<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
356<input type=hidden name="p" value="_cgiargpAttrsafe_">
357
358<frameset rows="*,160" border=0>
359 <noframes><body bgcolor="#ffffff">
360 <p>You must have a frame enabled browser to obtain feedback
361 on how the building process is progressing. The collection <i>will</i>
362 continue to build as normal however.</p>
363
364 <table>
365 <tr valign=center><td>
366 To stop the building process at any time, click here.
367 <br>The collection you are working on will remain intact.
368 </td>
369 <td><input type="submit" value="stop building"></td>
370 </table>
371
372 </body>
373 </noframes>
374 <frame src="_gwcgi_?e=_compressedoptions_&p=bildframe1">
375 <frame src="_gwcgi_?e=_compressedoptions_&p=bildstatus">
376</frameset>
377</html>
378}
379
380#######################################################################
381# bildframe1
382#######################################################################
383
384# header overridden to allow base target to be set
385
386_bildframe1header_ {_cgihead_
387<html>
388<head>
389<base target=_top>
390<title>_pagetitle_</title>
391_globalscripts_
392_cssheader_
393</head>
394<body class="bgimage">
395_startspacer__pagebanner_
396}
397
398
399_bildframe1header_[v=1] {_cgihead_
400<html>
401<head>
402<base target=_top>
403<title>_pagetitle_</title>
404_globalscripts_
405</head>
406<body class="bgimage">
407_pagebanner_
408}
409
410_bildframe1scriptextra_ {}
411
412_bildframe1content_ {
413<form name="depositorform" method=post action="_gwcgi_">
414<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
415<input type=hidden name="p" value="bildcancel">
416
417<center>
418<table width=_pagewidth_>
419<tr><td>
420<div class="divbar">&nbsp;</div>
421<center>
422<h2>_textbild_</h2>
423</center>
424<div class="divbar">&nbsp;</div>
425<p>
426_depositor:textbild1_
427<p>
428
429<table>
430<tr valign=center><td>
431_depositor:textbild2_
432</td>
433<td><input type="submit" value="_depositor:textstopbuild_"></td>
434</table>
435
436<p>
437_depositor:textbild3_
438</td></tr>
439</table></center>
440</form>
441}
442
443
444#######################################################################
445# bildcancel
446#######################################################################
447
448_bildcancelscriptextra_ {
449function check\_submit (gotopage) \{
450 var form = document.depositorform;
451 form.p.value = gotopage;
452 form.submit();
453\}
454}
455_bildcancelcontent_ {
456<form name="depositorform" method=post action="_gwcgi_">
457<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
458<input type=hidden name="p" value="_cgiargpAttrsafe_">
459
460</form>
461<center>
462<table width=_pagewidth_>
463<tr><td>
464<div class="divbar">&nbsp;</div>
465<center>
466<h2>_depositor:textbuildcancelled_</h2>
467</center>
468<div class="divbar">&nbsp;</div>
469<p>
470_depositor:textbildcancel1_
471<p><center>
472_depositorbar_
473</center>
474
475</td></tr>
476</table></center>
477}
478
479
480#######################################################################
481# bildstatus
482#######################################################################
483
484# special header for status page
485_bildstatusheader_ {_cgihead_
486_htmlhead_(class="bgimage" onLoad="initialize();")_startspacer_
487}
488_bildstatusheader_[v=1] {_cgihead_
489_htmlhead_(onLoad="initialize();")
490}
491
492_bildstatusscriptextra_ {
493var timer = 5;
494function initialize() \{
495 setTimeout("count_down()",1000);
496\}
497
498function count_down() \{
499 if (timer==0) \{
500 window.status = "";
501 document.depositorform.submit();
502 \} else \{
503 if (timer==1) \{
504 window.status = "_textbsupdate1_";
505 \} else \{
506 window.status = "_textbsupdate2_ "+timer+" _textseconds_";
507 \}
508 timer--;
509 setTimeout("count_down()",1000);
510 \}
511\}
512}
513
514_bildstatuscontent_ {
515<form name="depositorform" method=post action="_gwcgi_">
516<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
517
518<center>
519<table width=_pagewidth_>
520<tr><td><center>
521_statusline_
522</center>
523</td></tr>
524</table></center>
525</form>
526}
527
528
529#######################################################################
530# bilddone
531#######################################################################
532
533_bilddoneheader_ {_cgihead_
534_htmlhead_(class="bgimage")_startspacer_
535}
536_bilddonescriptextra_ {
537
538function check\_submit (gotopage) \{
539 var form = document.depositorform;
540 form.p.value = gotopage;
541 form.submit();
542\}
543
544}
545
546
547_bilddonecontent_ {
548<center>
549<table width=_pagewidth_>
550<tr><td>
551<p>_textbildsuc_
552
553<p>_textviewbildsummary_
554
555<p><center>
556_depositorbar_
557</center>
558
559</td></tr>
560</table></center>
561}
562
563
564#######################################################################
565# bildfail
566#######################################################################
567
568_bildfailheader_ {_cgihead_
569_htmlhead_(class="bgimage")_startspacer_
570}
571_bildfailscriptextra_ {
572function check\_submit (gotopage) \{
573 var form = document.depositorform;
574 form.p.value = gotopage;
575 form.submit();
576\}
577}
578_bildfailcontent_ {
579<form name="depositorform" method=post action="_gwcgi_">
580<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
581<input type=hidden name="p" value="_cgiargpAttrsafe_">
582
583</form>
584
585<table width=_pagewidth_>
586<tr><td>
587_textfailmsg_
588</td></tr>
589<tr><td>
590</td></tr>
591</table></center>
592}
593
594# _textfailmsg_ will be set to one of the following macros from within
595# the server
596
597_textfailmsg1_ {
598_textfailmsg11_
599<p><center>
600_depositorbar_
601</center>
602}
603
604_textfailmsg6_ {_textfailmsg1_}
605
606_textfailmsg2_ {
607_textfailmsg21_
608<p>_textblcont_
609<p>_faillog_
610<p>_texttryagain_
611}
612
613_textfailmsg3_ {
614_textfailmsg31_
615<p>_textblcont_
616<p>_faillog_
617<p>_texttryagain_
618}
619
620_textfailmsg4_ {
621_textfailmsg41_
622<p>_textblcont_
623<p>_faillog_
624}
625
626_textfailmsg5_ {_textfailmsg4_}
627
628_textfailmsg7_ {
629_textfailmsg71_
630<p>_texttryagain_
631}
632
633#######################################################################
634# Error and message pages
635#######################################################################
636
637_messagehead_ {
638<form name="depositorform" method=post action="_gwcgi_">
639<input type=hidden name="e" value="_decodedcompressedoptionsAttrsafe_">
640
641<center>
642<table width=_pagewidth_>
643<tr><td>
644<div class="divbar">&nbsp;</div>
645}
646
647_messagefoot_ {
648<p>
649<a href="javascript:document.depositorform.submit();">_textretcoll_</a>
650<div class="divbar">&nbsp;</div>
651</td></tr>
652</table></center>
653</form>
654}
655
656_messagefootnolink_ {
657<div class="divbar">&nbsp;</div>
658</td></tr>
659</table></center>
660</form>
661}
662
663#_delpermissioncontent_ {
664#_messagehead_
665#<p>
666#_textdelperm_
667#_messagefoot_
668#}
669
670#_delinvalidcontent_ {
671#_messagehead_
672#<p>
673#_textdelinv_
674#_messagefoot_
675#}
676
677#_delsuccesscontent_ {
678#_messagehead_
679#<p>
680#_textdelsuc_
681#_messagefoot_
682#}
683
684#_clonefailcontent_ {
685#_messagehead_
686#<input type=hidden name="bc1clone" value="0">
687#<p>_textclonefail_
688#_messagefoot_
689#}
690
691_genericcontent_ {
692_messagehead_
693<p>_textcolerr_
694_messagefoot_
695}
696
697_tmpfailcontent_ {
698_messagehead_
699<p>
700_texttmpfail_
701_messagefoot_
702}
703
704#_mkcolfailcontent_ {
705#_messagehead_
706#<p>_textmkcolfail_
707#_messagefoot_
708#}
709
710_nocollectioncontent_ {
711_messagehead_
712<p>_textnocontent_
713<br><a href="_httppagedepositor_">_textrestart_</a>
714<p>
715_messagefootnolink_
716}
717
718#_reloaderrorcontent_ {
719#_messagehead_
720#<p>_textreloaderror_
721#<br><a href="_httppagedepositor_">_textrestart_</a>
722#<p>
723#_messagefootnolink_
724#}
725
726_exptscriptextra_ {}
727
728#_exptsuccesscontent_ {
729#_messagehead_
730#<input type=hidden name=p value=existing>
731#<p>_textexptsuc_
732#_messagefoot_
733#}
734
735#_exptfailcontent_ {
736#_messagehead_
737#<input type=hidden name=p value=existing>
738#_textexptfail_
739#_messagefoot_
740#}
741
742#######################################################################
743# depositonly
744#######################################################################
745
746_depositonlyscriptextra_ {}
747
748_depositonlycontent_ {
749
750<center>
751<em>Thanks for using the Depositor! Cick <a href="_gwcgi_">here</a> to return to the Greenstone home page. </em>
752<table width=_pagewidth_>
753<tr><td>
754<div class="divbar">&nbsp;</div>
755<center><h2>_textstep3_</h2></center>
756<div class="divbar">&nbsp;</div>
757<p>_textfilename_: _di1userfile_ </p>
758<p>_textfilesize_: _di1userfilesize_ </p>
759<div class="divbar">&nbsp;</div>
760</td></tr>
761<tr><td></td></tr>
762</table>
763</center>
764
765}
766
767###################################################
768## text macros that are defined by another package
769###################################################
770
771
772_textbsupdate1_ {_wizard:textbsupdate1_}
773_textbsupdate2_ {_wizard:textbsupdate2_}
774_textseconds_ {_wizard:textseconds_}
775
776_textbildsuc_ {_wizard:textbildsuc_}
777_textviewbildsummary_ {_wizard:textviewbildsummary_}
778
779_textview_ {_wizard:textview_}
780_textbild1_ {_wizard:textbild1_}
781
782_textbild2_ {_wizard:textbild2_}
783
784_textstopbuild_ {_wizard:textstopbuild_}
785
786_textbild3_ {_wizard:textbild3_}
787
788_textbuildcancelled_ {_wizard:textbuildcancelled_}
789
790_textbildcancel1_ {_wizard:textbildcancel1_}
791
792_textfailmsg11_ {_wizard:textfailmsg11_}
793_textfailmsg21_ {_wizard:textfailmsg21_}
794_textblcont_ {_wizard:textblcont_}
795
796_textfailmsg31_ {_wizard:textfailmsg31_}
797_textfailmsg41_ {_wizard:textfailmsg41_}
798_textfailmsg71_ {_wizard:textfailmsg71_}
Note: See TracBrowser for help on using the repository browser.