Changeset 2401 for trunk/gsdl/macros


Ignore:
Timestamp:
2001-05-11T15:58:47+12:00 (23 years ago)
Author:
sjboddie
Message:

Made some changes to the collector so that paths/URLs/ftp addresses are
checked (pinged for HTTP/FTP) when leaving the "source data" page.
Functionality is complete I think but the interface still needs a
little work.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/macros/collect.dm

    r2361 r2401  
    169169<ul>
    170170<input type=radio name=p value=new checked>
    171 create an entirely new collection
     171create a new collection
    172172<br>
    173173<input type=radio name=p value=existing>
     
    444444
    445445_srcescriptextra_ {
    446 var cloneval = _cgiargbc1clone_;
     446var selectedindex = _selectedindex_;
    447447
    448448function check\_submit (gotopage) \{
    449449  var form = document.collectorform;
    450   var found = 0;
    451   var i = 0;
    452   if (!form.bc1inputdir1.value.match(/^\\s*$/)) \{
    453     if (!form.bc1inputdir1.value.match(/^\(http|ftp|file\):/)) \{
    454       i = form.sel1.selectedIndex;
    455       form.bc1inputdir1.value = form.sel1.options[i].value + form.bc1inputdir1.value;
    456     \}
    457     found = 1;
    458   \}
    459   if (!form.bc1inputdir2.value.match(/^\\s*$/)) \{
    460     if (!form.bc1inputdir2.value.match(/^\(http|ftp|file\):/)) \{
    461       i = form.sel2.selectedIndex;
    462       form.bc1inputdir2.value = form.sel2.options[i].value + form.bc1inputdir2.value;
    463     \}
    464     found = 1;
    465   \}
    466   if (!form.bc1inputdir3.value.match(/^\\s*$/)) \{
    467     if (!form.bc1inputdir3.value.match(/^\(http|ftp|file\):/)) \{
    468       i = form.sel3.selectedIndex;
    469       form.bc1inputdir3.value = form.sel3.options[i].value + form.bc1inputdir3.value;
    470     \}
    471     found = 1;
    472   \}
    473   if (!form.bc1inputdir4.value.match(/^\\s*$/)) \{
    474     if (!form.bc1inputdir4.value.match(/^\(http|ftp|file\):/)) \{
    475       i = form.sel4.selectedIndex;
    476       form.bc1inputdir4.value = form.sel4.options[i].value + form.bc1inputdir4.value;
    477     \}
    478     found = 1;
    479   \}
    480 
    481   if (!found)
    482   \{
    483     alert("At least one input source must be specified");
    484     form.bc1inputdir1.focus();
    485     return;
    486   \}
    487 
    488450  form.p.value = gotopage;
     451  form.bc1fromsrce.value = "1";
    489452  form.submit();
    490 \}
    491 
    492 function clone\_changed (changedto) \{
    493   var form = document.collectorform;
    494   if (changedto != cloneval) \{
    495     form.bc1clonechanged.value = 1;
    496   \} else \{
    497     form.bc1clonechanged.value = 0;
    498   \}
    499   menuchange();
    500453\}
    501454
     
    510463           "work properly.");
    511464  \}
     465
     466  if (form.bc1clonecol.selectedIndex == 0) \{
     467    form.bc1clone.value = "0";
     468  \} else \{
     469    form.bc1clone.value = "1";
     470  \}
     471
     472  if (form.bc1clonecol.selectedIndex == selectedindex) \{
     473    form.bc1clonechanged.value = "0";
     474  \} else \{
     475    form.bc1clonechanged.value = "1";
     476  \}
     477\}
     478
     479function more (type) \{
     480  var form = document.collectorform;
     481  if (type == "file") \{
     482    form.bc1filenum.value = form.bc1filenum.value * 2;
     483  \} else if (type == "http") \{
     484    form.bc1httpnum.value = form.bc1httpnum.value * 2;
     485  \} else if (type == "ftp") \{
     486    form.bc1ftpnum.value = form.bc1ftpnum.value * 2;
     487  \}
     488  form.p.value = "srce";
     489  form.submit();
    512490\}
    513491}
     
    518496</center>
    519497<p>_iconblankbar_
    520 
    521 <p>You can either create a completely new collection, or "clone" an existing one
    522 -- that is, base the structure of your new collection on one that exists already.
    523 <ul>
    524 <input type=radio onClick="clone_changed(0);" name=bc1clone value=0
    525 _If_("_cgiargbc1clone_" eq "0",checked)><b>Create new collection</b>
    526 <br><font color="#909090">
    527 Create a completely new collection. The collection may contain html documents (.htm, .html), plain text
    528 documents (.txt, .text), or email documents (.email).
    529 </font>
    530 </ul>
    531 <ul>_If_("_fullnamemenu_" eq "",
    532 No collections available for cloning.,_srcemenu_)
    533 </ul>
     498_If_("_badsources_" eq "1",_srcebadsources_,_srcenewcontent_)
     499}
     500
     501_srcebadsources_ {
     502<p>One or more of the input sources you specified is unavailable.
     503}
     504
     505_srcenewcontent_ {
     506<p>Either use the default structure for your new collection, or base its
     507structure on a collection that exists already.
     508
     509<p>If you use the default structure, the new collection may contain html
     510documents (.htm, .html), plain text documents (.txt, .text), MS Word
     511documents (.doc), PDF documents (.pdf) or email documents (.email).
     512
     513<p>If you base the structure on an existing collection, the files in your
     514new collection must be exactly the same type as those used to build the
     515existing one.
     516
     517<p>Base the collection on
     518_fullnamemenu_
     519<p>_iconblankbar_
    534520}
    535521
     
    550536<input type=hidden name="e" value="_decodedcompressedoptions_">
    551537<input type=hidden name="p" value="_cgiargp_">
     538<input type=hidden name="bc1fromsrce" value="0">
    552539<input type=hidden name="bc1clonechanged" value="0">
    553 <input type=hidden name="bc1aboutdesc" value="_cgiargbc1aboutdesc_">
    554 <input type=hidden name="bc1contactemail" value="_cgiargbc1contactemail_">
     540<input type=hidden name="bc1clone" value="_cgiargbc1clone_">
     541<input type=hidden name="bc1filenum" value="_cgiargbc1filenum_">
     542<input type=hidden name="bc1httpnum" value="_cgiargbc1httpnum_">
     543<input type=hidden name="bc1ftpnum" value="_cgiargbc1ftpnum_">
    555544
    556545<center>
     
    561550
    562551<h4>Input source:</h4>
    563 <nobr>_typeselect_(1,file)<input type=text name="bc1inputdir1" value="_cgiargbc1inputdir1_" size=60></nobr>
    564 <br>
    565 <nobr>_typeselect_(2,http)<input type=text name="bc1inputdir2" value="_cgiargbc1inputdir2_" size=60></nobr>
    566 <br>
    567 <nobr>_typeselect_(3,ftp)<input type=text name="bc1inputdir3" value="_cgiargbc1inputdir3_" size=60></nobr>
    568 <br>
    569 <nobr>_typeselect_(4,file)<input type=text name="bc1inputdir4" value="_cgiargbc1inputdir4_" size=60></nobr>
    570 <br>
    571 <font color="#909090">
    572 These specify where the source data is located.  There are three kinds of
    573 location:
    574 <ul>
    575 <li> a directory name on your computer system (beginning with "file://"),
    576 <li> an address beginning with "http://" for files to be downloaded from the
    577 Web,
    578 <li> an address beginning with "ftp://" for files to be downloaded using FTP
    579 (file transfer protocol).
    580 </ul>
    581 In each case, the collection will include all files of the appropriate type in
    582 the specified directory, in any directories it contains, in any directories
    583 they contain, and so on. 
    584 <p>You can specify up to four different input sources.  If you specify a
    585 filename, just that file will be included.
    586 </font>
     552
     553<table border=0>
     554<tr valign=top><td><b>file://</b></td>
     555<td>_filelist_</td>
     556</tr>
     557<tr valign=top><td><b>http://</b></td>
     558<td>_httplist_</td>
     559</tr>
     560<tr valign=top><td><b>ftp://</b></td>
     561<td>_ftplist_</td>
     562</tr></table>
     563
     564<p>If you use file:// or ftp:// to specify a file, that file will be
     565downloaded.
     566
     567<p>If you use http:// it depends on whether the URL gives you a normal web
     568page in your browser, or a list of files.  If a page, that page will be
     569downloaded -- and so will all pages it links to, and all pages they link
     570to, etc. -- provided they reside on the same site, below the URL.
     571
     572<p>If you use file:// or ftp:// to specify a folder or directory, or give a
     573http:// URL that leads to a list of files, everything in the folder and all
     574its sub-folders will be included in the collection.
     575
     576<p>You can specify sources of more than one type.  To specify several
     577sources of the same type, just click the &quot;more&quot; button to get
     578more input boxes.
    587579
    588580<p>_iconblankbar_
     
    600592
    601593</form>
    602 }
    603 
    604 _typeselect_ {<select name="sel_1_">
    605 <option value="file://" _If_("_2_" eq "file",selected)>file://
    606 <option value="http://" _If_("_2_" eq "http",selected)>http://
    607 <option value="ftp://" _If_("_2_" eq "ftp",selected)>ftp://
    608 </select>}
    609 
    610 _srcemenu_ {<input type=radio name=bc1clone onClick="clone_changed(1);" value=1
    611 _If_("_cgiargbc1clone_" eq "1",checked)><b>Clone existing collection</b>
    612 <br>_fullnamemenu_<br>
    613 <font color=#909090>
    614 This pull-down menu specifies which collection you want to clone.  The files in
    615 your new collection must be exactly the same type as those used to build
    616 the existing one.
    617 </font>
    618594}
    619595
     
    644620<input type=hidden name="p" value="_cgiargp_">
    645621<input type=hidden name="bc1cfgchanged" value="_cgiargbc1cfgchanged_">
    646 <input type=hidden name="bc1aboutdesc" value="_cgiargbc1aboutdesc_">
    647 <input type=hidden name="bc1contactemail" value="_cgiargbc1contactemail_">
    648622
    649623<center>
     
    702676// -->
    703677</script>
     678</head>
     679
    704680<form name="collectorform" method=post action="_gwcgi_">
    705681<input type=hidden name="e" value="_decodedcompressedoptions_">
    706682<input type=hidden name="p" value="_cgiargp_">
    707 <input type=hidden name="bc1aboutdesc" value="_cgiargbc1aboutdesc_">
    708 <input type=hidden name="bc1contactemail" value="_cgiargbc1contactemail_">
    709 
    710 </head>
    711683
    712684<frameset rows="*,160" border=0>
     
    764736<input type=hidden name="e" value="_decodedcompressedoptions_">
    765737<input type=hidden name="p" value="bildcancel">
    766 <input type=hidden name="bc1aboutdesc" value="_cgiargbc1aboutdesc_">
    767 <input type=hidden name="bc1contactemail" value="_cgiargbc1contactemail_">
    768738
    769739<center>
     
    813783<input type=hidden name="e" value="_decodedcompressedoptions_">
    814784<input type=hidden name="p" value="_cgiargp_">
    815 <input type=hidden name="bc1aboutdesc" value="_cgiargbc1aboutdesc_">
    816 <input type=hidden name="bc1contactemail" value="_cgiargbc1contactemail_">
    817785
    818786</form>
     
    870838<form name="collectorform" method=post action="_gwcgi_">
    871839<input type=hidden name="e" value="_decodedcompressedoptions_">
    872 <input type=hidden name="bc1aboutdesc" value="_cgiargbc1aboutdesc_">
    873 <input type=hidden name="bc1contactemail" value="_cgiargbc1contactemail_">
    874840
    875841<center>
     
    924890<input type=hidden name="e" value="_decodedcompressedoptions_">
    925891<input type=hidden name="p" value="_cgiargp_">
    926 <input type=hidden name="bc1aboutdesc" value="_cgiargbc1aboutdesc_">
    927 <input type=hidden name="bc1contactemail" value="_cgiargbc1contactemail_">
    928892
    929893</form>
     
    959923<form name="collectorform" method=post action="_gwcgi_">
    960924<input type=hidden name="e" value="_decodedcompressedoptions_">
    961 <input type=hidden name="bc1aboutdesc" value="_cgiargbc1aboutdesc_">
    962 <input type=hidden name="bc1contactemail" value="_cgiargbc1contactemail_">
    963925
    964926<center>
Note: See TracChangeset for help on using the changeset viewer.