Index: /trunk/gsdl/lib/fileutil.cpp
===================================================================
--- /trunk/gsdl/lib/fileutil.cpp	(revision 1436)
+++ /trunk/gsdl/lib/fileutil.cpp	(revision 1437)
@@ -253,2 +253,25 @@
 #endif
 }
+
+// returns the last line (or last 256 characters)
+// of filename file
+text_t file_tail (const text_t &filename) {
+
+  text_t return_str;
+  char *filenamec = filename.getcstr();
+
+  ifstream file_in (filenamec);
+  if (file_in) {
+    file_in.seekg (256, ios::end);
+    char c;
+    file_in.get(c);
+    while (!file_in.eof()) {
+      if (c == '\n') return_str.clear();
+      else return_str.push_back (c);
+      file_in.get(c);
+    }
+    file_in.close();
+  }
+  delete filenamec;
+  return return_str;
+}
Index: /trunk/gsdl/lib/fileutil.h
===================================================================
--- /trunk/gsdl/lib/fileutil.h	(revision 1436)
+++ /trunk/gsdl/lib/fileutil.h	(revision 1437)
@@ -51,3 +51,5 @@
 void file_copy (const text_t &fromfile, const text_t &tofile);
 
+text_t file_tail (const text_t &filename);
+
 #endif
Index: /trunk/gsdl/macros/collect.dm
===================================================================
--- /trunk/gsdl/macros/collect.dm	(revision 1436)
+++ /trunk/gsdl/macros/collect.dm	(revision 1437)
@@ -14,4 +14,8 @@
 _gsjimage_ [v=1] {<a href="#" onClick="check\_submit(_4_);">_5_</a><br>}
 
+
+# a plain header for those pages that need it (the _pagebanner_ macro
+# will be set to this by the server for those pages.
+_plainbanner_ {}
 
 #######################################################################
@@ -598,20 +602,17 @@
 # Build page
 
-_bildscriptextra_ {
-var changed = 0;
-
-function check\_submit (gotopage) \{
-  var form = document.collectorform;
-  form.bc1cfgchanged.value = changed;
-  form.cp.value = gotopage;
-  form.submit();
-\}
-}
-
 _bildcontent_ {
-<form name="collectorform" method=post action="_gwcgi_">
-<input type=hidden name="e" value="_decodedcompressedoptions_">
-<input type=hidden name="cp" value="_cgiargcp_">
-
+<frameset rows="*,150" border=0>
+  <noframes><body bgcolor="#ffffff">
+  <p>You must have a frame enabled browser to view this.</p>
+  </body>
+  </noframes>
+  <frame src="_gwcgi_?e=_compressedoptions_&cp=bildframe1">
+  <frame src="_gwcgi_?e=_compressedoptions_&cp=bildstatus">
+</frameset>
+}
+
+_bildframe1scriptextra_ {}
+_bildframe1content_ {
 <center>
 <table width=_pagewidth_>
@@ -622,17 +623,20 @@
 </center>
 <p>_iconblankbar_
-
-<p><center>
-_collectorbar_
-</center>
-
-</td></tr>
-</table></center>
-
-</form>
-}
-
-
-
+<p>
+The collection is now being built: this might take some time. The building
+status line below gives feedback on how the operation is progressing.
+</td></tr>
+</table></center>
+}
+
+_bildstatusscriptextra_ {}
+_bildstatuscontent_ {
+<center>
+<table width=_pagewidth_>
+<tr><td>
+_statusline_
+</td></tr>
+</table></center>
+}
 
 #######################################################################
@@ -643,4 +647,8 @@
 <form name="collectorform" method=post action="_gwcgi_">
 <input type=hidden name="e" value="_decodedcompressedoptions_">
+
+<center>
+<table width=_pagewidth_>
+<tr><td>
 _iconblankbar_
 }
@@ -649,6 +657,8 @@
 <p>
 <a href="javascript:document.collectorform.submit();">Return to the collector</a>
+<p>_iconblankbar_
+</td></tr>
+</table></center>
 </form>
-_iconblankbar_
 }
 
Index: /trunk/gsdl/src/recpt/collectoraction.cpp
===================================================================
--- /trunk/gsdl/src/recpt/collectoraction.cpp	(revision 1436)
+++ /trunk/gsdl/src/recpt/collectoraction.cpp	(revision 1437)
@@ -511,4 +511,11 @@
   while (rprotolist_here != rprotolist_end) {
     if ((*rprotolist_here).p != NULL) {
+
+      // don't include z39.50 collection
+      if ((*rprotolist_here).p->get_protocol_name () == "z3950proto") {
+	rprotolist_here ++;
+	continue;
+      }
+
       text_tarray collist;
       comerror_t err;
@@ -601,4 +608,30 @@
 }
 
+// set the _statusline_ macro
+void collectoraction::set_statusline (displayclass &disp, const text_t &collection, ostream &logout) {
+
+  // the build command creates .bld.download, .bld.import, and .bld.build files (in that
+  // order) and deletes them (also in that order) when each stage is complete. the .bld
+  // file is the concatenation of all these files.
+  text_t bld_file = filename_cat (gsdlhome, "tmp", collection + ".bld");
+  text_t statusline;
+
+  if (file_exists (bld_file + ".download")) {
+    statusline = "Downloading files ...<br>";
+    statusline += file_tail (bld_file + ".download");
+  } else if (file_exists (bld_file + ".import")) {
+    statusline = "Importing collection ...<br>";
+    statusline += file_tail (bld_file + ".import");
+  } else if (file_exists (bld_file + ".build")) {
+    statusline = "Building collection ...";
+    statusline += file_tail (bld_file + ".build");
+  } else {
+    statusline += file_tail (bld_file);
+  }
+
+  disp.setmacro ("statusline", "collector", statusline);
+
+}
+
 void collectoraction::define_internal_macros (displayclass &disp, cgiargsclass &args, 
 					      recptprotolistclass *protos, ostream &logout) {
@@ -610,4 +643,6 @@
   //                   collection" page
   // _cfgfile_ -- if displaying the "configure collection" page
+  // _statusline_ -- if displaying the bildstatus page
+  // _pagebanner_ -- may be set to _collector:plainbanner_ for some pages
 
   text_t &collector_page = args["cp"];
@@ -617,4 +652,10 @@
   // set _pagescriptextra_ macro to _cpagescriptextra_
   disp.setmacro ("pagescriptextra", "collector", "_" + collector_page + "scriptextra_");
+
+  // set _pagebanner_ for those pages that don't want a fancy header (e.g. those
+  // displayed in frames
+  if (collector_page == "bildstatus") {
+    disp.setmacro ("pagebanner", "collector", "_plainbanner_");
+  }
 
   // set the collectorbar macro
@@ -696,4 +737,6 @@
   if (collector_page == "conf") 
     set_cfgfile (disp, args["bc1dirname"], logout);
+  if (collector_page == "bildstatus")
+    set_statusline (disp, args["bc1dirname"], logout);
 }
 
@@ -705,24 +748,4 @@
   text_t &collector_page = args["cp"];
   text_t &collection = args["bc1dirname"];
-  text_t message;
-
-  if (do_mkcol) {
-    // execute mkcol.pl (do_mkcol is set from within check_cgiargs)
-    text_t mkcol_cmd = "perl ";
-    mkcol_cmd += filename_cat (gsdlhome, "bin", "script", "mkcol.pl");
-    mkcol_cmd += " -creator \"" + args["bc1contactemail"] + "\"";
-    mkcol_cmd += " -title \"" + args["bc1fullname"] + "\"";
-    mkcol_cmd += " -about \"" + carriage_replace (args["bc1aboutdesc"], 0) + "\" ";
-    mkcol_cmd += collection;
-    char *mkcol_cmdc = mkcol_cmd.getcstr();
-    system (mkcol_cmdc);
-    delete mkcol_cmdc;
-    
-    // make sure it went ok
-    text_t cfgfile = filename_cat (gsdlhome, "collect", collection, 
-				   "etc", "collect.cfg");
-    if (!file_writable (cfgfile)) message = "mkcolfail";
-    do_mkcol = false; // reset for fast-cgi
-  }
 
   if (collector_page == "bild") {
@@ -759,44 +782,71 @@
 #endif
     delete build_cmdc;
-  }
-
-  if (args["bc1dodelete"] == "1") {
-    // delete bcidirname collection
-    if (collection_protected (collection)) {
-      message = "delinvalid";
-
+
+    // don't want header and stuff for build page as it uses frames
+    textout << outconvert << disp << ("_collector:bildcontent_\n");
+
+  } else {
+
+    // not bild page
+
+    text_t message;
+
+    if (do_mkcol) {
+      // execute mkcol.pl (do_mkcol is set from within check_cgiargs)
+      text_t mkcol_cmd = "perl ";
+      mkcol_cmd += filename_cat (gsdlhome, "bin", "script", "mkcol.pl");
+      mkcol_cmd += " -creator \"" + args["bc1contactemail"] + "\"";
+      mkcol_cmd += " -title \"" + args["bc1fullname"] + "\"";
+      mkcol_cmd += " -about \"" + carriage_replace (args["bc1aboutdesc"], 0) + "\" ";
+      mkcol_cmd += collection;
+      char *mkcol_cmdc = mkcol_cmd.getcstr();
+      system (mkcol_cmdc);
+      delete mkcol_cmdc;
+      
+      // make sure it went ok
+      text_t cfgfile = filename_cat (gsdlhome, "collect", collection, 
+				     "etc", "collect.cfg");
+      if (!file_writable (cfgfile)) message = "mkcolfail";
+      do_mkcol = false; // reset for fast-cgi
+    }
+
+    if (args["bc1dodelete"] == "1") {
+      // delete bcidirname collection
+      if (collection_protected (collection)) {
+	message = "delinvalid";
+	
+      } else {
+	
+	text_t delete_cmd = "perl " + filename_cat (gsdlhome, "bin", "script", "delcol.pl");
+	delete_cmd += " -f " + collection;
+	char *delete_cmdc = delete_cmd.getcstr();
+	int rv = system (delete_cmdc);
+	delete delete_cmdc;
+	if (rv != 0) {
+	  // deletion failed -- permissions?
+	  message = "delpermission";
+	} else {
+	  message = "delsuccess";
+	}
+      }
+    }
+    
+    if (clone_failed) {
+      // clone_failed is set from check_cgiargs if an attempt was made 
+      // to clone an invalid collection
+      message = "clonefail";
+      clone_failed = false;
+    }
+    
+    if (message.empty()) {
+      textout << outconvert << disp << ("_collector:header_\n")
+	      << ("_collector:" + collector_page + "content_\n")
+	      << ("_collector:footer_\n");
     } else {
-
-      text_t delete_cmd = "perl " + filename_cat (gsdlhome, "bin", "script", "delcol.pl");
-      delete_cmd += " -f " + collection;
-      char *delete_cmdc = delete_cmd.getcstr();
-      int rv = system (delete_cmdc);
-      delete delete_cmdc;
-      if (rv != 0) {
-	// deletion failed -- permissions?
-	message = "delpermission";
-      } else {
-	message = "delsuccess";
-      }
-    }
-  }
-
-  if (clone_failed) {
-    // clone_failed is set from check_cgiargs if an attempt was made 
-    // to clone an invalid collection
-    message = "clonefail";
-    clone_failed = false;
-  }
-  
-  if (message.empty()) {
-    textout << outconvert << disp << ("_collector:header_\n")
-	    << ("_collector:" + collector_page + "content_\n")
-	    << ("_collector:footer_\n");
-  } else {
-    textout << outconvert << disp << ("_collector:header_\n")
-	    << ("_collector:" + message + "content_\n")
-	    << ("_collector:footer_\n");
-  }
-
+      textout << outconvert << disp << ("_collector:header_\n")
+	      << ("_collector:" + message + "content_\n")
+	      << ("_collector:footer_\n");
+    }
+  }
   return true;
 }
Index: /trunk/gsdl/src/recpt/collectoraction.h
===================================================================
--- /trunk/gsdl/src/recpt/collectoraction.h	(revision 1436)
+++ /trunk/gsdl/src/recpt/collectoraction.h	(revision 1437)
@@ -50,4 +50,6 @@
   void set_cfgfile (displayclass &disp, const text_t &dirname, ostream &logout);
 
+  void set_statusline (displayclass &disp, const text_t &collection, ostream &logout);
+
   void update_cfgfile_clone (cgiargsclass &args, ostream &logout);
 
