Index: branches/corba/gsdl/src/recpt/comtypes.cpp
===================================================================
--- branches/corba/gsdl/src/recpt/comtypes.cpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/comtypes.cpp	(revision 1509)
@@ -28,4 +28,10 @@
 /*
    $Log$
+   Revision 1.22.2.1  2000/09/06 21:48:58  davidb
+
+   Improvements to corba implementation so images within a collection
+   are handled better and images in the remote site but not in the local
+   site are cached locally.
+
    Revision 1.22  1999/12/13 02:24:33  davidb
    Data fields for cross collection searching (CCS)
@@ -138,4 +144,6 @@
   format.erase(format.begin(), format.end());
   building.erase(format.begin(), format.end());
+  httpdomain.clear();
+  httpprefix.clear();
   receptionist.clear();
 }
Index: branches/corba/gsdl/src/recpt/comtypes.h
===================================================================
--- branches/corba/gsdl/src/recpt/comtypes.h	(revision 1087)
+++ branches/corba/gsdl/src/recpt/comtypes.h	(revision 1509)
@@ -98,4 +98,6 @@
   text_tmap format;
   text_tmap building;
+  text_t httpdomain;
+  text_t httpprefix;
   text_t receptionist;
 };
Index: branches/corba/gsdl/src/recpt/corbaclient.mpp
===================================================================
--- branches/corba/gsdl/src/recpt/corbaclient.mpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/corbaclient.mpp	(revision 1509)
@@ -62,17 +62,30 @@
 #include "recptconfig.h"
 
-int main () {
+int main (int argc, char* argv[]) {
   receptionist recpt;
-  corbaproto   nproto;
+  corbaproto*  cproto_array[argc];
   text_t       gsdlhome;
+  text_t       httpdomain;
+  text_t       httpprefix;
 
-  site_cfg_read(gsdlhome);
+  cproto_array[0] = NULL; // unused
 
-//  cout << "GRB 0" << endl;
+  if (argc==1)
+  {
+    cout << "Content-type: text/html" << endl << endl;
+    cout << "Usage: " << argv[0] << "site1.objid [site2.objid ...]" << endl;
+    return(0);
+  }
 
-  // add the protocol to the receptionist
-  recpt.add_protocol (&nproto);
+  // Strictly speaking httpdomain and httpprefix are not needed.
+  // Need to modify site_cfg_read to eliminate this dependency. // ****
+  site_cfg_read(gsdlhome,httpdomain,httpprefix);
 
-//  cout << "GRB 1" << endl;
+  for (int i=1; i<argc; i++)
+    {
+      // add the protocol to the receptionist
+      cproto_array[i] = new corbaproto(argv[i]);
+      recpt.add_protocol (cproto_array[i]);
+    }
 
   // add other converters
@@ -86,6 +99,4 @@
   gboutconvert.setmapfile (gsdlhome, "ugbk", 0xa1f5);
   recpt.add_converter ("g", &gbinconvert, &gboutconvert);
-
-//  cout << "GRB 2" << endl;
 
   // the list of actions. Note: these actions will become invalid
@@ -114,4 +125,5 @@
 
   buildaction abuildaction;
+  abuildaction.set_receptionist (&recpt);
   recpt.add_action (&abuildaction);
 
@@ -119,6 +131,4 @@
   aauthenaction.set_receptionist(&recpt);
   recpt.add_action (&aauthenaction);
-
-//  cout << "GRB 3" << endl;
 
   // list of browsers
@@ -144,6 +154,14 @@
   cgiwrapper (recpt, "");
 
-  //  cout << "TEST" << endl;
+  for (int i=1; i<argc; i++)
+    {
+      delete cproto_array[i];
+    }
+
   return 0;
 }
 
+
+
+
+
Index: branches/corba/gsdl/src/recpt/corbaproto.h
===================================================================
--- branches/corba/gsdl/src/recpt/corbaproto.h	(revision 1087)
+++ branches/corba/gsdl/src/recpt/corbaproto.h	(revision 1509)
@@ -42,7 +42,10 @@
   CORBA::BOA_var        boa;
   CORBA::Object_var     obj;
+  text_t gsdlhome;
+  text_t site_name;
+
  public:
   virtual ~corbaproto() {}
-  corbaproto();
+  corbaproto(char* site_name);
 
   // add_collectserver should be called for each collection server
@@ -56,4 +59,12 @@
   // this init will init each of the collection servers
   bool init (ostream &logout);
+
+  // used to check for icons and retrieve them from the collection
+  // site if they are missing
+  void  cache_missing_icons(text_tmap& format_map,
+			    text_t& httpdomain, 
+			    text_t& httpprefix);
+
+  text_t get_site_name ();
 
   text_t get_protocol_name ();
Index: branches/corba/gsdl/src/recpt/corbaproto.mpp
===================================================================
--- branches/corba/gsdl/src/recpt/corbaproto.mpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/corbaproto.mpp	(revision 1509)
@@ -29,4 +29,6 @@
 #include <fstream.h>
 
+#include "fileutil.h"
+
 // protocol headers for CORBA
 #include "corbaiface.h"
@@ -275,13 +277,19 @@
 }
 
-corbaproto::corbaproto()
+corbaproto::corbaproto(char* _site_name)
 { char *dummyv[1] = {""};
   int   dummyc = 0;
-  /*  // CORBA variables
-  static CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" );
-  static CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" );
+  // CORBA variables
+  /* static CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" );
+     static CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" ); */
+
+  CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" );
+  CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" );
+
+  char objid_filename[256];
+  sprintf(objid_filename,"/tmp/%s.objid",_site_name);
 
   // Get ref from "naming service"
-  ifstream in ("/tmp/account.objid");
+  ifstream in (objid_filename);
   char ref[1000];
   in >> ref;
@@ -289,20 +297,39 @@
 
   // startup corba
-  static CORBA::Object_var obj = orb->string_to_object (ref);
-
-  client = corbaiface::_narrow( obj );*/
-  client = NULL;
+  // static CORBA::Object_var obj = orb->string_to_object (ref);
+  CORBA::Object_var obj = orb->string_to_object (ref);
+
+  client = corbaiface::_narrow( obj ); 
+  // client = NULL; // ****
+
+  gsdlhome.clear();
+  site_name = _site_name;
 }
 
 corbaiface_var corbaproto::getCorbaClient()
 {
+  // This function was written to help corba when ORB and BOA were
+  // not working in "persistent" mode.
+  // Now that persistent mode is working it is not longer needed/used.
+
   char *dummyv[1] = {""};
   int   dummyc = 0;
   // CORBA variables
-  static CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" );
-  static CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" );
+//  static CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" );
+//  static CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" );
+
+  // DB // Try this out!! // ****
+  CORBA::ORB_var orb = CORBA::ORB_init( dummyc , dummyv, "mico-local-orb" );
+  CORBA::BOA_var boa = orb->BOA_init( dummyc , dummyv, "mico-local-boa" );
+
+  /*  char* site_name_chars = site_name.getcstr();
+  char objid_filename[256];
+  sprintf(objid_filename,"/tmp/%s.objid",site_name_chars);
+  // delete site_name_chars; */
+
+  text_t objid_filename = "/tmp/" + site_name + ".objid";
 
   // Get ref from "naming service"
-  ifstream in ("/tmp/account.objid");
+  ifstream in (objid_filename.getcstr());
   char ref[1000];
   in >> ref;
@@ -310,5 +337,7 @@
 
   // startup corba
-  static CORBA::Object_var obj = orb->string_to_object (ref);
+  // DB // Try this out!! // ****
+  // static CORBA::Object_var obj = orb->string_to_object (ref);
+  CORBA::Object_var obj = orb->string_to_object (ref);
 
   return corbaiface::_narrow( obj );
@@ -327,5 +356,6 @@
 
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
 
   // convert all the requisite structures into their CORBA form
@@ -335,4 +365,12 @@
   // execute the corba transaction
   lclient->configure(corbaKey, corbaCfgline);  
+
+  if (key=="gsdlhome")
+    {
+      // store gsdlhome in corba prototype so it can be used later to
+      // check if icons specified in format statements exist on the
+      // recptionist's side
+      gsdlhome = cfgline[0];
+    }
 }
 
@@ -342,8 +380,81 @@
 
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
-
-  // execute the corba transaction
-  return lclient->init();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
+
+  // execute the corba transaction
+  return lclient->initialise();
+}
+
+void  corbaproto::cache_missing_icons(text_tmap& format_map,
+				      text_t& httpdomain, 
+				      text_t& httpprefix)
+{
+  // consider making this a member function in the object?
+
+  text_tmap::iterator format_here = format_map.begin();
+  text_tmap::iterator format_end = format_map.end();
+  while (format_here!=format_end)
+    {
+      text_t format_line = format_here->second;
+
+      // cout << "*** format line = " << format_line << endl; // ****
+
+      text_t::iterator fl_begin = format_line.begin();
+      text_t::iterator fl_end = format_line.end();
+
+      text_t::iterator httpimg_find = findword(fl_begin,fl_end,"_httpimg_");
+      text_t::iterator http_find = httpimg_find;
+
+      while (httpimg_find!=fl_end)
+	{
+	  http_find = httpimg_find+5;
+	  httpimg_find += 9;
+
+	  // look for white space " or >
+	  text_t::iterator filename_end = httpimg_find;
+	  while (filename_end != fl_end)
+	    {
+	      if (*filename_end == ' ') break;
+	      if (*filename_end == '\t') break;
+	      if (*filename_end == '\"') break;
+	      if (*filename_end == '>') break;
+	      filename_end++;
+	    }
+
+	  text_t img_filename = substr(httpimg_find,filename_end);
+
+	  text_t site_img_filename = filename_cat(gsdlhome,"images",img_filename);
+
+	  // look to see if img filename exists in images directory
+	  if (!file_exists(site_img_filename))
+	    {
+	      text_t cache_img_dir
+		= filename_cat(gsdlhome,"images",".cache");
+
+	      text_t remote_img_url = "http://" + httpdomain + httpprefix
+		+ "/images" + img_filename;
+
+	      text_t wget_cmd = "wget -q -N --directory-prefix="+cache_img_dir
+		+ " " + remote_img_url;
+
+	      char* wget_cmd_chars = wget_cmd.getcstr();
+
+	      system(wget_cmd_chars);
+	      delete wget_cmd_chars;
+
+	      format_map[format_here->first] 
+		= substr(fl_begin,http_find) + "cache" + substr(http_find,fl_end);
+
+	    }
+
+	  httpimg_find = findword(httpimg_find,fl_end,"_httpimg_");
+	}
+      format_here++;
+    }
+}
+
+text_t corbaproto::get_site_name () {
+  return site_name;
 }
 
@@ -356,5 +467,5 @@
 				     ostream &/*logout*/) {
 
-  cout << "Corbaproto::Collection list" << endl;
+  // cout << "Corbaproto::Collection list" << endl;
 
   corbatext_tarray corba_collist;
@@ -362,5 +473,6 @@
 
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
 
   // execute the corba transaction
@@ -383,5 +495,6 @@
 
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
 
   // convert all the requisite structures into their CORBA form
@@ -405,5 +518,6 @@
 
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
 
   // convert all the requisite structures into their CORBA form
@@ -417,4 +531,5 @@
 }
 
+
 void corbaproto::get_collectinfo (const text_t &collection, 
 				 ColInfoResponse_t &collectinfo,
@@ -427,5 +542,6 @@
 
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
 
   // convert all the requisite structures into their CORBA form
@@ -447,5 +563,10 @@
   corbatext_corbaMapToMap(corbaCollectInfo.format, collectinfo.format);
   corbatext_corbaMapToMap(corbaCollectInfo.building, collectinfo.building);
+  corbaconv_text_t::setCorbatext(collectinfo.httpdomain,corbaCollectInfo.httpdomain);
+  corbaconv_text_t::setCorbatext(collectinfo.httpprefix,corbaCollectInfo.httpprefix);
   corbaconv_text_t::setCorbatext(collectinfo.receptionist,corbaCollectInfo.receptionist);
+
+  cache_missing_icons(collectinfo.format,collectinfo.httpdomain,
+		      collectinfo.httpprefix);
 
   err = (comerror_t) corbaError;  
@@ -463,5 +584,6 @@
   
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
 
   // convert all the requisite structures into their CORBA form
@@ -492,5 +614,6 @@
 
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
 
   // convert all the requisite structures into their CORBA form
@@ -531,5 +654,6 @@
 
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
 
   // convert all the requisite structures into their CORBA form
@@ -572,5 +696,6 @@
 
   // get the corba client reference
-  corbaiface_var lclient = this->getCorbaClient();
+  // corbaiface_var lclient = this->getCorbaClient(); // ****
+  corbaiface_var lclient = client;
 
   // convert all the requisite structures into their CORBA form
Index: branches/corba/gsdl/src/recpt/documentaction.cpp
===================================================================
--- branches/corba/gsdl/src/recpt/documentaction.cpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/documentaction.cpp	(revision 1509)
@@ -28,4 +28,10 @@
 /*
    $Log$
+   Revision 1.36.2.2  2000/09/06 21:49:00  davidb
+
+   Improvements to corba implementation so images within a collection
+   are handled better and images in the remote site but not in the local
+   site are cached locally.
+
    Revision 1.36.2.1  2000/04/04 15:02:35  cs025
    Corba first commit
@@ -963,6 +969,6 @@
 		  << "<html><head></head>\n"
 		  << "<frameset rows=\"68,*\" noresize border=0>\n"
-		  << "<frame scrolling=no frameborder=0 src=\"_gwcgi_?e=_compressedoptions_&a=p&p=nav\">\n"
-		  << "<frame name=\"documenttop\" frameborder=0 src=\"_gwcgi_?e=_compressedoptions_&a=d&d=" 
+		  << "<frame scrolling=no frameborder=0 src=\"_gwcgi_?_optsite_e=_compressedoptions_&a=p&p=nav\">\n"
+		  << "<frame name=\"documenttop\" frameborder=0 src=\"_gwcgi_?_optsite_e=_compressedoptions_&a=d&d=" 
 		  << args["d"] << "\">"
 		  << "<noframes>\n"
Index: branches/corba/gsdl/src/recpt/nullproto.cpp
===================================================================
--- branches/corba/gsdl/src/recpt/nullproto.cpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/nullproto.cpp	(revision 1509)
@@ -28,4 +28,10 @@
 /*
    $Log$
+   Revision 1.12.2.2  2000/09/06 21:49:01  davidb
+
+   Improvements to corba implementation so images within a collection
+   are handled better and images in the remote site but not in the local
+   site are cached locally.
+
    Revision 1.12.2.1  2000/04/04 15:02:36  cs025
    Corba first commit
@@ -101,4 +107,8 @@
 }
 
+text_t nullproto::get_site_name () {
+  return "";
+}
+
 text_t nullproto::get_protocol_name () {
   return "nullproto";
Index: branches/corba/gsdl/src/recpt/nullproto.h
===================================================================
--- branches/corba/gsdl/src/recpt/nullproto.h	(revision 1087)
+++ branches/corba/gsdl/src/recpt/nullproto.h	(revision 1509)
@@ -44,7 +44,5 @@
   // add_collectserver should be called for each collection server
   // before any configuration is done
-  void set_collectset(collectset *set)
-    { this->cset = set;
-    }
+  void set_collectset(collectset *set) { this->cset = set; }
 
   // this configure will configure each of the collection servers
@@ -53,4 +51,6 @@
   // this init will init each of the collection servers
   bool init (ostream &logout);
+
+  text_t get_site_name ();
 
   text_t get_protocol_name ();
Index: branches/corba/gsdl/src/recpt/pageaction.cpp
===================================================================
--- branches/corba/gsdl/src/recpt/pageaction.cpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/pageaction.cpp	(revision 1509)
@@ -28,4 +28,10 @@
 /*
    $Log$
+   Revision 1.29.2.1  2000/09/06 21:49:02  davidb
+
+   Improvements to corba implementation so images within a collection
+   are handled better and images in the remote site but not in the local
+   site are cached locally.
+
    Revision 1.29  2000/03/19 21:16:46  nzdl
    added german language interface
@@ -204,7 +210,9 @@
 	while (collist_here != collist_end) {
 	  
+	  text_t protocol_name = (*rprotolist_here).p->get_protocol_name ();
+
 	  ColInfoResponse_t cinfo;
 	  (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout);
-	  
+
 	  if (err == noError) {
 	    if (cinfo.isPublic && (cinfo.buildDate > 0)) {
@@ -217,18 +225,50 @@
 	      text_t collectionname = *collist_here;
 	      text_t alt = collectionname;
+
 	      if (get_info ("collection", *collist_here, metadata, false, 
 			    (*rprotolist_here).p, response, logout)) {
 		if (!response.docInfo[0].metadata["collectionname"].values[0].empty())
 		  alt = response.docInfo[0].metadata["collectionname"].values[0];
-		
+
+		text_t iconurl;
+		iconurl.clear();
+
 		if (!response.docInfo[0].metadata["iconcollectionsmall"].values[0].empty())
-		    collectionname = "<img width=150 border=1 src=\""
-		      + response.docInfo[0].metadata["iconcollectionsmall"].values[0]
-		      + "\" alt=\"" + alt + "\">";
+		  {
+		    iconurl = response.docInfo[0].metadata["iconcollectionsmall"].values[0];
+
+		  }
 		else if (!response.docInfo[0].metadata["iconcollection"].values[0].empty())
-		  collectionname = "<img width=150 border=1 src=\""
-		    + response.docInfo[0].metadata["iconcollection"].values[0]
-		    + "\" alt=\"" + alt + "\">";
-		else collectionname = alt;
+		  {
+		    iconurl = response.docInfo[0].metadata["iconcollection"].values[0];
+		  }
+
+		if (!iconurl.empty())
+		  {
+		    // check to see URL is local to colserver
+		    text_t::iterator iconurl_head = iconurl.begin();
+		    text_t iconhead = substr(iconurl_head,iconurl_head+16);
+		    if (iconhead=="_httpcollection_")
+		      {
+			// local and using _httpcollection_
+			text_t icontail = substr(iconurl_head+16,iconurl.end());
+			iconurl = "http://" + cinfo.httpdomain 
+			  + cinfo.httpprefix + "/collect/" 
+			  + *collist_here + "/" + icontail;
+		      }
+		    else if (iconurl[0]=='/')
+		      {
+			// local but with full path
+			iconurl = "http://" + cinfo.httpdomain + iconurl;
+		      }
+
+		    collectionname 
+		      = "<img width=150 border=1 src=\"" + iconurl + "\" alt=\"" + alt + "\">";
+		  }
+		else
+		  {
+		    collectionname = alt;
+		  }
+
 	      }
 		
@@ -246,9 +286,13 @@
 	      }
 	      
-	      text_t link = "<a href=\"_gwcgi_?a=p&p=about&c=" + *collist_here + "\">";
+	      text_t optsite = "";
+	      text_t site_name = (*rprotolist_here).p->get_site_name ();
+	      if (!site_name.empty()) { optsite = "site="+site_name+"&"; }
+
+	      text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + "\">";
 	      if (*collist_here == "chinese")
-		link = "<a href=\"_gwcgi_?a=p&p=about&l=zh&nw=u&c=" + *collist_here + "\">";
+		link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&l=zh&nw=u&c=" + *collist_here + "\">";
 	      if (*collist_here == "arabic")
-		link = "<a href=\"_gwcgi_?a=p&p=about&w=a&c=" + *collist_here + "\">";
+		link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&w=a&c=" + *collist_here + "\">";
 
 	      if (!cinfo.receptionist.empty()) 
@@ -266,10 +310,12 @@
 	  collist_here ++;
 	}
-	homeextra += "</tr></table></center>\n";
-	disp.setmacro ("homeextra", "home", homeextra); 
-      }
-    }
+      }
+    }
+    homeextra += "</td>";
     rprotolist_here ++;
   }
+  homeextra += "</tr></table></center>\n";
+  disp.setmacro ("homeextra", "home", homeextra); 
+
 }
 
Index: branches/corba/gsdl/src/recpt/queryaction.cpp
===================================================================
--- branches/corba/gsdl/src/recpt/queryaction.cpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/queryaction.cpp	(revision 1509)
@@ -28,4 +28,10 @@
 /*
    $Log$
+   Revision 1.36.2.1  2000/09/06 21:49:03  davidb
+
+   Improvements to corba implementation so images within a collection
+   are handled better and images in the remote site but not in the local
+   site are cached locally.
+
    Revision 1.36  2000/02/21 21:57:48  sjboddie
    actions are now configured with gsdlhome
@@ -648,8 +654,8 @@
       if (size>5&&args["hcl"]==1) { //compress the list, show the expand button
        
-      historylist += "<td><a href=\"_gwcgi_?e=_compressedoptions_&a=q&hcl=0\">_textexpand_</a></td>\n";
+      historylist += "<td><a href=\"_gwcgi_?_optsite_e=_compressedoptions_&a=q&hcl=0\">_textexpand_</a></td>\n";
       }
       else if (size >5 && args["hcl"]==0) { // expand the list, show contract button
-	historylist += "<td><a href=\"_gwcgi_?e=_compressedoptions_&a=q&hcl=1\">_textcontract_</a></td>\n";
+	historylist += "<td><a href=\"_gwcgi_?_optsite_e=_compressedoptions_&a=q&hcl=1\">_textcontract_</a></td>\n";
       }
       historylist += "</table>\n";
@@ -673,5 +679,5 @@
 	historylist += "<tr> <td width=40 align=center>"+c+"</td>\n";
 	historylist += "<td width=340 align=left>"+query+"</td><td width=60 align=center>"+numdocs+"</td>\n";
-	historylist += "<td width=60 align=center><a href=\"_gwcgi_?e=_compressedoptions_&";
+	historylist += "<td width=60 align=center><a href=\"_gwcgi_?_optsite_e=_compressedoptions_&";
 	historylist += *here+"\"><img name=\"display\" src=\"_httpicondisplay_\" width=_widthdisplay_ ";
 	historylist += "height=_heightdisplay_ border=\"0\" alt=\"" + userinfo +"\"></a></td></tr>\n";
@@ -714,4 +720,5 @@
 	  << "<form name=QueryForm method=get action=\"_gwcgi_\">\n"
 	  << "<input type=hidden name=a value=\"q\">\n"
+	  << "<input type=hidden name=site value=\"_cgiargsite_\">\n"
 	  << "<input type=hidden name=e value=\"_compressedoptions_\">\n"
 	  << "<input type=hidden name=ccp value=\"1\">\n"
Index: branches/corba/gsdl/src/recpt/receptionist.cpp
===================================================================
--- branches/corba/gsdl/src/recpt/receptionist.cpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/receptionist.cpp	(revision 1509)
@@ -28,4 +28,10 @@
 /*
    $Log$
+   Revision 1.47.2.1  2000/09/06 21:49:04  davidb
+
+   Improvements to corba implementation so images within a collection
+   are handled better and images in the remote site but not in the local
+   site are cached locally.
+
    Revision 1.47  2000/02/17 22:26:17  sjboddie
    set macros for displaying macrons in utf8
@@ -1230,4 +1236,20 @@
   disp.setmacro ("httpimg", "Global", configinfo.httpimg);
   disp.setmacro ("httpprefix", "Global", configinfo.httpprefix);
+
+  if (!collection.empty()) {
+    // DB // ****
+    ColInfoResponse_t cinfo;
+    comerror_t err;
+    recptproto *collectproto = protocols.getrecptproto (collection, logout);
+    if (collectproto != NULL) {
+      collectproto->get_collectinfo (collection, cinfo, err, logout);
+      text_t httpcollection 
+	= "http://" + cinfo.httpdomain + cinfo.httpprefix 
+        +"/collect/" + collection; 
+      
+      disp.setmacro ("httpcollection", "Global", httpcollection); 
+    }
+  }
+
   text_t compressedoptions = get_compressed_arg(args, logout);
   disp.setmacro ("compressedoptions", "Global", dm_safe(compressedoptions));
@@ -1296,5 +1318,21 @@
 	}
       }
-    }
-  }
-}
+
+      text_t iconcollection;
+      disp.expandstring ("Global", "_iconcollection_", iconcollection);
+      if (!iconcollection.empty())
+	{
+	  if (iconcollection[0]=='/')
+	    {
+	      // local but with full path
+	      ColInfoResponse_t cinfo;
+	      comerror_t err;
+	      collectproto->get_collectinfo (collection, cinfo, err, logout);
+	      iconcollection = "http://" + cinfo.httpdomain + iconcollection;
+	      disp.setmacro("iconcollection","Global",iconcollection);
+	    }
+	}
+    }
+  }
+}
+
Index: branches/corba/gsdl/src/recpt/recptconfig.cpp
===================================================================
--- branches/corba/gsdl/src/recpt/recptconfig.cpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/recptconfig.cpp	(revision 1509)
@@ -28,4 +28,10 @@
 /*
    $Log$
+   Revision 1.6.2.3  2000/09/06 21:49:05  davidb
+
+   Improvements to corba implementation so images within a collection
+   are handled better and images in the remote site but not in the local
+   site are cached locally.
+
    Revision 1.6.2.2  2000/04/06 11:11:40  cs025
    Corba improvements; tidied client initialisation in corbaproto and also
@@ -84,13 +90,20 @@
 private:
   text_t *gsdlhome;
+  text_t *httpdomain;
+  text_t *httpprefix;
   int    *maxrequests;
 public:
   __site_configuration (text_t *_gsdlhome, int *_maxrequests) {
     gsdlhome = _gsdlhome;
+    httpdomain = NULL;
+    httpprefix = NULL;
     maxrequests = _maxrequests;
   }
 
-  __site_configuration (text_t *_gsdlhome) {
+  __site_configuration (text_t *_gsdlhome, text_t *_httpdomain, 
+			text_t *_httpprefix) {
     gsdlhome    = _gsdlhome;
+    httpdomain = _httpdomain;
+    httpprefix = _httpprefix;
     maxrequests = NULL;
   }
@@ -99,4 +112,14 @@
     if (key == "gsdlhome") {
       *gsdlhome = cfgline[0];
+    }
+
+    if (key == "httpprefix" &&
+	httpprefix != NULL) {
+      *httpprefix = cfgline[0];
+    }
+
+    if (key == "httpdomain" &&
+	httpdomain != NULL) {
+      *httpdomain = cfgline[0];
     }
 
@@ -124,27 +147,5 @@
   // blank the gsdl home text
   gsdlhome.clear();
-
-  /*
-  // Look for gsdlsite.cfg in same directory that executable is in.
-  text_tarray cfgline;
-  text_t key;
-  ifstream confin ("gsdlsite.cfg");
-
-  if (confin) {
-    while (read_cfg_line(confin, cfgline) >= 0) {
-      if (cfgline.size () >= 2) {
-	key = cfgline[0];
-	cfgline.erase(cfgline.begin());
-
-	sitecfg.configure(key, cfgline);
-	// configure the receptionist
-	recpt.configure (key, cfgline);
-      }
-    }
-    confin.close ();
-
-    return true;
-  }
-  */
+  // also set  maxrequests to 0 ??
 
   if (gsdlconfigurator.configure("gsdlsite.cfg")) {
@@ -154,34 +155,21 @@
 }
 
-// this version just grabs gsdlhome, returns false if it can't find it
-bool site_cfg_read (text_t &gsdlhome) {
+// this version grabs gsdlhome, httpdomain and httpprefix, 
+// returns false if it can't find all of them
+bool site_cfg_read (text_t &gsdlhome, text_t &httpdomain, 
+		    text_t &httpprefix) {
   // get gsdlhome etc
-  __site_configuration sitecfg(&gsdlhome);
+  __site_configuration sitecfg(&gsdlhome,&httpdomain,&httpprefix);
   configurator gsdlconfigurator(&sitecfg);
 
   gsdlhome.clear();
+  httpdomain.clear();
+  httpprefix.clear();
 
   if (gsdlconfigurator.configure("gsdlsite.cfg") &&
-      !gsdlhome.empty()) {
+      !gsdlhome.empty() && !httpdomain.empty() && !httpprefix.empty()) {
     return true;
   }
-  /*
-  // Look for gsdlsite.cfg in same directory that executable is in.
-  text_tarray cfgline;
-  text_t key;
-  ifstream confin ("gsdlsite.cfg");
-
-  if (confin) {
-    while (read_cfg_line(confin, cfgline) >= 0) {
-      if (cfgline.size () >= 2) {
-	if (cfgline[0] == "gsdlhome") {
-	  gsdlhome = cfgline[1];
-	  return true;
-	}
-      }
-    }
-    confin.close ();
-  }
-  */
+
   return false;
 }
Index: branches/corba/gsdl/src/recpt/recptconfig.h
===================================================================
--- branches/corba/gsdl/src/recpt/recptconfig.h	(revision 1087)
+++ branches/corba/gsdl/src/recpt/recptconfig.h	(revision 1509)
@@ -39,5 +39,5 @@
 // reads site configuration file returning true on success
 bool site_cfg_read (receptionist &recpt, text_t &gsdlhome, int &maxrequests);
-bool site_cfg_read (text_t &gsdlhome);
+bool site_cfg_read (text_t &gsdlhome, text_t &httpdomain, text_t &httpprefix);
 
 // main_cfg_read reads either collect.cfg or main.cfg and returning 
Index: branches/corba/gsdl/src/recpt/recptproto.cpp
===================================================================
--- branches/corba/gsdl/src/recpt/recptproto.cpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/recptproto.cpp	(revision 1509)
@@ -28,4 +28,10 @@
 /*
    $Log$
+   Revision 1.7.2.1  2000/09/06 21:49:06  davidb
+
+   Improvements to corba implementation so images within a collection
+   are handled better and images in the remote site but not in the local
+   site are cached locally.
+
    Revision 1.7  1999/09/07 04:56:59  sjboddie
    added GPL notice
@@ -69,4 +75,12 @@
 bool recptproto::init (ostream &/*logout*/) {
   return true;
+}
+
+// get_site_name should return the name of the site used.
+// This is trivially empty in the case of a null protocol.  If a remote 
+// connection to a site is being used then this should return the name 
+// used to label a site. 
+text_t recptproto::get_site_name () {
+  return "";
 }
 
Index: branches/corba/gsdl/src/recpt/recptproto.h
===================================================================
--- branches/corba/gsdl/src/recpt/recptproto.h	(revision 1087)
+++ branches/corba/gsdl/src/recpt/recptproto.h	(revision 1509)
@@ -62,4 +62,10 @@
   // out to the log file and no other output should be produced.
   virtual bool init (ostream &logout);
+
+  // get_site_name should return the name of the site used.
+  // This is trivially empty in the case of a null protocol.  If a remote 
+  // connection to a site is being used then this should return the name 
+  // used to label a site. 
+  virtual text_t get_site_name ();
 
   // get_protocol_name should return the name of this protocol (e.g. recptproto)
Index: branches/corba/gsdl/src/recpt/statusaction.cpp
===================================================================
--- branches/corba/gsdl/src/recpt/statusaction.cpp	(revision 1087)
+++ branches/corba/gsdl/src/recpt/statusaction.cpp	(revision 1509)
@@ -28,4 +28,10 @@
 /*
    $Log$
+   Revision 1.25.2.1  2000/09/06 21:49:07  davidb
+
+   Improvements to corba implementation so images within a collection
+   are handled better and images in the remote site but not in the local
+   site are cached locally.
+
    Revision 1.25  2000/02/29 21:00:31  sjboddie
    fixed some compiler warnings
@@ -443,5 +449,5 @@
 	  } else {
 	    textout << outconvert << disp
-		    << "\"<a href=\"_gwcgi_?e=_compressedoptions_&a=status&sp=collectioninfo&pr="
+		    << "\"<a href=\"_gwcgi_?_optsite_e=_compressedoptions_&a=status&sp=collectioninfo&pr="
 		    << protoname
 		    << "&c="
