Subversion Repositories eFlore/Applications.cel

Rev

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