source: gsdl/trunk/macros/deposit.dm@ 16680

Last change on this file since 16680 was 16680, checked in by anna, 12 years ago

Improved customization of metadata sets/elements used in the Depositor. Two aspects involved: the front-end user interface (depositoraction.cpp) and back-end GLI format panel. Associated changes include the depositor's macro file, GLI dictionary and GLI help document

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