Index: /gli/branches/rtl-gli/CheckJavaVersion.java
===================================================================
--- /gli/branches/rtl-gli/CheckJavaVersion.java	(revision 18350)
+++ /gli/branches/rtl-gli/CheckJavaVersion.java	(revision 18351)
@@ -1,33 +1,100 @@
-public class CheckJavaVersion
-{
-    static public void main(String[] args)
-    {
-	String java_version = System.getProperty("java.version");
-	System.out.println("Java version: " + java_version);
+import java.util.regex.Pattern;
 
-	try {
-	    // Identify major version number
-	    int major_dot_position = java_version.indexOf(".");
-	    String java_version_major_string = java_version.substring(0, major_dot_position);
-	    int java_version_major = (new Integer(java_version_major_string)).intValue();
 
-	    // Identify minor version number
-	    int minor_dot_position = java_version.indexOf(".", major_dot_position + 1);
-	    String java_version_minor_string = java_version.substring(major_dot_position + 1, minor_dot_position);
-	    int java_version_minor = (new Integer(java_version_minor_string)).intValue();
-
-	    // Version of Java must be 1.4 or higher to run the GLI
-	    if (java_version_major > 1 || (java_version_major == 1 && java_version_minor >= 4)) {
-		// Valid
-		System.exit(2);
-	    }
-	    else {
-		// Invalid
-		System.exit(1);
-	    }
+public class CheckJavaVersion {
+	static final String MINIMUM_VERSION_PREFIX = "1.4";
+	
+	/**
+	 * @param args, arg[0] is the minium version of Java required
+	 * to run the program. arg[1] is the name of the program.
+	 * If arg[1] is left out, then no distinct program name is
+	 * mentioned. If arg[0] is left out as well, then Greenstone3's
+	 * minimum default version of 1.4.x is assumed.
+	 * The program exits with 1 if the Java version being used is 
+	 * incompatible and with 2 if it is acceptable.
+	 */
+	public static void main(String[] args) {
+		String minimumVersion = MINIMUM_VERSION_PREFIX;
+		String programName = "this program"; 
+		// the version of java that's in use
+		String runningJavaVersion = System.getProperty("java.version");
+		
+		if(args.length > 0) {
+			minimumVersion = args[0];
+		}
+		if(args.length > 1) {
+			programName = args[1];
+		}
+		
+		System.out.println("\nChecking for a compatible Java version..."
+				+ "\nLooking for minimum version: " + minimumVersion);
+		
+		// Version numbers can be of the form "1.5.0_2" 
+		// We want to split version numbers into the individual numbers
+		// For example: splitting 1.5.0_2 will give us {1,5,0,2},
+		// while splitting 1.5.0_10 will give us {1,5,0,10}.
+		// The comparison then is straightforward.
+		
+		// We will split version strings into the individual numbers
+		// using regular expressions. However, the tokens . and _ are
+		// reserved in regular expressions and need to be escaped: 
+		// Period: \Q.\E;  underscore: \Q_\E.
+		// Once escaped, it should be indicated in the regular expression
+		// that the two characters are separate tokens by using |, so 
+		// that the regex becomes: ".|_" -> \Q.\E|\Q_\E.
+		String period = "\\Q.\\E";
+		String underscore = "\\Q_\\E";
+			 // Can't use Pattern.quote() since it is not there in Java 1.4.*
+		     //String period = Pattern.quote(".");
+		     //String underscore = Pattern.quote("_");
+		
+		String[] minVersionNums = minimumVersion.split(period+"|"+underscore);
+		String[] runningVersionNums =runningJavaVersion.split(period+"|"+underscore);
+		
+		boolean acceptable = true;
+		// only keep looping while we haven't gone past the end of either array
+		int i=0;
+		for(; i < minVersionNums.length && i < runningVersionNums.length; i++)
+		{
+			int min = Integer.parseInt(minVersionNums[i]);
+			int run = Integer.parseInt(runningVersionNums[i]);
+			if(run > min) { 
+			        // certain success: one of the higher positional numbers 
+			        // of the running version is greater than the corresponding
+			        // number of the minimum version, meaning we've finished.
+				break;
+			} else if(run < min) { 
+				// fail: running version number is lower than corresponding 
+				// minimum version number
+				acceptable = false;
+				break;
+			} 
+		}
+		
+		// Consider minVersion = 1.5.0_10 and runningVersion = 1.5.0
+		// this means the runningversion is still insufficient. 
+		// HOWEVER, minVersion being longer does not always mean it is
+		// a later version, consider: min=1.5.0_9.12 and run=1.5.0_10
+		// This should be acceptable since 10 > 9 even though min is longer.
+		// SOLUTION: If the last values for both were the same, the running 
+		// Version is not compatible if the minVersionNums array is longer
+		int min = Integer.parseInt(minVersionNums[i-1]);
+		int run = Integer.parseInt(runningVersionNums[i-1]);
+		
+		// if the last values were the same, check whether min is longer
+		// in which case the running version is not acceptable
+		if(min == run && minVersionNums.length > runningVersionNums.length) 
+		{
+			acceptable = false;
+		}
+		
+		if(acceptable) {
+			System.out.println("Found compatible Java version " +runningJavaVersion);
+			System.exit(2); // acceptable case
+		} else {
+			System.out.println("The current Java version " + 
+				runningJavaVersion + " is insufficient to run " + programName);
+			System.exit(1);
+		} 
 	}
-	catch (Exception exception) {
-	    System.err.println("Exception: " + exception);
-	}
-    }
 }
Index: /gli/branches/rtl-gli/FLI_README.txt
===================================================================
--- /gli/branches/rtl-gli/FLI_README.txt	(revision 18351)
+++ /gli/branches/rtl-gli/FLI_README.txt	(revision 18351)
@@ -0,0 +1,46 @@
+FLI, the Fedora Librarian Interface:
+____________________________________
+
+A Purpose of FLI:
+FLI is built on top of GLI. Just as with GLI, it allows you to drag-and-drop documents into a collection which it will then build. The building process of FLI is different in that it will export the documents into a Fedora repository.
+
+
+B Some limitations and workarounds
+- You need the Greenstone server to be running on the same machine as where your Fedora machine is running. This may or may not remain a requirement in the future.
+- FLI will put documents into the Fedora repository (a process called "ingesting into Fedora"). If you happen to encounter some connection failure problems please try the following and also inform us of the context of your problem. To overcome such a problem, what you need to do is:
+ * Stop the fedora server
+ * Go to FEDORA_HOME/tomcat/conf/Catalina/localhost/
+(where FEDORA_HOME is your Fedora installation folder)
+ * Create a file containing this XML:
+<?xml version='1.0' encoding='utf-8'?>
+<Context docBase="/full/path/to/parent/folder/of/your/greenstone/collectdir" path="/gsdl"></Context>
+Where this full path would be your 
+- GSDLHOME/web/sites/localsite for Greenstone 3, and 
+- just plain GSDLHOME for Greenstone 2. 
+Note that in both cases, it has to be the full path to the parent directory of the "collect" directory.
+ * restart the fedora server
+ * Now you can run FLI as described below.
+
+
+C Prerequisites for running FLI: 
+- You need Greenstone 2 or 3
+- You need Fedora installed (which would have required you to set the environment variables FEDORA_HOME, CATALINA_HOME and JAVA_HOME). Then add a new environment variable called FEDORA_VERSION and set it to the value of your Fedora installation's version number.
+- You need the Greenstone server running on the same machine as where your Fedora server is installed.
+
+
+D Running FLI:
+- If you have more than one Greenstone installed (Greenstone 2 and Greenstone 3), then first run the setup file for the Greenstone installation you want to use, so that your Greenstone environment is set up. 
+If you were on linux, you would have to source the setup scripts by going into the Greenstone installation directory and typing
+	source setup.bash
+if it is Greenstone 2.
+And
+	source gs3-setup.sh
+if it is Greenstone 3.	
+If you're on Windows you would run setup.bat in the Greenstone 2 folder or gs3-setup.bat in the Greenstone 3 folder.
+- If you're using a linux xterm, you'd go into Greenstone's gli folder and type:
+	./fli.sh
+If you're on Windows, go into Greenstone's gli folder and double-click on fli.bat
+- Once FLI starts up, it will ask you the Fedora server details and your Fedora username and password to access the Fedora repository.
+- Drag and drop documents into a collection as before, go to the Build tab and press the Build button. Once the building is finished, pressing the preview button will open the browser onto the Fedora search page. 
+- If you have other digital objects in your Fedora repository besides the content generated by Greenstone, you will have to type "greenstone:*" (or just "greenstone*") in the search box--with the quotes.
+If your Fedora repository only contains documents built in FLI, then pressing just the search button should be fine.
Index: /gli/branches/rtl-gli/READMEen.txt
===================================================================
--- /gli/branches/rtl-gli/READMEen.txt	(revision 18350)
+++ /gli/branches/rtl-gli/READMEen.txt	(revision 18351)
@@ -41,5 +41,5 @@
 
 If you have downloaded the Greenstone source distribution, or you have
-obtained the GLI via CVS, you will have the source code (Java) of the
+obtained the GLI via SVN, you will have the source code (Java) of the
 Librarian Interface. Compiling it requires a suitable version of the Java
 Software Development Kit (version 1.4.0 or newer). You can download one
Index: /gli/branches/rtl-gli/READMEes.txt
===================================================================
--- /gli/branches/rtl-gli/READMEes.txt	(revision 18350)
+++ /gli/branches/rtl-gli/READMEes.txt	(revision 18351)
@@ -44,5 +44,5 @@
 
 Si usted ha bajado la versión con el código fuente de Greenstone o ha 
-obtenido la GLI por medio de CVS, entonces tendrá el código fuente 
+obtenido la GLI por medio de SVN, entonces tendrá el código fuente 
 (Java) de la Interfaz de la Biblioteca Digital. Para compilarlo se necesita 
 una versión adecuada del Kit de Desarrollo de Software Java (versión 
Index: /gli/branches/rtl-gli/READMEfr.txt
===================================================================
--- /gli/branches/rtl-gli/READMEfr.txt	(revision 18350)
+++ /gli/branches/rtl-gli/READMEfr.txt	(revision 18351)
@@ -40,5 +40,5 @@
 
 Si vous avez téléchargé la distribution source de Greenstone, ou si vous 
-avez obtenu Greenstone à travers CVS, alors vous avez le code source (Java) 
+avez obtenu Greenstone à travers SVN, alors vous avez le code source (Java) 
 de Librarian Interface. Le compiler requière une version adéquate de Java 
 Software Development Kit (version 1.4.0 ou supérieure). Vous pouvez le 
Index: /gli/branches/rtl-gli/READMEru.txt-cp1251
===================================================================
--- /gli/branches/rtl-gli/READMEru.txt-cp1251	(revision 18350)
+++ /gli/branches/rtl-gli/READMEru.txt-cp1251	(revision 18351)
@@ -42,5 +42,5 @@
 
 Åñëè Âû çàãðóçèëè èñòî÷íèê äèñòðèáóòèâà Greenstone èëè æå ðàñïîëàãàåòå GLI
-îò CVS, òî Âû ðàñïîëàãàåòå èñõîäíîé ïðîãðàììîé Java èíòåðôåéñà áèáëèîòåêè.
+îò SVN, òî Âû ðàñïîëàãàåòå èñõîäíîé ïðîãðàììîé Java èíòåðôåéñà áèáëèîòåêè.
 Êîìïèëÿöèÿ åž òðåáóåò ïîäõîäÿùåé âåðñèè ïðîãðàììíîãî îáåñïå÷åíèÿ Java
 Software Development Kit (âåðñèÿ 1.4.0 èëè áîëåå íîâàÿ). Âû ìîæåòå çàãðóçèòü
Index: /gli/branches/rtl-gli/READMEru.txt-koi8-r
===================================================================
--- /gli/branches/rtl-gli/READMEru.txt-koi8-r	(revision 18350)
+++ /gli/branches/rtl-gli/READMEru.txt-koi8-r	(revision 18351)
@@ -42,5 +42,5 @@
 
 åÓÌÉ ÷Ù ÚÁÇÒÕÚÉÌÉ ÉÓÔÏÞÎÉË ÄÉÓÔÒÉÂÕÔÉ×Á Greenstone ÉÌÉ ÖÅ ÒÁÓÐÏÌÁÇÁÅÔÅ GLI
-ÏÔ CVS, ÔÏ ÷Ù ÒÁÓÐÏÌÁÇÁÅÔÅ ÉÓÈÏÄÎÏÊ ÐÒÏÇÒÁÍÍÏÊ Java ÉÎÔÅÒÆÅÊÓÁ ÂÉÂÌÉÏÔÅËÉ.
+ÏÔ SVN, ÔÏ ÷Ù ÒÁÓÐÏÌÁÇÁÅÔÅ ÉÓÈÏÄÎÏÊ ÐÒÏÇÒÁÍÍÏÊ Java ÉÎÔÅÒÆÅÊÓÁ ÂÉÂÌÉÏÔÅËÉ.
 ëÏÍÐÉÌÑÃÉÑ Å£ ÔÒÅÂÕÅÔ ÐÏÄÈÏÄÑÝÅÊ ×ÅÒÓÉÉ ÐÒÏÇÒÁÍÍÎÏÇÏ ÏÂÅÓÐÅÞÅÎÉÑ Java
 Software Development Kit (×ÅÒÓÉÑ 1.4.0 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÁÑ). ÷Ù ÍÏÖÅÔÅ ÚÁÇÒÕÚÉÔØ
Index: /gli/branches/rtl-gli/chkinst.bat
===================================================================
--- /gli/branches/rtl-gli/chkinst.bat	(revision 18351)
+++ /gli/branches/rtl-gli/chkinst.bat	(revision 18351)
@@ -0,0 +1,32 @@
+::@echo off
+
+set CHECK=1
+
+:: Check that the Greenstone installation looks OK
+if "%GLILANG%" == "en" echo Checking GSDL: %1
+if "%GLILANG%" == "es" echo Revisando GSDL: %1
+if "%GLILANG%" == "fr" echo Vrification de GSDL: %1
+if "%GLILANG%" == "ru" echo à®¢¥àª  GSDL: %1
+
+:: if either of the files exist, we know we can install greenstone
+if exist %1\gs3-setup.bat set CHECK=0
+if exist %1\setup.bat set CHECK=0
+
+if "%CHECK%" == "0" goto endchk
+
+	:: Otherwise, if there was no setup file, then installation fails
+	echo.
+	if "%GLILANG%" == "en" echo The Greenstone %2 installation could not be found, or is incomplete.
+	if "%GLILANG%" == "en" echo Try reinstalling Greenstone %2 then running this script again.
+
+	if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone %2 o est  incompleta.
+	if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone %2 y a continuaci¢n ejecute nuevamente este gui¢n.
+
+	if "%GLILANG%" == "fr" echo L'installation de Greenstone %2 est introuvable ou incomplte. Essayez
+	if "%GLILANG%" == "fr" echo de rinstaller Greenstone %2 et excutez ce script 
+ nouveau.
+
+	if "%GLILANG%" == "ru" echo ­áâ ««ïæšï Greenstone %2 ­¥ ¡ë«  ­ ©€¥­  š«š ®­  ­¥¯®«­ . ®¯à®¡ã©â¥ ¯®¢â®à­®
+	if "%GLILANG%" == "ru" echo ãáâ ­®¢šâì Greenstone %2,   § â¥¬ ¢¢¥áâš íâ®â áªàš¯â á­®¢ .
+
+:endchk
Index: /gli/branches/rtl-gli/clean.bat
===================================================================
--- /gli/branches/rtl-gli/clean.bat	(revision 18350)
+++ /gli/branches/rtl-gli/clean.bat	(revision 18351)
@@ -29,9 +29,15 @@
 if exist "cdm\*.class" del "cdm\*.class"
 if exist "collection\*.class" del "collection\*.class"
+if exist "download\*.class" del "download\*.class"
 if exist "feedback\*.class" del "feedback\*.class"
 if exist "file\*.class" del "file\*.class"
 if exist "gems\*.class" del "gems\*.class"
+if exist "greenstone\*.class" del "greenstone\*.class"
+if exist "greenstone3\*.class" del "greenstone3\*.class"
 if exist "gui\*.class" del "gui\*.class"
+if exist "gui\metaaudit\*.class" del "gui\metaaudit\*.class"
+if exist "gui\tree\*.class" del "gui\tree\*.class"
 if exist "metadata\*.class" del "metadata\*.class"
+if exist "remote\*.class" del "remote\*.class"
 if exist "shell\*.class" del "shell\*.class"
 if exist "util\*.class" del "util\*.class"
Index: /gli/branches/rtl-gli/client-fli.bat
===================================================================
--- /gli/branches/rtl-gli/client-fli.bat	(revision 18351)
+++ /gli/branches/rtl-gli/client-fli.bat	(revision 18351)
@@ -0,0 +1,14 @@
+@echo off
+
+set PROGNAME=Fedora
+set PROGNAME_EN=Fedora Librarian Interface
+set PROGABBR=FLI
+
+:: run GLI in fedora mode
+client-gli.bat -fedora %*
+
+:done
+:: ---- Clean up ----
+set PROGNAME_EN=
+set PROGABBR=
+set PROGNAME=
Index: /gli/branches/rtl-gli/client-fli.sh
===================================================================
--- /gli/branches/rtl-gli/client-fli.sh	(revision 18351)
+++ /gli/branches/rtl-gli/client-fli.sh	(revision 18351)
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+PROGNAME="Fedora"
+export PROGNAME
+
+PROGNAME_EN="Fedora Librarian Interface"
+export PROGNAME_EN
+
+PROGABBR="FLI"
+export PROGABBR
+
+# run GLI in fedora mode
+./client-gli.sh -fedora $*
Index: /gli/branches/rtl-gli/client-gli.bat
===================================================================
--- /gli/branches/rtl-gli/client-gli.bat	(revision 18350)
+++ /gli/branches/rtl-gli/client-gli.bat	(revision 18351)
@@ -1,5 +1,20 @@
 @echo off
+pushd "%CD%"
+CD /D "%~dp0"
 set GLILANG=en
 
+if "%PROGNAME" == "" set PROGNAME=Greenstone
+
+if not "%PROGFULLNAME" == "" goto setvars
+if "%GLILANG%" == "es" set PROGFULLNAME="Biblioteca Digital Greenstone"  
+if "%GLILANG%" == "fr" set PROGFULLNAME="Bibliothécaire Greenstone"
+if "%GLILANG%" == "ru" set PROGFULLNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
+:: if the PROGFULLNAME is still not set, then set the language to English
+if "%PROGFULLNAME%" == "" set PROGNAME=Greenstone Digital Library
+  
+
+:setvars
+if "%PROGABBR%" == "" set PROGABBR=GLI
+if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Librarian Interface
 
 ::  -------- Run the Greenstone Librarian Interface --------
@@ -23,23 +38,23 @@
 :findGSDL
 echo.
-if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
-if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
+if "%GLILANG%" == "en" echo %PROGNAME_EN% (%PROGABBR%)
+if "%GLILANG%" == "en" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "en" echo %PROGABBR% comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
 if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
 
-if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
+if "%GLILANG%" == "es" echo Interfaz de la %PROGFULLNAME% (%PROGNAME_EN% - %PROGABBR%)
+if "%GLILANG%" == "es" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "es" echo La Interfaz de la %PROGFULLNAME% NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
 if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
 if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
 
-if "%GLILANG%" == "fr" echo Interface du Bibliothcaire Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "fr" echo GLI est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
+if "%GLILANG%" == "fr" echo Interface du %PROGFULLNAME% (%PROGNAME_EN% - %PROGABBR%)
+if "%GLILANG%" == "fr" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "fr" echo %PROGABBR% est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
 if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit 
  le redistribuer
 
-if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á %PROGNAME% (%PROGNAME_EN% - %PROGABBR%)
+if "%GLILANG%" == "ru" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
 if "%GLILANG%" == "ru" echo  ­¥ € ¥â   ; €¥â «š á¬. ¢ â¥ªáâ¥ LICENSE.TXT
 if "%GLILANG%" == "ru" echo â® - á¢®¡®€­® à á¯à®áâà ­ï¥¬®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
@@ -99,17 +114,17 @@
     if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
     if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
-    if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
+    if "%GLILANG%" == "en" echo %PROGNAME_EN%.
 
     if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
     if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
-    if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
+    if "%GLILANG%" == "es" echo antes de correr la Interfaz de la %PROGFULLNAME%.
 
     if "%GLILANG%" == "fr" echo Une version adquate de Java n'a pas pu tre localise. Vous devez
     if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou suprieur)
-    if "%GLILANG%" == "fr" echo avant de dmarrer Greenstone Librarian Interface.
+    if "%GLILANG%" == "fr" echo avant de dmarrer %PROGNAME_EN%.
 
     if "%GLILANG%" == "ru" echo ¥ ã€ «®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ á®®â¢¥âáâ¢ãîé¥© ¢¥àášš Java.
     if "%GLILANG%" == "ru" echo ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
-    if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone.
+    if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  %PROGNAME%.
     goto exit
 
@@ -120,14 +135,14 @@
 if exist "GLI.jar" goto runGLI
     echo.
-    if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
+    if "%GLILANG%" == "en" echo You need to compile the %PROGNAME_EN% (using makegli.bat)
     if "%GLILANG%" == "en" echo before running this script.
 
-    if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
+    if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la %PROGFULLNAME%
     if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
 
-    if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegil.bat)
+    if "%GLILANG%" == "fr" echo Vous devez compiler le %PROGNAME% Interface (en utilisant makegil.bat)
     if "%GLILANG%" == "fr" echo avant d'excuter ce script.
 
-    if "%GLILANG%" == "ru" echo ë €®«Š­ë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone (šá¯®«ì§ãï makegli.bat)
+    if "%GLILANG%" == "ru" echo ë €®«Š­ë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥ç­ë© š­â¥àä¥©á %PROGNAME% (šá¯®«ì§ãï makegli.bat)
     if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ íâ®£® áªàš¯â 
     goto exit
@@ -139,8 +154,8 @@
 
 
-if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface...
-if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la Biblioteca Digital Greenstone...
-if "%GLILANG%" == "fr" echo Excution de Greenstone Librarian Interface
-if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone...
+if "%GLILANG%" == "en" echo Running the %PROGNAME_EN%...
+if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la %PROGFULLNAME%...
+if "%GLILANG%" == "fr" echo Excution de %PROGNAME_EN%
+if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š®â¥ç­ë© š­â¥àä¥©á %PROGNAME%...
 
 :: -Xms32M          To set minimum memory
@@ -166,2 +181,3 @@
 :: ---- Clean up ----
 set JAVAPATH=
+popd
Index: /gli/branches/rtl-gli/client-gli.sh
===================================================================
--- /gli/branches/rtl-gli/client-gli.sh	(revision 18350)
+++ /gli/branches/rtl-gli/client-gli.sh	(revision 18351)
@@ -2,25 +2,49 @@
 glilang=en
 
+if [ "x$PROGNAME" = "x" ] ; then
+    PROGNAME="Greenstone"
+  if [ "$glilang" = "es" ]; then
+    PROGFULLNAME="Biblioteca Digital Greenstone"
+  elif [ "$glilang" = "fr" ]; then
+    PROGFULLNAME="Bibliothécaire Greenstone"
+  elif [ "$glilang" = "ru" ]; then
+    PROGFULLNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
+  else
+    PROGFULLNAME="Greenstone Digital Library"
+  fi
+  else
+    PROGFULLNAME=$PROGNAME
+fi
+
+if [ "x$PROGABBR" = "x" ] ; then
+    PROGABBR="GLI"
+fi
+
+if [ "x$PROGNAME_EN" = "x" ] ; then
+    PROGNAME_EN="Greenstone Librarian Interface"
+fi
+
+
 echo
 if [ "$glilang" = "es" ]; then
-    echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
+    echo "Interfaz de la $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
+    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
+    echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
     echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
     echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
 elif [ "$glilang" = "fr" ]; then
-    echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GLI est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
+    echo "Interface du $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
+    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
+    echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
     echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
 elif [ "$glilang" = "ru" ]; then
-    echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
+    echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
+    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
     echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
     echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
 else
-    echo "Greenstone Librarian Interface (GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
+    echo "$PROGNAME Librarian Interface ($PROGABBR)"
+    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
+    echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
     echo "This is free software, and you are welcome to redistribute it"
 fi
@@ -76,17 +100,17 @@
 	echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
 	echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
-	echo "antes de correr la Interfaz de la Biblioteca Digital Greenstone."
+	echo "antes de correr la Interfaz de la $PROGFULLNAME                    ."
     elif [ "$glilang" = "fr" ]; then
 	echo "Une version adéquate de Java n'a pas pu être localisée."
 	echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
-	echo "supérieur) avant de démarrer Greenstone Librarian Interface."
+	echo "supérieur) avant de démarrer $PROGNAME Librarian Interface."
     elif [ "$glilang" = "ru" ]; then
 	echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
 	echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
-	echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone."
+	echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ $PROGNAME."
     else
 	echo "Failed to locate an appropriate version of Java. You must install a"
 	echo "Java Runtime Environment (version 1.4 or greater) before running the"
-	echo "Greenstone Librarian Interface."
+	echo "$PROGNAME Librarian Interface."
     fi
     exit 1
@@ -126,14 +150,14 @@
     echo
     if [ "$glilang" = "es" ]; then
-	echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
+	echo "Usted necesita compilar la Interfaz de la $PROGFULLNAME"
 	echo "(por medio de makegli.sh) antes de ejecutar este guión."
     elif [ "$glilang" = "fr" ]; then
-	echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
+	echo "Vous devez compiler le $PROGNAME Interface (en utilisant makegli.sh)"
 	echo "avant d'exécuter ce script."
     elif [ "$glilang" = "ru" ]; then
-	echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
+	echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME"
 	echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
     else
-	echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
+	echo "You need to compile the $PROGNAME Librarian Interface (using makegli.sh)"
 	echo "before running this script."
     fi
@@ -145,11 +169,11 @@
 echo
 if [ "$glilang" = "es" ]; then
-    echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
+    echo "Ejecutando la Interfaz de la $PROGFULLNAME..."
 elif [ "$glilang" = "fr" ]; then
-    echo "Exécution de Greenstone Librarian Interface"
+    echo "Exécution de $PROGNAME Librarian Interface"
 elif [ "$glilang" = "ru" ]; then
-    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
+    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME..."
 else
-    echo "Running the Greenstone Librarian Interface..."
+    echo "Running the $PROGNAME Librarian Interface..."
 fi
 
@@ -162,5 +186,6 @@
 # -Xloggc:<file>   Write garbage collection log
 
-$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone $*
+# GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2:
+$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone $*
 
 if [ "$glilang" = "es" ]; then
Index: i/branches/rtl-gli/client-gli4gs3.bat
===================================================================
--- /gli/branches/rtl-gli/client-gli4gs3.bat	(revision 18350)
+++ 	(revision )
@@ -1,167 +1,0 @@
-@echo off
-set GLILANG=en
-
-
-::  -------- Run the Greenstone Librarian Interface --------
-
-:: This script must be run from within the directory in which it lives
-if exist client-gli.bat goto start
-    if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
-    if "%GLILANG%" == "es" echo Este gui¢n deber  ejecutarse desde el directorio en el que reside.
-    if "%GLILANG%" == "fr" echo Ce script doit tre excut 
- partir du rpertoire dans lequel il se trouve.
-    if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
-    goto exit
-
-:start
-if "%OS%" == "Windows_NT" goto findGSDL
-    :: Invoke a new command processor to ensure there's enough environment space
-    if "%1" == "Second" goto findGSDL
-        command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
-        goto done
-
-:findGSDL
-echo.
-if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
-if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
-if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
-
-if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
-if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
-if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
-
-if "%GLILANG%" == "fr" echo Interface du Bibliothcaire Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "fr" echo GLI est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
-if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit 
- le redistribuer
-
-if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "ru" echo  ­¥ € ¥â   ; €¥â «š á¬. ¢ â¥ªáâ¥ LICENSE.TXT
-if "%GLILANG%" == "ru" echo â® - á¢®¡®€­® à á¯à®áâà ­ï¥¬®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
-
-
-:findJava
-:: ---- Check Java exists ----
-set JAVAPATH=
-
-:: Some users may set the above line manually
-if not "%JAVAPATH%" == "" goto testJava
-
-    :: If it is set, use the JAVA_HOME environment variable
-    if not "%JAVA_HOME%" == "" goto javahome
-
-    :: Check if Java is on the search path
-    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
-    call setjava.bat
-    del setjava.bat
-    if not "%JAVAPATH%" == "" goto testJava
-
-    :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > jdk.reg
-    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
-    type jdk.reg > jdk.txt
-    del jdk.reg
-    type nul > jre.reg
-    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
-    type jre.reg > jre.txt
-    del jre.reg
-
-    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
-    del jdk.txt
-    del jre.txt
-    call setjava.bat
-    del setjava.bat
-
-    :: If nothing was found in the registry, we're stuck
-    if "%JAVAPATH%" == "" goto noJava
-
-    set JAVAPATH=%JAVAPATH%\bin
-    goto testJava
-
-:javahome
-    set JAVAPATH=%JAVA_HOME%\bin
-
-:testJava
-:: Check that a Java executable has been found
-if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
-if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
-if "%GLILANG%" == "fr" echo Vrification de Java: %JAVAPATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
-if exist "%JAVAPATH%\java.exe" goto checkGLI
-
-:noJava
-    echo.
-    if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
-    if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
-    if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
-
-    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
-    if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
-    if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
-
-    if "%GLILANG%" == "fr" echo Une version adquate de Java n'a pas pu tre localise. Vous devez
-    if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou suprieur)
-    if "%GLILANG%" == "fr" echo avant de dmarrer Greenstone Librarian Interface.
-
-    if "%GLILANG%" == "ru" echo ¥ ã€ «®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ á®®â¢¥âáâ¢ãîé¥© ¢¥àášš Java.
-    if "%GLILANG%" == "ru" echo ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
-    if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone.
-    goto exit
-
-
-:checkGLI
-:: ---- Check that the GLI has been compiled ----
-if exist "classes/org/greenstone/gatherer/Gatherer.class" goto runGLI
-if exist "GLI.jar" goto runGLI
-    echo.
-    if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
-    if "%GLILANG%" == "en" echo before running this script.
-
-    if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
-    if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
-
-    if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegil.bat)
-    if "%GLILANG%" == "fr" echo avant d'excuter ce script.
-
-    if "%GLILANG%" == "ru" echo ë €®«Š­ë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone (šá¯®«ì§ãï makegli.bat)
-    if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ íâ®£® áªàš¯â 
-    goto exit
-
-
-:runGLI
-:: ---- Finally, run the GLI ----
-echo.
-
-
-if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface...
-if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la Biblioteca Digital Greenstone...
-if "%GLILANG%" == "fr" echo Excution de Greenstone Librarian Interface
-if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone...
-
-:: -Xms32M          To set minimum memory
-:: -Xmx32M          To set maximum memory
-:: -verbose:gc      To set garbage collection messages
-:: -Xincgc          For incremental garbage collection
-:: -Xprof           Function call profiling
-:: -Xloggc:<file>   Write garbage collection log
-
-"%JAVAPATH%\java" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl3 %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-if "%GLILANG%" == "en" echo Done!
-if "%GLILANG%" == "es" echo ­Hecho!
-if "%GLILANG%" == "fr" echo Termin!
-if "%GLILANG%" == "ru" echo ë¯®«­¥­®!
-goto done
-
-:exit
-echo.
-pause
-
-:done
-:: ---- Clean up ----
-set JAVAPATH=
Index: i/branches/rtl-gli/client-gli4gs3.sh
===================================================================
--- /gli/branches/rtl-gli/client-gli4gs3.sh	(revision 18350)
+++ 	(revision )
@@ -1,174 +1,0 @@
-#!/bin/sh
-glilang=en
-
-echo
-if [ "$glilang" = "es" ]; then
-    echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
-    echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
-    echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
-elif [ "$glilang" = "fr" ]; then
-    echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GLI est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
-    echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
-elif [ "$glilang" = "ru" ]; then
-    echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
-    echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
-else
-    echo "Greenstone Librarian Interface (GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
-    echo "This is free software, and you are welcome to redistribute it"
-fi
-echo
-
-##  -------- Run the Greenstone Librarian Interface --------
-
-# This script must be run from within the directory in which it lives
-thisdir=`pwd`
-if [ ! -f "${thisdir}/client-gli.sh" ]; then
-    if [ "$glilang" = "es" ]; then
-        echo "Este guión deberá ejecutarse desde el directorio en el que reside."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
-    elif [ "$glilang" = "ru" ]; then
-	echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
-    else
-	echo "This script must be run from the directory in which it resides."
-    fi
-    exit 1
-fi
-
-
-## ---- Check Java exists ----
-javapath=
-
-# Some users may set the above line manually
-if [ "x$javapath" = "x" ]; then
-
-    # If it is set, use the JAVA_HOME environment variable
-    if [ "x$JAVA_HOME" != "x" ]; then
-	javapath="$JAVA_HOME/bin/java"
-
-    # Check if Java is on the search path
-    else
-	javapath=`which java 2> /dev/null`
-    fi
-fi
-
-# Check that a Java executable has been found
-if [ "$glilang" = "es" ]; then
-    echo "Revisando Java: $javapath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de Java: $javapath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ Java: $javapath"
-else
-    echo "Checking Java: $javapath"
-fi
-if [ ! -x "$javapath" ]; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
-	echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
-	echo "antes de correr la Interfaz de la Biblioteca Digital Greenstone."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Une version adéquate de Java n'a pas pu être localisée."
-	echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
-	echo "supérieur) avant de démarrer Greenstone Librarian Interface."
-    elif [ "$glilang" = "ru" ]; then
-	echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
-	echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
-	echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone."
-    else
-	echo "Failed to locate an appropriate version of Java. You must install a"
-	echo "Java Runtime Environment (version 1.4 or greater) before running the"
-	echo "Greenstone Librarian Interface."
-    fi
-    exit 1
-fi
-
-
-## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
-`$javapath -classpath . CheckJavaVersion > /dev/null`
-if [ $? -ne 2 ] ; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
-	echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
-	echo "la Interfaz de la Biblioteca Digital Greenstone. Por favor instale "
-	echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
-	echo "posterior) y ejecute nuevamente este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "La version de Java Runtime Environment que vous avez installée est"
-	echo "trop vielle pour faire fonctionner Greenstone Librarian Interface."
-	echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
-	echo "récente) et redémarrez le script."
-    elif [ "$glilang" = "ru" ]; then
-	echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
-	echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
-	echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
-	echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
-    else
-	echo "The version of the Java Runtime Environment you have installed is too"
-	echo "old to run the Greenstone Librarian Interface. Please install a new"
-	echo "version of the JRE (version 1.4 or newer) and rerun this script."
-    fi
-    exit 1
-fi
-
-## ---- Check that the GLI has been compiled ----
-if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
-	echo "(por medio de makegli.sh) antes de ejecutar este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
-	echo "avant d'exécuter ce script."
-    elif [ "$glilang" = "ru" ]; then
-	echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
-	echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
-    else
-	echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
-	echo "before running this script."
-    fi
-    exit 1
-fi
-
-
-## ---- Finally, run the GLI ----
-echo
-if [ "$glilang" = "es" ]; then
-    echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
-elif [ "$glilang" = "fr" ]; then
-    echo "Exécution de Greenstone Librarian Interface"
-elif [ "$glilang" = "ru" ]; then
-    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
-else
-    echo "Running the Greenstone Librarian Interface..."
-fi
-
-# Other arguments you can provide to GLI to work around memory limitations, or debug
-# -Xms<number>M    To set minimum memory (by default 32MB)
-# -Xmx<number>M    To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
-# -verbose:gc      To set garbage collection messages
-# -Xincgc          For incremental garbage collection (significantly slows performance)
-# -Xprof           Function call profiling
-# -Xloggc:<file>   Write garbage collection log
-
-$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/commons-codec-1.3.jar:lib/commons-httpclient-3.1-rc1.jar:lib/commons-logging-1.1.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone -gsdl3 $*
-
-if [ "$glilang" = "es" ]; then
-    echo "¡Hecho!"
-elif [ "$glilang" = "fr" ]; then
-    echo "Terminé!"
-elif [ "$glilang" = "ru" ]; then
-    echo "÷ÙÐÏÌÎÅÎÏ!"
-else
-    echo "Done!"
-fi
Index: /gli/branches/rtl-gli/fli.bat
===================================================================
--- /gli/branches/rtl-gli/fli.bat	(revision 18351)
+++ /gli/branches/rtl-gli/fli.bat	(revision 18351)
@@ -0,0 +1,53 @@
+@echo off
+
+:: by default, assume English
+set PROGNAME=Fedora Librarian Interface
+if "%GLILANG%" == "es" set PROGNAME=Biblioteca Digital Fedora.
+if "%GLILANG%" == "fr" set PROGNAME=Bibliothécaire Fedora.
+if "%GLILANG%" == "ru" set PROGNAME=ÉÎÔÅÒÆÅÊÓ Fedora.
+:: How to export PROGNAME?
+
+set PROGNAME_EN=Fedora Librarian Interface
+set PROGABBR=FLI
+
+
+echo.
+:: Test to see if FEDORA_HOME environment variable has been set up
+if "%FEDORA_HOME%" == "" goto noFed
+	:: Check if the directory FEDORA_HOME exists
+	:: MAN: Can't use the if command to test directly for a directory, but the null (NUL) device does exist in
+	:: every directory. As a result, you can test for the null device to determine whether a directory exists. 
+	if not exist %FEDORA_HOME%\nul echo Error: Cannot find Fedora home. No such directory: %FEDORA_HOME%
+	if not exist %FEDORA_HOME%\nul goto exit
+		
+:: If FEDORA_VERSION not set, default fedora-version to 3 after warning user.
+if not "%FEDORA_VERSION%" == "" goto runFed
+	echo FEDORA_VERSION (major version of Fedora) was not set. Defaulting to: 3.
+	echo If you are running a different version of Fedora, set the FEDORA_VERSION
+	echo environment variable.
+	set FEDORA_VERSION="3"
+	echo.
+
+
+:runFed
+:: MAN: The %* batch parameter is a wildcard reference to all the arguments, not including %0, 
+:: that are passed to the batch file.
+echo FEDORA_HOME: %FEDORA_HOME%. 
+echo FEDORA_VERSION: %FEDORA_VERSION%
+gli.bat -fedora -fedora_home %FEDORA_HOME% -fedora_version %FEDORA_VERSION% %*
+
+:: Either (or both) of FEDORA_HOME and FEDORA_VERSION were not set, both are crucial
+:noFed
+echo Error: Cannot run %PROGNAME_EN% (%PROGABBR%) if FEDORA_HOME is not set.
+goto exit
+
+
+:exit
+echo.
+pause
+
+:done
+:: ---- Clean up ----
+set PROGNAME_EN=
+set PROGABBR=
+set PROGNAME=
Index: /gli/branches/rtl-gli/fli.sh
===================================================================
--- /gli/branches/rtl-gli/fli.sh	(revision 18351)
+++ /gli/branches/rtl-gli/fli.sh	(revision 18351)
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+if [ "$glilang" = "es" ]; then
+  PROGNAME="Biblioteca Digital Fedora"
+elif [ "$glilang" = "fr" ]; then
+  PROGNAME="Bibliothécaire Fedora"
+elif [ "$glilang" = "ru" ]; then
+  PROGNAME="ÉÎÔÅÒÆÅÊÓ Fedora"
+else
+  PROGNAME="Fedora Librarian Interface"
+fi
+export PROGNAME
+
+PROGNAME_EN="Fedora Librarian Interface"
+export PROGNAME_EN
+
+PROGABBR="FLI"
+export PROGABBR
+
+echo
+# Test to see if FEDORA environment variables have been set up
+if [ "x$FEDORA_HOME" == "x" ]; then
+    echo "Error: Cannot run $PROGNAME_EN (PROGABBR) if FEDORA_HOME is not set."
+    exit
+fi
+
+if [ ! -d "$FEDORA_HOME" ]; then
+    echo "Error: Cannot find Fedora Home. No such directory: $FEDORA_HOME"
+    exit
+fi
+
+# If FEDORA_VERSION not set, default fedora-version to 3 after warning user.  
+if [ "x$FEDORA_VERSION" == "x" ]; then
+    echo "FEDORA_VERSION (major version of Fedora) was not set. Defaulting to: 3."
+    echo "If you are running a different version of Fedora, set the FEDORA_VERSION"
+    echo "environment variable."
+    FEDORA_VERSION="3"
+    export FEDORA_VERSION
+    echo
+fi
+
+# Finally run GLI in fedora mode
+echo "FEDORA_HOME: $FEDORA_HOME"
+echo "FEDORA_VERSION: $FEDORA_VERSION"
+./gli.sh -fedora -fedora_home "$FEDORA_HOME" -fedora_version "$FEDORA_VERSION" $*
Index: i/branches/rtl-gli/gems4gs3.bat
===================================================================
--- /gli/branches/rtl-gli/gems4gs3.bat	(revision 18350)
+++ 	(revision )
@@ -1,211 +1,0 @@
-@echo off
-set GLILANG=en
-
-::  -------- Run the Greenstone Editor for Metadata Sets --------
-
-:: This script must be run from within the directory in which it lives
-if exist gems4gs3.bat goto start
-    if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
-    if "%GLILANG%" == "es" echo Este gui¢n deber  ejecutarse desde el directorio en el que reside.
-    if "%GLILANG%" == "fr" echo Ce script doit tre excut 
- partir du rpertoire dans lequel il se trouve.
-    if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
-    goto exit
-
-:start
-if "%OS%" == "Windows_NT" goto findGSDL3
-    :: Invoke a new command processor to ensure there's enough environment space
-    if "%1" == "Second" goto findGSDL3
-        command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
-        goto done
-
-:findGSDL3
-echo.
-if "%GLILANG%" == "en" echo Greenstone Editor for Metadata Sets (GEMS)
-if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "en" echo GEMS comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
-if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
-
-if "%GLILANG%" == "es" echo Editar conjuntos de metadatos (Greenstone Editor for Metadata Sets - GEMS)
-if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "es" echo GEMS NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
-if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
-if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
-
-if "%GLILANG%" == "fr" echo Editer les jeux de méta-données (Greenstone Editor for Metadata Sets - GEMS)
-if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "fr" echo GEMS est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
-if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit 
- le redistribuer
-
-if "%GLILANG%" == "ru" echo Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ (Greenstone Editor for Metadata Sets - GEMS)
-if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "ru" echo  ­¥ € ¥â   ; €¥â «š á¬. ¢ â¥ªáâ¥ LICENSE.TXT
-if "%GLILANG%" == "ru" echo â® - á¢®¡®€­® à á¯à®áâà ­ï¥¬®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
-
-echo.
-::  ---- Determine GSDL3HOME ----
-set GSDL3SRCPATH=
-
-:: Some users may set the above line manually
-if not "%GSDL3SRCPATH%" == "" goto testGSDL3
-    :: The default location for the GLI (and thus GEMS) is a subdirectory of Greenston
-    set GSDL3SRCPATH=..
-    :: If it is set, use the GSDLSRCHOME environment variable 
-    if "%GSDL3SRCHOME%" == "" goto testGSDL3
-	set GSDL3SRCPATH=%GSDL3SRCHOME%
-
-
-:testGSDL3
-:: Check that the Greenstone installation looks OK
-if "%GLILANG%" == "en" echo Checking GSDL3: %GSDL3SRCPATH%
-if "%GLILANG%" == "es" echo Revisando GSDL3: %GSDL3SRCPATH%
-if "%GLILANG%" == "fr" echo Vrification de GSDL3: %GSDLSRCPATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  GSDL3: %GSDLSRCPATH%
-:: Some users may set the above line manually
-if exist "%GSDL3SRCPATH%\gs3-setup.bat" goto prepGSDL3
-    echo.
-    if "%GLILANG%" == "en" echo The Greenstone installation could not be found, or is incomplete.
-    if "%GLILANG%" == "en" echo Try reinstalling Greenstone then running this script again.
-
-    if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone o est  incompleta.
-    if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone y a continuaci¢n ejecute nuevamente este gui¢n.
-
-    if "%GLILANG%" == "fr" echo L'installation de Greenstone est introuvable ou incomplte. Essayez
-    if "%GLILANG%" == "fr" echo de rinstaller Greenstone et excutez ce script 
- nouveau.
-
-    if "%GLILANG%" == "ru" echo ­áâ ««ïæšï Greenstone ­¥ ¡ë«  ­ ©€¥­  š«š ®­  ­¥¯®«­ . ®¯à®¡ã©â¥ ¯®¢â®à­®
-    if "%GLILANG%" == "ru" echo ãáâ ­®¢šâì Greenstone,   § â¥¬ ¢¢¥áâš íâ®â áªàš¯â á­®¢ .
-    goto exit
-
-:prepGSDL3
-:: Setup Greenstone, unless it has already been done
-if not "%GSDL3SRCHOME%" == "" goto doneGSDL3
-    cd %GSDL3SRCPATH% 
-    call gs3-setup.bat SetEnv > null 
-    cd %GSDL3SRCHOME%/gli
-
-:doneGSDL3
-:: GSDL3SRCPATH is no longer needed, since GSDL3HOME should now be set
-set GSDL3SRCPATH=
-
-:findJava
-:: ---- Check Java exists ----
-set JAVAPATH=
-
-:: Some users may set the above line manually
-if not "%JAVAPATH%" == "" goto testJava
-
-    :: If it is set, use the JAVA_HOME environment variable
-    if not "%JAVA_HOME%" == "" goto javahome
-
-    :: Check if Java is on the search path
-    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
-    call setjava.bat
-    del setjava.bat
-    if not "%JAVAPATH%" == "" goto testJava
-
-    :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > jdk.reg
-    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
-    type jdk.reg > jdk.txt
-    del jdk.reg
-    type nul > jre.reg
-    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
-    type jre.reg > jre.txt
-    del jre.reg
-
-    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
-    del jdk.txt
-    del jre.txt
-    call setjava.bat
-    del setjava.bat
-
-    :: If nothing was found in the registry, we're stuck
-    if "%JAVAPATH%" == "" goto noJava
-
-    set JAVAPATH=%JAVAPATH%\bin
-    goto testJava
-
-:javahome
-    set JAVAPATH=%JAVA_HOME%\bin
-
-:testJava
-:: Check that a Java executable has been found
-if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
-if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
-if "%GLILANG%" == "fr" echo Vrification de Java: %JAVAPATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
-if exist "%JAVAPATH%\java.exe" goto checkGEMS
-
-:noJava
-    echo.
-    if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
-    if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
-    if "%GLILANG%" == "en" echo Greenstone Editor for Metadata Sets.
-
-    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
-    if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
-    if "%GLILANG%" == "es" echo antes de correr la Editar conjuntos de metadatos.
-
-    if "%GLILANG%" == "fr" echo Une version adquate de Java n'a pas pu tre localise. Vous devez
-    if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou suprieur)
-    if "%GLILANG%" == "fr" echo avant de dmarrer Editer les jeux de méta-données.
-
-    if "%GLILANG%" == "ru" echo ¥ ã€ «®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ á®®â¢¥âáâ¢ãîé¥© ¢¥àášš Java.
-    if "%GLILANG%" == "ru" echo ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
-    if "%GLILANG%" == "ru" echo Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ.
-    goto exit
-
-
-:checkGEMS
-:: ---- Check that the GEMS has been compiled ----
-if exist "classes/org/greenstone/gatherer/gems/GEMS.class" goto runGEMS
-if exist "GLI.jar" goto runGEMS
-    echo.
-    if "%GLILANG%" == "en" echo You need to compile the Greenstone Editor for Metadata Sets (using makegli.bat)
-    if "%GLILANG%" == "en" echo before running this script.
-
-    if "%GLILANG%" == "es" echo Usted necesita compilar la Editar conjuntos de metadatos
-    if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
-
-    if "%GLILANG%" == "fr" echo Vous devez compiler le Editer les jeux de méta-données (en utilisant
-    if "%GLILANG%" == "fr" echo makegli.bat) avant d'excuter ce script.
-
-    if "%GLILANG%" == "ru" echo ë €®«Š­ë ª®¬¯š«šà®¢ âì Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ (šá¯®«ì§ãï makegli.bat)
-    if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ íâ®£® áªàš¯â 
-    goto exit
-
-
-:runGEMS
-:: ---- Finally, run the GEMS ----
-echo.
-
-if "%GLILANG%" == "en" echo Running the Greenstone Editor for Metadata Sets...
-if "%GLILANG%" == "es" echo Ejecutando la Editar conjuntos de metadatos...
-if "%GLILANG%" == "fr" echo Excution de Editer les jeux de méta-données
-if "%GLILANG%" == "ru" echo ¥ªãéš© Ðåäàêòèðîâàòü íàáîðû ìåòàäàííûõ...
-
-:: -Xms32M          To set minimum memory
-:: -Xmx32M          To set maximum memory
-:: -verbose:gc      To set garbage collection messages
-:: -Xincgc          For incremental garbage collection
-:: -Xprof           Function call profiling
-:: -Xloggc:<file>   Write garbage collection log
-
-"%JAVAPATH%\java" -cp classes/;GLI.jar;lib/apache.jar org.greenstone.gatherer.gems.GEMS -gsdl3 %GSDL3HOME% %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-if "%GLILANG%" == "en" echo Done!
-if "%GLILANG%" == "es" echo ­Hecho!
-if "%GLILANG%" == "fr" echo Termin!
-if "%GLILANG%" == "ru" echo ë¯®«­¥­®!
-goto done
-
-:exit
-echo.
-pause
-
-:done
-:: ---- Clean up ----
-set JAVAPATH=
Index: i/branches/rtl-gli/gems4gs3.sh
===================================================================
--- /gli/branches/rtl-gli/gems4gs3.sh	(revision 18350)
+++ 	(revision )
@@ -1,226 +1,0 @@
-#!/bin/sh
-glilang=en
-
-echo
-if [ "$glilang" = "es" ]; then
-    echo "Editar conjuntos de metadatos (Greenstone Editor for Metadata Sets - GEMS)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GEMS NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
-    echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
-    echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
-elif [ "$glilang" = "fr" ]; then
-    echo "Editer les jeux de méta-données (Greenstone Editor for Metadata Sets - GEMS)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GEMS est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
-    echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
-elif [ "$glilang" = "ru" ]; then
-    echo "òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ (Greenstone Editor for Metadata Sets - GEMS)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
-    echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
-else
-    echo "Greenstone Editor for Metadata Sets (GEMS)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GEMS comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
-    echo "This is free software, and you are welcome to redistribute it"
-fi
-echo
-
-##  -------- Run the Greenstone Editor for Metadata Sets --------
-
-# This script must be run from within the directory in which it lives
-thisdir=`pwd`
-if [ ! -f "${thisdir}/gems4gs3.sh" ]; then
-    if [ "$glilang" = "es" ]; then
-        echo "Este guión deberá ejecutarse desde el directorio en el que reside."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
-    elif [ "$glilang" = "ru" ]; then
-	echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
-    else
-	echo "This script must be run from the directory in which it resides."
-    fi
-    exit 1
-fi
-
-##  ---- Determine GSDL3SRCHOME ----
-gsdl3srcpath=
-# Some users may set the above line manually
-if [ "x$gsdl3srcpath" = "x" ]; then
-    # Check the environment variable first
-    if [ "x$GSDL3SRCHOME" != "x" ]; then
-	gsdl3srcpath=$GSDL3SRCHOME
-
-    # If it is not set, assume that the GLI (and thus GEMS) is installed as a subdirectory of Greenstone3
-    else
-	gsdl3srcpath=`(cd .. && pwd)` 
-    fi
-fi
-
-# Check that the Greenstone installation looks OK
-if [ "$glilang" = "es" ]; then
-    echo "Revisando GSDL3: $gsdl3srcpath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de GSDL3: $gsdl3srcpath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ GSDL3: $gsdl3srcpath"
-else
-    echo "Checking GSDL3: $gsdl3srcpath"
-fi
-if [ ! -f "${gsdl3srcpath}/gs3-setup.sh" ] ; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "No se pudo encontrar la instalación de Greenstone o está incompleta."
-        echo "Trate de reinstalar Greenstone y a continuación ejecute nuevamente"
-	echo "este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "L'installation de Greenstone est introuvable ou incomplète."
-	echo "Essayez de réinstaller Greenstone et exécutez ce script à nouveau."
-    elif [ "$glilang" = "ru" ]; then
-	echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
-	echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
-    else
-	echo "The Greenstone installation could not be found, or is incomplete."
-	echo "Try reinstalling Greenstone then running this script again."
-    fi
-    exit 1
-fi
-
-# Setup Greenstone3, unless it has already been done
-if [ "x$GSDL3SRCHOME" = "x" ]; then
-    cd "$gsdl3srcpath"
-    . gs3-setup.sh
-    cd "$thisdir"
-fi
-
-
-## ---- Check Java exists ----
-javapath=
-
-# Some users may set the above line manually
-if [ "x$javapath" = "x" ]; then
-
-    # If it is set, use the JAVA_HOME environment variable
-    if [ "x$JAVA_HOME" != "x" ]; then
-	javapath="$JAVA_HOME/bin/java"
-
-    # Check if Java is on the search path
-    else
-	javapath=`which java 2> /dev/null`
-    fi
-fi
-
-# Check that a Java executable has been found
-if [ "$glilang" = "es" ]; then
-    echo "Revisando Java: $javapath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de Java: $javapath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ Java: $javapath"
-else
-    echo "Checking Java: $javapath"
-fi
-if [ ! -x "$javapath" ]; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
-	echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
-	echo "antes de correr la Editar conjuntos de metadatos."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Une version adéquate de Java n'a pas pu être localisée."
-	echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
-	echo "supérieur) avant de démarrer Editer les jeux de méta-données."
-    elif [ "$glilang" = "ru" ]; then
-	echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
-	echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
-	echo "ÐÅÒÅÄ ××ÏÄÏÍ òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ."
-    else
-	echo "Failed to locate an appropriate version of Java. You must install a"
-	echo "Java Runtime Environment (version 1.4 or greater) before running the"
-	echo "Greenstone Editor for Metadata Sets."
-    fi
-    exit 1
-fi
-
-
-## -- Check the version of Java is new enough (1.4.0 or higher) to run the GEMS --
-`$javapath -classpath . CheckJavaVersion > /dev/null`
-if [ $? -ne 2 ] ; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
-	echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
-	echo "la Editar conjuntos de metadatos. Por favor instale una nueva "
-	echo "versión del Ambiente de Ejecución Java (versión 1.4 o posterior)"
-	echo "y ejecute nuevamente este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "La version de Java Runtime Environment que vous avez installée est"
-	echo "trop vielle pour faire fonctionner Editer les jeux de méta-données."
-	echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
-	echo "récente) et redémarrez le script."
-    elif [ "$glilang" = "ru" ]; then
-	echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
-	echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ. ðÏÖÁÌÕÊÓÔÁ, "
-	echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
-	echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
-    else
-	echo "The version of the Java Runtime Environment you have installed is too"
-	echo "old to run the Greenstone Editor for Metadata Sets. Please install a new"
-	echo "version of the JRE (version 1.4 or newer) and rerun this script."
-    fi
-    exit 1
-fi
-
-
-## ---- Check that the GEMS has been compiled ----
-if [ ! -f "classes/org/greenstone/gatherer/gems/GEMS.class" ] && [ ! -f "GLI.jar" ]; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "Usted necesita compilar la Editar conjuntos de metadatos"
-	echo "(por medio de makegli.sh) antes de ejecutar este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Vous devez compiler le Editer les jeux de méta-données (en utilisant makegli.sh)"
-	echo "avant d'exécuter ce script."
-    elif [ "$glilang" = "ru" ]; then
-	echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ"
-	echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
-    else
-	echo "You need to compile the Greenstone Editor for Metadata Sets (using makegli.sh)"
-	echo "before running this script."
-    fi
-    exit 1
-fi
-
-
-## ---- Finally, run the GEMS ----
-echo
-if [ "$glilang" = "es" ]; then
-    echo "Ejecutando la Editar conjuntos de metadatos..."
-elif [ "$glilang" = "fr" ]; then
-    echo "Exécution de Editer les jeux de méta-données"
-elif [ "$glilang" = "ru" ]; then
-    echo "ôÅËÕÝÉÊ òÅÄÁËÔÉÒÏ×ÁÔØ ÎÁÂÏÒÙ ÍÅÔÁÄÁÎÎÙÈ..."
-else
-    echo "Running the Greenstone Editor for Metadata Sets..."
-fi
-
-# Other arguments you can provide to GEMS to work around memory limitations, or debug
-# -Xms<number>M    To set minimum memory (by default 32MB)
-# -Xmx<number>M    To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
-# -verbose:gc      To set garbage collection messages
-# -Xincgc          For incremental garbage collection (significantly slows performance)
-# -Xprof           Function call profiling
-# -Xloggc:<file>   Write garbage collection log
-
-
-$javapath -classpath classes/:GLI.jar:lib/apache.jar org.greenstone.gatherer.gems.GEMS -gsdl3 $GSDL3HOME $*
-
-if [ "$glilang" = "es" ]; then
-    echo "¡Hecho!"
-elif [ "$glilang" = "fr" ]; then
-    echo "Terminé!"
-elif [ "$glilang" = "ru" ]; then
-    echo "÷ÙÐÏÌÎÅÎÏ!"
-else
-    echo "Done!"
-fi
Index: /gli/branches/rtl-gli/gli.bat
===================================================================
--- /gli/branches/rtl-gli/gli.bat	(revision 18350)
+++ /gli/branches/rtl-gli/gli.bat	(revision 18351)
@@ -1,3 +1,6 @@
 @echo off
+color 0A
+pushd "%CD%"
+CD /D "%~dp0"
 set GLILANG=en
 
@@ -15,74 +18,162 @@
 
 :start
-if "%OS%" == "Windows_NT" goto findGSDL
+if "%OS%" == "Windows_NT" goto progName
     :: Invoke a new command processor to ensure there's enough environment space
-    if "%1" == "Second" goto findGSDL
+    if "%1" == "Second" goto progName
         command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
         goto done
 
+
+:progName
+if not "%PROGNAME%" == "" goto findGSDL
+	:: otherwise PROGNAME was not set, so default to the Greenstone Librarian Interface (GLI) program
+	if "%GLILANG%" == "es" set PROGNAME=Biblioteca Digital Greenstone
+	if "%GLILANG%" == "fr" set PROGNAME=Bibliothécaire Greenstone
+	if "%GLILANG%" == "ru" set PROGNAME=ÉÎÔÅÒÆÅÊÓ Greenstone
+	:: if the PROGNAME is still not set, then set the language to English
+	if "%PROGNAME%" == "" set PROGNAME=Greenstone Librarian Interface
+
+
+if "%PROGABBR%" == "" set PROGABBR=GLI
+if "%PROGNAME_EN%" == "" set PROGNAME_EN=Greenstone Librarian Interface
+
 :findGSDL
 echo.
-if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
-if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
+if "%GLILANG%" == "en" echo %PROGNAME% (%PROGABBR%)
+if "%GLILANG%" == "en" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "en" echo %PROGABBR% comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
 if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
 
-if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
+if "%GLILANG%" == "es" echo Interfaz de la %PROGNAME% (%PROGNAME_EN% - %PROGABBR%)
+if "%GLILANG%" == "es" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "es" echo La Interfaz de la %PROGNAME% NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
 if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
 if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
 
-if "%GLILANG%" == "fr" echo Interface du Bibliothcaire Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "fr" echo GLI est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
+if "%GLILANG%" == "fr" echo Interface du %PROGNAME% (%PROGNAME_EN% - %PROGABBR%)
+if "%GLILANG%" == "fr" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "fr" echo %PROGABBR% est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
 if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit 
  le redistribuer
 
-if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á %PROGNAME% (%PROGNAME_EN% - %PROGABBR%)
+if "%GLILANG%" == "ru" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
 if "%GLILANG%" == "ru" echo  ­¥ € ¥â   ; €¥â «š á¬. ¢ â¥ªáâ¥ LICENSE.TXT
 if "%GLILANG%" == "ru" echo â® - á¢®¡®€­® à á¯à®áâà ­ï¥¬®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
 
 echo.
-::  ---- Determine GSDLHOME ----
+::  ---- Determine path to Greenstone home for GS2 and GS3 ----
 set GSDLPATH=
-
-:: Some users may set the above line manually
-if not "%GSDLPATH%" == "" goto testGSDL
-
-    :: The default location for the GLI is a subdirectory of Greenstone
-    set GSDLPATH=..
-
-    :: If it is set, use the GSDLHOME environment variable 
-    if "%GSDLHOME%" == "" goto testGSDL
-	set GSDLPATH=%GSDLHOME%
+:: Some users may set the above line manually, or it may be set as an argument
+
+set _VERSION=
+if not "%GSDLPATH%" == "" goto getVer
+	:: Otherwise gsdlpath is not yet set
+	:: Check the env vars first 
+	if not "%GSDL3SRCHOME%" == "" goto ver3
+		if not "%GSDLHOME%" == "" goto ver2
+			:: If not set, the default location for the GLI is a subdirectory of Greenstone
+			set GSDLPATH=..
+			goto getVer
+
+:getVer
+call gsdlver.bat %GSDLPATH% %_VERSION% > nul
+if "%_VERSION%" == "1" goto exit
+::if we are running GS2, free up any pre-set GS3 environment variables since we won't need them
+if "%_VERSION%" == "2" set GSDL3SRCHOME=
+if "%_VERSION%" == "2" set GSDL3HOME=
+goto testGSDL
+
+
+:ver3
+set _VERSION=3
+set GSDLPATH=%GSDL3SRCHOME%
+:: if GS2 is now also set, then both GS3 and GS2 are set: 
+:: warn the user that we have defaulted to GS3
+if not "%GSDLHOME%" == "" echo Both Greenstone 2 and Greenstone 3 environments are set.
+if not "%GSDLHOME%" == "" echo It is assumed you want to run Greenstone 3.
+if not "%GSDLHOME%" == "" echo If you want to run Greenstone 2, please unset the
+if not "%GSDLHOME%" == "" echo environment variable GSDL3SRCHOME before running GLI.
+if not "%GSDLHOME%" == "" echo.
+goto testGSDL
+
+
+:ver2
+set _VERSION=2
+set GSDLPATH=%GSDLHOME%
+::free up the GS3 environment variables since we are running GS2 and don't need them
+set GSDL3SRCHOME=
+set GSDL3HOME=
+goto testGSDL
+
 
 :testGSDL
-:: Check that the Greenstone installation looks OK
-if "%GLILANG%" == "en" echo Checking GSDL: %GSDLPATH%
-if "%GLILANG%" == "es" echo Revisando GSDL: %GSDLPATH%
-if "%GLILANG%" == "fr" echo Vrification de GSDL: %GSDLPATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  GSDL: %GSDLPATH%
-if exist "%GSDLPATH%\setup.bat" goto prepGSDL
-    echo.
-    if "%GLILANG%" == "en" echo The Greenstone installation could not be found, or is incomplete.
-    if "%GLILANG%" == "en" echo Try reinstalling Greenstone then running this script again.
-
-    if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone o est  incompleta.
-    if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone y a continuaci¢n ejecute nuevamente este gui¢n.
-
-    if "%GLILANG%" == "fr" echo L'installation de Greenstone est introuvable ou incomplte. Essayez
-    if "%GLILANG%" == "fr" echo de rinstaller Greenstone et excutez ce script 
- nouveau.
-
-    if "%GLILANG%" == "ru" echo ­áâ ««ïæšï Greenstone ­¥ ¡ë«  ­ ©€¥­  š«š ®­  ­¥¯®«­ . ®¯à®¡ã©â¥ ¯®¢â®à­®
-    if "%GLILANG%" == "ru" echo ãáâ ­®¢šâì Greenstone,   § â¥¬ ¢¢¥áâš íâ®â áªàš¯â á­®¢ .
-    goto exit
+set CHECK=1
+call chkinst.bat "%GSDLPATH%" %_VERSION% %GLILANG% %CHECK% > nul
+if "%CHECK%" == "1" goto exit
+	:: otherwise installation worked well
+	goto prepGSDL
+
 
 :prepGSDL
-:: Setup Greenstone, unless it has already been done
+:: Greenstone 3 case
+if "%_VERSION%" == "3" goto prepGS3
+
+if not "%_VERSION%" == "2" echo "Greenstone version unknown"
+if not "%_VERSION%" == "2" goto :exit
+
+:: Otherwise, we are dealing with Greenstone 2
+:: Setup Greenstone 2, unless it has already been done
 if not "%GSDLHOME%" == "" goto doneGSDL
-    call "%GSDLPATH%\setup.bat" SetEnv > nul
+    call "%GSDLPATH%\setup.bat" SetEnv
+    goto doneGSDL
+
+
+:prepGS3
+set GSDL2PATH=
+: Some users may set the above line manually
+
+if "%GSDL3SRCHOME%" == "" goto setup3
+	if "%GSDL3HOME%" == "" goto setup3
+		::otherwise
+		goto gs2build
+
+
+:setup3
+:: Setup Greenstone 3, unless it has already been done
+    cd | winutil\setvar.exe GLIDIR > %TMP%\setgli.bat
+    call %TMP%\setgli.bat
+    del %TMP%\setgli.bat
+    cd "%GSDLPATH%"
+    call gs3-setup.bat SetEnv
+    cd %GLIDIR%
+    goto gs2build
+
+
+:gs2build
+	:: If Greenstone version 3 is running, we want to set gsdl2path
+	:: Determine GSDLHOME for GS3 
+	if not "%GSDL2PATH%" == "" goto setupGS2
+		:: GSDL2PATH is not yet set. 
+		:: And if GSDLHOME is not set either, then assume 
+		:: that the gs2build subdir of GS3 exists
+		if "%GSDLHOME%" == "" set GSDL2PATH=%GSDL3SRCHOME%\gs2build
+		if "%GSDLHOME%" == "" goto setupGS2	
+			:: Otherwise GSDLHOME is set, so set GSDL2PATH to GSDLHOME
+			echo GSDLHOME environment variable is set to %GSDLHOME%.	
+			echo Will use this to find build scripts.
+			set GSDL2PATH=%GSDLHOME%
+
+:setupGS2
+set CHECK=1
+call chkinst.bat "%GSDL2PATH%" 2 %GLILANG% %CHECK% > nul
+if "%CHECK%" == "1" goto exit
+	:: otherwise installation worked well
+	:: Setup Greenstone, unless it has already been done
+	if "%GSDLHOME%" == "" call "%GSDL2PATH%\setup.bat" SetEnv
+	:: Either way, we can now dispose of GSDL2PATH
+	set GSDL2PATH=	
+	goto doneGSDL
+
 
 :doneGSDL
@@ -95,11 +186,13 @@
 set PERLPATH=
 
-:: Some users may set the above line manually
+:: Some users may set the above line manually - If you do this, you need to 
+:: make sure that perl is in your path otherwise lucene collections may not 
+:: work
 if not "%PERLPATH%" == "" goto testPerl
 
     :: Check if Perl is on the search path
-    echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > setperl.bat
-    call setperl.bat
-    del setperl.bat
+    echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
+    call %TMP%\setperl.bat
+    del %TMP%\setperl.bat
     if not "%PERLPATH%" == "" goto testPerl
 
@@ -108,35 +201,40 @@
 
     :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > perl.reg
-    regedit /E perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
-    type perl.reg > perl.txt
-    del perl.reg
-
-    winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > setperl.bat
-    del perl.txt
-    call setperl.bat
-    del setperl.bat
+    type nul > %TMP%\perl.reg
+    regedit /E %TMP%\perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
+    type %TMP%\perl.reg > %TMP%\perl.txt
+    del %TMP%\perl.reg
+
+    winutil\findperl.exe %TMP%\perl.txt | winutil\setvar.exe PERLPATH > %TMP%\setperl.bat
+    del %TMP%\perl.txt
+    call %TMP%\setperl.bat
+    del %TMP%\setperl.bat
 
     :: If nothing was found in the registry, we're stuck
     if "%PERLPATH%" == "" goto noPerl
 
+    :: if have found perl in registry, but not in path, then we need to 
+    :: add it to path for lucene stuff.
+    if "%OS%" == "Windows_NT" set PATH=%PATH%;%PERLPATH%
+    if "%OS%" == "" set PATH="%PATH%";"%PERLPATH%"
     goto testPerl
 
 :gsdlPerl
     set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
-
+    	
 :testPerl
 :: Check that a Perl executable has been found
-if "%GLILANG%" == "en" echo Checking Perl: %PERLPATH%
-if "%GLILANG%" == "es" echo Revisando Perl: %PERLPATH%
-if "%GLILANG%" == "fr" echo Vrification de Perl: %PERLPATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  Perl: %PERLPATH%
-if exist "%PERLPATH%\perl.exe" goto findJava
+if not exist "%PERLPATH%\perl.exe" goto noPerl
+echo Perl:
+echo %PERLPATH%
+echo.
+
+goto findJava
 
 :noPerl
     echo.
-    if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires perl in order to operate,
-    if "%GLILANG%" == "en" echo but perl could not be detected on your system. Please ensure that perl
-    if "%GLILANG%" == "en" echo is installed and is on your search path, then rerun this script.
+    if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires Perl in order to operate,
+    if "%GLILANG%" == "en" echo but Perl could not be detected on your system. Please ensure that Perl
+    if "%GLILANG%" == "en" echo is installed and is on your search path, then try again.
 
     if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder
@@ -158,51 +256,23 @@
 
 :findJava
-:: ---- Check Java exists ----
-set JAVAPATH=
-
-:: Some users may set the above line manually
-if not "%JAVAPATH%" == "" goto testJava
-
-    :: If it is set, use the JAVA_HOME environment variable
-    if not "%JAVA_HOME%" == "" goto javahome
-
-    :: Check if Java is on the search path
-    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
-    call setjava.bat
-    del setjava.bat
-    if not "%JAVAPATH%" == "" goto testJava
-
-    :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > jdk.reg
-    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
-    type jdk.reg > jdk.txt
-    del jdk.reg
-    type nul > jre.reg
-    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
-    type jre.reg > jre.txt
-    del jre.reg
-
-    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
-    del jdk.txt
-    del jre.txt
-    call setjava.bat
-    del setjava.bat
-
-    :: If nothing was found in the registry, we're stuck
-    if "%JAVAPATH%" == "" goto noJava
-
-    set JAVAPATH=%JAVAPATH%\bin
-    goto testJava
-
-:javahome
-    set JAVAPATH=%JAVA_HOME%\bin
-
-:testJava
-:: Check that a Java executable has been found
-if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
-if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
-if "%GLILANG%" == "fr" echo Vrification de Java: %JAVAPATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
-if exist "%JAVAPATH%\java.exe" goto checkGLI
+    if "%_VERSION%" == "2" (
+		set SEARCH4J_EXECUTABLE=%GSDLHOME%\bin\windows\search4j.exe
+		set HINT=%GSDLHOME%\packages\jre
+	)
+    if "%_VERSION%" == "3" (
+		set SEARCH4J_EXECUTABLE=%GSDL3SRCHOME%\bin\search4j.exe
+		set HINT=%GSDL3SRCHOME%\packages\jre
+	)
+    
+    "%SEARCH4J_EXECUTABLE%" -e -m "1.4.0_00" -p "%HINT%" | winutil\setvar.exe JAVA_EXECUTABLE > %TMP%\set_java_executable.bat
+    call "%TMP%\set_java_executable.bat"
+    del "%TMP%\set_java_executable.bat"
+    
+    if "%JAVA_EXECUTABLE%" == "" goto noJava
+    echo Java:
+    echo %JAVA_EXECUTABLE%
+    echo.
+
+    goto checkGLI
 
 :noJava
@@ -212,17 +282,16 @@
     if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
 
-    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
+    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
     if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
     if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
 
-    if "%GLILANG%" == "fr" echo Une version adquate de Java n'a pas pu tre localise. Vous devez
-    if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou suprieur)
-    if "%GLILANG%" == "fr" echo avant de dmarrer Greenstone Librarian Interface.
-
-    if "%GLILANG%" == "ru" echo ¥ ã€ «®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ á®®â¢¥âáâ¢ãîé¥© ¢¥àášš Java.
-    if "%GLILANG%" == "ru" echo ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
-    if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone.
+    if "%GLILANG%" == "fr" echo Une version ad?quate de Java n'a pas pu ?tre localis?e. Vous devez
+    if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou sup?rieur)
+    if "%GLILANG%" == "fr" echo avant de d?marrer Greenstone Librarian Interface.
+
+    if "%GLILANG%" == "ru" echo ¥ ã «®áì ®¯à¥¥«âì ¬¥áâ®­ å®¥­¥ á®®â¢¥âáâ¢ãîé¥© ¢¥àá Java.
+    if "%GLILANG%" == "ru" echo ?ë ®«­ë ãáâ ­®¢âì Java Runtime Environment (¢¥àáî 1.4 « ¢ëè¥) ¯¥à¥ ¢¢®®¬
+    if "%GLILANG%" == "ru" echo ¡¡«®â¥ç­®£® ­â¥àä¥©á  Greenstone.
     goto exit
-
 
 :checkGLI
@@ -246,11 +315,44 @@
 
 :runGLI
+
+if not "%_VERSION%" == "" (
+    echo Greenstone Major Version:
+	echo %_VERSION%
+	echo.
+)
+
+if not "%GSDL3SRCHOME%" == "" (
+    echo GSDL3SRCHOME:
+    echo %GSDL3SRCHOME%
+	echo.
+)
+
+if not "%GSDL3HOME%" == "" (
+    echo GSDL3HOME:
+    echo %GSDL3HOME%
+	echo.
+)
+
+if not "%GSDLHOME%" == "" (
+    echo GSDLHOME:
+    echo %GSDLHOME%
+	echo.
+)
+
+:: ---- Explain how to bypass Imagemagick and Ghostscript bundled with Greenstone if needed ----
+echo.
+if exist "%GSDLHOME%\bin\windows\ghostscript\bin\*.*" echo GhostScript bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to %GSDLHOME%\bin\windows and rename the folder called ghostscript to something else.
+echo.
+echo.
+if exist "%GSDLHOME%\bin\windows\imagemagick\*.*" echo ImageMagick bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to %GSDLHOME%\bin\windows and rename the folder called imagemagick to something else.
+echo.
+echo.
+
+
 :: ---- Finally, run the GLI ----
-echo.
-
-if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface...
-if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la Biblioteca Digital Greenstone...
-if "%GLILANG%" == "fr" echo Excution de Greenstone Librarian Interface
-if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone...
+if "%GLILANG%" == "en" echo Running the %PROGNAME%...
+if "%GLILANG%" == "es" echo Ejecutando la %PROGNAME%...
+if "%GLILANG%" == "fr" echo Excution de %PROGNAME%
+if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š %PROGNAME%...
 
 :: -Xms32M          To set minimum memory
@@ -261,11 +363,35 @@
 :: -Xloggc:<file>   Write garbage collection log
 
-if exist "%GSDLHOME%\server.exe" goto localLib 
+
+:: Run GS3 if version = 3
+if "%_VERSION%" == "3" "%JAVA_EXECUTABLE%" -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -gsdl3 %GSDL3HOME% -gsdl3src %GSDL3SRCHOME% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
+if "%_VERSION%" == "3" goto finRun
+
+:: Run GS2 since version is 2:
+:: if FLI is running, we don't want the local Greenstone library server running
+if "%PROGABBR%" == "FLI" goto webLib
+	:: Else we're running GLI, so we want the local Greenstone library server (if server.exe exists, otherwise it will be webLib)
+	if exist "%GSDLHOME%\server.exe" goto localLib 
 
 :webLib
-    "%JAVAPATH%\java" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-    if ERRORLEVEL 2 goto webLib
-
+    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
+    if ERRORLEVEL 2 if not "%localLibFailed%" == "true" (
+        echo webLib failed, going to localLib
+		set webLibFailed=true
+        goto localLib
+    )
+    goto finRun	
+
+:localLib
+    "%JAVA_EXECUTABLE%" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% -local_library %GSDLHOME%\server.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
+    if ERRORLEVEL 2 if not "%webLibFailed%" == "true" (
+        echo localLib failed, going to webLib
+        set localLibFailed=true
+        goto webLib
+    )
+    goto finRun
+
+
+:finRun
     if "%GLILANG%" == "en" echo Done!
     if "%GLILANG%" == "es" echo ­Hecho!
@@ -274,21 +400,15 @@
     goto done
 
-:localLib
-    "%JAVAPATH%\java" -Xmx128M -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -perl %PERLPATH% -local_library %GSDLHOME%\server.exe %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-    if ERRORLEVEL 2 goto localLib
-
-    if "%GLILANG%" == "en" echo Done!
-    if "%GLILANG%" == "es" echo ­Hecho!
-    if "%GLILANG%" == "fr" echo Termin!
-    if "%GLILANG%" == "ru" echo ë¯®«­¥­®!
-    goto done
 
 :exit
 echo.
 pause
+color 07
+popd
 
 :done
 :: ---- Clean up ----
 set PERLPATH=
-set JAVAPATH=
+set JAVA_EXECUTABLE=
+color 07
+popd
Index: /gli/branches/rtl-gli/gli.sh
===================================================================
--- /gli/branches/rtl-gli/gli.sh	(revision 18350)
+++ /gli/branches/rtl-gli/gli.sh	(revision 18351)
@@ -1,26 +1,101 @@
 #!/bin/sh
+
+# Function that, when given gsdlpath as parameter, will return the
+# version of greenstone that is to run (2 or 3). If things are not,
+# this program will exit here.
+get_version() {
+    # first parameter is value of gsdlpath
+    if [ -f "${1}/gs3-setup.sh" ]; then
+    return 3
+    elif [ -f "${1}/setup.bash" ]; then
+    return 2
+    else
+    echo "Error: can't determine which Greenstone version is being run."
+    exit 1
+    fi
+}
+
+# Function that is passed the following paramters (in order):
+# - the gsdlpath (GS3 home, GS2 home or gs2build for GS3), 
+# - the version of greenstone that's running, and 
+# - the language GLI is set to
+# and checks the installation. 
+# If things are not right, this program will exit here.
+check_installation() {
+# Check that the Greenstone installation looks OK
+    if [ "$3" = "es" ]; then
+    echo "Revisando GSDL$2: $1"
+    elif [ "$3" = "fr" ]; then
+    echo "Vérification de GSDL$2: $1"
+    elif [ "$3" = "ru" ]; then
+    echo "ðÒÏ×ÅÒËÁ GSDL$2: $1"
+    else
+    echo "Checking GSDL$2: $1"
+    fi
+    # even if we are only checking for gs2build (gsdl2path), we still 
+    # need the file setup.bash to exist in the following condition:
+    if [ ! -f "${1}/gs3-setup.sh" -a ! -f "${1}/setup.bash" ] ; then
+    echo
+    if [ "$3" = "es" ]; then
+        echo "No se pudo encontrar la instalación de Greenstone $2 o está incompleta."
+        echo "Trate de reinstalar Greenstone $2 y a continuación ejecute nuevamente"
+        echo "este guión."
+    elif [ "$3" = "fr" ]; then
+        echo "L'installation de Greenstone $2 est introuvable ou incomplète."
+        echo "Essayez de réinstaller Greenstone $2 et exécutez ce script à nouveau."
+    elif [ "$3" = "ru" ]; then
+        echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone $_version ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
+        echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone $2, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
+    else
+        echo "The Greenstone $2 installation could not be found, or is incomplete."
+        echo "Try reinstalling Greenstone $2 then running this script again."
+    fi
+    exit 1
+    fi
+}
+
 glilang=en
 
+if [ "x$PROGNAME" = "x" ] ; then
+  if [ "$glilang" = "es" ]; then
+    PROGNAME="Biblioteca Digital Greenstone"
+  elif [ "$glilang" = "fr" ]; then
+    PROGNAME="Bibliothécaire Greenstone"
+  elif [ "$glilang" = "ru" ]; then
+    PROGNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
+  else
+    PROGNAME="Greenstone Librarian Interface"
+  fi
+fi
+
+if [ "x$PROGABBR" = "x" ] ; then
+    PROGABBR="GLI"
+fi
+
+if [ "x$PROGNAME_EN" = "x" ] ; then
+    PROGNAME_EN="Greenstone Librarian Interface"
+fi
+
 echo
 if [ "$glilang" = "es" ]; then
-    echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
+    echo "Interfaz de la $PROGNAME ($PROGNAME_EN - $PROGABBR)"
     echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
+    echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
     echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
     echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
 elif [ "$glilang" = "fr" ]; then
-    echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
+    echo "Interface du $PROGNAME ($PROGNAME_EN - $PROGABBR)"
     echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GLI est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
+    echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
     echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
 elif [ "$glilang" = "ru" ]; then
-    echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
+    echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ($PROGNAME_EN - $PROGABBR)"
     echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
     echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
     echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
 else
-    echo "Greenstone Librarian Interface (GLI)"
+    echo "$PROGNAME ($PROGABBR)"
     echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
+    echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
     echo "This is free software, and you are welcome to redistribute it"
 fi
@@ -35,9 +110,9 @@
         echo "Este guión deberá ejecutarse desde el directorio en el que reside."
     elif [ "$glilang" = "fr" ]; then
-	echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
+    echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
     elif [ "$glilang" = "ru" ]; then
-	echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
-    else
-	echo "This script must be run from the directory in which it resides."
+    echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
+    else
+    echo "This script must be run from the directory in which it resides."
     fi
     exit 1
@@ -46,54 +121,114 @@
 
 ##  ---- Determine GSDLHOME ----
+## gsdlpath can be either Greenstone 3 or Greenstone 2
 gsdlpath=
-
 # Some users may set the above line manually
-if [ "x$gsdlpath" = "x" ]; then
+
+
+# This variable is set automatically:
+_version=
+if [ "x$gsdlpath" != "x" ]; then
+    get_version $gsdlpath
+    _version=$?
+# otherwise $gsdlpath is not yet set
+else
     # Check the environment variable first
+    # Check whether environment variables for both GS2 and GS3 are set
+    # and if so, warn the user that we have defaulted to GS3
+    if [ "x$GSDLHOME" != "x" -a "x$GSDL3SRCHOME" != "x" ]; then
+        # _version not set, but both env vars set, so default to 3
+    _version=3
+    gsdlpath=$GSDL3SRCHOME
+    echo "Both Greenstone 2 and Greenstone 3 environments are set." 
+    echo "It is assumed you want to run Greenstone 3."
+    echo "If you want to run Greenstone 2, please unset the"
+    echo "environment variable GSDL3SRCHOME before running GLI."
+    echo ""
+    elif [ "x$GSDL3SRCHOME" != "x" ]; then
+    echo "Only gsdl3srchome set"
+    gsdlpath=$GSDL3SRCHOME
+    _version=3
+    echo "$gsdlpath"
+    elif [ "x$GSDLHOME" != "x" ]; then
+    gsdlpath=$GSDLHOME
+    _version=2
+    # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone
+    else
+    gsdlpath=`(cd .. && pwd)`
+    # Still need to find what version we are running:
+    # GS3 main directory contains file gs3-setup.sh, GS2 only setup.bash
+    get_version $gsdlpath
+    _version=$?
+    fi
+fi
+
+echo "Greenstone version found: $_version"
+
+# Check that the main Greenstone installation for the version we're running looks OK
+check_installation $gsdlpath $_version $glilang
+
+
+# Need to source the correct setup file depending on whether we are running
+# gs3 or gs2
+# If we're running version GS2
+if [ "$_version" -eq 2 ]; then
+    # Setup Greenstone 2, unless it has already been done
+    if [ "x$GSDLHOME" = "x" ]; then
+    cd "$gsdlpath"
+    . ./setup.bash
+    cd "$thisdir"
+    fi
+# else, if we're running GS3
+elif [ "$_version" -eq 3 ]; then
+    # Setup Greenstone 3, unless it has already been done
+    if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then
+    cd "$gsdlpath"
+    . ./gs3-setup.sh
+    cd "$thisdir"
+    fi
+    
+    ## if Greenstone version 3 is running, we want to set gsdl2path
+    ##  ---- Determine GSDLHOME ----
+    ## may be already set, or manually entered here.
+    gsdl2path=
+    
+    # Some users may set the above line manually
+    if [ "x$gsdl2path" = "x" ]; then
+        # Check the environment variable first
     if [ "x$GSDLHOME" != "x" ]; then
-	gsdlpath=$GSDLHOME
-
-    # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone
-    else
-	gsdlpath=`(cd .. && pwd)`
-    fi
-fi
-
-# Check that the Greenstone installation looks OK
-if [ "$glilang" = "es" ]; then
-    echo "Revisando GSDL: $gsdlpath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de GSDL: $gsdlpath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath"
-else
-    echo "Checking GSDL: $gsdlpath"
-fi
-if [ ! -f "${gsdlpath}/setup.bash" ] ; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "No se pudo encontrar la instalación de Greenstone o está incompleta."
-        echo "Trate de reinstalar Greenstone y a continuación ejecute nuevamente"
-	echo "este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "L'installation de Greenstone est introuvable ou incomplète."
-	echo "Essayez de réinstaller Greenstone et exécutez ce script à nouveau."
-    elif [ "$glilang" = "ru" ]; then
-	echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
-	echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
-    else
-	echo "The Greenstone installation could not be found, or is incomplete."
-	echo "Try reinstalling Greenstone then running this script again."
-    fi
-    exit 1
-fi
-
-# Setup Greenstone, unless it has already been done
-if [ "x$GSDLHOME" = "x" ]; then
-    cd "$gsdlpath"
-    . setup.bash
+        echo "GSDLHOME environment variable is set to $GSDLHOME."
+        echo "Will use this to find build scripts."
+        gsdl2path=$GSDLHOME
+        # If it is not set, assume that the gs2build subdirectory of Greenstone 3 exists
+    else
+        gsdl2path=$GSDL3SRCHOME/gs2build
+    fi
+    fi
+    # Check that Greenstone 3's Greenstone 2 stuff looks OK (in gs2build)
+    check_installation $gsdl2path "" $glilang
+  
+    # Setup Greenstone 3's gs2build, unless it has already been done
+    if [ "x$GSDLHOME" = "x" ]; then
+    cd "$gsdl2path"
+    . ./setup.bash
     cd "$thisdir"
-fi
-
+    fi
+
+else 
+    echo "Greenstone version unknown."    
+    exit 1
+fi
+
+echo
+if [ "x$GSDL3SRCHOME" != "x" ]; then
+    echo "GSDL3SRCHOME is: $GSDL3SRCHOME"
+fi
+if [ "x$GSDL3HOME" != "x" ]; then
+    echo "GSDL3HOME is: $GSDL3HOME"
+fi
+if [ "x$GSDLHOME" != "x" ]; then
+    echo "GSDLHOME is: $GSDLHOME"
+fi
+echo
 
 ##  ---- Check Perl exists ----
@@ -107,86 +242,131 @@
 
 # Check that a Perl executable has been found
-if [ "$glilang" = "es" ]; then
-    echo "Revisando Perl: $perlpath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de Perl: $perlpath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
-else
-    echo "Checking Perl: $perlpath"
-fi
+echo "Perl:"
 if [ ! -x "$perlpath" ] ; then
     echo
     if [ "$glilang" = "es" ]; then
-	echo "La Interfaz de la Biblioteca Digital Greenstone requiere Perl para "
-	echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
-	echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
-	echo "continuación ejecute nuevamente este guión."
+    echo "La Interfaz de la $PROGNAME requiere Perl para "
+    echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
+    echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
+    echo "continuación ejecute nuevamente este guión."
     elif [ "$glilang" = "fr" ]; then
-	echo "Greenstone Librarian Interface nécessite perl pour son fonctionnement,"
-	echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
-	echo "assurer que perl est installé et est spécifié dans votre chemin de "
-	echo "recherche, puis redémarrez ce script."
+    echo "$PROGNAME nécessite Perl pour son fonctionnement,"
+    echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
+    echo "assurer que perl est installé et est spécifié dans votre chemin de "
+    echo "recherche, puis redémarrez ce script."
     elif [ "$glilang" = "ru" ]; then
-	echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
-	echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
-	echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ"
-	echo "ÜÔÏÔ ÓËÒÉÐÔ."
-    else
-	echo "The Greenstone Librarian Interface requires perl in order to operate,"
-	echo "but perl could not be detected on your system. Please ensure that perl"
-	echo "is installed and is on your search path, then rerun this script."
-    fi
-    exit 1
-fi
-
-
-## ---- Check Java exists ----
-javapath=
-
-# Some users may set the above line manually
-if [ "x$javapath" = "x" ]; then
-
-    # If it is set, use the JAVA_HOME environment variable
-    if [ "x$JAVA_HOME" != "x" ]; then
-	javapath="$JAVA_HOME/bin/java"
-
-    # Check if Java is on the search path
-    else
-	javapath=`which java 2> /dev/null`
-    fi
-fi
-
-# Check that a Java executable has been found
-if [ "$glilang" = "es" ]; then
-    echo "Revisando Java: $javapath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de Java: $javapath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ Java: $javapath"
-else
-    echo "Checking Java: $javapath"
-fi
-if [ ! -x "$javapath" ]; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
-	echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
-	echo "antes de correr la Interfaz de la Biblioteca Digital Greenstone."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Une version adéquate de Java n'a pas pu être localisée."
-	echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
-	echo "supérieur) avant de démarrer Greenstone Librarian Interface."
-    elif [ "$glilang" = "ru" ]; then
-	echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
-	echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
-	echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone."
-    else
-	echo "Failed to locate an appropriate version of Java. You must install a"
-	echo "Java Runtime Environment (version 1.4 or greater) before running the"
-	echo "Greenstone Librarian Interface."
-    fi
-    exit 1
-fi
+    echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
+    echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
+    echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ"
+    echo "ÜÔÏÔ ÓËÒÉÐÔ."
+    else
+    echo "The $PROGNAME requires Perl in order to operate,"
+    echo "but perl could not be detected on your system. Please ensure that perl"
+    echo "is installed and is on your search path, then rerun this script."
+    fi
+    exit 1
+fi
+echo $perlpath
+echo
+
+## ---- Check Java ----
+echo "Java:"
+MINIMUM_JAVA_VERSION=1.4.0_00
+
+# Some users may set this line manually
+#JAVA_HOME=
+
+if [ -z $javapath ]; then
+
+    # sus out search4j
+    if [ "$_version" -eq 2 -a -e "$GSDLHOME/bin/$GSDLOS/search4j" ]; then
+        SEARCH4J_EXECUTABLE=$GSDLHOME/bin/$GSDLOS/search4j
+    elif [ "$_version" -eq 3 -a -e "$GSDL3SRCHOME/bin/$GSDLOS/search4j" ]; then
+        SEARCH4J_EXECUTABLE=$GSDL3SRCHOME/bin/search4j
+    elif [ -e "../bin/$GSDLOS/search4j" ]; then
+        SEARCH4J_EXECUTABLE=../bin/$GSDLOS/search4j
+    elif [ -e "../bin/search4j" ]; then
+        SEARCH4J_EXECUTABLE=../bin/search4j
+    else
+        echo "Couldn't determine the location of the search4j executable"
+        echo "If you are running Greenstone2"
+        echo "   * check GSDLHOME is set"
+        echo "   * check bin/$GSDLOS/search4j exists"
+        echo "   * check bin/$GSDLOS/search4j is executable"
+        echo "If you are running Greenstone3"
+        echo "   * check GSDL3SRCHOME is set"
+        echo "   * check bin/search4j exists"
+        echo "   * check bin/search4j is executable"
+        echo "   * try running 'ant compile-search4j'"
+    fi
+
+	# Give search4j a hint to find Java depending on the platform
+	if [ $GSDLOS = linux ]; then
+		HINT=`cd ..;pwd`/packages/jre
+	elif [ $GSDLOS = darwin ]; then
+		HINT=/System/Library/Frameworks/JavaVM.framework/Home
+	fi	
+	
+    javapath=`$SEARCH4J_EXECUTABLE -e -p $HINT -m $MINIMUM_JAVA_VERSION`
+
+    if [ "$?" != "0" ]; then
+
+        OLDVER=`"$SEARCH4J_EXECUTABLE" -v -p "$HINT"`
+
+        if [ "$?" = "0" ]; then
+
+            if [ "$glilang" = "es" ]; then
+                echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
+                echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
+                echo "la Interfaz de la $PROGNAME. Por favor instale "
+                echo "una nueva versión del Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o "
+                echo "posterior) y ejecute nuevamente este guión."
+            elif [ "$glilang" = "fr" ]; then
+                echo "La version de Java Runtime Environment que vous avez installée est"
+                echo "trop vielle pour faire fonctionner $PROGNAME."
+                echo "Veuillez installer une nouvelle version du JRE (version $MINIMUM_JAVA_VERSION ou plus"
+                echo "récente) et redémarrez le script."
+            elif [ "$glilang" = "ru" ]; then
+                echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
+                echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ $PROGNAME. ðÏÖÁÌÕÊÓÔÁ, "
+                echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
+                echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
+            else
+                echo "The version of the Java Runtime Environment you have installed ($OLDVER)"
+                echo "is too old to run the $PROGNAME. Please install a new"
+                echo "version of the JRE (version $MINIMUM_JAVA_VERSION or newer) and rerun this script."
+            fi
+            exit 1
+
+        else
+
+            echo
+            if [ "$glilang" = "es" ]; then
+                echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
+                echo "instalar un Ambiente de Ejecución Java (versión $MINIMUM_JAVA_VERSION o superior) "
+                echo "antes de correr la Interfaz de la $PROGNAME."
+            elif [ "$glilang" = "fr" ]; then
+                echo "Une version adéquate de Java n'a pas pu être localisée."
+                echo "Vous devez installer un Java Runtime Environment (version $MINIMUM_JAVA_VERSION ou"
+                echo "supérieur) avant de démarrer $PROGNAME."
+				echo "Si vous avez Java installé sur votre ordinateur veuillez vérifier la variable"
+				echo "d'environnement JAVA_HOME."
+            elif [ "$glilang" = "ru" ]; then
+                echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
+                echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ $MINIMUM_JAVA_VERSION ÉÌÉ ×ÙÛÅ)"
+                echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ $PROGNAME."
+            else
+                echo "Failed to locate an appropriate version of Java. You must install a"
+                echo "Java Runtime Environment (version $MINIMUM_JAVA_VERSION or greater) before running the"
+                echo "$PROGNAME."
+				echo "If you have Java intalled on your machine please set the environment variable JAVA_HOME."
+            fi
+        fi
+
+    fi
+
+fi
+echo $javapath
+echo
 
 
@@ -195,26 +375,4 @@
 if [ $? -ne 2 ] ; then
     echo
-    if [ "$glilang" = "es" ]; then
-	echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
-	echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
-	echo "la Interfaz de la Biblioteca Digital Greenstone. Por favor instale "
-	echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
-	echo "posterior) y ejecute nuevamente este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "La version de Java Runtime Environment que vous avez installée est"
-	echo "trop vielle pour faire fonctionner Greenstone Librarian Interface."
-	echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
-	echo "récente) et redémarrez le script."
-    elif [ "$glilang" = "ru" ]; then
-	echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
-	echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
-	echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
-	echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
-    else
-	echo "The version of the Java Runtime Environment you have installed is too"
-	echo "old to run the Greenstone Librarian Interface. Please install a new"
-	echo "version of the JRE (version 1.4 or newer) and rerun this script."
-    fi
-    exit 1
 fi
 
@@ -223,62 +381,79 @@
     echo
     if [ "$glilang" = "es" ]; then
-	echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
-	echo "(por medio de makegli.sh) antes de ejecutar este guión."
+    echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
+    echo "(por medio de makegli.sh) antes de ejecutar este guión."
     elif [ "$glilang" = "fr" ]; then
-	echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
-	echo "avant d'exécuter ce script."
+    echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
+    echo "avant d'exécuter ce script."
     elif [ "$glilang" = "ru" ]; then
-	echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
-	echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
-    else
-	echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
-	echo "before running this script."
-    fi
-    exit 1
-fi
+    echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
+    echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
+    else
+    echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
+    echo "before running this script."
+    fi
+    exit 1
+fi
+
+## ---- Explain how to bypass Imagemagick and Ghostscript bundled with Greenstone if needed ----
+if [ -e "$GSDLHOME/bin/$GSDLOS/ghostscript" ] ; then
+echo "GhostScript bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to $GSDLHOME/bin/$GSDLOS and rename the folder called ghostscript to something else."
+fi
+echo
+echo
+if [ -e "$GSDLHOME/bin/$GSDLOS/imagemagick" ] ; then
+echo "ImageMagick bundled with Greenstone will be used, if you wish to use the version installed on your system (if any) please go to $GSDLHOME/bin/$GSDLOS and rename the folder called imagemagick to something else."
+echo
+echo
+fi
+
 
 ## ---- Finally, run the GLI ----
-echo
 if [ "$glilang" = "es" ]; then
-    echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
+    echo "Ejecutando la Interfaz de la $PROGNAME..."
 elif [ "$glilang" = "fr" ]; then
-    echo "Exécution de Greenstone Librarian Interface"
+    echo "Exécution de $PROGNAME..."
 elif [ "$glilang" = "ru" ]; then
-    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
+    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
 else
-    echo "Running the Greenstone Librarian Interface..."
-fi
-
+    echo "Running the $PROGNAME..."
+fi
+
+# basic_command is the cmd string common to both Greenstone 3 and Greenstone 2 execution
+basic_command="$javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg"
 stop_gli=0
 while [ "$stop_gli" = "0" ] ; do 
-
-# Other arguments you can provide to GLI to work around memory limitations, or debug
-# -Xms<number>M    To set minimum memory (by default 32MB)
-# -Xmx<number>M    To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
-# -verbose:gc      To set garbage collection messages
-# -Xincgc          For incremental garbage collection (significantly slows performance)
-# -Xprof           Function call profiling
-# -Xloggc:<file>   Write garbage collection log
-
-
-
-  $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl $GSDLHOME -gsdlos $GSDLOS $*
-  exit_status=$?
-
-  if [ "$exit_status" != "2" ] ; then
-    stop_gli=1
-  else
-    echo
-    if [ "$glilang" = "es" ]; then
-        echo "Restarting/Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
-    elif [ "$glilang" = "fr" ]; then
-        echo "Restarting/Exécution de Greenstone Librarian Interface"
-    elif [ "$glilang" = "ru" ]; then
-        echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
-    else
-        echo "Restarting the Greenstone Librarian Interface..."
-    fi
-
-  fi
+    
+    # Other arguments you can provide to GLI to work around memory limitations, or debug
+    # -Xms<number>M    To set minimum memory (by default 32MB)
+    # -Xmx<number>M    To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
+    # -verbose:gc      To set garbage collection messages
+    # -Xincgc          For incremental garbage collection (significantly slows performance)
+    # -Xprof           Function call profiling
+    # -Xloggc:<file>   Write garbage collection log
+    
+    exit_status=0
+    if [ "$_version" -eq 2 ]; then
+        $basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS $*
+        exit_status=$?
+    elif [ "$_version" -eq 3 ]; then    
+        $basic_command -gsdl $GSDLHOME -gsdlos $GSDLOS -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME $*
+        exit_status=$?
+    fi
+    
+    if [ "$exit_status" != "2" ] ; then
+        stop_gli=1
+    else
+        echo
+        if [ "$glilang" = "es" ]; then
+            echo "Restarting/Ejecutando la Interfaz de la $PROGNAME..."
+        elif [ "$glilang" = "fr" ]; then
+            echo "Restarting/Exécution de $PROGNAME..."
+        elif [ "$glilang" = "ru" ]; then
+            echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ $PROGNAME..."
+        else
+            echo "Restarting the $PROGNAME..."
+        fi
+    fi
 done 
 
Index: i/branches/rtl-gli/gli4gs3.bat
===================================================================
--- /gli/branches/rtl-gli/gli4gs3.bat	(revision 18350)
+++ 	(revision )
@@ -1,328 +1,0 @@
-@echo off
-set GLILANG=en
-
-
-::  -------- Run the Greenstone Librarian Interface --------
-
-:: This script must be run from within the directory in which it lives
-if exist gli4gs3.bat goto start
-    if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
-    if "%GLILANG%" == "es" echo Este gui¢n deber  ejecutarse desde el directorio en el que reside.
-    if "%GLILANG%" == "fr" echo Ce script doit tre excut 
- partir du rpertoire dans lequel il se trouve.
-    if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
-    goto exit
-
-:start
-if "%OS%" == "Windows_NT" goto findGSDL3
-    :: Invoke a new command processor to ensure there's enough environment space
-    if "%1" == "Second" goto findGSDL3
-        command /E:2048 /C %0 Second %1 %2 %3 %4 %5 %6 %7 %8 %9
-        goto done
-
-:findGSDL3
-echo.
-if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
-if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
-if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
-
-if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
-if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
-if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
-
-if "%GLILANG%" == "fr" echo Interface du Bibliothcaire Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "fr" echo GLI est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
-if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit 
- le redistribuer
-
-if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
-if "%GLILANG%" == "ru" echo  ­¥ € ¥â   ; €¥â «š á¬. ¢ â¥ªáâ¥ LICENSE.TXT
-if "%GLILANG%" == "ru" echo â® - á¢®¡®€­® à á¯à®áâà ­ï¥¬®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
-
-echo.
-::  ---- Determine GSDL3HOME ----
-set GSDL3PATH=%GSDL3PATH%
-
-:: Some users may set the above line manually, or it may be set as an argument
-if not "%GSDL3PATH%" == "" goto testGSDL3
-
-    :: The default location for the GLI is a subdirectory of Greenstone 3
-    set GSDL3PATH=..
-
-    :: If it is set, use the GSDL3HOME environment variable
-    if "%GSDL3SRCHOME%" == "" goto testGSDL3
-	set GSDL3PATH=%GSDL3SRCHOME%
-
-:testGSDL3
-:: Check that the Greenstone 3 installation looks OK
-if "%GLILANG%" == "en" echo Checking GSDL3: %GSDL3PATH%
-if "%GLILANG%" == "es" echo Revisando GSDL3: %GSDL3PATH%
-if "%GLILANG%" == "fr" echo Vrification de GSDL3: %GSDL3PATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  GSDL3: %GSDL3PATH%
-if exist "%GSDL3PATH%\gs3-setup.bat" goto prepGSDL3
-    echo.
-    if "%GLILANG%" == "en" echo The Greenstone 3 installation could not be found, or is incomplete.
-    if "%GLILANG%" == "en" echo Try reinstalling Greenstone 3 then running this script again.
-
-    if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone 3 o est  incompleta.
-    if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone 3 y a continuaci¢n ejecute nuevamente este gui¢n.
-
-    if "%GLILANG%" == "fr" echo L'installation de Greenstone 3 est introuvable ou incomplte. Essayez
-    if "%GLILANG%" == "fr" echo de rinstaller Greenstone 3 et excutez ce script 
- nouveau.
-
-    if "%GLILANG%" == "ru" echo ­áâ ««ïæšï Greenstone 3 ­¥ ¡ë«  ­ ©€¥­  š«š ®­  ­¥¯®«­ . ®¯à®¡ã©â¥ ¯®¢â®à­®
-    if "%GLILANG%" == "ru" echo ãáâ ­®¢šâì Greenstone, 3   § â¥¬ ¢¢¥áâš íâ®â áªàš¯â á­®¢ .
-    goto exit
-
-:prepGSDL3
-:: Setup Greenstone 3, unless it has already been done
-if not "%GSDL3SRCHOME%" == "" goto doneGSDL3
-    cd | winutil\setvar.exe GLIDIR > setgli.bat
-    call setgli.bat
-    del setgli.bat
-    cd "%GSDL3PATH%"
-    call gs3-setup.bat SetEnv > nul
-    cd %GLIDIR%
-
-:doneGSDL3
-:: GSDL3PATH is no longer needed, since GSDL3HOME should now be set
-set GSDL3PATH=
-
-
-::  ---- Determine GSDLHOME ----
-set GSDLPATH=%GSDLPATH%
-
-:: Some users may set the above line manually, or it may be set in the environment
-if not "%GSDLPATH%" == "" goto testGSDL
-
-    :: The default location for Greenstone is a gs2build subdirectory of Greenstone 3
-    set GSDLPATH=%GSDL3SRCHOME%\gs2build
-
-    :: If it is set, use the GSDLHOME environment variable
-    if "%GSDLHOME%" == "" goto testGSDL
-	set GSDLPATH=%GSDLHOME%
-
-:testGSDL
-:: Check that the Greenstone installation looks OK
-if "%GLILANG%" == "en" echo Checking GSDL: %GSDLPATH%
-if "%GLILANG%" == "es" echo Revisando GSDL: %GSDLPATH%
-if "%GLILANG%" == "fr" echo Vrification de GSDL: %GSDLPATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  GSDL: %GSDLPATH%
-if exist "%GSDLPATH%\setup.bat" goto prepGSDL
-    echo.
-    if "%GLILANG%" == "en" echo The Greenstone installation could not be found, or is incomplete.
-    if "%GLILANG%" == "en" echo Try reinstalling Greenstone then running this script again.
-
-    if "%GLILANG%" == "es" echo No se pudo encontrar la instalaci¢n de Greenstone o est  incompleta.
-    if "%GLILANG%" == "es" echo Trate de reinstalar Greenstone y a continuaci¢n ejecute nuevamente este gui¢n.
-
-    if "%GLILANG%" == "fr" echo L'installation de Greenstone est introuvable ou incomplte. Essayez
-    if "%GLILANG%" == "fr" echo de rinstaller Greenstone et excutez ce script 
- nouveau.
-
-    if "%GLILANG%" == "ru" echo ­áâ ««ïæšï Greenstone ­¥ ¡ë«  ­ ©€¥­  š«š ®­  ­¥¯®«­ . ®¯à®¡ã©â¥ ¯®¢â®à­®
-    if "%GLILANG%" == "ru" echo ãáâ ­®¢šâì Greenstone,   § â¥¬ ¢¢¥áâš íâ®â áªàš¯â á­®¢ .
-    goto exit
-
-:prepGSDL
-:: Setup Greenstone, unless it has already been done
-if not "%GSDLHOME%" == "" goto doneGSDL
-    call "%GSDLPATH%\setup.bat" SetEnv > nul
-
-:doneGSDL
-:: GSDLPATH is no longer needed, since GSDLHOME should now be set
-set GSDLPATH=
-
-
-:findPerl
-::  ---- Check Perl exists ----
-set PERLPATH=
-
-:: Some users may set the above line manually
-if not "%PERLPATH%" == "" goto testPerl
-
-    :: Check if Perl is on the search path
-    echo %PATH%| winutil\which.exe perl.exe | winutil\setvar.exe PERLPATH > setperl.bat
-    call setperl.bat
-    del setperl.bat
-    if not "%PERLPATH%" == "" goto testPerl
-
-    :: If not, try GSDLHOME\bin\windows\perl\bin
-    if exist "%GSDLHOME%\bin\windows\perl\bin\perl.exe" goto gsdlPerl
-
-    :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > perl.reg
-    regedit /E perl.reg "HKEY_LOCAL_MACHINE\SOFTWARE\Perl"
-    type perl.reg > perl.txt
-    del perl.reg
-
-    winutil\findperl.exe perl.txt | winutil\setvar.exe PERLPATH > setperl.bat
-    del perl.txt
-    call setperl.bat
-    del setperl.bat
-
-    :: If nothing was found in the registry, we're stuck
-    if "%PERLPATH%" == "" goto noPerl
-
-    goto testPerl
-
-:gsdlPerl
-    set PERLPATH=%GSDLHOME%\bin\windows\perl\bin
-
-:testPerl
-:: Check that a Perl executable has been found
-if "%GLILANG%" == "en" echo Checking Perl: %PERLPATH%
-if "%GLILANG%" == "es" echo Revisando Perl: %PERLPATH%
-if "%GLILANG%" == "fr" echo Vrification de Perl: %PERLPATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  Perl: %PERLPATH%
-if exist "%PERLPATH%\perl.exe" goto findJava
-
-:noPerl
-    echo.
-    if "%GLILANG%" == "en" echo The Greenstone Librarian Interface requires perl in order to operate,
-    if "%GLILANG%" == "en" echo but perl could not be detected on your system. Please ensure that perl
-    if "%GLILANG%" == "en" echo is installed and is on your search path, then rerun this script.
-
-    if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone requiere Perl para poder
-    if "%GLILANG%" == "es" echo operar, pero ste no aparece en su sistema. Por favor aseg£rese de
-    if "%GLILANG%" == "es" echo que Perl est  instalado y se encuentra en su ruta de b£squeda.
-    if "%GLILANG%" == "es" echo A continuaci¢n ejecute nuevamente este gui¢n.
-
-    if "%GLILANG%" == "fr" echo Greenstone Librarian Interface ncessite perl pour son fonctionnement,
-    if "%GLILANG%" == "fr" echo mais perl n'a pas pu tre dtect dans votre systme. Veuillez vous 
-    if "%GLILANG%" == "fr" echo assurer que perl est install et est spcifi dans votre chemin de 
-    if "%GLILANG%" == "fr" echo recherche, puis redmarrez ce script.
-
-    if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone âà¥¡ã¥â Perl, çâ®¡ë š¬¥âì ¢®§¬®Š­®áâì
-    if "%GLILANG%" == "ru" echo à ¡®â âì, ­® Perl ­¥ ¡ë« ¢ ¢ è¥© ášáâ¥¬¥. ®Š «ã©áâ , ¯®€â¢¥à€šâ¥,
-    if "%GLILANG%" == "ru" echo çâ® Perl ãáâ ­®¢«¥­ š ­ å®€šâáï ­  ¢ è¥¬ ¯ãâš ¯®šáª , § â¥¬
-    if "%GLILANG%" == "ru" echo ¯®¢â®à­®¢¢¥€šâ¥ íâ®â áªàš¯â.
-    goto exit
-
-
-:findJava
-:: ---- Check Java exists ----
-set JAVAPATH=
-
-:: Some users may set the above line manually
-if not "%JAVAPATH%" == "" goto testJava
-
-    :: If it is set, use the JAVA_HOME environment variable
-    if not "%JAVA_HOME%" == "" goto javahome
-
-    :: Check if Java is on the search path
-    echo %PATH%| winutil\which.exe java.exe | winutil\setvar.exe JAVAPATH > setjava.bat
-    call setjava.bat
-    del setjava.bat
-    if not "%JAVAPATH%" == "" goto testJava
-
-    :: Still haven't found anything, so try looking in the registry (gulp!)
-    type nul > jdk.reg
-    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
-    type jdk.reg > jdk.txt
-    del jdk.reg
-    type nul > jre.reg
-    regedit /E jre.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment"
-    type jre.reg > jre.txt
-    del jre.reg
-
-    winutil\findjava.exe jdk.txt jre.txt | winutil\setvar.exe JAVAPATH > setjava.bat
-    del jdk.txt
-    del jre.txt
-    call setjava.bat
-    del setjava.bat
-
-    :: If nothing was found in the registry, we're stuck
-    if "%JAVAPATH%" == "" goto noJava
-
-    set JAVAPATH=%JAVAPATH%\bin
-    goto testJava
-
-:javahome
-    set JAVAPATH=%JAVA_HOME%\bin
-
-:testJava
-:: Check that a Java executable has been found
-if "%GLILANG%" == "en" echo Checking Java: %JAVAPATH%
-if "%GLILANG%" == "es" echo Revisando Java: %JAVAPATH%
-if "%GLILANG%" == "fr" echo Vrification de Java: %JAVAPATH%
-if "%GLILANG%" == "ru" echo à®¢¥àª  Java: %JAVAPATH%
-if exist "%JAVAPATH%\java.exe" goto checkGLI
-
-:noJava
-    echo.
-    if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Java. You must install a
-    if "%GLILANG%" == "en" echo Java Runtime Environment (version 1.4 or greater) before running the
-    if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
-
-    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Java. Usted deber 
-    if "%GLILANG%" == "es" echo instalar un Ambiente de Ejecuci¢n Java (versi¢n 1.4 o superior)
-    if "%GLILANG%" == "es" echo antes de correr la Interfaz de la Biblioteca Digital Greenstone.
-
-    if "%GLILANG%" == "fr" echo Une version adquate de Java n'a pas pu tre localise. Vous devez
-    if "%GLILANG%" == "fr" echo installer un Java Runtime Environment (version 1.4 ou suprieur)
-    if "%GLILANG%" == "fr" echo avant de dmarrer Greenstone Librarian Interface.
-
-    if "%GLILANG%" == "ru" echo ¥ ã€ «®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ á®®â¢¥âáâ¢ãîé¥© ¢¥àášš Java.
-    if "%GLILANG%" == "ru" echo ë €®«Š­ë ãáâ ­®¢šâì Java Runtime Environment (¢¥àášî 1.4 š«š ¢ëè¥) ¯¥à¥€ ¢¢®€®¬
-    if "%GLILANG%" == "ru" echo ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone.
-    goto exit
-
-
-:checkGLI
-:: ---- Check that the GLI has been compiled ----
-if exist "classes/org/greenstone/gatherer/GathererProg.class" goto runGLI
-if exist "GLI.jar" goto runGLI
-    echo.
-    if "%GLILANG%" == "en" echo You need to compile the Greenstone Librarian Interface (using makegli.bat)
-    if "%GLILANG%" == "en" echo before running this script.
-
-    if "%GLILANG%" == "es" echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
-    if "%GLILANG%" == "es" echo (por medio de makegli.bat) antes de ejecutar este gui¢n.
-
-    if "%GLILANG%" == "fr" echo Vous devez compiler le Greenstone Interface (en utilisant makegil.bat)
-    if "%GLILANG%" == "fr" echo avant d'excuter ce script.
-
-    if "%GLILANG%" == "ru" echo ë €®«Š­ë ª®¬¯š«šà®¢ âì ¡š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone (šá¯®«ì§ãï makegli.bat)
-    if "%GLILANG%" == "ru" echo ¯¥à¥€ ¢¢®€®¬ íâ®£® áªàš¯â 
-    goto exit
-
-
-:runGLI
-:: ---- Finally, run the GLI ----
-echo.
-
-if "%GLILANG%" == "en" echo Running the Greenstone Librarian Interface...
-if "%GLILANG%" == "es" echo Ejecutando la Interfaz de la Biblioteca Digital Greenstone...
-if "%GLILANG%" == "fr" echo Excution de Greenstone Librarian Interface
-if "%GLILANG%" == "ru" echo ¥ªãéš© ¡š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone...
-
-:: -Xms32M          To set minimum memory
-:: -Xmx32M          To set maximum memory
-:: -verbose:gc      To set garbage collection messages
-:: -Xincgc          For incremental garbage collection
-:: -Xprof           Function call profiling
-:: -Xloggc:<file>   Write garbage collection log
-
-"%JAVAPATH%\java" -cp classes/;GLI.jar;lib/apache.jar;lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl %GSDLHOME% -gsdlos %GSDLOS% -gsdl3 %GSDL3HOME% -gsdl3src %GSDL3SRCHOME% -perl %PERLPATH% %1 %2 %3 %4 %5 %6 %7 %8 %9
-
-if "%GLILANG%" == "en" echo Done!
-if "%GLILANG%" == "es" echo ­Hecho!
-if "%GLILANG%" == "fr" echo Termin!
-if "%GLILANG%" == "ru" echo ë¯®«­¥­®!
-goto done
-
-:exit
-echo.
-pause
-
-:done
-:: ---- Clean up ----
-set PERLPATH=
-set JAVAPATH=
Index: i/branches/rtl-gli/gli4gs3.sh
===================================================================
--- /gli/branches/rtl-gli/gli4gs3.sh	(revision 18350)
+++ 	(revision )
@@ -1,345 +1,0 @@
-#!/bin/sh
-glilang=en
-
-echo
-if [ "$glilang" = "es" ]; then
-    echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
-    echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
-    echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
-elif [ "$glilang" = "fr" ]; then
-    echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GLI est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
-    echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
-elif [ "$glilang" = "ru" ]; then
-    echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
-    echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
-else
-    echo "Greenstone Librarian Interface (GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
-    echo "GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
-    echo "This is free software, and you are welcome to redistribute it"
-fi
-echo
-
-##  -------- Run the Greenstone Librarian Interface --------
-
-# This script must be run from within the directory in which it lives
-thisdir=`pwd`
-if [ ! -f "${thisdir}/gli4gs3.sh" ]; then
-    if [ "$glilang" = "es" ]; then
-        echo "Este guión deberá ejecutarse desde el directorio en el que reside."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
-    elif [ "$glilang" = "ru" ]; then
-	echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
-    else
-	echo "This script must be run from the directory in which it resides."
-    fi
-    exit 1
-fi
-
-
-##  ---- Determine GSDL3HOME ----
-## may be already set or manually entered here
-gsdl3path=$gsdl3path
-
-# Some users may set the above line manually
-if [ "x$gsdl3path" = "x" ]; then
-    # Check the environment variable first
-    if [ "x$GSDL3SRCHOME" != "x" ]; then
-	gsdl3path=$GSDL3SRCHOME
-
-    # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone 3
-    else
-	gsdl3path=`(cd .. && pwd)`
-    fi
-fi
-
-# Check that the Greenstone 3 installation looks OK
-if [ "$glilang" = "es" ]; then
-    echo "Revisando GSDL3: $gsdl3path"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de GSDL3: $gsdl3path"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ GSDL3: $gsdl3path"
-else
-    echo "Checking GSDL3: $gsdl3path"
-fi
-if [ ! -f "${gsdl3path}/gs3-setup.sh" ] ; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "No se pudo encontrar la instalación de Greenstone 3 o está incompleta."
-        echo "Trate de reinstalar Greenstone 3 y a continuación ejecute nuevamente"
-	echo "este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "L'installation de Greenstone 3 est introuvable ou incomplète."
-	echo "Essayez de réinstaller Greenstone 3 et exécutez ce script à nouveau."
-    elif [ "$glilang" = "ru" ]; then
-	echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone 3 ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
-	echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone 3, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
-    else
-	echo "The Greenstone 3 installation could not be found, or is incomplete."
-	echo "Try reinstalling Greenstone 3 then running this script again."
-    fi
-    exit 1
-fi
-
-# Setup Greenstone 3, unless it has already been done
-if [ "x$GSDL3HOME" = "x" -o "x$GSDL3SRCHOME" = "x" ]; then
-    cd "$gsdl3path"
-    . gs3-setup.sh
-    cd "$thisdir"
-fi
-
-
-##  ---- Determine GSDLHOME ----
-## may be already set, or manually entered here.
-gsdlpath=$gsdlpath
-
-# Some users may set the above line manually
-if [ "x$gsdlpath" = "x" ]; then
-    # Check the environment variable first
-    if [ "x$GSDLHOME" != "x" ]; then
-	gsdlpath=$GSDLHOME
-
-    # If it is not set, assume that the gs2build subdirectory of Greenstone 3 exists
-    else
-	gsdlpath=$GSDL3SRCHOME/gs2build
-    fi
-fi
-
-# Check that the Greenstone installation looks OK
-if [ "$glilang" = "es" ]; then
-    echo "Revisando GSDL: $gsdlpath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de GSDL: $gsdlpath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath"
-else
-    echo "Checking GSDL: $gsdlpath"
-fi
-if [ ! -f "${gsdlpath}/setup.bash" ] ; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "No se pudo encontrar la instalación de Greenstone o está incompleta."
-        echo "Trate de reinstalar Greenstone y a continuación ejecute nuevamente"
-	echo "este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "L'installation de Greenstone est introuvable ou incomplète."
-	echo "Essayez de réinstaller Greenstone et exécutez ce script à nouveau."
-    elif [ "$glilang" = "ru" ]; then
-	echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
-	echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
-    else
-	echo "The Greenstone installation could not be found, or is incomplete."
-	echo "Try reinstalling Greenstone then running this script again."
-    fi
-    exit 1
-fi
-
-# Setup Greenstone, unless it has already been done
-if [ "x$GSDLHOME" = "x" ]; then
-    cd "$gsdlpath"
-    . setup.bash
-    cd "$thisdir"
-fi
-
-
-##  ---- Check Perl exists ----
-perlpath=
-
-# Some users may set the above line manually
-if [ "x$perlpath" = "x" ]; then
-    # Check if Perl is on the search path
-    perlpath=`which perl 2> /dev/null`
-fi
-
-# Check that a Perl executable has been found
-if [ "$glilang" = "es" ]; then
-    echo "Revisando Perl: $perlpath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de Perl: $perlpath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
-else
-    echo "Checking Perl: $perlpath"
-fi
-if [ ! -x "$perlpath" ] ; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "La Interfaz de la Biblioteca Digital Greenstone requiere Perl para "
-	echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
-	echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
-	echo "continuación ejecute nuevamente este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Greenstone Librarian Interface nécessite perl pour son fonctionnement,"
-	echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
-	echo "assurer que perl est installé et est spécifié dans votre chemin de "
-	echo "recherche, puis redémarrez ce script."
-    elif [ "$glilang" = "ru" ]; then
-	echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
-	echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
-	echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ"
-	echo "ÜÔÏÔ ÓËÒÉÐÔ."
-    else
-	echo "The Greenstone Librarian Interface requires perl in order to operate,"
-	echo "but perl could not be detected on your system. Please ensure that perl"
-	echo "is installed and is on your search path, then rerun this script."
-    fi
-    exit 1
-fi
-
-
-## ---- Check Java exists ----
-javapath=
-
-# Some users may set the above line manually
-if [ "x$javapath" = "x" ]; then
-
-    # If it is set, use the JAVA_HOME environment variable
-    if [ "x$JAVA_HOME" != "x" ]; then
-	javapath="$JAVA_HOME/bin/java"
-
-    # Check if Java is on the search path
-    else
-	javapath=`which java 2> /dev/null`
-    fi
-fi
-
-# Check that a Java executable has been found
-if [ "$glilang" = "es" ]; then
-    echo "Revisando Java: $javapath"
-elif [ "$glilang" = "fr" ]; then
-    echo "Vérification de Java: $javapath"
-elif [ "$glilang" = "ru" ]; then
-    echo "ðÒÏ×ÅÒËÁ Java: $javapath"
-else
-    echo "Checking Java: $javapath"
-fi
-if [ ! -x "$javapath" ]; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
-	echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
-	echo "antes de correr la Interfaz de la Biblioteca Digital Greenstone."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Une version adéquate de Java n'a pas pu être localisée."
-	echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
-	echo "supérieur) avant de démarrer Greenstone Librarian Interface."
-    elif [ "$glilang" = "ru" ]; then
-	echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
-	echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
-	echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone."
-    else
-	echo "Failed to locate an appropriate version of Java. You must install a"
-	echo "Java Runtime Environment (version 1.4 or greater) before running the"
-	echo "Greenstone Librarian Interface."
-    fi
-    exit 1
-fi
-
-
-## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
-`$javapath -classpath . CheckJavaVersion > /dev/null`
-if [ $? -ne 2 ] ; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
-	echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
-	echo "la Interfaz de la Biblioteca Digital Greenstone. Por favor instale "
-	echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
-	echo "posterior) y ejecute nuevamente este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "La version de Java Runtime Environment que vous avez installée est"
-	echo "trop vielle pour faire fonctionner Greenstone Librarian Interface."
-	echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
-	echo "récente) et redémarrez le script."
-    elif [ "$glilang" = "ru" ]; then
-	echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
-	echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
-	echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
-	echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
-    else
-	echo "The version of the Java Runtime Environment you have installed is too"
-	echo "old to run the Greenstone Librarian Interface. Please install a new"
-	echo "version of the JRE (version 1.4 or newer) and rerun this script."
-    fi
-    exit 1
-fi
-
-## ---- Check that the GLI has been compiled ----
-if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
-    echo
-    if [ "$glilang" = "es" ]; then
-	echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
-	echo "(por medio de makegli.sh) antes de ejecutar este guión."
-    elif [ "$glilang" = "fr" ]; then
-	echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
-	echo "avant d'exécuter ce script."
-    elif [ "$glilang" = "ru" ]; then
-	echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
-	echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
-    else
-	echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
-	echo "before running this script."
-    fi
-    exit 1
-fi
-
-## ---- Finally, run the GLI ----
-echo
-if [ "$glilang" = "es" ]; then
-    echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
-elif [ "$glilang" = "fr" ]; then
-    echo "Exécution de Greenstone Librarian Interface"
-elif [ "$glilang" = "ru" ]; then
-    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
-else
-    echo "Running the Greenstone Librarian Interface..."
-fi
-
-stop_gli=0
-while [ "$stop_gli" = "0" ] ; do 
-
-# Other arguments you can provide to GLI to work around memory limitations, or debug
-# -Xms<number>M    To set minimum memory (by default 32MB)
-# -Xmx<number>M    To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
-# -verbose:gc      To set garbage collection messages
-# -Xincgc          For incremental garbage collection (significantly slows performance)
-# -Xprof           Function call profiling
-# -Xloggc:<file>   Write garbage collection log
-
-    $javapath -Xmx128M -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar org.greenstone.gatherer.GathererProg -gsdl $GSDLHOME -gsdlos $GSDLOS -gsdl3 $GSDL3HOME -gsdl3src $GSDL3SRCHOME $*
-    exit_status=$?
-
-  if [ "$exit_status" != "2" ] ; then
-    stop_gli=1
-  else
-    echo
-    if [ "$glilang" = "es" ]; then
-        echo "Restarting/Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
-    elif [ "$glilang" = "fr" ]; then
-        echo "Restarting/Exécution de Greenstone Librarian Interface"
-    elif [ "$glilang" = "ru" ]; then
-        echo "Restarting/ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
-    else
-        echo "Restarting the Greenstone Librarian Interface..."
-    fi
-
-  fi
-done 
-
-if [ "$glilang" = "es" ]; then
-    echo "¡Hecho!"
-elif [ "$glilang" = "fr" ]; then
-    echo "Terminé!"
-elif [ "$glilang" = "ru" ]; then
-    echo "÷ÙÐÏÌÎÅÎÏ!"
-else
-    echo "Done!"
-fi
Index: /gli/branches/rtl-gli/gsdlver.bat
===================================================================
--- /gli/branches/rtl-gli/gsdlver.bat	(revision 18351)
+++ /gli/branches/rtl-gli/gsdlver.bat	(revision 18351)
@@ -0,0 +1,11 @@
+@echo off
+
+:: This batch script returns the version of greenstone that is running
+set _VERSION=1
+
+:: first parameter is the value of gsdlpath
+if exist %1\gs3-setup.bat set _VERSION=3
+if exist %1\setup.bat set _VERSION=2
+
+:: otherwise
+if "%_VERSION%" == "1" echo Error: can't determine which Greenstone version is being run.
Index: /gli/branches/rtl-gli/makegli.bat
===================================================================
--- /gli/branches/rtl-gli/makegli.bat	(revision 18350)
+++ /gli/branches/rtl-gli/makegli.bat	(revision 18351)
@@ -1,3 +1,5 @@
 @echo off
+pushd "%CD%"
+CD /D "%~dp0"
 set GLILANG=en
 
@@ -7,10 +9,10 @@
 echo.
 if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
-if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "en" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
 if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
 if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
 
 if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "es" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
 if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
 if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
@@ -18,5 +20,5 @@
 
 if "%GLILANG%" == "fr" echo Interface du Bibliothcaire Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "fr" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
 if "%GLILANG%" == "fr" echo GLI est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
 if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit 
@@ -24,5 +26,5 @@
 
 if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥àä¥©á Greenstone (Greenstone Librarian Interface - GLI)
-if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
+if "%GLILANG%" == "ru" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
 if "%GLILANG%" == "ru" echo  ­¥ € ¥â   ; €¥â «š á¬. ¢ â¥ªáâ¥ LICENSE.TXT
 if "%GLILANG%" == "ru" echo â® - á¢®¡®€­® à á¯à®áâà ­ï¥¬®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
@@ -137,7 +139,8 @@
 
 :: Compile the GLI
-"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar src/org/greenstone/gatherer/GathererProg.java src/org/greenstone/gatherer/util/DragTreeSelectionModel.java 
+:: Sun compiler (tested with 1.5 and 1.6) didn't compile DragTreeSelectionModel.java or MetadataAuditTableModel.java automatically, so we need to put them in explicitly
+"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar src/org/greenstone/gatherer/GathererProg.java src/org/greenstone/gatherer/util/DragTreeSelectionModel.java src/org/greenstone/gatherer/metadata/MetadataAuditTableModel.java 
 "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar src/org/greenstone/gatherer/GathererApplet.java
-"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
+:: "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
 
 :: Compile the GEMS
@@ -156,7 +159,9 @@
 :exit
 echo.
+popd
 pause
 
 :done
 :: ---- Clean up ----
+popd
 set JAVACPATH=
Index: /gli/branches/rtl-gli/makegli.sh
===================================================================
--- /gli/branches/rtl-gli/makegli.sh	(revision 18350)
+++ /gli/branches/rtl-gli/makegli.sh	(revision 18351)
@@ -5,5 +5,5 @@
 if [ "$glilang" = "es" ]; then
     echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
+    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
     echo "La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
     echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
@@ -11,15 +11,15 @@
 elif [ "$glilang" = "fr" ]; then
     echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
+    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
     echo "GLI est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
     echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
 elif [ "$glilang" = "ru" ]; then
     echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
+    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
     echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
     echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
 else
     echo "Greenstone Librarian Interface (GLI)"
-    echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
+    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
     echo "GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
     echo "This is free software, and you are welcome to redistribute it"
@@ -125,5 +125,5 @@
 $javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar src/org/greenstone/gatherer/GathererProg.java
 $javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar src/org/greenstone/gatherer/GathererApplet.java
-$javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
+#$javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
 # Compile the GEMS
 $javacpath -deprecation -d classes/ -sourcepath src/ -classpath classes/:lib/apache.jar:lib/qfslib.jar src/org/greenstone/gatherer/gems/GEMS.java
Index: /gli/branches/rtl-gli/makejar.bat
===================================================================
--- /gli/branches/rtl-gli/makejar.bat	(revision 18350)
+++ /gli/branches/rtl-gli/makejar.bat	(revision 18351)
@@ -1,3 +1,5 @@
 echo off
+pushd "%CD%"
+CD /D "%~dp0"
 set GLILANG=en
 
@@ -136,5 +138,5 @@
 
 :: Recreate the metadata.zip file (contains the GLI metadata directory)
-if exist jar\org\greenstone (
+if exist metadata.zip (
   del /f metadata.zip
 )
@@ -168,3 +170,5 @@
     move SignedGatherer.jar ..\bin\java\SignedGatherer.jar
 )
+:exit
 
+popd
Index: /gli/branches/rtl-gli/makejar.sh
===================================================================
--- /gli/branches/rtl-gli/makejar.sh	(revision 18350)
+++ /gli/branches/rtl-gli/makejar.sh	(revision 18351)
@@ -17,4 +17,6 @@
     exit 1
 fi
+
+echo "Generating the JAR files for Remote Greenstone"
 
 ## ---- Check that the GLI has been compiled ----
