Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 318 Rev 322
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
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 referentielGeo ;
26
	private static String referentielGeo ;
27
	
27
	
28
	private static String cleGoogleMaps ;
28
	private static String cleGoogleMaps ;
29
 
29
 
30
	private static String lienEfloreBaseUrl;
30
	private static String lienEfloreBaseUrl;
31
	
31
	
32
	private static String refTax;
32
	private static String refTax;
33
	
33
	
34
	private static String refTaxVersion;
34
	private static String refTaxVersion;
35
 
35
 
36
	/**
36
	/**
37
	 * Constructeur sans argument
37
	 * Constructeur sans argument
38
	 */
38
	 */
39
	public Configuration() {
39
	public Configuration() {
40
		// on utilise le dictionnaire d'internationalisation pour lire les
40
		// on utilise le dictionnaire d'internationalisation pour lire les
41
		// variables du fichier javascript
41
		// variables du fichier javascript
42
		
42
		
43
		if(GWT.isScript()) {
43
		//if(GWT.isScript()) {
44
			serviceBaseUrl = Dictionary.getDictionary("configuration").get(
44
			serviceBaseUrl = Dictionary.getDictionary("configuration").get(
45
					"serviceBaseUrl");
45
					"serviceBaseUrl");
46
			
46
			
47
			suiviBugUrl = Dictionary.getDictionary("configuration").get(
47
			suiviBugUrl = Dictionary.getDictionary("configuration").get(
48
			"suiviBugUrl");
48
			"suiviBugUrl");
49
			
49
			
50
			imageBaseUrl = Dictionary.getDictionary("configuration").get(
50
			imageBaseUrl = Dictionary.getDictionary("configuration").get(
51
			"imageBaseUrl");
51
			"imageBaseUrl");
52
			
52
			
53
			aideBaseUrl = Dictionary.getDictionary("configuration").get(
53
			aideBaseUrl = Dictionary.getDictionary("configuration").get(
54
			"aideBaseUrl");
54
			"aideBaseUrl");
55
			
55
			
56
			referentielGeo = Dictionary.getDictionary("configuration").get(
56
			referentielGeo = Dictionary.getDictionary("configuration").get(
57
			"referentielGeo");
57
			"referentielGeo");
58
			
58
			
59
			cleGoogleMaps = Dictionary.getDictionary("configuration").get(
59
			cleGoogleMaps = Dictionary.getDictionary("configuration").get(
60
			"cleGoogleMaps");
60
			"cleGoogleMaps");
61
			
61
			
62
			lienEfloreBaseUrl = Dictionary.getDictionary("configuration").get(
62
			lienEfloreBaseUrl = Dictionary.getDictionary("configuration").get(
63
			"lienEfloreBaseUrl");
63
			"lienEfloreBaseUrl");
64
			
64
			
65
			refTax = Dictionary.getDictionary("configuration").get(
65
			refTax = Dictionary.getDictionary("configuration").get(
66
			"refTax");
66
			"refTax");
67
			
67
			
68
			refTaxVersion = Dictionary.getDictionary("configuration").get(
68
			refTaxVersion = Dictionary.getDictionary("configuration").get(
69
			"refTaxVersion");
69
			"refTaxVersion");
70
			
-
 
71
		}
-
 
72
		else
-
 
73
		{
-
 
74
			
-
 
75
			serviceBaseUrl = "http://162.38.234.9/jrest";
-
 
76
			suiviBugUrl = "http://www.tela-botanica.net/suivi/index.php?do=newtask&project=2";
-
 
77
			aideBaseUrl = "http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki=AideCEL";
-
 
78
			imageBaseUrl = "http://162.38.234.9/Documents/images_serveur/";
-
 
79
			referentielGeo = "WGS84";
-
 
80
			cleGoogleMaps = "ABQIAAAADBUAHF9l14gI02QVAbUYJBQYIbFcBI1ENnSUwK1SMsxOkt3ljBTFFxjHcCePFsiX1MX5_m2r1MnSOw";
-
 
81
			refTax = "BDNFF";
-
 
82
			refTaxVersion = "4.02";
-
 
83
			lienEfloreBaseUrl = "www.tela-botanica.org/eflore";
-
 
84
		}
-
 
85
	}
70
	}
86
 
71
 
87
	/**
72
	/**
88
	 * Accesseur pour l'url de base du serveur jrest
73
	 * Accesseur pour l'url de base du serveur jrest
89
	 * 
74
	 * 
90
	 * @return une url de la forme http://emplacement_serveur/jrest
75
	 * @return une url de la forme http://emplacement_serveur/jrest
91
	 */
76
	 */
92
	public static String getServiceBaseUrl() {
77
	public static String getServiceBaseUrl() {
93
		return serviceBaseUrl;
78
		return serviceBaseUrl;
94
	}
79
	}
95
	
80
	
96
	/**
81
	/**
97
	 * Accesseur pour l'url de base du suivi de bug
82
	 * Accesseur pour l'url de base du suivi de bug
98
	 * 
83
	 * 
99
	 * @return une url pointant vers le suivi des bugs
84
	 * @return une url pointant vers le suivi des bugs
100
	 */
85
	 */
101
	public static String getSuiviBugUrl() {
86
	public static String getSuiviBugUrl() {
102
		return suiviBugUrl;
87
		return suiviBugUrl;
103
	}
88
	}
104
	
89
	
105
	/**
90
	/**
106
	 * Accesseur pour l'url de base des images
91
	 * Accesseur pour l'url de base des images
107
	 * 
92
	 * 
108
	 * @return une url pointant vers la racine du dossier contenant les images
93
	 * @return une url pointant vers la racine du dossier contenant les images
109
	 */
94
	 */
110
	public static String getImageBaseUrl() {
95
	public static String getImageBaseUrl() {
111
		return imageBaseUrl ;
96
		return imageBaseUrl ;
112
	}
97
	}
113
	
98
	
114
	/**
99
	/**
115
	 * Accesseur pour l'url de base de l'aide
100
	 * Accesseur pour l'url de base de l'aide
116
	 * 
101
	 * 
117
	 * @return une url pointant vers la racine de l'aide
102
	 * @return une url pointant vers la racine de l'aide
118
	 */
103
	 */
119
	public static String getAideBaseUrl() {
104
	public static String getAideBaseUrl() {
120
		return aideBaseUrl ;
105
		return aideBaseUrl ;
121
	}
106
	}
122
	
107
	
123
	/**
108
	/**
124
	 * Accesseur pour le référentiel geo
109
	 * Accesseur pour le référentiel geo
125
	 * 
110
	 * 
126
	 * @return le référentiel geo
111
	 * @return le référentiel geo
127
	 */
112
	 */
128
	public static String getReferentielGeo() {
113
	public static String getReferentielGeo() {
129
		return referentielGeo ;
114
		return referentielGeo ;
130
	}
115
	}
131
	
116
	
132
	/**
117
	/**
133
	 * Accesseur pour la clé google maps
118
	 * Accesseur pour la clé google maps
134
	 * 
119
	 * 
135
	 * @return la clé google maps
120
	 * @return la clé google maps
136
	 */
121
	 */
137
	public static String getCleGoogleMaps() {
122
	public static String getCleGoogleMaps() {
138
		return cleGoogleMaps ;
123
		return cleGoogleMaps ;
139
	}
124
	}
140
 
125
 
141
	public static String getLienEfloreBaseUrl() {
126
	public static String getLienEfloreBaseUrl() {
142
		return lienEfloreBaseUrl;
127
		return lienEfloreBaseUrl;
143
		
128
		
144
	}
129
	}
145
	
130
	
146
	public static String getRefTax() {
131
	public static String getRefTax() {
147
		return refTax;
132
		return refTax;
148
		
133
		
149
	}
134
	}
150
	
135
	
151
	public static String getRefTaxVersion() {
136
	public static String getRefTaxVersion() {
152
		return refTaxVersion;
137
		return refTaxVersion;
153
		
138
		
154
	}
139
	}
155
 
140
 
156
}
141
}