Changeset 1305

Show
Ignore:
Timestamp:
25.07.2000 14:19:51 (20 years ago)
Author:
sjboddie
Message:

some more tidying up of end-user collection building

Location:
trunk/gsdl
Files:
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/cgi-bin/webpage_buildcol.pl

    r1192 r1305  
    118118    { 
    119119        my $download_cmd = "perl " . &util::filename_cat ($ENV{'GSDLHOME'}, "bin", "script"); 
    120         my $file_or_url  = $building_cfg_text->{'building'}->{'fileorurl'}; 
    121          
    122         if ($file_or_url =~ m/^url$/i) 
    123         { 
    124         # run urlcopy.pl to download files 
    125         $download_cmd = " urlcopy.pl "; 
    126         my @urls = split("\n",$input_dir); 
    127         my $u; 
    128         foreach $u (@urls) 
    129         { 
    130             $u =~ s/^\s+//; 
    131             $u =~ s/\s+$//; 
    132             $download_cmd .= "\"$u\" "; 
    133         } 
    134         } 
    135         else 
    136         { 
    137         # run filecopy.pl to download files 
    138         $input_dir =~ s/^\s+//; 
    139         $input_dir =~ s/\s+$//; 
    140         $download_cmd = " filecopy.pl $input_dir"; 
    141         } 
    142          
    143         $download_cmd .= " $dirname"; 
     120 
     121        # run filecopy.pl to download files 
     122        $input_dir =~ s/^\s+//; 
     123        $input_dir =~ s/\s+$//; 
     124        $download_cmd = " filecopy.pl \"$input_dir\" \"$dirname\""; 
    144125         
    145126        # execute download command and monitor the output generated 
  • trunk/gsdl/cgi-bin/webpage_mkcol.pl

    r1192 r1305  
    151151    my $about_desc    = $args->{'bc1aboutdesc'}; 
    152152    my $src_format    = $args->{'bc1srcformat'}; 
    153     my $file_or_url   = $args->{'bc1fileorurl'}; 
    154153    my $input_dir     = $args->{'bc1inputdir'}; 
    155154    my $copy_dir      = $args->{'bc1copydir'}; 
     
    163162    $cmd .= " -about   \"$about_desc\""; 
    164163    $cmd .= " -plugin  \"GMLPlug\""; 
    165     $cmd .= " -plugin  \"${src_format}Plug\""; 
     164    if ($src_format eq "HTML") { 
     165        $cmd .= " -plugin  \"HTMLPlug -keep_head\""; 
     166    } else { 
     167        $cmd .= " -plugin  \"${src_format}Plug\""; 
     168    } 
    166169    $cmd .= " -plugin  \"ArcPlug\""; 
    167170    $cmd .= " -plugin  \"RecPlug\""; 
    168 ### $cmd .= " -refine  \"$refine_plugs\""; 
    169171    $cmd .= " $unique_dirname"; 
    170172 
     
    174176    if ($status == 0) 
    175177    { 
    176         # append copydir, file_or_url and input_dir to end of collect.cfg 
    177         # we'll also append DocumentUseHTML if processing HTML docs 
     178        # append copydir and input_dir to end of collect.cfg we'll also 
     179        # append DocumentUseHTML if processing HTML docs 
    178180        my $cfg_filename  
    179181        = &util::filename_cat($ENV{'GSDLHOME'},"collect",$unique_dirname, 
     
    188190            } 
    189191 
    190             print CFGAPP "building\tfileorurl\t$file_or_url\n"; 
    191             print CFGAPP "building\tinputdir\t$input_dir\n"; 
     192            print CFGAPP "building\tinputdir\t\"$input_dir\"\n"; 
    192193            print CFGAPP "building\tcopydir\t\t$copy_dir\n"; 
    193194            print CFGAPP "building\tingsdlarea\t$in_gsdl_area\n"; 
  • trunk/gsdl/macros/base.dm

    r1289 r1305  
    6565####################################################################### 
    6666 
     67# _win32_ will be set to 1 if we're on windows 
     68_win32_ {} 
     69 
    6770_navigationbar_ {} 
    6871_javaimagesnavbar_ {} 
  • trunk/gsdl/macros/build.dm

    r1291 r1305  
    7272_bcargaboutdesc_    {} 
    7373_bcargsrcformat_    {TEXT} 
    74 _bcargfileorurl_    {file} 
    7574_bcarginputdir_     {} 
    7675_bcargcopydir_      {yes} 
     
    9897    args += "&bc1aboutdesc=" + escape(form.bc1aboutdesc.value); 
    9998    args += "&bc1srcformat=" + escape(form.bc1srcformat.value); 
    100     args += "&bc1fileorurl=" + escape(form.bc1fileorurl.value); 
    10199    args += "&bc1inputdir=" + escape(form.bc1inputdir.value); 
    102100    args += "&bc1copydir=" + escape(form.bc1copydir.value); 
     
    115113        simulate_get_action("_httpbuild_&bca=newcol"); 
    116114   \} 
    117 } 
    118  
    119 _wizardbarforu_ { 
    120     _wizardlink_(:archiveopts,Archive options) 
    121115} 
    122116 
     
    181175  _wizardlink_(textinfo,Textual information) 
    182176  _wizardlink_(:source,Source data) 
    183   _If_("_bcargfileorurl_" eq "file", _wizardbarforu_) 
    184   _wizardlink_(:metadata,Metadata) 
    185   <td> 
    186     <font color="#006666"> 
    187         Save 
    188     </font> 
    189   </td> 
     177  _wizardlink_(:archiveopts,Archive options) 
     178  _wizardlink_(:definished,Save) 
    190179</tr> 
    191180</table> 
     
    274263 
    275264<input type=hidden name="bc1srcformat" value="_bcargsrcformat_"> 
    276 <input type=hidden name="bc1fileorurl" value="_bcargfileorurl_"> 
    277265<input type=hidden name="bc1inputdir" value="_bcarginputdir_"> 
    278266<input type=hidden name="bc1copydir" value="_bcargcopydir_"> 
     
    359347_headmesssource_ { New collection wizard: source data } 
    360348 
    361 _fileortextinput_ { 
    362     _If_("_bcarginputdir_" eq "", 
    363       <input type="file" name="bc1inputdir" size=42>, 
    364       <input type="text" name="bc1inputdir" value="_bcarginputdir_" size=50>) 
    365 } 
    366  
    367349_contentsource_ { 
    368350 
     
    378360        if (form.bc1inputdir.value.match(/^\\s*$/)) 
    379361          \{ 
    380          if (form.bc1fileorurl.value == "file") 
    381            \{ 
    382                  alert("Directory for source files needs to be specified"); 
    383            \} 
    384          else 
    385            \{ 
    386                  alert("At least one URL for source files needs to be specified"); 
    387            \} 
    388  
     362             alert("Directory for source files needs to be specified"); 
    389363             form.bc1inputdir.focus(); 
    390364             return; 
     
    392366 
    393367    // work out the next newcol "wizard" page 
    394     if (form.bc1fileorurl.value == "file") 
     368        var prefix_re  
     369       = new RegExp(form.gsdlhome.value + "/collect/([^/]+)/(import|archive)"); 
     370 
     371        if (form.bc1inputdir.value.match(prefix_re)) 
     372      \{ 
     373         form.bc1ingsdlarea.value = "yes"; 
     374             if (form.bc1inputdir.value != "_bcarginputdir_") 
     375           \{ 
     376                  // input dir has been changed 
     377                  form.bc1copydir.value = "no"; 
     378               \} 
     379          \} 
     380        else 
    395381      \{ 
    396         var prefix_re  
    397          = new RegExp(form.gsdlhome.value + "/collect/([^/]+)/(import|archive)"); 
    398  
    399         if (form.bc1inputdir.value.match(prefix_re)) 
    400           \{ 
    401         form.bc1ingsdlarea.value = "yes"; 
    402         if (form.bc1inputdir.value != "_bcarginputdir_") 
    403           \{ 
    404             // input dir has been changed 
    405                 form.bc1copydir.value = "no"; 
    406           \} 
    407           \} 
    408         else 
    409           \{ 
    410         form.bc1ingsdlarea.value = "no"; 
    411           \} 
    412         form.wizard.value += ":archiveopts"; 
     382         form.bc1ingsdlarea.value = "no"; 
    413383      \} 
    414     else 
    415       \{ 
    416           form.bc1ingsdlarea.value = "no"; 
    417           form.bc1copydir.value = "yes"; 
    418           form.wizard.value += ":metadata"; 
    419       \} 
     384    form.wizard.value += ":archiveopts"; 
    420385 
    421386        simulate_get_action("_httpbuild_&bca=newcol"); 
     
    430395   \} 
    431396 
    432    function datasource_changed() \{ 
    433         var form = document.form; 
    434     var fou_index = form.bc1fileorurlmenu.selectedIndex; 
    435     var fou_choice = form.bc1fileorurlmenu.options[fou_index].value; 
    436     form.bc1fileorurl.value = fou_choice; 
    437  
    438     var inputdir = form.bc1inputdir.value; 
    439     if (fou_choice == "url")  
    440       \{ 
    441         if (!inputdir.match(/^file:/i)) 
    442           \{ 
    443         form.bc1inputdir.value = "file:"+inputdir; 
    444           \} 
    445       \} 
    446     else 
    447       \{ 
    448         var first_line_index = inputdir.indexOf("\\n",0); 
    449         var first_line  
    450         = (first_line_index>0) ? inputdir.substring(0,first_line_index-1) : inputdir; 
    451         if (first_line.match(/^file:/)) 
    452           \{ 
    453             var file = first_line.substring(5,inputdir.length); 
    454         form.bc1inputdir.value = file; 
    455           \} 
    456       \} 
    457         simulate_get_action("_httpbuild_&bca=newcol"); 
    458    \} 
    459397   // end hiding --> 
    460  
    461398 
    462399</script> 
     
    501438  </td> 
    502439</tr> 
    503 <tr> 
    504   <td>Source location:</td> 
     440 
     441<tr> 
    505442  <td> 
    506     <input type="hidden" name="bc1fileorurl" value="_bcargfileorurl_"> 
    507     <select name="bc1fileorurlmenu" onChange=datasource_changed()> 
    508       <option value="file" _If_("_bcargfileorurl_" eq "file",selected)>Local disk 
    509       <option value="url"  _If_("_bcargfileorurl_" eq "url",selected)>The Internet 
    510     </select> 
    511   </td> 
    512 </tr> 
     443    Input directory: 
     444  </td> 
     445 
     446  <td colspan=3> 
     447     <input type=text name="bc1inputdir" value="_bcarginputdir_" size=40> 
     448  </td> 
     449  </td> 
     450</tr> 
     451 
    513452<tr> 
    514453  <td></td> 
    515454  <td colspan=3> 
    516455     <font color="#909090"> 
    517         The source data used to build a collection can be on either the local disk 
    518     or externally accessible over the Web.  Use this pull-down menu to 
    519     control this setting.  On selecting an item from the menu this page will 
    520     automatically reconfigure itself so the request for input (below) will be 
    521     a local directory or a URL as appropriate. 
    522  
    523      _If_('"_bcargfileorurl_" eq "url"', 
    524     <p> When entering a URL it is important to distinguish between a directory 
    525     and a file.  A directory must end with <tt>/</tt> 
    526     ) 
    527  
    528       </font> 
    529   </td> 
    530 </tr> 
    531  
    532 <tr> 
    533   <td> 
    534      _If_('"_bcargfileorurl_" eq "file"', 
    535       Input directory:,Input URL/URLS) 
    536   </td> 
    537  
    538   <td colspan=3> 
    539      _If_('"_bcargfileorurl_" eq "file"', 
    540       _fileortextinput_, 
    541           <textarea name="bc1inputdir" cols=50 rows=3  
    542          wrap=physical>_bcarginputdir_</textarea> 
    543           ) 
    544   </td> 
    545   </td> 
    546 </tr> 
    547  
    548 <tr> 
    549   <td></td> 
    550   <td colspan=3> 
    551      <font color="#909090"> 
    552      _If_('"_bcargfileorurl_" eq "file"', 
    553456    The input directory specifies where on the local disk the source data is  
    554457    located. 
    555     , 
    556     Any URL specified here is downloaded and any links within that page that 
    557     refer to further documents at that site\, contained within the same directory 
    558     structure are recursively copied.  At least one URL needs to be specified. 
    559           ) 
    560458     </font> 
    561459  </td> 
     
    590488        var form = document.form; 
    591489 
    592     form.wizard.value += ":metadata"; 
     490    form.wizard.value += ":definished"; 
    593491 
    594492        simulate_get_action("_httpbuild_&bca=newcol"); 
     
    618516<input type=hidden name="bc1aboutdesc" value="_bcargaboutdesc_")> 
    619517<input type=hidden name="bc1srcformat" value="_bcargsrcformat_"> 
    620 <input type=hidden name="bc1fileorurl" value="_bcargfileorurl_"> 
    621518<input type=hidden name="bc1inputdir" value="_bcarginputdir_"> 
    622519<input type=hidden name="bc1ingsdlarea" value="_bcargingsdlarea_"> 
     
    671568} 
    672569 
    673  
    674570#---------------------------------------------------------------------------# 
    675571 
    676 _headmessmetadata_ { New collection wizard: metadata } 
    677  
    678 _contentmetadata_ { 
     572_headmessdefinished_ { New collection wizard: data entry finished } 
     573 
     574_contentdefinished_ { 
    679575 
    680576 
     
    693589    \} 
    694590 
    695     form.wizard.value += ":definished"; //***** 
     591    form.wizard.value += ":definished"; 
    696592 
    697593    var cgi_prefix = "webpage_mkcol.pl"; 
     
    717613<input type=hidden name="bc1aboutdesc" value="_bcargaboutdesc_")> 
    718614<input type=hidden name="bc1srcformat" value="_bcargsrcformat_"> 
    719 <input type=hidden name="bc1fileorurl" value="_bcargfileorurl_"> 
    720 <input type=hidden name="bc1inputdir" value="_bcarginputdir_"> 
    721 <input type=hidden name="bc1copydir" value="_bcargcopydir_"> 
    722 <input type=hidden name="bc1ingsdlarea" value="_bcargingsdlarea_"> 
    723 <input type=hidden name="bc1refine" value="_bcargrefine_"> 
    724  
    725 <table border=0> 
    726 <tr> 
    727   <td> 
    728     Extract acronyms: 
    729   </td> 
    730   <td colspan=3> 
    731     <input type=hidden name="bc1acronyms" value="_bcargacronyms_"> 
    732     <input type=radio name="bc1acronymsradio" value="on"  
    733     onClick=document.form.bc1acronyms.value="on" 
    734     _If_('"_bcargacronyms_" eq "on"', checked)> on 
    735     &nbsp;&nbsp;&nbsp;&nbsp; 
    736     <input type=radio name="bc1acronymsradio" value="off" 
    737     onClick=document.form.bc1acronyms.value="off" 
    738     _If_('"_bcargacronyms_" eq "off"', checked)> off 
    739   </td> 
    740 </tr> 
    741 <tr> 
    742   <td></td> 
    743   <td colspan=3> 
    744      <font color="#909090"> 
    745     Switch this option on if you want acronyms in the 
    746         text extracted as metadata. 
    747      </font> 
    748   </td> 
    749 </tr> 
    750  
    751 <tr><td><p>&nbsp;</td></tr> 
    752 <tr><td colspan=4 align=middle> 
    753   <a href="javascript:save()">Save_iconwizardnext_</a> 
    754 </table> 
    755 </form> 
    756 </td></tr></table></center> 
    757  
    758 _wizardbar_ 
    759 } 
    760  
    761  
    762 #---------------------------------------------------------------------------# 
    763  
    764 _headmessdefinished_ { New collection wizard: data entry finished } 
    765  
    766 _contentdefinished_ { 
    767  
    768  
    769 <script language="javascript"> 
    770  
    771    <!-- Hide code from non-js browsers 
    772    _commonjavascript_ 
    773    //**********     page never used!!! 
    774    // end hiding --> 
    775  
    776  
    777 </script> 
    778  
    779 <center><table><tr><td> 
    780 <form name="form" method="post" action="_gwcgi_"> 
    781 <input type=hidden name="gsdlhome" value="_gsdlhome_"> 
    782 <input type=hidden name="a" value="bc"> 
    783 <input type=hidden name="bc" value="newcol"> 
    784 _hiddenargs_ 
    785  
    786 <input type=hidden name="bc1fullname" value="_bcargfullname_")> 
    787 <input type=hidden name="bc1contactemail" value="_bcargcontactemail_")> 
    788 <input type=hidden name="bc1aboutdesc" value="_bcargaboutdesc_")> 
    789 <input type=hidden name="bc1srcformat" value="_bcargsrcformat_"> 
    790 <input type=hidden name="bc1fileorurl" value="_bcargfileorurl_"> 
    791615<input type=hidden name="bc1inputdir" value="_bcarginputdir_"> 
    792616<input type=hidden name="bc1copydir" value="_bcargcopydir_"> 
     
    798622<tr> 
    799623  <td> 
    800     This concludes the data entry required to build a new collection. 
    801      
    802  
    803     Away to (download) and then create config file 
    804  
    805     possible want to re-edit 
    806     build stuff 
     624    This concludes the data entry required to create a new collection. 
     625 
     626    <p>Select "finish" to save your collection info and create the 
     627       collection or select from the wizard bar to go back and change 
     628       any of your previous selections. 
     629 
    807630  </td> 
    808631</tr> 
     
    810633<tr><td><p>&nbsp;</td></tr> 
    811634<tr><td align=middle> 
    812   <a href="javascript:next_page();">Create new collection_iconwizardnext_</a> 
     635  <a href="javascript:save();">finish_iconwizardnext_</a> 
    813636</table> 
    814637</form> 
    815638</td></tr></table></center> 
    816639 
     640_wizardbar_ 
    817641} 
    818642 
     
    858682    if (do_save) 
    859683    \{ 
    860         var cgi_prefix = "webpage_editcol.pl"; 
    861         cgi_prefix += "?httpbuild=" + escape("_httpbuild_"); 
    862         cgi_prefix += "&bc1cfgfile=" + escape(form.bc1cfgfile.value); 
    863  
    864         simulate_get_action(cgi_prefix); 
     684//      var cgi_prefix = "webpage_editcol.pl"; 
     685//      cgi_prefix += "?httpbuild=" + escape("_httpbuild_"); 
     686//      cgi_prefix += "&bc1cfgfile=" + escape(form.bc1cfgfile.value); 
     687 
     688//      simulate_get_action(cgi_prefix); 
     689 
     690        // need to do it this way so POST method is used (as IE can't 
     691        // handle large config files sent in URL) 
     692        form.action = "webpage_editcol.pl"; 
     693        form.submit(); 
     694 
    865695    \} 
    866696   \} 
     
    887717<input type=hidden name="a" value="bc"> 
    888718<input type=hidden name="bc" value="editcol"> 
     719<input type=hidden name="httpbuild" value="_httpbuild_"> 
    889720_hiddenargs_ 
    890721 
     
    1061892  <td colspan=4>  
    1062893      Building a collection is a multi-staged process.  After selecting the 
    1063     collection you wish to be built, you must specify with stages of 
    1064         the building process you want executed. 
     894      collection you wish to be built, you must specify which stages of 
     895      the building process you want executed. 
     896      _If_(_win32_, 
     897      <p><font color="#B00000"> 
     898      <blockquote>It is recommended that you close all other windows and applications 
     899      while building a collection as they may interfere with the building 
     900      process. 
     901      </blockquote></font>) 
     902      <br> 
    1065903  </td> 
    1066904</tr> 
     
    1158996_headmessbuildframe_ { Executing build commands } 
    1159997 
    1160  
    1161 # not sure why we need 3 frames here when one appears to always be blank 
    1162 # - Stefan 
    1163 #_contentbuildframe_ { 
    1164  
    1165 #<frameset rows="*,150,*" border=0> 
    1166 #  <noframes><body bgcolor="#ffffff"> 
    1167 #  <p>You must have a frame enabled browser to view this.</p> 
    1168 #  </body> 
    1169 #  </noframes> 
    1170 #  <frame src="_httpbuild_&bca=buildcol&wizard=buildexec&bc1dirname=_bcargdirname_&bc1tmpname=_bcargtmpname_" name=infoframe> 
    1171 #  <frame src="_httpbuild_&bca=buildstatus&bc1tmpname=_bcargtmpname_" name=execframe> 
    1172 #  <frame src="_httpbuild_&bca=blankpage" name=blankframe> 
    1173 #</frameset> 
    1174 #} 
    1175  
    1176998_contentbuildframe_ { 
    1177999 
    1178 <frameset rows="200,150" border=0> 
     1000<frameset rows="2*,150,*" border=0> 
    11791001  <noframes><body bgcolor="#ffffff"> 
    11801002  <p>You must have a frame enabled browser to view this.</p> 
     
    11831005  <frame src="_httpbuild_&bca=buildcol&wizard=buildexec&bc1dirname=_bcargdirname_&bc1tmpname=_bcargtmpname_" name=infoframe> 
    11841006  <frame src="_httpbuild_&bca=buildstatus&bc1tmpname=_bcargtmpname_" name=execframe> 
     1007  <frame src="_httpbuild_&bca=blankpage" name=blankframe> 
    11851008</frameset> 
    11861009} 
    1187  
    11881010 
    11891011#---------------------------------------------------------------------------# 
     
    14711293 
    14721294 
    1473  
     1295_headmesscollog_ { Collection Build Log } 
     1296 
     1297 
     1298_contentcollog_ { 
     1299<pre> 
     1300_bldfile_ 
     1301</pre> 
     1302} 
    14741303 
    14751304 
     
    15421371      <li><a href="_httppageabout_&c=_build:bcargdirname_" target="_top">Access 
    15431372    the newly built collection_build:iconwizardnext_</a> 
     1373      <li><a href="_httpbuild_&bca=collog&bc1dirname=_build:bcargdirname_">View  
     1374        the build log for this collection_build:iconwizardnext_</a> 
    15441375      <li><a href="_httpbuild_&bca=newcol">Make a new 
    15451376    collection_build:iconwizardnext_</a> 
  • trunk/gsdl/src/recpt/buildaction.cpp

    r1285 r1305  
    329329 
    330330      // read in collect.bld 
    331       text_t bld_fname = filename_cat(gsdlhome, "log", dirname+ ".bld"); 
     331      text_t bld_fname = filename_cat(gsdlhome, "etc", dirname+ ".bld"); 
    332332 
    333333#ifdef GSDL_USE_IOS_H 
  • trunk/gsdl/src/recpt/receptionist.cpp

    r1285 r1305  
    10641064  disp.setmacro ("decodedcompressedoptions", "Global", dm_safe(compressedoptions)); 
    10651065 
     1066#if defined (__WIN32__) 
     1067  disp.setmacro ("win32", "Global", "1"); 
     1068#endif 
     1069 
    10661070  // set macron macros if encoding is utf8 
    10671071  if (args["w"] == "u") {