root/gli/trunk/client-gli.sh @ 17946

Revision 17946, 7.8 KB (checked in by max, 11 years ago)

Small changes

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/bin/sh
2glilang=en
3
4if [ "x$PROGNAME" = "x" ] ; then
5    PROGNAME="Greenstone"
6  if [ "$glilang" = "es" ]; then
7    PROGFULLNAME="Biblioteca Digital Greenstone"
8  elif [ "$glilang" = "fr" ]; then
9    PROGFULLNAME="Bibliothécaire Greenstone"
10  elif [ "$glilang" = "ru" ]; then
11    PROGFULLNAME="ÉÎÔÅÒÆÅÊÓ Greenstone"
12  else
13    PROGFULLNAME="Greenstone Digital Library"
14  fi
15  else
16    PROGFULLNAME=$PROGNAME
17fi
18
19if [ "x$PROGABBR" = "x" ] ; then
20    PROGABBR="GLI"
21fi
22
23if [ "x$PROGNAME_EN" = "x" ] ; then
24    PROGNAME_EN="Greenstone Librarian Interface"
25fi
26
27
28echo
29if [ "$glilang" = "es" ]; then
30    echo "Interfaz de la $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
31    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
32    echo "La Interfaz de la $PROGNAME NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÍA."
33    echo "Para mayor información vea los términos de la licencia en LICENSE.txt"
34    echo "Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita"
35elif [ "$glilang" = "fr" ]; then
36    echo "Interface du $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
37    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
38    echo "$PROGABBR est fourni sans AUCUNE GARANTIE; pour des détails, voir LICENSE.txt"
39    echo "Ceci est un logiciel libre, et vous êtes invité à le redistribuer"
40elif [ "$glilang" = "ru" ]; then
41    echo "âÉÂÌÉÏÔÅÞÎÙÊ $PROGFULLNAME ($PROGNAME_EN - $PROGABBR)"
42    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
43    echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
44    echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
45else
46    echo "$PROGNAME Librarian Interface ($PROGABBR)"
47    echo "Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato"
48    echo "$PROGABBR comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt"
49    echo "This is free software, and you are welcome to redistribute it"
50fi
51echo
52
53##  -------- Run the Greenstone Librarian Interface --------
54
55# This script must be run from within the directory in which it lives
56thisdir=`pwd`
57if [ ! -f "${thisdir}/client-gli.sh" ]; then
58    if [ "$glilang" = "es" ]; then
59        echo "Este guión deberá ejecutarse desde el directorio en el que reside."
60    elif [ "$glilang" = "fr" ]; then
61    echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
62    elif [ "$glilang" = "ru" ]; then
63    echo "üÔÏÔ ÓËÒÉÐÔ ÄÏÌÖÅÎ ÂÙÔØ ×ÚÑÔ ÉÚ ÄÉÒÅËÔÏÒÉÉ, × ËÏÔÏÒÏÊ ÏÎ ÒÁÓÐÏÌÏÖÅÎ"
64    else
65    echo "This script must be run from the directory in which it resides."
66    fi
67    exit 1
68fi
69
70
71## ---- Check Java exists ----
72javapath=
73
74# Some users may set the above line manually
75if [ "x$javapath" = "x" ]; then
76
77    # If it is set, use the JAVA_HOME environment variable
78    if [ "x$JAVA_HOME" != "x" ]; then
79    javapath="$JAVA_HOME/bin/java"
80
81    # Check if Java is on the search path
82    else
83    javapath=`which java 2> /dev/null`
84    fi
85fi
86
87# Check that a Java executable has been found
88if [ "$glilang" = "es" ]; then
89    echo "Revisando Java: $javapath"
90elif [ "$glilang" = "fr" ]; then
91    echo "Vérification de Java: $javapath"
92elif [ "$glilang" = "ru" ]; then
93    echo "ðÒÏ×ÅÒËÁ Java: $javapath"
94else
95    echo "Checking Java: $javapath"
96fi
97if [ ! -x "$javapath" ]; then
98    echo
99    if [ "$glilang" = "es" ]; then
100    echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
101    echo "instalar un Ambiente de Ejecución Java (versión 1.4 o superior) "
102    echo "antes de correr la Interfaz de la $PROGFULLNAME                    ."
103    elif [ "$glilang" = "fr" ]; then
104    echo "Une version adéquate de Java n'a pas pu être localisée."
105    echo "Vous devez installer un Java Runtime Environment (version 1.4 ou"
106    echo "supérieur) avant de démarrer $PROGNAME Librarian Interface."
107    elif [ "$glilang" = "ru" ]; then
108    echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
109    echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ 1.4 ÉÌÉ ×ÙÛÅ)"
110    echo "ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ $PROGNAME."
111    else
112    echo "Failed to locate an appropriate version of Java. You must install a"
113    echo "Java Runtime Environment (version 1.4 or greater) before running the"
114    echo "$PROGNAME Librarian Interface."
115    fi
116    exit 1
117fi
118
119
120## -- Check the version of Java is new enough (1.4.0 or higher) to run the GLI --
121`$javapath -classpath . CheckJavaVersion > /dev/null`
122if [ $? -ne 2 ] ; then
123    echo
124    if [ "$glilang" = "es" ]; then
125    echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en "
126    echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar "
127    echo "la Interfaz de la Biblioteca Digital Greenstone. Por favor instale "
128    echo "una nueva versión del Ambiente de Ejecución Java (versión 1.4 o "
129    echo "posterior) y ejecute nuevamente este guión."
130    elif [ "$glilang" = "fr" ]; then
131    echo "La version de Java Runtime Environment que vous avez installée est"
132    echo "trop vielle pour faire fonctionner Greenstone Librarian Interface."
133    echo "Veuillez installer une nouvelle version du JRE (version 1.4 ou plus"
134    echo "récente) et redémarrez le script."
135    elif [ "$glilang" = "ru" ]; then
136    echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
137    echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
138    echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ 1.4 ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
139    echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
140    else
141    echo "The version of the Java Runtime Environment you have installed is too"
142    echo "old to run the Greenstone Librarian Interface. Please install a new"
143    echo "version of the JRE (version 1.4 or newer) and rerun this script."
144    fi
145    exit 1
146fi
147
148## ---- Check that the GLI has been compiled ----
149if [ ! -f "classes/org/greenstone/gatherer/GathererProg.class" ] && [ ! -f "GLI.jar" ]; then
150    echo
151    if [ "$glilang" = "es" ]; then
152    echo "Usted necesita compilar la Interfaz de la $PROGFULLNAME"
153    echo "(por medio de makegli.sh) antes de ejecutar este guión."
154    elif [ "$glilang" = "fr" ]; then
155    echo "Vous devez compiler le $PROGNAME Interface (en utilisant makegli.sh)"
156    echo "avant d'exécuter ce script."
157    elif [ "$glilang" = "ru" ]; then
158    echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME"
159    echo "(ÉÓÐÏÌØÚÕÑ makegli.sh) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
160    else
161    echo "You need to compile the $PROGNAME Librarian Interface (using makegli.sh)"
162    echo "before running this script."
163    fi
164    exit 1
165fi
166
167
168## ---- Finally, run the GLI ----
169echo
170if [ "$glilang" = "es" ]; then
171    echo "Ejecutando la Interfaz de la $PROGFULLNAME..."
172elif [ "$glilang" = "fr" ]; then
173    echo "Exécution de $PROGNAME Librarian Interface"
174elif [ "$glilang" = "ru" ]; then
175    echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ $PROGNAME..."
176else
177    echo "Running the $PROGNAME Librarian Interface..."
178fi
179
180# Other arguments you can provide to GLI to work around memory limitations, or debug
181# -Xms<number>M    To set minimum memory (by default 32MB)
182# -Xmx<number>M    To set maximum memory (by default the nearest 2^n to the total remaining physical memory)
183# -verbose:gc      To set garbage collection messages
184# -Xincgc          For incremental garbage collection (significantly slows performance)
185# -Xprof           Function call profiling
186# -Xloggc:<file>   Write garbage collection log
187
188# GS2 only requires -classpath classes/:GLI.jar:lib/apache.jar:lib/qfslib.jar. GS3 requires more but it doesn't conflict with GS2:
189$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 $*
190
191if [ "$glilang" = "es" ]; then
192    echo "¡Hecho!"
193elif [ "$glilang" = "fr" ]; then
194    echo "Terminé!"
195elif [ "$glilang" = "ru" ]; then
196    echo "÷ÙÐÏÌÎÅÎÏ!"
197else
198    echo "Done!"
199fi
Note: See TracBrowser for help on using the browser.