source: main/tags/2.51-jcdl/gli/gli.sh@ 25339

Last change on this file since 25339 was 7317, checked in by kjdon, 20 years ago

added in two libraries for feedback stuff

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 11.3 KB
Line 
1#!/bin/sh
2glilang=en
3
4echo
5if [ "$glilang" == "es" ]; then
6 echo "Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)"
7 echo "Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato"
8 echo "La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
9 echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
10 echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
11elif [ "$glilang" == "fr" ]; then
12 echo "Interface du Bibliothécaire Greenstone (Greenstone Librarian Interface - GLI)"
13 echo "Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato"
14 echo "GLI est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
15 echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
16elif [ "$glilang" == "ru" ]; then
17 echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone (Greenstone Librarian Interface - GLI)"
18 echo "Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato"
19 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
20 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
21else
22 echo "Greenstone Librarian Interface (GLI)"
23 echo "Copyright (C) 2004, New Zealand Digital Library Project, University Of Waikato"
24 echo "GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
25 echo "This is free software, and you are welcome to redistribute it"
26fi
27echo
28
29## -------- Run the Greenstone Librarian Interface --------
30
31# This script must be run from within the directory in which it lives
32thisdir=`pwd`
33if [ ! -f "${thisdir}/gli.sh" ]; then
34 if [ "$glilang" == "es" ]; then
35 echo "Este guión deberá ejecutarse desde el directorio en el que reside."
36 elif [ "$glilang" == "fr" ]; then
37 echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
38 elif [ "$glilang" == "ru" ]; then
39 echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
40 else
41 echo "This script must be run from the directory in which it resides."
42 fi
43 exit 1
44fi
45
46
47## ---- Determine GSDLHOME ----
48gsdlpath=
49
50# Some users may set the above line manually
51if [ "$gsdlpath" == "" ]; then
52 # Check the environment variable first
53 if [ "$GSDLHOME" != "" ]; then
54 gsdlpath=$GSDLHOME
55
56 # If it is not set, assume that the GLI is installed as a subdirectory of Greenstone
57 else
58 pushd .. > /dev/null
59 gsdlpath=`pwd`
60 popd > /dev/null
61 fi
62fi
63
64# Check that the Greenstone installation looks OK
65if [ "$glilang" == "es" ]; then
66 echo "Revisando GSDL: $gsdlpath"
67elif [ "$glilang" == "fr" ]; then
68 echo "Vérification de GSDL: $gsdlpath"
69elif [ "$glilang" == "ru" ]; then
70 echo "ðÒÏ×ÅÒËÁ GSDL: $gsdlpath"
71else
72 echo "Checking GSDL: $gsdlpath"
73fi
74if [ ! -f "${gsdlpath}/setup.bash" ] ; then
75 echo
76 if [ "$glilang" == "es" ]; then
77 echo "No se pudo encontrar la instalación de Greenstone o está incompleta."
78 echo "Trate de reinstalar Greenstone y a continuación ejecute nuevamente"
79 echo "este guión."
80 elif [ "$glilang" == "fr" ]; then
81 echo "L'installation de Greenstone est introuvable ou incomplète."
82 echo "Essayez de réinstaller Greenstone et exécutez ce script à nouveau."
83 elif [ "$glilang" == "ru" ]; then
84 echo "éÎÓÔÁÌÌÑÃÉÑ Greenstone ÎÅ ÂÙÌÁ ÎÁÊÄÅÎÁ ÉÌÉ ÏÎÁ ÎÅÐÏÌÎÁ."
85 echo "ðÏÐÒÏÂÕÊÔÅ ÐÏ×ÔÏÒÎÏ ÕÓÔÁÎÏ×ÉÔØ Greenstone, Á ÚÁÔÅÍ ××ÅÓÔÉ ÜÔÏÔ ÓËÒÉÐÔ ÓÎÏ×Á."
86 else
87 echo "The Greenstone installation could not be found, or is incomplete."
88 echo "Try reinstalling Greenstone then running this script again."
89 fi
90 exit 1
91fi
92
93# Setup Greenstone, unless it has already been done
94if [ "$GSDLHOME" == "" ]; then
95 pushd $gsdlpath > /dev/null
96 source setup.bash
97 popd > /dev/null
98fi
99
100
101## ---- Check Perl exists ----
102perlpath=
103
104# Some users may set the above line manually
105if [ "$perlpath" == "" ]; then
106 # Check if Perl is on the search path
107 perlpath=`which perl 2> /dev/null`
108fi
109
110# Check that a Perl executable has been found
111if [ "$glilang" == "es" ]; then
112 echo "Revisando Perl: $perlpath"
113elif [ "$glilang" == "fr" ]; then
114 echo "Vérification de Perl: $perlpath"
115elif [ "$glilang" == "ru" ]; then
116 echo "ðÒÏ×ÅÒËÁ Perl: $perlpath"
117else
118 echo "Checking Perl: $perlpath"
119fi
120if [ ! -x "$perlpath" ] ; then
121 echo
122 if [ "$glilang" == "es" ]; then
123 echo "La Interfaz de la Biblioteca Digital Greenstone requiere Perl para "
124 echo "poder operar, pero éste no aparece en su sistema. Por favor asegúrese "
125 echo "de que Perl está instalado y se encuentra en su ruta de búsqueda. A "
126 echo "continuación ejecute nuevamente este guión."
127 elif [ "$glilang" == "fr" ]; then
128 echo "Greenstone Librarian Interface nécessite perl pour son fonctionnement,"
129 echo "mais perl n'a pas pu être détecté dans votre système. Veuillez vous "
130 echo "assurer que perl est installé et est spécifié dans votre chemin de "
131 echo "recherche, puis redémarrez ce script."
132 elif [ "$glilang" == "ru" ]; then
133 echo "âÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone ÔÒÅÂÕÅÔ Perl, ÞÔÏÂÙ ÉÍÅÔØ ×ÏÚÍÏÖÎÏÓÔØ"
134 echo "ÒÁÂÏÔÁÔØ, ÎÏ Perl ÎÅ ÂÙÌ × ×ÁÛÅÊ ÓÉÓÔÅÍÅ. ðÏÖÁÌÕÊÓÔÁ, ÐÏÄÔ×ÅÒÄÉÔÅ, ÞÔÏ "
135 echo "Perl ÕÓÔÁÎÏ×ÌÅÎ É ÎÁÈÏÄÉÔÓÑ ÎÁ ×ÁÛÅÍ ÐÕÔÉ ÐÏÉÓËÁ, ÚÁÔÅÍ ÐÏ×ÔÏÒÎÏ××ÅÄÉÔÅ"
136 echo "ÜÔÏÔ ÓËÒÉÐÔ."
137 else
138 echo "The Greenstone Librarian Interface requires perl in order to operate,"
139 echo "but perl could not be detected on your system. Please ensure that perl"
140 echo "is installed and is on your search path, then rerun this script."
141 fi
142 exit 1
143fi
144
145
146## ---- Check Java exists ----
147javapath=
148
149# Some users may set the above line manually
150if [ "$javapath" == "" ]; then
151
152 # If it is set, use the JAVA_HOME environment variable
153 if [ "$JAVA_HOME" != "" ]; then
154 javapath="$JAVA_HOME/bin/java"
155
156 # Check if Java is on the search path
157 else
158 javapath=`which java 2> /dev/null`
159 fi
160fi
161
162# Check that a Java executable has been found
163if [ "$glilang" == "es" ]; then
164 echo "Revisando Java: $javapath"
165elif [ "$glilang" == "fr" ]; then
166 echo "Vérification de Java: $javapath"
167elif [ "$glilang" == "ru" ]; then
168 echo "ðÒÏ×ÅÒËÁ Java: $javapath"
169else
170 echo "Checking Java: $javapath"
171fi
172if [ ! -x "$javapath" ]; then
173 echo
174 if [ "$glilang" == "es" ]; then
175 echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
176 echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
177 echo "antes de correr la Interfaz de la Biblioteca Digital Greenstone."
178 elif [ "$glilang" == "fr" ]; then
179 echo "Une version adéquate de Java n'a pas pu être localisée."
180 echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
181 echo "supérieur) avant de démarrer Greenstone Librarian Interface."
182 elif [ "$glilang" == "ru" ]; then
183 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
184 echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
185 echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ Greenstone."
186 else
187 echo "Failed to locate an appropriate version of Java. You must install a"
188 echo "Java Runtime Environment (version 1.4 or greater) before running the"
189 echo "Greenstone Librarian Interface."
190 fi
191 exit 1
192fi
193
194
195## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
196javaversion=`$javapath -version 2>&1 | sed -n 's/^java version \"\(.*\)\"/\1/p'`
197jvmajor=`echo $javaversion | sed -n 's/^\([0-9]*\).*$/\1/p'`
198jvminor=`echo $javaversion | sed -n 's/^[0-9]*\.\([0-9]*\).*$/\1/p'`
199
200jok=1
201if [ $jvmajor -lt 1 ] ; then
202 jok=0
203fi
204if [ $jvmajor -eq 1 ] && [ $jvminor -lt 4 ] ; then
205 jok=0
206fi
207if [ $jok -eq 0 ] ; then
208 echo
209 if [ "$glilang" == "es" ]; then
210 echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
211 echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
212 echo "la Interfaz de la Biblioteca Digital Greenstone. Por favor instale "
213 echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
214 echo "posterior) y ejecute nuevamente este guión."
215 elif [ "$glilang" == "fr" ]; then
216 echo "La version de Java Runtime Environment que vous avez installée est"
217 echo "trop vielle pour faire fonctionner Greenstone Librarian Interface."
218 echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
219 echo "récente) et redémarrez le script."
220 elif [ "$glilang" == "ru" ]; then
221 echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
222 echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
223 echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
224 echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
225 else
226 echo "The version of the Java Runtime Environment you have installed is too"
227 echo "old to run the Greenstone Librarian Interface. Please install a new"
228 echo "version of the JRE (version 1.4 or newer) and rerun this script."
229 fi
230 exit 1
231fi
232
233## ---- Check that the GLI has been compiled ----
234if [ ! -f "classes/org/greenstone/gatherer/Gatherer.class" ] && [ ! -f "GLI.jar" ]; then
235 echo
236 if [ "$glilang" == "es" ]; then
237 echo "Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone"
238 echo "(por medio de makegli.sh) antes de ejecutar este guión."
239 elif [ "$glilang" == "fr" ]; then
240 echo "Vous devez compiler le Greenstone Interface (en utilisant makegli.sh)"
241 echo "avant d'exécuter ce script."
242 elif [ "$glilang" == "ru" ]; then
243 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
244 echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
245 else
246 echo "You need to compile the Greenstone Librarian Interface (using makegli.sh)"
247 echo "before running this script."
248 fi
249 exit 1
250fi
251
252if [ "$1" == "-test" ]; then
253 if [ "$glilang" == "es" ]; then
254 echo "Clase de prueba: $2"
255 echo "Argumentos $*"
256 elif [ "$glilang" == "fr" ]; then
257 echo "Classe de test: $2"
258 echo "Arguments $*"
259 elif [ "$glilang" == "ru" ]; then
260 echo "éÓÐÙÔÁÔÅÌØÎÙÊ ËÌÁÓÓ: $2"
261 echo "ðÁÒÁÍÅÔÒÙ $*"
262 else
263 echo "Testing class: $2"
264 echo "Arguments $*"
265 fi
266 $javapath -classpath classes/:GLI.jar:lib/apache.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar $2 $3
267 exit 0
268fi
269
270## ---- Finally, run the GLI ----
271echo
272if [ "$glilang" == "es" ]; then
273 echo "Ejecutando la Interfaz de la Biblioteca Digital Greenstone..."
274elif [ "$glilang" == "fr" ]; then
275 echo "Exécution de Greenstone Librarian Interface"
276elif [ "$glilang" == "ru" ]; then
277 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone..."
278else
279 echo "Running the Greenstone Librarian Interface..."
280fi
281
282# Other arguments you can provide to GLI to work around memory limitations, or debug
283# -Xms<number>M To set minimum memory (by default 32MB)
284# -Xmx<number>M To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
285# -verbose:gc To set garbage collection messages
286# -Xincgc For incremental garbage collection (significantly slows performance)
287# -Xprof Function call profiling
288# -Xloggc:<file> Write garbage collection log
289
290$javapath -classpath classes/:GLI.jar:lib/apache.jar:lib/jp.jar:lib/polloxml.jar:lib/qfslib.jar:lib/mail.jar:lib/activation.jar org.greenstone.gatherer.Gatherer -gsdl $GSDLHOME -wget $wok$wgetpath $*
291
292if [ "$glilang" == "es" ]; then
293 echo "¡Hecho!"
294elif [ "$glilang" == "fr" ]; then
295 echo "Terminé!"
296elif [ "$glilang" == "ru" ]; then
297 echo "÷ÙÐÏÌÎÅÎÏ!"
298else
299 echo "Done!"
300fi
Note: See TracBrowser for help on using the repository browser.