Index: /trunk/gsdl/macros/collect.dm
===================================================================
--- /trunk/gsdl/macros/collect.dm	(revision 1432)
+++ /trunk/gsdl/macros/collect.dm	(revision 1433)
@@ -12,5 +12,5 @@
 name="_4_" src="_2_" onLoad="gbutton(this,'_3_');" border=0 alt="_5_"></a>}
 
-_gsimage_ [v=1] {<a href="#" onClick="check\_submit(_4_);">_5_</a><br>}
+_gsjimage_ [v=1] {<a href="#" onClick="check\_submit(_4_);">_5_</a><br>}
 
 
@@ -58,4 +58,8 @@
 _textview_ {view}
 
+_icongcdelof_ {<img src="_httpicongcdelof_" alt="_textdel_">}
+_icongcdelon_ {<img src="_httpicongcdelon_" alt="_textdel_">}
+_textdel_ {delete collection}
+
 #######################################################################
 # http macros 
@@ -66,4 +70,5 @@
 _httpbild_ {_gwcgi_?e=_compressedoptions_&cp=bild}
 _httpview_ {_gwcgi_?e=_compressedoptions_&cp=view}
+_httpdel_  {javascript:do_delete();}
 
 _httpicongcinfoof_ {_httpimg_/gcinfoof.gif}
@@ -97,4 +102,6 @@
 _httpiconncviewof_ {_httpimg_/ncviewof.gif}
 
+_httpicongcdelof_ {_httpimg_/gcdelof.gif}
+_httpicongcdelon_ {_httpimg_/gcdelon.gif}
 
 #######################################################################
@@ -164,4 +171,70 @@
 }
 
+
+#######################################################################
+# Changing an existing collection page
+
+_existingscriptextra_ {
+function check\_submit (gotopage) \{
+  var form = document.collectorform;
+  if (gotopage == "srce") \{
+    form.bc1esrce.value = "1";
+  \}
+  if (gotopage == "conf") \{
+    form.bc1econf.value = "1";
+  \}
+  form.cp.value = gotopage;
+  form.submit();
+\}
+
+function do_delete () \{
+  var form = document.collectorform;  
+  var i = form.bc1dirname.selectedIndex;
+  var del = confirm ("Confirm deletion of " + form.bc1dirname.options[i].value + " collection?");
+  if (del) \{
+    form.bc1dodelete.value = "1";
+    form.submit();
+  \}
+\}
+}
+
+_changeexisting_ {
+<p>First select the collection that you want to work with (write protected
+collections won't appear in this list).
+<br>_fullnamemenu_<br>
+<p>With the collection you have selected, you can
+
+<table cellspacing=6>
+<tr><td width=20 align=right valign=bottom>1.</td>
+<td valign=bottom>_gsjimage_( ,_collector:httpicongcsrceof_,_collector:httpicongcsrceon_,srce,_collector:textsrce_)</td>
+<td valign=bottom>Add more data and rebuild the collection</td></tr>
+<tr><td align=right valign=bottom>2.</td>
+<td valign=bottom>_gsjimage_(_,_collector:httpicongcconfof_,_collector:httpicongcconfon_,conf,_collector:textconf_)</td>
+<td valign=bottom>Edit the collection configuration file</td></tr>
+<tr><td align=right valign=bottom>3.</td>
+<td valign=bottom>_gsimage_(_collector:httpdel_,_collector:httpicongcdelof_,_collector:httpicongcdelon_,del,_collector:textdel_)</td>
+<td valign=bottom>Delete the collection entirely</td></tr>
+</table>
+}
+
+_existingcontent_ {
+<form name="collectorform" method=post action="_gwcgi_">
+<input type=hidden name="e" value="_decodedcompressedoptions_">
+<input type=hidden name="cp" value="_cgiargcp_">
+<input type=hidden name="bc1dodelete" value="0">
+<input type=hidden name="bc1esrce" value="0">
+<input type=hidden name="bc1econf" value="0">
+<center>
+<table width=_pagewidth_>
+<tr><td>
+_iconblankbar_
+<center><h2>Changing an existing collection</h2></center>
+_iconblankbar_
+_If_("_fullnamemenu_" eq "",<p>No write-enabled collections are available for modifying,_changeexisting_)
+<p>_iconblankbar_
+</td></tr>
+</table></center>
+</form>
+}
 
 #######################################################################
@@ -334,7 +407,8 @@
 
 _srcescriptextra_ {
+var cloneval = _cgiargbc1clone_;
+
 function check\_submit (gotopage) \{
   var form = document.collectorform;
-
   if (form.bc1inputdir1.value.match(/^\\s*$/) &&
       form.bc1inputdir2.value.match(/^\\s*$/) &&
@@ -350,15 +424,16 @@
   form.submit();
 \}
-}
-
-_srcecontent_ {
-<form name="collectorform" method=post action="_gwcgi_">
-<input type=hidden name="e" value="_decodedcompressedoptions_">
-<input type=hidden name="cp" value="_cgiargcp_">
-
-<center>
-<table width=_pagewidth_>
-<tr><td>
-_iconblankbar_
+
+function clone\_changed (changedto) \{
+  var form = document.collectorform;
+  if (changedto != cloneval) \{
+    form.bc1clonechanged.value = 1;
+  \} else \{
+    form.bc1clonechanged.value = 0;
+  \}
+\}
+}
+
+_srcenew_ {
 <center>
 <h2>Source data</h2>
@@ -369,5 +444,6 @@
 -- that is, base the structure of your new collection on one that exists already.
 <ul>
-<input type=radio name=bc1clone value=0 _If_("_cgiargbc1clone_" eq "0",checked)><b>Create new collection</b>
+<input type=radio onClick="clone_changed(0);" name=bc1clone value=0
+_If_("_cgiargbc1clone_" eq "0",checked)><b>Create new collection</b>
 <br><font color="#909090">
 Create a completely new collection. The collection may contain html documents (.htm, .html), plain text
@@ -378,4 +454,29 @@
 No collections available for cloning.,_srcemenu_)
 </ul>
+}
+
+_srceappend_ {
+<center>
+<h2>Add new data</h2>
+</center>
+<p>_iconblankbar_
+<h4>Adding data:</h4>
+The files that you specify below will be added to the collection. Make sure
+that you do not re-specify files that are already in the collection:
+otherwise two copies will be included. Files are identified by their full
+pathname, Web pages by their absolute Web address.
+}
+
+_srcecontent_ {
+<form name="collectorform" method=post action="_gwcgi_">
+<input type=hidden name="e" value="_decodedcompressedoptions_">
+<input type=hidden name="cp" value="_cgiargcp_">
+<input type=hidden name="bc1clonechanged" value="0">
+
+<center>
+<table width=_pagewidth_>
+<tr><td>
+_iconblankbar_
+_If_("_cgiargbc1esrce_" eq "1",_srceappend_,_srcenew_)
 
 <h4>Input source:</h4>
@@ -419,5 +520,6 @@
 }
 
-_srcemenu_ {<input type=radio name=bc1clone value=1 _If_("_cgiargbc1clone_" eq "1",checked)><b>Clone existing collection</b>
+_srcemenu_ {<input type=radio name=bc1clone onClick="clone_changed(1);" value=1 
+_If_("_cgiargbc1clone_" eq "1",checked)><b>Clone existing collection</b>
 <br>_fullnamemenu_<br>
 <font color=#909090>
@@ -535,10 +637,23 @@
 
 #######################################################################
-# Error pages
-#######################################################################
+# Error and message pages
+#######################################################################
+
+_messagehead_ {
+<form name="collectorform" method=post action="_gwcgi_">
+<input type=hidden name="e" value="_decodedcompressedoptions_">
+_iconblankbar_
+}
+
+_messagefoot_ {
+<p>
+<a href="javascript:document.collectorform.submit();">Return to the collector</a>
+</form>
+_iconblankbar_
+}
 
 _mkcolfailcontent_ {
+_messagehead_
 <p>
-
 Greenstone failed to create the directory structure required to create your
 new collection. Possible causes are:
@@ -546,3 +661,39 @@
 <li> Greenstone does not have permission to write to the gsdl/collect 
      directory.
-}
+</ul>
+_messagefoot_
+}
+
+_delpermissioncontent_ {
+_messagehead_
+<p>
+Some or all of the _cgiargbc1dirname_ collection could not be
+deleted. Possible causes are:
+<ul>
+<li> Greenstone does not have permission to delete the gsdl/collect/_cgibc1dirname_
+directory.
+</ul>
+_messagefoot_
+}
+
+_delinvalidcontent_ {
+_messagehead_
+<p>
+The _cgiargbc1dirname_ collection is protected or invalid. Deletion was cancelled.
+_messagefoot_
+}
+
+_delsuccesscontent_ {
+_messagehead_
+<p>
+The _cgiargbc1dirname_ collection was successfully deleted.
+_messagefoot_
+}
+
+_clonefailcontent_ {
+_messagehead_
+<input type=hidden name="bc1clone" value="0">
+<p>
+The _cgiargclonecol_ collection cound not be cloned.
+_messagefoot_
+}
