Index: /greenstone3/trunk/src/java/org/greenstone/gsdl3/core/MessageRouter.java
===================================================================
--- /greenstone3/trunk/src/java/org/greenstone/gsdl3/core/MessageRouter.java	(revision 19351)
+++ /greenstone3/trunk/src/java/org/greenstone/gsdl3/core/MessageRouter.java	(revision 19352)
@@ -47,6 +47,6 @@
  * The hub of a Greenstone system.
  *
- * Accepts  XML requests (via process method of ModuleInterface) and routes them to the appropriate collection or
- * service or external entity.
+ * Accepts XML requests (via process method of ModuleInterface) and routes them
+ * to the appropriate collection or service or external entity.
  *
  * contains a map of module objects - may be services, collections, comms
@@ -61,6 +61,8 @@
  * @see Communicator
  *
- * Since some service classes are moved into a separate directory in order for them to be checked out from a different repository,
- * we modify the configureServices method to search some of the classes in other place if they are not found in the service directory.
+ * Since some service classes are moved into a separate directory in order for
+ * them to be checked out from a different repository, we modify the
+ * configureServices method to search some of the classes in other place if they
+ * are not found in the service directory.
  */
 public class MessageRouter implements  ModuleInterface {
@@ -174,8 +176,8 @@
           // set up the authenticator
           Authenticator.setDefault(new Authenticator(){
-	      protected PasswordAuthentication getPasswordAuthentication(){
-		return new PasswordAuthentication(user, new String(passwd).toCharArray());
-	      }
-	    });
+          protected PasswordAuthentication getPasswordAuthentication(){
+            return new PasswordAuthentication(user, new String(passwd).toCharArray());
+          }
+        });
           
         } catch (Exception e) {
@@ -263,7 +265,7 @@
         mainResult.appendChild(this.doc.importNode(result, true));
       } else {
-	// The message needs to go to another module. The same message can 
-	// be passed to multiple modules  - they will be in a comma 
-	// separated list in the 'to' attribute
+        // The message needs to go to another module. The same message can 
+        // be passed to multiple modules  - they will be in a comma 
+        // separated list in the 'to' attribute
         String [] modules = path.split(",");
         
@@ -311,8 +313,8 @@
   }
   public Element getCollectionList() {
-	    return collection_list;
+    return collection_list;
   }
   public HashMap getModuleMap() {
-	    return module_map;
+    return module_map;
   }
   // ********************************************************************
@@ -327,5 +329,5 @@
       while (i.hasNext()) {
         ((ModuleInterface)i.next()).cleanUp();
-	i.remove();
+        i.remove();
       }
     }
@@ -345,19 +347,17 @@
       String potential_site_name = GSPath.getFirstLink(name);
       if (remote_site != null) {
-	if (remote_site.equals(potential_site_name)) {
-	  list.removeChild(item);
-	}
+        if (remote_site.equals(potential_site_name)) {
+          list.removeChild(item);
+        }
       } else {
-	if (name.equals(potential_site_name)) {// there was no site
-	  list.removeChild(item);
-	  ModuleInterface m = (ModuleInterface)this.module_map.remove(name);
-	  m.cleanUp(); // clean up any open files/connections etc 
-	  m=null;
-	}
-      }
-    }
-		    
-    logger.error(this.converter.getString(list));	    
-	    
+        if (name.equals(potential_site_name)) {// there was no site
+          list.removeChild(item);
+          ModuleInterface m = (ModuleInterface)this.module_map.remove(name);
+          m.cleanUp(); // clean up any open files/connections etc 
+          m=null;
+        }
+      }
+    }
+    logger.error(this.converter.getString(list));
   }
 
@@ -370,12 +370,13 @@
       String name = item.getAttribute(GSXML.NAME_ATT);
       // will remove the node from site_list
-      deactivateModule(GSXML.SITE_ELEM, name);	    
-    }
-	
-  }
+      deactivateModule(GSXML.SITE_ELEM, name);
+    }
+
+  }
+
   /** read thru own site config file - create services and connect to sites
    */
   protected boolean configureLocalSite() {
-	
+
     // this may be a reconfigure, so clean up the old moduleMap
     cleanUpModuleMapEntire();
@@ -449,27 +450,24 @@
       Class service_class = null;
       try {
-	service_class = Class.forName("org.greenstone.gsdl3.service."+service_name);
+        service_class = Class.forName("org.greenstone.gsdl3.service."+service_name);
       } catch(ClassNotFoundException e) {
-    	  
-	try {
-	  //try the service_name alone in case the package name is already specified
-	  service_class = Class.forName(service_name);
-    		  
-	}catch(ClassNotFoundException ae) {
-	  logger.info(ae.getMessage());
-	}
+        try {
+          //try the service_name alone in case the package name is already specified
+          service_class = Class.forName(service_name);
+        }catch(ClassNotFoundException ae) {
+          logger.info(ae.getMessage());
+        }
       }
       try {
-    	  
-    	ServiceRack s = (ServiceRack)service_class.newInstance();
-	s.setSiteHome(this.site_home);
+        ServiceRack s = (ServiceRack)service_class.newInstance();
+        s.setSiteHome(this.site_home);
         s.setSiteAddress(this.site_http_address);
-	s.setLibraryName(this.library_name);
+        s.setLibraryName(this.library_name);
         s.setMessageRouter(this);
         // pass the XML node to the service for service configuration
         if (!s.configure(n, null)) {
-	  logger.error ("couldn't configure ServiceRack "+service_name);
-	  continue;
-	}
+          logger.error ("couldn't configure ServiceRack "+service_name);
+          continue;
+        }
         
         // find out the supported services for this service module
@@ -520,6 +518,6 @@
       sc.setMessageRouter(this);
       if (!sc.configure(cluster)) {
-	logger.error ("couldn't configure ServiceCluster "+name);
-	continue;
+        logger.error ("couldn't configure ServiceCluster "+name);
+        continue;
       }
 
@@ -603,6 +601,6 @@
         // only public collections will appear on the home page
         // add short description_ to collection_list_
-	this.collection_list.appendChild(e);
-	
+        this.collection_list.appendChild(e);
+
         if (c.hasOAI()) {
           Element ane = this.doc.createElement(GSXML.COLLECTION_ELEM);
@@ -616,10 +614,10 @@
         
       } else {
-	this.private_collection_list.appendChild(e);
+        this.private_collection_list.appendChild(e);
       }
       return true;
     } else {
       logger.error("Couldn't configure collection: "+
-		   col_name+".");
+        col_name+".");
       return false;
     }
@@ -803,22 +801,22 @@
       // also remove the xml bit from description list
       if (type.equals(GSXML.COLLECTION_ELEM)) {
-	if (((Collection)m).isPublic()) { 
-	  Element this_col = GSXML.getNamedElement(this.collection_list, GSXML.COLLECTION_ELEM, GSXML.NAME_ATT, name);
-	  if (this_col != null) {
-	    this.collection_list.removeChild(this_col);
-	  }
-	  if (((Collection)m).hasOAI()) {
-	    this_col = GSXML.getNamedElement(this.oai_collection_list, GSXML.COLLECTION_ELEM, GSXML.NAME_ATT, name);
-	    if (this_col != null) {
-	      this.oai_collection_list.removeChild(this_col);
-	    }
-	  }
-	} else {
-	  // a private collection
-	  Element this_col = GSXML.getNamedElement(this.private_collection_list, GSXML.COLLECTION_ELEM, GSXML.NAME_ATT, name);
-	  if (this_col != null) {
-	    this.private_collection_list.removeChild(this_col);
-	  } 
-	}
+        if (((Collection)m).isPublic()) { 
+          Element this_col = GSXML.getNamedElement(this.collection_list, GSXML.COLLECTION_ELEM, GSXML.NAME_ATT, name);
+          if (this_col != null) {
+            this.collection_list.removeChild(this_col);
+          }
+          if (((Collection)m).hasOAI()) {
+            this_col = GSXML.getNamedElement(this.oai_collection_list, GSXML.COLLECTION_ELEM, GSXML.NAME_ATT, name);
+            if (this_col != null) {
+              this.oai_collection_list.removeChild(this_col);
+            }
+          }
+        } else {
+          // a private collection
+          Element this_col = GSXML.getNamedElement(this.private_collection_list, GSXML.COLLECTION_ELEM, GSXML.NAME_ATT, name);
+          if (this_col != null) {
+            this.private_collection_list.removeChild(this_col);
+          } 
+        }
       } else if (type.equals(GSXML.SERVICE_ELEM)) {
         Element this_service = GSXML.getNamedElement(this.service_list, GSXML.SERVICE_ELEM, GSXML.NAME_ATT, name);
@@ -840,10 +838,10 @@
           cleanUpModuleMapSubset(this.cluster_list, name);
           cleanUpModuleMapSubset(this.service_list, name);
-	  
-	  // can remote collections be in the oai_coll list, or private coll list ??
+          
+          // can remote collections be in the oai_coll list, or private coll list ??
         }
       } else {
         logger.error("invalid module type: "+type+", can't remove info about this module");
-      }	
+      }
       
       m.cleanUp(); // clean up any open files/connections etc - can cause trouble on windows
@@ -941,7 +939,7 @@
             // else it a specific request
             if (subset.equals(GSXML.COLLECTION_ELEM+GSXML.LIST_MODIFIER)) {
-	      // get rid of all the old collection stuff (not counting remote ones) before activating all the new ones
-	      cleanUpModuleMapSubset(this.collection_list, null);
-	      cleanUpModuleMapSubset(this.private_collection_list, null);
+              // get rid of all the old collection stuff (not counting remote ones) before activating all the new ones
+              cleanUpModuleMapSubset(this.collection_list, null);
+              cleanUpModuleMapSubset(this.private_collection_list, null);
               success = configureCollections();
             } else {
@@ -972,5 +970,5 @@
               } else if (subset.equals(GSXML.SITE_ELEM+GSXML.LIST_MODIFIER)) {
                 Element site_list = (Element)GSXML.getChildByTagName(site_config_elem, GSXML.SITE_ELEM+GSXML.LIST_MODIFIER);
-		cleanUpAllExternalSiteInfo();
+                cleanUpAllExternalSiteInfo();
                 success = configureExternalSites(site_list);
               }
@@ -993,16 +991,16 @@
           if (action.equals(GSXML.SYSTEM_TYPE_DEACTIVATE)) {
             success = deactivateModule(module_type, module_name);
-	    if (success) {
-	      Element s = GSXML.createTextElement(this.doc, GSXML.STATUS_ELEM, module_type+": "+module_name+" deactivated");
-	      response.appendChild(s);
-	    } else {
-	      Element s = GSXML.createTextElement(this.doc, GSXML.STATUS_ELEM, module_type+": "+module_name+" could not be deactivated");
-	      response.appendChild(s);
-	    }
+            if (success) {
+              Element s = GSXML.createTextElement(this.doc, GSXML.STATUS_ELEM, module_type+": "+module_name+" deactivated");
+              response.appendChild(s);
+            } else {
+              Element s = GSXML.createTextElement(this.doc, GSXML.STATUS_ELEM, module_type+": "+module_name+" could not be deactivated");
+              response.appendChild(s);
+            }
             
           } else if (action.equals(GSXML.SYSTEM_TYPE_ACTIVATE)) {
-	    // we need to deactivate the module first, in case this is a 
-	    // reconfigure
-	    deactivateModule(module_type, module_name);
+            // we need to deactivate the module first, in case this is a 
+            // reconfigure
+            deactivateModule(module_type, module_name);
             if (module_type.equals(GSXML.COLLECTION_ELEM)) {
               success = activateCollectionByName(module_name);
