source: other-projects/trunk/gs3-webservices-democlient/gs3democlient.sh@ 15338

Last change on this file since 15338 was 15309, checked in by ak19, 13 years ago

CheckJavaVersion returns 2 if the running java version is acceptable and 1 if it is not

  • Property svn:executable set to *
File size: 6.5 KB
Line 
1#!/bin/sh
2language=en
3
4echo
5if [ "$language" = "es" ]; then
6 echo "GS3 Web Services demo-client"
7 echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
8 echo "GS3 Web Services demo-client 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 [ "$language" = "fr" ]; then
12 echo "GS3 Web Services demo-client"
13 echo "Copyright (C) 2006, 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 [ "$language" = "ru" ]; then
17 echo "GS3 Web Services demo-client"
18 echo "Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato"
19 echo "âéç ÎÅ ÄÁÅÔ áâóïìàôîï îéëáëéè çáòáîôéê; ÄÅÔÁÌÉ ÓÍ. × ÔÅËÓÔÅ LICENSE.TXT"
20 echo "üÔÏ - Ó×ÏÂÏÄÎÏ ÒÁÓÐÒÏÓÔÒÁÎÑÅÍÏÅ ÐÒÏÇÒÁÍÍÎÏÅ ÏÂÅÓÐÅÞÅÎÉÅ É ÷Ù ÍÏÖÅÔÅ ÒÁÓÐÒÏÓÔÒÁÎÑÔØ ÅÇÏ"
21else
22 echo "GS3 Web Services demo-client"
23 echo "Copyright (C) 2006, 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}/gs3democlient.sh" ]; then
34 if [ "$language" = "es" ]; then
35 echo "Este guión deberá ejecutarse desde el directorio en el que reside."
36 elif [ "$language" = "fr" ]; then
37 echo "Ce script doit être exécuté à partir du répertoire dans lequel il se trouve."
38 elif [ "$language" = "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## ---- Check Java exists ----
48javapath=
49
50# Some users may set the above line manually
51if [ "x$javapath" = "x" ]; then
52
53 # If it is set, use the JAVA_HOME environment variable
54 if [ "x$JAVA_HOME" != "x" ]; then
55 javapath="$JAVA_HOME/bin/java"
56
57 # Check if Java is on the search path
58 else
59 javapath=`which java 2> /dev/null`
60 fi
61fi
62
63# Check that a Java executable has been found
64version="1.5"
65
66if [ "$language" = "es" ]; then
67 echo "Revisando Java: $javapath"
68elif [ "$language" = "fr" ]; then
69 echo "Vérification de Java: $javapath"
70elif [ "$language" = "ru" ]; then
71 echo "ðÒÏ×ÅÒËÁ Java: $javapath"
72else
73 echo "Checking Java: $javapath"
74fi
75if [ ! -x "$javapath" ]; then
76 echo
77 if [ "$language" = "es" ]; then
78 echo "No se pudo localizar una versión apropiada de Java. Usted deberá "
79 echo "instalar un Ambiente de Ejecución Java (versión 1.5 o superior) "
80 echo "antes de correr la GS3 Web Services demo-client."
81 elif [ "$language" = "fr" ]; then
82 echo "Une version adéquate de Java n'a pas pu être localisée."
83 echo "Vous devez installer un Java Runtime Environment (version $version"
84 echo "ou supérieur) avant de démarrer GS3 Web Services demo-client."
85 elif [ "$language" = "ru" ]; then
86 echo "îÅ ÕÄÁÌÏÓØ ÏÐÒÅÄÅÌÉÔØ ÍÅÓÔÏÎÁÈÏÖÄÅÎÉÅ ÓÏÏÔ×ÅÔÓÔ×ÕÀÝÅÊ ×ÅÒÓÉÉ Java."
87 echo "÷Ù ÄÏÌÖÎÙ ÕÓÔÁÎÏ×ÉÔØ Java Runtime Environment (×ÅÒÓÉÀ $version ÉÌÉ"
88 echo "×ÙÛÅ) ÐÅÒÅÄ ××ÏÄÏÍ ÂÉÂÌÉÏÔÅÞÎÏÇÏ ÉÎÔÅÒÆÅÊÓÁ GS3 Web Services demo-client."
89 else
90 echo "Failed to locate an appropriate version of Java. You must install a"
91 echo "Java Runtime Environment (version $version or greater) before running the"
92 echo "GS3 Web Services demo-client."
93 fi
94 exit 1
95fi
96
97
98## -- Check the version of Java is new enough (1.5.0 or higher) to run the GS3democlient --
99`$javapath -classpath . CheckJavaVersion $version GS3democlient > /dev/null`
100if [ $? -ne 2 ] ; then
101 echo
102 if [ "$language" = "es" ]; then
103 echo "La versión del Ambiente de Ejecución Java (JRE por sus siglas en"
104 echo "inglés) que usted tiene instalada es demasiado vieja para ejecutar"
105 echo "la GS3 Web Services demo-client. Por favor instale"
106 echo "una nueva versión del Ambiente de Ejecución Java (versión $version"
107 echo "o posterior) y ejecute nuevamente este guión."
108 elif [ "$language" = "fr" ]; then
109 echo "La version de Java Runtime Environment que vous avez installée est"
110 echo "trop vielle pour faire fonctionner GS3 Web Services demo-client."
111 echo "Veuillez installer une nouvelle version du JRE (version $version ou"
112 echo "plus récente) et redémarrez le script."
113 elif [ "$language" = "ru" ]; then
114 echo "÷ÅÒÓÉÑ Java Runtime Environment, ËÏÔÏÒÕÀ ÷Ù ÕÓÔÁÎÏ×ÉÌÉ, ÏÞÅÎØ ÓÔÁÒÁ,"
115 echo "ÞÔÏÂÙ ÕÐÒÁ×ÌÑÔØ ÂÉÂÌÉÏÔÅÞÎÙÍ ÉÎÔÅÒÆÅÊÓÏÍ Greenstone. ðÏÖÁÌÕÊÓÔÁ, "
116 echo "ÕÓÔÁÎÏ×ÉÔÅ ÎÏ×ÕÀ ×ÅÒÓÉÀ JRE (×ÅÒÓÉÀ $version ÉÌÉ ÂÏÌÅÅ ÎÏ×ÕÀ) É"
117 echo "ÐÅÒÅÕÓÔÁÎÏ×ÉÔÅ ÜÔÏÔ ÓËÒÉÐÔ"
118 else
119 echo "The version of the Java Runtime Environment you have installed is too"
120 echo "old to run the GS3 Web Services demo-client. Please install a new"
121 echo "version of the JRE (version $version or newer) and rerun this script."
122 fi
123 exit 1
124fi
125
126## ---- Check that the GS3democlient executable exists ----
127if [ ! -f "GS3democlient.jar" ]; then
128 echo
129 if [ "$language" = "es" ]; then
130 echo "Usted necesita compilar la GS3 Web Services demo-client"
131 echo "(por medio de ant build-demo-client) antes de ejecutar este guión."
132 elif [ "$language" = "fr" ]; then
133 echo "Vous devez compiler le GS3 Web Services demo-client (en utilisant"
134 echo "ant build-demo-client) avant d'exécuter ce script."
135 elif [ "$language" = "ru" ]; then
136 echo "÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone"
137 echo "(ÉÓÐÏÌØÚÕÑ ant build-demo-client) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ"
138 else
139 echo "You need to compile the GS3 Web Services demo-client (using"
140 echo "ant build-demo-client) before running this script."
141 fi
142 exit 1
143fi
144
145## ---- Finally, run the GS3democlient ----
146echo
147if [ "$language" = "es" ]; then
148 echo "Ejecutando la GS3 Web Services demo-client..."
149elif [ "$language" = "fr" ]; then
150 echo "Exécution de GS3 Web Services demo-client"
151elif [ "$language" = "ru" ]; then
152 echo "ôÅËÕÝÉÊ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ GS3 Web Services demo-client..."
153else
154 echo "Running GS3 Web Services demo-client..."
155fi
156
157 $javapath -jar GS3democlient.jar
158##$*
159
160if [ "$language" = "es" ]; then
161 echo "¡Hecho!"
162elif [ "$language" = "fr" ]; then
163 echo "Terminé!"
164elif [ "$language" = "ru" ]; then
165 echo "÷ÙÐÏÌÎÅÎÏ!"
166else
167 echo "Done!"
168fi
Note: See TracBrowser for help on using the repository browser.