Index: /other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java
===================================================================
--- /other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java	(revision 15436)
+++ /other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/FedoraGS3Connection.java	(revision 15437)
@@ -29,5 +29,4 @@
 import org.greenstone.fedora.services.FedoraGS3Exception.FedoraGS3RunException;
 import org.greenstone.fedora.services.FedoraGS3Exception.NotAFedoraServerException;
-import org.greenstone.fedora.services.FedoraToGS3Interface.Constants;
 import org.greenstone.gsdl3.util.GSXML;
 import org.w3c.dom.Document;
@@ -111,4 +110,9 @@
 	protected String gSearchWSDLURL;
 	
+	/** The name of the index that FedoraGSearch will index the GS3
+	 * documents into. If no name is specified in the properties file,
+	 * this will default to FedoraIndex. */
+	protected String gSearchIndexName;
+	
 	/** 5 argument constructor is the same as that of superclass FedoraConnection:
 	 * @param protocol can be either http or https
@@ -175,14 +179,19 @@
 	 * properties loaded from a propertiesFile. This method is overridden  
 	 * here in order to instantiate the gSearchConnection based on the  
-	 * gSearchWSDLURL. (If one was not provided in the properties file,  
+	 * - gSearchWSDLURL (If one was not provided in the properties file,  
 	 * gSearchWSDLURL defaults to something of the form
 	 * "http://localhost:8080/fedoragsearch/services/FgsOperations?wsdl"
 	 * where http://localhost:8080/fedora is the baseURL of fedora and
 	 * "gsearch/services/FgsOperations?wsdl" is the default gSearchWSDLSuffix.)
+	 * - name of the index into which the GS3 documents have been indexed 
+	 * and which FedoraGenericSearch should use to perform searches. If none is
+	 * given in the properties file, then the index name defaults "FedoraIndex".
 	 * @param properties is the Properties Map loaded from a properties file
 	 * (if there was any) which specifies such things as host and port of the
 	 * FedoraServer, but can also specify the property "gsearch.wsdlURL".
 	 * At the end of this method, properties' "gsearch.wsdlURL" will be set
-	 * to whatever the final value of this.gSearchWSDLURL is.
+	 * to whatever the final value of this.gSearchWSDLURL is, and 
+	 * "gsearch.indexName" will be set to to whatever the final value of
+	 * this.gSearchIndexName is. 
 	*/
 	protected void setInitialisationProperties(Properties properties)
@@ -200,4 +209,10 @@
 		// so that it will be written out to the properties file again
 		properties.setProperty("gsearch.wsdlURL", this.gSearchWSDLURL);
+		
+		// Similarly for the name of the index FedoraGenericSearch should use
+		// when performing searches for GS3 docs stored in Fedora's repository.
+		this.gSearchIndexName = properties.getProperty(
+				"gsearch.indexName", "FedoraIndex"); // default to FedoraIndex
+		properties.setProperty("gsearch.indexName", this.gSearchIndexName);
 		// Create a connection to FedoraGSearch's web services:
 		initSearchFunctionality();
@@ -212,5 +227,7 @@
 	{
 		try {
-			this.fedoraGSearch = new GSearchConnection(gSearchWSDLURL);
+			this.fedoraGSearch = null;
+			this.fedoraGSearch = new GSearchConnection(
+					gSearchWSDLURL, gSearchIndexName);
 			this.serviceNames = SERVICES;
 		} catch(Exception e){
@@ -251,5 +268,20 @@
 	 * @param url is the new url of the GSearch web services WSDL file */
 	public void setGSearchWSDLURL(String url) { 
-		gSearchWSDLURL = url;
+		this.gSearchWSDLURL = url;
+		initSearchFunctionality();
+	}
+	
+	/** @return the gSearchIndexName, the name of the index Fedora Generic
+	 * Search will search in (where GS3 docs have been indexed into). */
+	public String getGSearchIndexName() { return gSearchIndexName; }
+	
+	/** Sets the member variable gSearchIndexName that specifies the name
+	 * of the index containing indexed GS3 documents. Then it attempts 
+	 * to instantiate a connection to the Fedora GSearch web services using
+	 * this changed value for indexName. 
+	 * @param indexName is the new name of the index containing indexed GS3 
+	 * docs that GSearch should search in. */
+	public void setGSearchIndexName(String indexName) { 
+		this.gSearchIndexName = indexName;
 		initSearchFunctionality();
 	}
Index: /other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/FedoraToGS3Interface.java
===================================================================
--- /other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/FedoraToGS3Interface.java	(revision 15436)
+++ /other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/FedoraToGS3Interface.java	(revision 15437)
@@ -23,9 +23,9 @@
 import java.util.Map;
 
-
 /**
- * The following methods return the same data as FedoraGS3DL, but formatted as 
- * Greenstone Response-Message XML. This way our java-client can parse   
- * the returned XML in the same way and store them in the same datastructures. 
+ * Most of the following methods return the same data as FedoraGS3DL, but 
+ * formatted as Greenstone Response-Message XML. This way our java-client can 
+ * parse the returned XML in the same way and store them in the same data
+ * structures. 
  * @author ak19
 */
@@ -54,4 +54,27 @@
 		public static final String COMMA = ",";
 	}
+    
+        /* FEDORA GENERIC SEARCH RELATED */
+	/** @return the gSearchWSDLURL, the url of the WSDL for the
+	 * FedoraGSearch web services */
+	public String getGSearchWSDLURL();
+	
+	/** Sets the member variable gSearchWSDLURL that specify the location of
+	 * the WSDL file of FedoraGSearch's web services. Then it attempts 
+	 * to instantiate a connection to those web services. 
+	 * @param url is the new url of the GSearch web services WSDL file */
+	public void setGSearchWSDLURL(String url);
+	
+	/** @return the gSearchIndexName, the name of the index Fedora Generic
+	 * Search will search in (where GS3 docs have been indexed into). */
+	public String getGSearchIndexName();
+	
+	/** Sets the member variable gSearchIndexName that specifies the name
+	 * of the index containing indexed GS3 documents. Then it attempts 
+	 * to instantiate a connection to the Fedora GSearch web services using
+	 * this changed value for indexName. 
+	 * @param indexName is the new name of the index containing indexed GS3 
+	 * docs that GSearch should search in. */
+	public void setGSearchIndexName(String indexName);
 	
 	/* DESCRIBE SERVICES */
Index: /other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/GSearchConnection.java
===================================================================
--- /other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/GSearchConnection.java	(revision 15436)
+++ /other-projects/trunk/gs3-webservices-democlient/src/GS3Fedora/org/greenstone/fedora/services/GSearchConnection.java	(revision 15437)
@@ -60,5 +60,4 @@
 	protected static String NAMESPACE_URI = "http://server.fedoragsearch.defxws.dk";
 	protected static String SERVICE_NAME = "OperationsService"; 
-	protected static final String INDEX_NAME = "FedoraIndex"; 
 
 	/** The names of the methods we use of Fedora Generic Search's web services
@@ -78,4 +77,9 @@
 	/** separator used internally to separate values of a search field */ 
 	protected static final String SPACE = " ";
+
+        /** The name of the Index wherein FedoraGSearch has indexed all the GS3 docs.
+	 * This final member is public here so that others may read the indexName  
+	 * that this GSearchConnection works with. */
+	public final String indexName; 
 	
 	/** The Service object used to connect to the FedoraGSearch web services */
@@ -89,13 +93,20 @@
 	protected final DocumentBuilder builder;
 	
+
+    
 	/** Constructor that takes a String representing the url of the WSDL
 	 * file for FedoraGSearch's web services, and tries to establish a 
 	 * connection to those web services. 
 	 * @param wsdlFileLocation is a String representing the url of the WSDL file
+	 * @param indexName is the name of the index that Fedora Generic Search
+	 * should work with (the index wherein the indexed GS3 documents have been
+	 * placed). 
 	*/
-	public GSearchConnection(String wsdlFileLocation) 
+	public GSearchConnection(String wsdlFileLocation, String indexName) 
 		throws MalformedURLException, ServiceException, 
 			ParserConfigurationException
 	{ 
+		this.indexName = indexName;
+		
 		URL wsdlURL = new URL(wsdlFileLocation);
 		service = new Service(wsdlURL, new QName(NAMESPACE_URI, SERVICE_NAME));
@@ -218,5 +229,5 @@
 		return gFindObjects(fullSearchTerm, sort, 
 			hitPageStart, hitPageSize, snippetsMax, 
-			fieldMaxLength, INDEX_NAME, resultPageXslt);
+			fieldMaxLength, indexName, resultPageXslt);
 	}
 	
@@ -364,5 +375,5 @@
 		return gFindObjects(fieldedSearchTerms, sort, 
 				hitPageStart, hitPageSize, snippetsMax, 
-				fieldMaxLength, INDEX_NAME, resultPageXslt);
+				fieldMaxLength, indexName, resultPageXslt);
 	}
 	
@@ -460,5 +471,5 @@
 		try { 
 			GSearchConnection searcher = new GSearchConnection(
-				"http://localhost:8080/fedoragsearch/services/FgsOperations?wsdl");
+				"http://localhost:8080/fedoragsearch/services/FgsOperations?wsdl", "FedoraIndex");
 			
 			
