Index: /gsdl/trunk/lib/Makefile.in
===================================================================
--- /gsdl/trunk/lib/Makefile.in	(revision 15401)
+++ /gsdl/trunk/lib/Makefile.in	(revision 15402)
@@ -89,18 +89,21 @@
 
 HEADERS = \
-  cfgread.h      fileutil.h     gsdlunicode.h  gsdltools.h text_t.h \
-  display.h      gsdlconf.h     gsdltimes.h    cnfgable.h  cnfgator.h \
-  phrases.h md5.h $(CORBAHEADERS)
+  cfgread.h        cnfgable.h       cnfgator.h     display.h \
+  fileutil.h       gsdlsitecfg.h    gsdltimes.h    gsdltools.h \
+  gsdlunicode.h    md5.h            phrases.h      text_t.h \
+  $(CORBAHEADERS)  gsdlconf.h
 
 
 SOURCES = \
-  cfgread.cpp      fileutil.cpp     text_t.cpp     cnfgable.cpp \
-  display.cpp      gsdlunicode.cpp  gsdltimes.cpp  gsdltools.cpp \
-  cnfgator.cpp     phrases.cpp  md5.cpp $(CORBASOURCES)
+  cfgread.cpp      cnfgable.cpp     cnfgator.cpp   display.cpp \
+  fileutil.cpp     gsdlsitecfg.cpp  gsdltimes.cpp  gsdltools.cpp \
+  gsdlunicode.cpp  md5.cpp          phrases.cpp    text_t.cpp \
+  $(CORBASOURCES)
 
 OBJECTS = \
-  cfgread.o        fileutil.o       text_t.o     cnfgable.o \
-  display.o        gsdlunicode.o    gsdltimes.o  gsdltools.o \
-  cnfgator.o       phrases.o    md5.o $(CORBAOBJECTS)
+  cfgread.o        cnfgable.o       cnfgator.o     display.o \
+  fileutil.o       gsdlsitecfg.o    gsdltimes.o    gsdltools.o \
+  gsdlunicode.o    md5.o            phrases.o      text_t.o \
+  $(CORBAOBJECTS)
 
 
Index: /gsdl/trunk/lib/gsdlsitecfg.cpp
===================================================================
--- /gsdl/trunk/lib/gsdlsitecfg.cpp	(revision 15402)
+++ /gsdl/trunk/lib/gsdlsitecfg.cpp	(revision 15402)
@@ -0,0 +1,203 @@
+/**********************************************************************
+ *
+ * gsdlsitecfg.cpp -- 
+ * Copyright (C) 2008  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+
+#include "gsdlsitecfg.h"
+
+#if defined(GSDL_USE_OBJECTSPACE)
+#  include <ospace/std/iostream>
+#  include <ospace/std/fstream>
+#elif defined(GSDL_USE_IOS_H)
+#  include <iostream.h>
+#  include <fstream.h>
+#else
+#  include <iostream>
+#  include <fstream>
+#endif
+
+
+class __site_configuration : public configurable {
+private:
+  text_t *gsdlhome;
+  text_t *httpdomain;
+  text_t *httpprefix;
+  text_t *collection;
+  text_tset *actions;
+  text_tset *browsers;
+  int    *maxrequests;
+public:
+  __site_configuration (text_t *_gsdlhome, int *_maxrequests) {
+    gsdlhome = _gsdlhome;
+    httpdomain = NULL;
+    httpprefix = NULL;
+    collection = NULL;
+    actions = NULL;
+    browsers = NULL;
+    maxrequests = _maxrequests;
+  }
+
+  __site_configuration (text_t *_gsdlhome, text_t *_httpdomain,
+                        text_t *_httpprefix) {
+    gsdlhome    = _gsdlhome;
+    httpdomain = _httpdomain;
+    httpprefix = _httpprefix;
+    collection = NULL;
+    actions = NULL;
+    browsers = NULL;
+    maxrequests = NULL;
+  }
+
+  __site_configuration (text_t *_gsdlhome, text_t *_httpdomain,
+			text_t *_httpprefix, text_t *_collection) {
+    gsdlhome    = _gsdlhome;
+    httpdomain = _httpdomain;
+    httpprefix = _httpprefix;
+    collection = _collection;
+    actions = NULL;
+    browsers = NULL;
+    maxrequests = NULL;
+  }
+
+  __site_configuration (text_t *_httpprefix, text_tset *_actions, text_tset *_browsers) {
+    gsdlhome    = NULL;
+    httpdomain = NULL;
+    httpprefix = _httpprefix;
+    collection = NULL;
+    actions = _actions;
+    browsers = _browsers;
+    maxrequests = NULL;
+  }
+
+  inline void configure (const text_t &key, const text_tarray &cfgline) {
+    if (gsdlhome != NULL && key == "gsdlhome") {
+      *gsdlhome = cfgline[0];
+    }
+
+    if (httpprefix != NULL && key == "httpprefix") {
+      *httpprefix = cfgline[0];
+    }
+
+    if (httpdomain != NULL && key == "httpdomain") {
+      *httpdomain = cfgline[0];
+    }
+
+    if (collection != NULL && key == "collection") {
+      *collection = cfgline[0];
+    } 
+
+    if (actions != NULL && key == "actions") {
+      actions->clear();
+      text_tarray::const_iterator thisAction = cfgline.begin();
+      text_tarray::const_iterator endAction = cfgline.end();
+      while (thisAction != endAction) {
+	actions->insert(*thisAction);
+	++thisAction;
+      }
+    } 
+
+    if (browsers != NULL && key == "browsers") {
+      browsers->clear();
+      text_tarray::const_iterator thisBrowser = cfgline.begin();
+      text_tarray::const_iterator endBrowser = cfgline.end();
+      while (thisBrowser != endBrowser) {
+	browsers->insert(*thisBrowser);
+	++thisBrowser;
+      }
+    }
+
+    if (maxrequests != NULL && key == "maxrequests") {
+      *maxrequests = cfgline[0].getint();
+      if ((*maxrequests) < 1) {
+	*maxrequests = 1;
+      }
+    }
+  }
+};
+
+
+// reads site configuration file returning true on success
+// also sets gsdlhome and maxrequests 
+// gsdlsite.cfg should be in same directory as library executable
+bool site_cfg_read (configurator gsdlconfigurator, text_t &gsdlhome, int &maxrequests)
+{
+  __site_configuration sitecfg(&gsdlhome, &maxrequests);
+  gsdlconfigurator.add_configurable(&sitecfg);
+
+  // blank the gsdl home text
+  gsdlhome.clear();
+
+  if (gsdlconfigurator.configure("gsdlsite.cfg"))
+  {
+    return true;
+  }
+
+  return false;
+}
+
+
+// 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, &httpdomain, &httpprefix);
+  configurator gsdlconfigurator(&sitecfg);
+
+  gsdlhome.clear();
+  httpdomain.clear();
+  httpprefix.clear();
+
+  if (gsdlconfigurator.configure("gsdlsite.cfg"))
+  {
+    return true;
+  }
+
+  return false;
+}
+
+
+// this version grabs gsdlhome, httpdomain, httpprefix, collection, 
+// returns false if it can't find gsdlhome, httpdomain and httpprefix
+bool site_cfg_read (text_t &gsdlhome, text_t &httpdomain, 
+		    text_t &httpprefix, text_t &collection)
+{
+  // get gsdlhome etc
+  __site_configuration sitecfg(&gsdlhome, &httpdomain, &httpprefix, &collection);
+  configurator gsdlconfigurator(&sitecfg);
+	
+  gsdlhome.clear();
+  httpdomain.clear();
+  httpprefix.clear();
+  collection.clear();
+	
+  if (gsdlconfigurator.configure("gsdlsite.cfg") &&
+      !gsdlhome.empty() && !httpdomain.empty() && !httpprefix.empty())
+  {
+    return true;
+  }	
+
+  return false;
+}
Index: /gsdl/trunk/lib/gsdlsitecfg.h
===================================================================
--- /gsdl/trunk/lib/gsdlsitecfg.h	(revision 15402)
+++ /gsdl/trunk/lib/gsdlsitecfg.h	(revision 15402)
@@ -0,0 +1,41 @@
+/**********************************************************************
+ *
+ * gsdlsitecfg.h -- 
+ * Copyright (C) 2008  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+
+#ifndef GSDLSITECFG_H
+#define GSDLSITECFG_H
+
+
+#include "cnfgator.h"
+#include "text_t.h"
+
+
+// reads gsdlsite.cfg file returning true on success
+bool site_cfg_read (configurator gsdlconfigurator, text_t &gsdlhome, int &maxrequests);
+bool site_cfg_read (text_t &gsdlhome, text_t &httpdomain, text_t &httpprefix);
+bool site_cfg_read (text_t &gsdlhome, text_t &httpdomain, text_t &httpprefix, text_t &collection);
+
+
+#endif
Index: /gsdl/trunk/src/colservr/collectset.cpp
===================================================================
--- /gsdl/trunk/src/colservr/collectset.cpp	(revision 15401)
+++ /gsdl/trunk/src/colservr/collectset.cpp	(revision 15402)
@@ -25,5 +25,8 @@
 
 
+#include "collectset.h"
 #include "collectserver.h"
+#include "colservrconfig.h"
+#include "gsdlsitecfg.h"
 #include "filter.h"
 #include "browsefilter.h"
@@ -39,8 +42,4 @@
 #include <assert.h>
 
-#include "colservrconfig.h"
-#include "recptconfig.h"
-#include "fileutil.h"
-#include "collectset.h"
 
 collectset::collectset (text_t &gsdlhome) {
Index: /gsdl/trunk/src/recpt/Makefile.in
===================================================================
--- /gsdl/trunk/src/recpt/Makefile.in	(revision 15401)
+++ /gsdl/trunk/src/recpt/Makefile.in	(revision 15402)
@@ -158,5 +158,5 @@
 
 COMMONHEADERS = receptionist.h cgiwrapper.h cgiargs.h action.h browserclass.h \
-                converter.h recptconfig.h cgiutils.h OIDtools.h browsetoolsclass.h \
+                converter.h maincfg.h cgiutils.h OIDtools.h browsetoolsclass.h \
 		statusaction.h pageaction.h comtypes.h recptproto.h \
 		pingaction.h queryaction.h documentaction.h  \
@@ -180,5 +180,5 @@
 
 COMMONSOURCES = receptionist.cpp cgiwrapper.cpp cgiargs.cpp action.cpp browserclass.cpp \
-                converter.cpp recptconfig.cpp cgiutils.cpp OIDtools.cpp browsetoolsclass.cpp \
+                converter.cpp maincfg.cpp cgiutils.cpp OIDtools.cpp browsetoolsclass.cpp \
 		statusaction.cpp pageaction.cpp comtypes.cpp  \
 		recptproto.cpp pingaction.cpp queryaction.cpp documentaction.cpp \
@@ -213,5 +213,5 @@
 
 COMMONOBJECTS = receptionist.o cgiwrapper.o cgiargs.o action.o browserclass.o \
-                converter.o recptconfig.o cgiutils.o OIDtools.o browsetoolsclass.o \
+                converter.o maincfg.o cgiutils.o OIDtools.o browsetoolsclass.o \
 		statusaction.o pageaction.o comtypes.o \
 		recptproto.o pingaction.o queryaction.o documentaction.o \
@@ -393,5 +393,5 @@
 test:
 
-Z3950_OBJS = comtypes.o recptproto.o infodbclass.o OIDtools.o recptconfig.o \
+Z3950_OBJS = comtypes.o recptproto.o infodbclass.o OIDtools.o maincfg.o \
 	 $(COLSERVROBJECTS) \
     ../colservr/z3950parser.o ../colservr/z3950explain.o \
Index: /gsdl/trunk/src/recpt/cgiwrapper.cpp
===================================================================
--- /gsdl/trunk/src/recpt/cgiwrapper.cpp	(revision 15401)
+++ /gsdl/trunk/src/recpt/cgiwrapper.cpp	(revision 15402)
@@ -31,5 +31,6 @@
 #include "gsdlconf.h"
 #include "cgiwrapper.h"
-#include "recptconfig.h"
+#include "gsdlsitecfg.h"
+#include "maincfg.h"
 #include "fileutil.h"
 #include "cgiutils.h"
@@ -482,5 +483,6 @@
   // read in the configuration files.
   text_t gsdlhome;
-  if (!site_cfg_read (recpt, gsdlhome, maxrequests)) {
+  configurator gsdlconfigurator(&recpt);
+  if (!site_cfg_read (gsdlconfigurator, gsdlhome, maxrequests)) {
     // couldn't find the site configuration file
     page_errorsitecfg (errorpage, debug, 0);
Index: /gsdl/trunk/src/recpt/librarymain.cpp
===================================================================
--- /gsdl/trunk/src/recpt/librarymain.cpp	(revision 15401)
+++ /gsdl/trunk/src/recpt/librarymain.cpp	(revision 15402)
@@ -27,5 +27,4 @@
 #include "receptionist.h"
 #include "cgiwrapper.h"
-#include "recptconfig.h"
 #include "fileutil.h"
 #include "nullproto.h"
Index: /gsdl/trunk/src/recpt/maincfg.cpp
===================================================================
--- /gsdl/trunk/src/recpt/maincfg.cpp	(revision 15402)
+++ /gsdl/trunk/src/recpt/maincfg.cpp	(revision 15402)
@@ -0,0 +1,82 @@
+/**********************************************************************
+ *
+ * maincfg.cpp -- 
+ * Copyright (C) 2008  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+#include "maincfg.h"
+#include "fileutil.h"
+
+
+#if defined(GSDL_USE_OBJECTSPACE)
+#  include <ospace/std/iostream>
+#  include <ospace/std/fstream>
+#elif defined(GSDL_USE_IOS_H)
+#  include <iostream.h>
+#  include <fstream.h>
+#else
+#  include <iostream>
+#  include <fstream>
+#endif
+
+
+// main_cfg_read reads both main.cfg and collect.cfg. It attempts
+// to read main.cfg first so values in collect.cfg override those
+// set earlier by main.cfg
+bool main_cfg_read (receptionist &recpt, const text_t &gsdlhome,
+		     const text_t &collection) {
+
+  // read in the main configuration file
+  bool rv = false;
+
+  text_t key, filename;
+  text_tarray cfgline;
+  filename = filename_cat (gsdlhome, "etc");
+  filename = filename_cat (filename, "main.cfg");
+  if (!collection.empty() && file_exists(filename)) {
+    rv = recpt.read_configfile(filename);
+  } else {
+    filename_cat (filename, gsdlhome, "etc", "main.cfg");
+    if (file_exists (filename)) {
+      rv = recpt.read_configfile(filename);
+    }
+  }
+
+  // Look for collect.cfg in GSDLHOME/collect/collection-name/etc directory 
+  // (if this is for a particular collection), and then GSDLHOME/etc.
+  if (!collection.empty()) {
+    filename = filename_cat (gsdlhome, "collect");
+    filename = filename_cat (filename, collection);
+    filename = filename_cat (filename, "etc");
+    filename = filename_cat (filename, "collect.cfg");
+    if (!file_exists (filename)) {
+      filename = filename_cat (gsdlhome, "etc");
+      filename = filename_cat (filename, "collect.cfg");
+      if (!file_exists (filename)) filename.clear();
+    }
+
+    if (!filename.empty()) {
+      rv |= recpt.read_configfile(filename);
+    }
+  }
+  return rv;
+}
Index: /gsdl/trunk/src/recpt/maincfg.h
===================================================================
--- /gsdl/trunk/src/recpt/maincfg.h	(revision 15402)
+++ /gsdl/trunk/src/recpt/maincfg.h	(revision 15402)
@@ -0,0 +1,45 @@
+/**********************************************************************
+ *
+ * maincfg.h -- 
+ * Copyright (C) 2008  The New Zealand Digital Library Project
+ *
+ * A component of the Greenstone digital library software
+ * from the New Zealand Digital Library Project at the
+ * University of Waikato, New Zealand.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ *
+ *********************************************************************/
+
+
+#ifndef MAINCFG_H
+#define MAINCFG_H
+
+
+#include "text_t.h"
+#include "receptionist.h"
+
+
+// read main.cfg for the actions and httpprefix
+void main_cfg_read (const text_t& collection, const text_t &gsdlhome, text_t &httpprefix, text_tset& actions, text_tset& browsers);
+
+// main_cfg_read reads either collect.cfg or main.cfg and returning 
+// true on success. It attempts to read collect.cfg first if a
+// collection is specified and then it tries to read in main.cfg
+bool main_cfg_read (receptionist &recpt, const text_t &gsdlhome,
+		    const text_t &collection);
+
+
+#endif
Index: dl/trunk/src/recpt/recptconfig.cpp
===================================================================
--- /gsdl/trunk/src/recpt/recptconfig.cpp	(revision 15401)
+++ 	(revision )
@@ -1,273 +1,0 @@
-/**********************************************************************
- *
- * recptconfig.cpp -- 
- * Copyright (C) 1999  The New Zealand Digital Library Project
- *
- * A component of the Greenstone digital library software
- * from the New Zealand Digital Library Project at the
- * University of Waikato, New Zealand.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *********************************************************************/
-
-#include "recptconfig.h"
-#include "fileutil.h"
-#include "cfgread.h"
-#include "cnfgator.h"
-
-
-#if defined(GSDL_USE_OBJECTSPACE)
-#  include <ospace/std/iostream>
-#  include <ospace/std/fstream>
-#elif defined(GSDL_USE_IOS_H)
-#  include <iostream.h>
-#  include <fstream.h>
-#else
-#  include <iostream>
-#  include <fstream>
-#endif
-
-class __site_configuration : public configurable {
-private:
-  text_t *gsdlhome;
-  text_t *httpdomain;
-  text_t *httpprefix;
-  text_t *collection;
-  text_tset *actions;
-  text_tset *browsers;
-  int    *maxrequests;
-public:
-  __site_configuration (text_t *_gsdlhome, int *_maxrequests) {
-    gsdlhome = _gsdlhome;
-    httpdomain = NULL;
-    httpprefix = NULL;
-    collection = NULL;
-    actions = NULL;
-    browsers = NULL;
-    maxrequests = _maxrequests;
-  }
-
-  __site_configuration (text_t *_gsdlhome, text_t *_httpdomain,
-                        text_t *_httpprefix) {
-    gsdlhome    = _gsdlhome;
-    httpdomain = _httpdomain;
-    httpprefix = _httpprefix;
-    collection = NULL;
-    actions = NULL;
-    browsers = NULL;
-    maxrequests = NULL;
-  }
-
-  __site_configuration (text_t *_gsdlhome, text_t *_httpdomain,
-			text_t *_httpprefix, text_t *_collection) {
-    gsdlhome    = _gsdlhome;
-    httpdomain = _httpdomain;
-    httpprefix = _httpprefix;
-    collection = _collection;
-    actions = NULL;
-    browsers = NULL;
-    maxrequests = NULL;
-  }
-
-  __site_configuration (text_t *_httpprefix, text_tset *_actions, text_tset *_browsers) {
-    gsdlhome    = NULL;
-    httpdomain = NULL;
-    httpprefix = _httpprefix;
-    collection = NULL;
-    actions = _actions;
-    browsers = _browsers;
-    maxrequests = NULL;
-  }
-
-  inline void configure (const text_t &key, const text_tarray &cfgline) {
-    if (gsdlhome != NULL && key == "gsdlhome") {
-      *gsdlhome = cfgline[0];
-    }
-
-    if (httpprefix != NULL && key == "httpprefix") {
-      *httpprefix = cfgline[0];
-    }
-
-    if (httpdomain != NULL && key == "httpdomain") {
-      *httpdomain = cfgline[0];
-    }
-
-    if (collection != NULL && key == "collection") {
-      *collection = cfgline[0];
-    } 
-
-    if (actions != NULL && key == "actions") {
-      actions->clear();
-      text_tarray::const_iterator thisAction = cfgline.begin();
-      text_tarray::const_iterator endAction = cfgline.end();
-      while (thisAction != endAction) {
-	actions->insert(*thisAction);
-	++thisAction;
-      }
-    } 
-
-    if (browsers != NULL && key == "browsers") {
-      browsers->clear();
-      text_tarray::const_iterator thisBrowser = cfgline.begin();
-      text_tarray::const_iterator endBrowser = cfgline.end();
-      while (thisBrowser != endBrowser) {
-	browsers->insert(*thisBrowser);
-	++thisBrowser;
-      }
-    }
-
-    if (maxrequests != NULL && key == "maxrequests") {
-      *maxrequests = cfgline[0].getint();
-      if ((*maxrequests) < 1) {
-	*maxrequests = 1;
-      }
-    }
-  }
-};
-
-
-// reads site configuration file returning true on success
-// also sets gsdlhome and maxrequests 
-// gsdlsite.cfg should be in same directory as library executable
-bool site_cfg_read (receptionist &recpt, text_t &gsdlhome, int &maxrequests) {
-  // initialise configurator, etc.
-  __site_configuration sitecfg (&gsdlhome, &maxrequests);
-  configurator         gsdlconfigurator(&recpt);
-
-  gsdlconfigurator.add_configurable(&sitecfg);
-
-  // blank the gsdl home text
-  gsdlhome.clear();
-
-  if (gsdlconfigurator.configure("gsdlsite.cfg")) {
-    return true;
-  }
-  return false;
-}
-
-// 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, &httpdomain, &httpprefix);
-  configurator gsdlconfigurator(&sitecfg);
-
-  gsdlhome.clear();
-  httpdomain.clear();
-  httpprefix.clear();
-
-  if (gsdlconfigurator.configure("gsdlsite.cfg")) {
-    return true;
-  }
-
-  return false;
-}
-
-// this version grabs gsdlhome, httpdomain, httpprefix, collection, 
-// returns false if it can't find gsdlhome, httpdomain and httpprefix
-bool site_cfg_read (text_t &gsdlhome, text_t &httpdomain, 
-		    text_t &httpprefix, text_t &collection) {
-  // get gsdlhome etc
-  __site_configuration sitecfg(&gsdlhome, &httpdomain, &httpprefix, &collection);
-  configurator gsdlconfigurator(&sitecfg);
-	
-  gsdlhome.clear();
-  httpdomain.clear();
-  httpprefix.clear();
-  collection.clear();
-	
-  if (gsdlconfigurator.configure("gsdlsite.cfg") &&
-      !gsdlhome.empty() && !httpdomain.empty() && !httpprefix.empty()) {
-    return true;
-  }	
-  return false;
-}
-
-void main_cfg_read (const text_t& collection, const text_t &gsdlhome, text_t &httpprefix, text_tset& actions, text_tset& browsers)
-{
-  __site_configuration sitecfg(&httpprefix, &actions, &browsers);
-  configurator gsdlconfigurator(&sitecfg);
-	
-  httpprefix.clear();
-  actions.clear();
-  browsers.clear();
-
-  text_t filename;
-	
-  filename_cat (filename, gsdlhome, "collect", collection, "etc", "main.cfg");
-  if (!file_exists(filename)) {
-    filename_cat (filename, gsdlhome, "etc", "main.cfg");
-    if (!file_exists (filename)) {
-      filename.clear();
-    }
-  }
-	
-  if (!filename.empty()) gsdlconfigurator.configure(filename);
-
-
-  if (!collection.empty()) {
-    filename_cat (filename, gsdlhome, "collect", collection, "etc", "collect.cfg");
-    if (!file_exists (filename)) {
-      filename_cat (filename, gsdlhome, "etc", "collect.cfg");
-      if (!file_exists (filename)) filename.clear();
-    }
-		
-    if (!filename.empty()) gsdlconfigurator.configure(filename);
-  }
-}
-
-// main_cfg_read reads both main.cfg and collect.cfg. It attempts
-// to read main.cfg first so values in collect.cfg override those
-// set earlier by main.cfg
-bool main_cfg_read (receptionist &recpt, const text_t &gsdlhome,
-		     const text_t &collection) {
-
-  // read in the main configuration file
-  bool rv = false;
-
-  text_t key, filename;
-  text_tarray cfgline;
-  filename = filename_cat (gsdlhome, "etc");
-  filename = filename_cat (filename, "main.cfg");
-  if (!collection.empty() && file_exists(filename)) {
-    rv = recpt.read_configfile(filename);
-  } else {
-    filename_cat (filename, gsdlhome, "etc", "main.cfg");
-    if (file_exists (filename)) {
-      rv = recpt.read_configfile(filename);
-    }
-  }
-
-  // Look for collect.cfg in GSDLHOME/collect/collection-name/etc directory 
-  // (if this is for a particular collection), and then GSDLHOME/etc.
-  if (!collection.empty()) {
-    filename = filename_cat (gsdlhome, "collect");
-    filename = filename_cat (filename, collection);
-    filename = filename_cat (filename, "etc");
-    filename = filename_cat (filename, "collect.cfg");
-    if (!file_exists (filename)) {
-      filename = filename_cat (gsdlhome, "etc");
-      filename = filename_cat (filename, "collect.cfg");
-      if (!file_exists (filename)) filename.clear();
-    }
-
-    if (!filename.empty()) {
-      rv |= recpt.read_configfile(filename);
-    }
-  }
-  return rv;
-}
Index: dl/trunk/src/recpt/recptconfig.h
===================================================================
--- /gsdl/trunk/src/recpt/recptconfig.h	(revision 15401)
+++ 	(revision )
@@ -1,52 +1,0 @@
-/**********************************************************************
- *
- * recptconfig.h -- 
- * Copyright (C) 1999  The New Zealand Digital Library Project
- *
- * A component of the Greenstone digital library software
- * from the New Zealand Digital Library Project at the
- * University of Waikato, New Zealand.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- *********************************************************************/
-
-
-#ifndef RECPTCONFIG_H
-#define RECPTCONFIG_H
-
-
-#include "gsdlconf.h"
-#include "text_t.h"
-#include "receptionist.h"
-#include "collectset.h"
-
-
-// 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, text_t &httpdomain, text_t &httpprefix);
-bool site_cfg_read (text_t &gsdlhome, text_t &httpdomain, text_t &httpprefix, text_t &collection);
-
-// read main.cfg for the actions and httpprefix
-void main_cfg_read (const text_t& collection, const text_t &gsdlhome, text_t &httpprefix, text_tset& actions, text_tset& browsers);
-
-// main_cfg_read reads either collect.cfg or main.cfg and returning 
-// true on success. It attempts to read collect.cfg first if a
-// collection is specified and then it tries to read in main.cfg
-bool main_cfg_read (receptionist &recpt, const text_t &gsdlhome,
-		    const text_t &collection);
-
-
-#endif
