Index: /main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.cpp
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.cpp	(revision 22211)
+++ /main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.cpp	(revision 22212)
@@ -218,139 +218,59 @@
     }
   }
-  else if (key == "oaisetname" && cfgline.size() == 2) {
-    this->setNameMap[cfgline[0]] = cfgline[1];
-  }
-  else if (key == "oaisetdescription" && cfgline.size() == 2) {
-    this->setDescriptionMap[cfgline[0]] = cfgline[1];
-  }
-  else if (key == "oaiversion" && cfgline.size() >= 1) {
-    this->oaiVersion = cfgline[0];
-  }
+  else if ( key == "oaisetname" || key == "oaisetdescription") { 
+    text_t coll_name;
+    text_t value = "";
+    if (this->collection != "") {
+      // we are in collect.cfg
+      coll_name = this->collection;
+      if (cfgline.size() == 1) {
+	// just the collection value
+	value = cfgline[0];
+      }
+      else if (cfgline.size() == 2) {
+	// we have a subset name (eg for classifier)
+	coll_name.append(":");
+	coll_name.append(cfgline[0]);
+	value = cfgline[1];
+      }
+    } else if (cfgline.size() == 2) {
+      // oai.cfg, line should be collname, setName
+      coll_name = cfgline[0];
+      value = cfgline[1];
+    }
+    if (value != "") {
+      if (this->collectMap[coll_name] == NULL) {
+	this->collectMap[coll_name] = new oaicollectconfig(coll_name);
+      }
+      if (key == "oaisetname") {
+	this->collectMap[coll_name]->setName = value;
+      } else if (key == "oaisetdescription") {
+	this->collectMap[coll_name]->setDescription = value;
+      }
+    }
+  }
+
   else if (key == "resumeafter" && cfgline.size() >= 1) {
     this->resumptionSize = cfgline[0].getint();
   }
-  // get and note a maintainer item to support the Identify Verb of OAI
-  else if (key == "maintainer" && cfgline.size() >= 1) {
-    int line = 0;
-    
-    // TODO: exhaustive checks for empty or default values of maintainer
-    while (line < cfgline.size()) {
-      if (cfgline[line] != "NULL" &&
-	  cfgline[line] != "") {
-	// do something
-	break;
-      }
-      else {
-	++line;
-      }
-    }
-    
-    // Only try to set the configuration if we have a legitimate value ...
-    if (line < cfgline.size()) {
-      // ensure we have a map to write to
-      if (this->collectMap[this->collection] == NULL) {
-	this->collectMap[this->collection] = new oaicollectconfig(this->collection);
-      }
-      this->collectMap[this->collection]->maintainer = cfgline[line];
-    }
-  }
-  else if (key == "repositoryName" && cfgline.size() >= 1) {
-    int line = 0;
-    
-    // TODO: exhaustive checks for empty or default values of repositoryName
-    while (line < cfgline.size()) {
-      if (cfgline[line] != "NULL" &&
-	  cfgline[line] != "") {
-	// do something
-	break;
-      }
-      else {
-	++line;
-      }
-    }
-    
-    // Only try to set the configuration if we have a legitimate value ...
-    if (line < cfgline.size()) {
-      // ensure we have a map to write to
-      if (this->collectMap[this->collection] == NULL) {
-	this->collectMap[this->collection] = new oaicollectconfig(this->collection);
-      }
-      this->collectMap[this->collection]->repositoryName = cfgline[line];
-    }
-  }
-  else if (key == "baseURL" && cfgline.size() >= 1) {
-    int line = 0;
-    
-    while (line < cfgline.size()) {
-      if (cfgline[line] != "NULL" &&
-	  cfgline[line] != "") {
-	// do something
-	break;
-      }
-      else {
-	++line;
-      }
-    }
-    
-    // Only try to set the configuration if we have a legitimate value ...
-    if (line < cfgline.size()) {
-      // ensure we have a map to write to
-      if (this->collectMap[this->collection] == NULL) {
-	this->collectMap[this->collection] = new oaicollectconfig(this->collection);
-      }
-      this->collectMap[this->collection]->baseURL = cfgline[line];
-    }
-  }
-  else if (key == "baseDocRoot" && cfgline.size() >= 1) {
-    int line = 0;
-    
-    while (line < cfgline.size()) {
-      if (cfgline[line] != "NULL" &&
-	  cfgline[line] != "") {
-	// do something
-	break;
-      }
-      else {
-	++line;
-      }
-    }
-    
-    // Only try to set the configuration if we have a legitimate value ...
-    if (line < cfgline.size()) {
-      // ensure we have a map to write to
-      if (this->collectMap[this->collection] == NULL) {
-	this->collectMap[this->collection] = new oaicollectconfig(this->collection);
-      }
-      this->collectMap[this->collection]->baseDocRoot = cfgline[line];
-    }
-  }
-}
-
-/** 
- *  TODO: store all field values in a map per collection
- */
-text_t oaiconfig::getCollectionConfig(const text_t &collection, const text_t &field)
-{
-  if (this->collectMap[collection] == NULL) {
-    return "";
-  }
-  if (field == "maintainer") {
-    return this->collectMap[collection]->maintainer;
-  }
-
-  if (field == "repositoryName") {
-    return this->collectMap[collection]->repositoryName;
-  }
-
-  if (field == "baseURL") {
-    return this->collectMap[collection]->baseURL;
-  }
-
-  if (field == "baseDocRoot") {
-    return this->collectMap[collection]->baseDocRoot;
-  }
-
-  return "";
-}
+
+  else if (key == "maintainer") {
+    this->maintainer = cfgline[0];
+  }
+  else if (key == "repositoryName") {
+    this->repositoryName = cfgline[0];
+  }
+  else if (key == "baseURL") {
+    this->baseURL = cfgline[0];
+  } 
+  else if (key == "baseLibraryURL") {
+    this->baseLibraryURL = cfgline[0];
+  }
+  else if (key == "baseDocRoot") {
+    this->baseDocRoot = cfgline[0];
+  }
+  
+}
+
 
 text_t oaiconfig::getMapping(const text_t &collection, const text_t &collectfield)
@@ -398,23 +318,41 @@
 }
 
-
+text_t oaiconfig::getBaseURL()
+{
+  return this->baseURL;
+}
+text_t oaiconfig::getBaseLibraryURL()
+{
+  return this->baseLibraryURL;
+}
+text_t oaiconfig::getBaseDocRoot()
+{
+  return this->baseDocRoot;
+}
+text_t oaiconfig::getRepositoryName()
+{
+  return this->repositoryName;
+}
+text_t oaiconfig::getMaintainer()
+{
+  return this->maintainer;
+}
 text_t oaiconfig::getSetName(const text_t &setSpec)
 {
-  if (setNameMap.find(setSpec) != setNameMap.end())
-  {
-    return setNameMap[setSpec];
-  }
-
-  return "";
-}
-
+  if (this->collectMap[setSpec] == NULL) {
+    return "" ;
+  }
+  
+  return this->collectMap[setSpec]->setName;
+  
+}
 
 text_t oaiconfig::getSetDescription(const text_t &setSpec)
 {
-  if (setDescriptionMap.find(setSpec) != setDescriptionMap.end())
-  {
-    return setDescriptionMap[setSpec];
-  }
-
-  return "";
-}
+  if (this->collectMap[setSpec] == NULL) {
+    return "" ;
+  }
+  
+  return this->collectMap[setSpec]->setDescription;
+}
+
Index: /main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.h
===================================================================
--- /main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.h	(revision 22211)
+++ /main/trunk/greenstone2/runtime-src/src/oaiservr/oaiconfig.h	(revision 22212)
@@ -6,15 +6,10 @@
 #include <map>
 
-// TODO: sort out the members of oaicollectconfig as private/public and add
-//       corresponding set/get functions
-
 class oaicollectconfig {
  public:
   oaicollectconfig(const text_t &collectname) { this->collection = collectname; }
   text_t    collection;
-  text_t    maintainer;
-  text_t    repositoryName;
-  text_t    baseURL; // URL of oaiserver.cgi
-  text_t    baseDocRoot; // Base URL for gsdl directory 
+  text_t    setName; // A display name for the set (collection)
+  text_t    setDescription; // A display description for the set (collection)
   text_tmap fieldMap;    // maps from OAI name to GSDL name
 };
@@ -28,5 +23,4 @@
   virtual ~oaiconfig();
   virtual void  configure(const text_t &key, const text_tarray &cfgline);
-  text_t        getCollectionConfig(const text_t &collection, const text_t &field);
   text_tarray & getCollectionsList() { return this->collectList; }
   text_tset & getMetadataSet() { return this->metadataSet; }
@@ -36,20 +30,28 @@
   text_t        getSetName(const text_t &setSpec);
   text_t        getSetDescription(const text_t &setSpec);
-  int           getOAIVersion();
-  int           resumeAfter();
+  int getOAIVersion();
+  int resumeAfter();
+  text_t getBaseURL();
+  text_t getBaseLibraryURL();
+  text_t getBaseDocRoot();
+  text_t getRepositoryName();
+  text_t getMaintainer();
  private:
   bool configureCollection(const text_t &gsdlhome, const text_t &collection);
   
+  text_t    repositoryName;
+  text_t    baseURL; // URL of oaiserver.cgi
+  text_t    baseLibraryURL; // URL of library.cgi (used for urls to greenstone documents )
+  text_t    baseDocRoot; // Base URL for gsdl directory (used for urls to source documents )
+  text_t    oaiVersion;        // The version of OAI running
+  int       resumptionSize;    // The number of items to produce before spitting out a resumptionToken
+  text_t    maintainer;
+
   text_tarray collectList;  // The list of collections to be taken in hand
   text_tset metadataSet; // The list of metadata sets to be supported
   text_tmap infoMap;        // Holds the information to be given in the case
                             // of an OAI identify request
-  text_tmap setNameMap;     // Holds user-defined names for the sets
-  text_tmap setDescriptionMap;  // Holds user-defined descriptions for the sets
   oaicollectmap collectMap; // The configuration of collections
   text_t collection;        // Used to track which collection is being configured
-  text_t oaiVersion;        // The version of OAI running
-  int    resumptionSize;    // The number of items to produce before spitting out a
-                            // resumptionToken
   
 };
