Subversion Repositories eFlore/Applications.cel

Rev

Rev 989 | Rev 1289 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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