Index: /trunk/gsdl3/src/java/org/greenstone/gsdl3/Library2.java
===================================================================
--- /trunk/gsdl3/src/java/org/greenstone/gsdl3/Library2.java	(revision 3475)
+++ /trunk/gsdl3/src/java/org/greenstone/gsdl3/Library2.java	(revision 3476)
@@ -37,14 +37,13 @@
     public static void main(String args[]) {
 
-	if (args.length != 4) {
-	    System.out.println("Usage: Library2 <sites home> <site name> <interfaces home> <interface name>");
+	if (args.length != 3) {
+	    System.out.println("Usage: Library2 <gsdl3 home> <site name> <interface name>");
 	    System.exit(1);
 	}
 
 	ConfigVars config_ = new ConfigVars();
-	config_.sites_home_ = args[0];
+	config_.gsdl3_home_ = args[0];
 	config_.site_name_ = args[1];
-	config_.interfaces_home_ = args[2];
-	config_.interface_name_ = args[3];
+	config_.interface_name_ = args[2];
 
 	config_.createXML();
@@ -53,6 +52,7 @@
 	// the servlet wont use this directly
 	MessageRouter message_router_ = new MessageRouter();
-	message_router_.setSiteHome(config_.sites_home_+File.separatorChar
-		       +config_.site_name_);
+	
+	message_router_.setSiteHome(GSFile.siteHome(config_.gsdl3_home_, 
+						    config_.site_name_));
 	message_router_.configure();
 	// new receptionist
Index: /trunk/gsdl3/src/java/org/greenstone/gsdl3/LibraryServlet.java
===================================================================
--- /trunk/gsdl3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 3475)
+++ /trunk/gsdl3/src/java/org/greenstone/gsdl3/LibraryServlet.java	(revision 3476)
@@ -10,5 +10,5 @@
 import java.io.File;
 
-/** a servlet to serve the greenstone library - using servlets instead
+/** a servlet to serve the greenstone library - we are using servlets instead
  * of cgi
  * the init method is called only once - the first time the servlet classes
@@ -16,5 +16,5 @@
  * method is called in a new thread (calls doGet/doPut etc)
  * takes the a=p&p=home type args and builds a simple request to send to 
- * its receptionist, which returns the result in html, cos output=html
+ * its receptionist, which returns a result in html, cos output=html
  * is set in the request
  * @see Receptionist
@@ -33,19 +33,17 @@
 	config_ = new ConfigVars();
 	String library_name_ = config.getInitParameter("libraryname");
-	String sites_home_ = config.getInitParameter("siteshome");
+	String gsdl3_home_ = config.getInitParameter("gsdl3home");
 	String site_name_ = config.getInitParameter("sitename");
-	String interfaces_home_ = config.getInitParameter("interfaceshome");
 	String interface_name_ = config.getInitParameter("interfacename");
-	if (library_name_ == null || sites_home_ == null || site_name_==null || interfaces_home_ ==null || interface_name_==null) {
+	if (library_name_ == null || gsdl3_home_ == null || site_name_==null ||  interface_name_==null) {
 	    // must have this
 	    System.err.println("initialisation parameters not all set!");
-	    System.err.println(" you must have libraryname, siteshome, sitename, interfaceshome, interfacename");
+	    System.err.println(" you must have libraryname, gsdl3home, sitename,  interfacename");
 	    System.exit(1);
 	}
 
 	config_.library_name_ = library_name_;
-	config_.sites_home_ = sites_home_;
+	config_.gsdl3_home_ = gsdl3_home_;
 	config_.site_name_ = site_name_;
-	config_.interfaces_home_ = interfaces_home_;
 	config_.interface_name_ =interface_name_;
 
@@ -55,6 +53,6 @@
 	// the servlet wont use this directly
 	message_router_ = new MessageRouter();
-	message_router_.setSiteHome(config_.sites_home_+File.separatorChar
-		       +config_.site_name_);
+	message_router_.setSiteHome(GSFile.siteHome(config_.gsdl3_home_, 
+						    config_.site_name_));
 	message_router_.configure();
 	// new receptionist
@@ -74,4 +72,6 @@
 	PrintWriter out = response.getWriter();
 
+	// if the interface owns the default - keep this here, otherwise move
+	// it to receptionist
 	String lang = request.getParameter("l");
 	if (lang==null || lang.equals("")) {
@@ -79,5 +79,5 @@
 	}
 	// the request to the receptionist	
-	String xml_request="<message lang='"+lang+"'>";
+	String xml_request="<message lang='"+lang+"'><request type='action' output='html' action=";
 
 	String action = request.getParameter("a");
@@ -85,8 +85,8 @@
 	    // display the home page
 	    // a=p&p=home
-	    xml_request +="<request type='action' output='html' action='p' subaction='home'/>";
+	    xml_request +="'p' subaction='home'/>";
 	} else {
 	    String subaction = request.getParameter("sa");
-	    xml_request += "<request type='action' action='"+action+"'";
+	    xml_request += "'"+action+"'";
 	    if (subaction != null) {
 		xml_request += " subaction='"+subaction+"'";
@@ -96,11 +96,11 @@
 	    while(params.hasMoreElements()) {
 		String name = (String)params.nextElement();
-		if (!name.equals("a") && !name.equals("sa")) {
-		    String value = request.getParameter(name);
+		//if (!name.equals("a") && !name.equals("sa")) {
+		String value = request.getParameter(name);
 		// for now, just add value as attribute - should un-url 
-		    // encode them etc and so some might need to be text not atts
-		    // or is that done already?
-		    xml_request += "<param name='"+name+"' value='"+value+"'/>";
-		}
+		// encode them etc and so some might need to be text not atts
+		// or is that done already?
+		xml_request += "<param name='"+name+"' value='"+value+"'/>";
+		//  }
 	    }
 	    xml_request += "</paramList></request>";
Index: /trunk/gsdl3/src/java/org/greenstone/gsdl3/util/ConfigVars.java
===================================================================
--- /trunk/gsdl3/src/java/org/greenstone/gsdl3/util/ConfigVars.java	(revision 3475)
+++ /trunk/gsdl3/src/java/org/greenstone/gsdl3/util/ConfigVars.java	(revision 3476)
@@ -1,20 +1,29 @@
 package org.greenstone.gsdl3.util;
-
-/** holds all the site setup variables
- * includes a method to represent them as an XML node
- */
 
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+/** holds all the site setup variables
+ * includes a method to represent them as an XML node
+ *
+ * is this only applicable to the servlet type interface? should this
+ * be called ServletConfigVars? or WebServletVars?
+ */
 public class ConfigVars {
 
+    /** the name that has been given to the servlet thats running eg library
+     * not needed for other types of clients*/
     public String library_name_=null;
-    public String sites_home_=null;
+    /** the gsdl home directory 
+     * where the sites and interfaces directories live */
+    public String gsdl3_home_ = null;
+    /** the name of the current site */
     public String site_name_=null;
-    public String interfaces_home_=null;
+    /** the name of the current interface */
     public String interface_name_=null;
+    /** the xml <config> element containing all the variables */
     public Element config_xml_ = null;
 
+    /** creates the <config> Element containting all the variables*/
     public void createXML() {
 	
@@ -23,11 +32,11 @@
 
 	config_xml_ = doc.createElement("config");
-	Element e = GSXML.createTextElement(doc, "library_name", library_name_);
+
+	Element e;
+	e = GSXML.createTextElement(doc, "library_name", library_name_);
 	config_xml_.appendChild(e);
-	e = GSXML.createTextElement(doc, "sites_home", sites_home_);
+	e = GSXML.createTextElement(doc, "gsdl3_home", gsdl3_home_);
 	config_xml_.appendChild(e);
 	e = GSXML.createTextElement(doc, "site_name", site_name_);
-	config_xml_.appendChild(e);
-	e = GSXML.createTextElement(doc, "interfaces_home", interfaces_home_);
 	config_xml_.appendChild(e);
 	e = GSXML.createTextElement(doc, "interface_name", interface_name_);
