Index: /trunk/gli/client-gli.bat
===================================================================
--- /trunk/gli/client-gli.bat	(revision 10759)
+++ /trunk/gli/client-gli.bat	(revision 10759)
@@ -0,0 +1,167 @@
+@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) 2005, 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) 2005, 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) 2005, 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) 2005, 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" -cp classes/;GLI.jar;lib/apache.jar;lib/jp.jar;lib/qfslib.jar;lib/mail.jar;lib/activation.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone %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: /trunk/gli/client-gli.sh
===================================================================
--- /trunk/gli/client-gli.sh	(revision 10759)
+++ /trunk/gli/client-gli.sh	(revision 10759)
@@ -0,0 +1,174 @@
+#!/bin/sh
+glilang=en
+
+echo
+if [ "$glilang" == "es" ]; then
+    echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
+    echo "Copyright (C) 2005, 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) 2005, 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) 2005, New Zealand Digital Library Project, University Of Waikato"
+    echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
+    echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
+else
+    echo "Greenstone Librarian Interface (GLI)"
+    echo "Copyright (C) 2005, 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 [ "$javapath" == "" ]; then
+
+    # If it is set, use the JAVA_HOME environment variable
+    if [ "$JAVA_HOME" != "" ]; 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 -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar:lib/mail.jar:lib/activation.jar org.greenstone.gatherer.GathererProg -use_remote_greenstone $*
+
+if [ "$glilang" == "es" ]; then
+    echo "¡Hecho!"
+elif [ "$glilang" == "fr" ]; then
+    echo "Terminé!"
+elif [ "$glilang" == "ru" ]; then
+    echo "÷ÙÐÏÌÎÅÎÏ!"
+else
+    echo "Done!"
+fi
