Subversion Repositories eFlore/Applications.cel

Rev

Rev 989 | 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;
1285 aurelien 51
 
52
	private static String tailleMaxUpload;
731 aurelien 53
 
2 aperonnet 54
	/**
55
	 * Constructeur sans argument
56
	 */
5 aperonnet 57
	public Configuration() {
58
		// on utilise le dictionnaire d'internationalisation pour lire les
59
		// variables du fichier javascript
140 aurelien 60
 
322 aurelien 61
		//if(GWT.isScript()) {
157 aurelien 62
			serviceBaseUrl = Dictionary.getDictionary("configuration").get(
63
					"serviceBaseUrl");
252 aurelien 64
 
431 aurelien 65
			emailContact = Dictionary.getDictionary("configuration").get(
66
			"emailContact");
67
 
157 aurelien 68
			suiviBugUrl = Dictionary.getDictionary("configuration").get(
69
			"suiviBugUrl");
252 aurelien 70
 
157 aurelien 71
			imageBaseUrl = Dictionary.getDictionary("configuration").get(
72
			"imageBaseUrl");
252 aurelien 73
 
157 aurelien 74
			aideBaseUrl = Dictionary.getDictionary("configuration").get(
75
			"aideBaseUrl");
252 aurelien 76
 
77
			referentielGeo = Dictionary.getDictionary("configuration").get(
78
			"referentielGeo");
79
 
271 aurelien 80
			cleGoogleMaps = Dictionary.getDictionary("configuration").get(
318 aurelien 81
			"cleGoogleMaps");
271 aurelien 82
 
318 aurelien 83
			lienEfloreBaseUrl = Dictionary.getDictionary("configuration").get(
84
			"lienEfloreBaseUrl");
85
 
86
			refTax = Dictionary.getDictionary("configuration").get(
87
			"refTax");
88
 
89
			refTaxVersion = Dictionary.getDictionary("configuration").get(
90
			"refTaxVersion");
596 aurelien 91
 
641 aurelien 92
			formatOriginal = Dictionary.getDictionary("configuration").get(
93
			"formatOriginal");
94
 
95
			formatZoom = Dictionary.getDictionary("configuration").get(
96
			"formatZoom");
97
 
98
			formatGalerie = Dictionary.getDictionary("configuration").get(
99
			"formatGalerie");
100
 
101
			formatListe = Dictionary.getDictionary("configuration").get(
102
			"formatListe");
103
 
731 aurelien 104
			utiliseRedirectionImage = Dictionary.getDictionary("configuration").get(
105
			"utiliseRedirectionImage");
106
 
107
			imageRedirectUrl = Dictionary.getDictionary("configuration").get(
108
			"imageRedirectUrl");
109
 
1285 aurelien 110
			tailleMaxUpload = Dictionary.getDictionary("configuration").get(
111
			"tailleMaxUpload");
112
 
596 aurelien 113
			//licence = Dictionary.getDictionary("configuration").get("licence");
2 aperonnet 114
	}
5 aperonnet 115
 
2 aperonnet 116
	/**
117
	 * Accesseur pour l'url de base du serveur jrest
5 aperonnet 118
	 *
2 aperonnet 119
	 * @return une url de la forme http://emplacement_serveur/jrest
120
	 */
100 jpm 121
	public static String getServiceBaseUrl() {
5 aperonnet 122
		return serviceBaseUrl;
2 aperonnet 123
	}
81 jpm 124
 
125
	/**
126
	 * Accesseur pour l'url de base du suivi de bug
127
	 *
128
	 * @return une url pointant vers le suivi des bugs
129
	 */
100 jpm 130
	public static String getSuiviBugUrl() {
81 jpm 131
		return suiviBugUrl;
132
	}
100 jpm 133
 
134
	/**
135
	 * Accesseur pour l'url de base des images
136
	 *
137
	 * @return une url pointant vers la racine du dossier contenant les images
138
	 */
139
	public static String getImageBaseUrl() {
140
		return imageBaseUrl ;
141
	}
142
 
143
	/**
144
	 * Accesseur pour l'url de base de l'aide
145
	 *
146
	 * @return une url pointant vers la racine de l'aide
147
	 */
148
	public static String getAideBaseUrl() {
149
		return aideBaseUrl ;
150
	}
151
 
252 aurelien 152
	/**
431 aurelien 153
	 * Accesseur pour l'email de contact du carnet en ligne
154
	 *
155
	 * @return une chaine contenant l'email de contact
156
	 */
157
	public static String getEmailContact() {
158
		return emailContact;
159
	}
160
 
161
	/**
271 aurelien 162
	 * Accesseur pour le référentiel geo
252 aurelien 163
	 *
271 aurelien 164
	 * @return le référentiel geo
252 aurelien 165
	 */
166
	public static String getReferentielGeo() {
167
		return referentielGeo ;
168
	}
271 aurelien 169
 
170
	/**
171
	 * Accesseur pour la clé google maps
172
	 *
173
	 * @return la clé google maps
174
	 */
175
	public static String getCleGoogleMaps() {
176
		return cleGoogleMaps ;
177
	}
2 aperonnet 178
 
318 aurelien 179
	public static String getLienEfloreBaseUrl() {
1285 aurelien 180
		return lienEfloreBaseUrl;
318 aurelien 181
	}
182
 
183
	public static String getRefTax() {
1285 aurelien 184
		return refTax;
318 aurelien 185
	}
186
 
187
	public static String getRefTaxVersion() {
1285 aurelien 188
		return refTaxVersion;
318 aurelien 189
	}
596 aurelien 190
 
191
	public static String getLicence() {
192
		return licence;
193
	}
641 aurelien 194
 
195
	public static String getFormatOriginal() {
196
		return formatOriginal;
197
	}
198
 
199
	public static String getFormatZoom() {
200
		return formatZoom;
201
	}
202
 
203
	public static String getFormatGalerie() {
204
		return formatGalerie;
205
	}
206
 
207
	public static String getFormatListe() {
208
		return formatListe;
209
	}
731 aurelien 210
 
1285 aurelien 211
	public static boolean utiliseRedirectionImages() {
731 aurelien 212
		return utiliseRedirectionImage.equals("1");
213
	}
214
 
1285 aurelien 215
	public static String getImageRedirectUrl() {
216
		return imageRedirectUrl;
731 aurelien 217
	}
1285 aurelien 218
 
219
	public static String getTailleMaxUpload() {
220
		return tailleMaxUpload;
221
	}
2 aperonnet 222
}