Subversion Repositories eFlore/Applications.cel

Rev

Rev 731 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
989 aurelien 1
package org.tela_botanica.client.modeles.objets;
2 aperonnet 2
 
157 aurelien 3
import com.google.gwt.core.client.GWT;
2 aperonnet 4
import com.google.gwt.i18n.client.Dictionary;
5
 
6
/**
5 aperonnet 7
 * Classe chargeant certains paramètres de configuration à partir d'un fichier
8
 * javascript (config.js)
9
 *
2 aperonnet 10
 * @author aurelien
5 aperonnet 11
 *
2 aperonnet 12
 */
13
public class Configuration {
5 aperonnet 14
 
2 aperonnet 15
	/**
16
	 * L'url de base du serveur jrest
17
	 */
100 jpm 18
	private static String serviceBaseUrl;
5 aperonnet 19
 
100 jpm 20
	private static String imageBaseUrl;
81 jpm 21
 
100 jpm 22
	private static String suiviBugUrl ;
23
 
24
	private static String aideBaseUrl ;
252 aurelien 25
 
431 aurelien 26
	private static String emailContact;
27
 
252 aurelien 28
	private static String referentielGeo ;
271 aurelien 29
 
30
	private static String cleGoogleMaps ;
5 aperonnet 31
 
318 aurelien 32
	private static String lienEfloreBaseUrl;
33
 
34
	private static String refTax;
35
 
36
	private static String refTaxVersion;
596 aurelien 37
 
38
	private static String licence ="";
641 aurelien 39
 
40
	private static String formatOriginal = "";
41
 
42
	private static String formatZoom = "";
43
 
44
	private static String formatGalerie = "";
45
 
46
	private static String formatListe = "";
318 aurelien 47
 
731 aurelien 48
	private static String utiliseRedirectionImage;
49
 
50
	private static String imageRedirectUrl;
51
 
2 aperonnet 52
	/**
53
	 * Constructeur sans argument
54
	 */
5 aperonnet 55
	public Configuration() {
56
		// on utilise le dictionnaire d'internationalisation pour lire les
57
		// variables du fichier javascript
140 aurelien 58
 
322 aurelien 59
		//if(GWT.isScript()) {
157 aurelien 60
			serviceBaseUrl = Dictionary.getDictionary("configuration").get(
61
					"serviceBaseUrl");
252 aurelien 62
 
431 aurelien 63
			emailContact = Dictionary.getDictionary("configuration").get(
64
			"emailContact");
65
 
157 aurelien 66
			suiviBugUrl = Dictionary.getDictionary("configuration").get(
67
			"suiviBugUrl");
252 aurelien 68
 
157 aurelien 69
			imageBaseUrl = Dictionary.getDictionary("configuration").get(
70
			"imageBaseUrl");
252 aurelien 71
 
157 aurelien 72
			aideBaseUrl = Dictionary.getDictionary("configuration").get(
73
			"aideBaseUrl");
252 aurelien 74
 
75
			referentielGeo = Dictionary.getDictionary("configuration").get(
76
			"referentielGeo");
77
 
271 aurelien 78
			cleGoogleMaps = Dictionary.getDictionary("configuration").get(
318 aurelien 79
			"cleGoogleMaps");
271 aurelien 80
 
318 aurelien 81
			lienEfloreBaseUrl = Dictionary.getDictionary("configuration").get(
82
			"lienEfloreBaseUrl");
83
 
84
			refTax = Dictionary.getDictionary("configuration").get(
85
			"refTax");
86
 
87
			refTaxVersion = Dictionary.getDictionary("configuration").get(
88
			"refTaxVersion");
596 aurelien 89
 
641 aurelien 90
			formatOriginal = Dictionary.getDictionary("configuration").get(
91
			"formatOriginal");
92
 
93
			formatZoom = Dictionary.getDictionary("configuration").get(
94
			"formatZoom");
95
 
96
			formatGalerie = Dictionary.getDictionary("configuration").get(
97
			"formatGalerie");
98
 
99
			formatListe = Dictionary.getDictionary("configuration").get(
100
			"formatListe");
101
 
731 aurelien 102
			utiliseRedirectionImage = Dictionary.getDictionary("configuration").get(
103
			"utiliseRedirectionImage");
104
 
105
			imageRedirectUrl = Dictionary.getDictionary("configuration").get(
106
			"imageRedirectUrl");
107
 
596 aurelien 108
			//licence = Dictionary.getDictionary("configuration").get("licence");
2 aperonnet 109
	}
5 aperonnet 110
 
2 aperonnet 111
	/**
112
	 * Accesseur pour l'url de base du serveur jrest
5 aperonnet 113
	 *
2 aperonnet 114
	 * @return une url de la forme http://emplacement_serveur/jrest
115
	 */
100 jpm 116
	public static String getServiceBaseUrl() {
5 aperonnet 117
		return serviceBaseUrl;
2 aperonnet 118
	}
81 jpm 119
 
120
	/**
121
	 * Accesseur pour l'url de base du suivi de bug
122
	 *
123
	 * @return une url pointant vers le suivi des bugs
124
	 */
100 jpm 125
	public static String getSuiviBugUrl() {
81 jpm 126
		return suiviBugUrl;
127
	}
100 jpm 128
 
129
	/**
130
	 * Accesseur pour l'url de base des images
131
	 *
132
	 * @return une url pointant vers la racine du dossier contenant les images
133
	 */
134
	public static String getImageBaseUrl() {
135
		return imageBaseUrl ;
136
	}
137
 
138
	/**
139
	 * Accesseur pour l'url de base de l'aide
140
	 *
141
	 * @return une url pointant vers la racine de l'aide
142
	 */
143
	public static String getAideBaseUrl() {
144
		return aideBaseUrl ;
145
	}
146
 
252 aurelien 147
	/**
431 aurelien 148
	 * Accesseur pour l'email de contact du carnet en ligne
149
	 *
150
	 * @return une chaine contenant l'email de contact
151
	 */
152
	public static String getEmailContact() {
153
		return emailContact;
154
	}
155
 
156
	/**
271 aurelien 157
	 * Accesseur pour le référentiel geo
252 aurelien 158
	 *
271 aurelien 159
	 * @return le référentiel geo
252 aurelien 160
	 */
161
	public static String getReferentielGeo() {
162
		return referentielGeo ;
163
	}
271 aurelien 164
 
165
	/**
166
	 * Accesseur pour la clé google maps
167
	 *
168
	 * @return la clé google maps
169
	 */
170
	public static String getCleGoogleMaps() {
171
		return cleGoogleMaps ;
172
	}
2 aperonnet 173
 
318 aurelien 174
	public static String getLienEfloreBaseUrl() {
175
		return lienEfloreBaseUrl;
176
 
177
	}
178
 
179
	public static String getRefTax() {
180
		return refTax;
181
 
182
	}
183
 
184
	public static String getRefTaxVersion() {
185
		return refTaxVersion;
186
 
187
	}
596 aurelien 188
 
189
	public static String getLicence() {
190
		return licence;
191
	}
641 aurelien 192
 
193
	public static String getFormatOriginal() {
194
 
195
		return formatOriginal;
196
	}
197
 
198
	public static String getFormatZoom() {
199
 
200
		return formatZoom;
201
	}
202
 
203
	public static String getFormatGalerie() {
204
 
205
		return formatGalerie;
206
	}
207
 
208
	public static String getFormatListe() {
209
 
210
		return formatListe;
211
	}
731 aurelien 212
 
213
	public static boolean utiliseRedirectionImages() {
214
 
215
		return utiliseRedirectionImage.equals("1");
216
 
217
	}
218
 
219
	public static String getImageRedirectUrl() {
220
 
221
		return imageRedirectUrl;
222
 
223
	}
2 aperonnet 224
}