Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 157 Rev 252
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
	
-
 
26
	private static String referentielGeo ;
-
 
27
	
-
 
28
	private static String systemeProj ;
25
 
29
 
26
	/**
30
	/**
27
	 * Constructeur sans argument
31
	 * Constructeur sans argument
28
	 */
32
	 */
29
	public Configuration() {
33
	public Configuration() {
30
		// on utilise le dictionnaire d'internationalisation pour lire les
34
		// on utilise le dictionnaire d'internationalisation pour lire les
31
		// variables du fichier javascript
35
		// variables du fichier javascript
32
		
36
		
33
		if(GWT.isScript()) {
37
		if(GWT.isScript()) {
34
			serviceBaseUrl = Dictionary.getDictionary("configuration").get(
38
			serviceBaseUrl = Dictionary.getDictionary("configuration").get(
35
					"serviceBaseUrl");
39
					"serviceBaseUrl");
-
 
40
			
36
			suiviBugUrl = Dictionary.getDictionary("configuration").get(
41
			suiviBugUrl = Dictionary.getDictionary("configuration").get(
37
			"suiviBugUrl");
42
			"suiviBugUrl");
-
 
43
			
38
			imageBaseUrl = Dictionary.getDictionary("configuration").get(
44
			imageBaseUrl = Dictionary.getDictionary("configuration").get(
39
			"imageBaseUrl");
45
			"imageBaseUrl");
-
 
46
			
40
			aideBaseUrl = Dictionary.getDictionary("configuration").get(
47
			aideBaseUrl = Dictionary.getDictionary("configuration").get(
41
			"aideBaseUrl");
48
			"aideBaseUrl");
-
 
49
			
-
 
50
			referentielGeo = Dictionary.getDictionary("configuration").get(
-
 
51
			"referentielGeo");
-
 
52
			
-
 
53
			systemeProj = Dictionary.getDictionary("configuration").get(
-
 
54
			"systemeProj");
42
		}
55
		}
43
		else
56
		else
44
		{
57
		{
45
			serviceBaseUrl = "http://localhost/jrest";
58
			serviceBaseUrl = "http://localhost/jrest";
46
			suiviBugUrl = "http://www.tela-botanica.org/suivi/index.php?do=newtask&project=2";
59
			suiviBugUrl = "http://www.tela-botanica.org/suivi/index.php?do=newtask&project=2";
47
			aideBaseUrl = "http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki=AideCEL";
60
			aideBaseUrl = "http://www.tela-botanica.org/wikini/eflore/wakka.php?wiki=AideCEL";
48
			imageBaseUrl = "http://localhost/Documents/images_serveur/"; 
61
			imageBaseUrl = "http://localhost/Documents/images_serveur/"; 
49
		}
62
		}
50
	}
63
	}
51
 
64
 
52
	/**
65
	/**
53
	 * Accesseur pour l'url de base du serveur jrest
66
	 * Accesseur pour l'url de base du serveur jrest
54
	 * 
67
	 * 
55
	 * @return une url de la forme http://emplacement_serveur/jrest
68
	 * @return une url de la forme http://emplacement_serveur/jrest
56
	 */
69
	 */
57
	public static String getServiceBaseUrl() {
70
	public static String getServiceBaseUrl() {
58
		return serviceBaseUrl;
71
		return serviceBaseUrl;
59
	}
72
	}
60
	
73
	
61
	/**
74
	/**
62
	 * Accesseur pour l'url de base du suivi de bug
75
	 * Accesseur pour l'url de base du suivi de bug
63
	 * 
76
	 * 
64
	 * @return une url pointant vers le suivi des bugs
77
	 * @return une url pointant vers le suivi des bugs
65
	 */
78
	 */
66
	public static String getSuiviBugUrl() {
79
	public static String getSuiviBugUrl() {
67
		return suiviBugUrl;
80
		return suiviBugUrl;
68
	}
81
	}
69
	
82
	
70
	/**
83
	/**
71
	 * Accesseur pour l'url de base des images
84
	 * Accesseur pour l'url de base des images
72
	 * 
85
	 * 
73
	 * @return une url pointant vers la racine du dossier contenant les images
86
	 * @return une url pointant vers la racine du dossier contenant les images
74
	 */
87
	 */
75
	public static String getImageBaseUrl() {
88
	public static String getImageBaseUrl() {
76
		return imageBaseUrl ;
89
		return imageBaseUrl ;
77
	}
90
	}
78
	
91
	
79
	/**
92
	/**
80
	 * Accesseur pour l'url de base de l'aide
93
	 * Accesseur pour l'url de base de l'aide
81
	 * 
94
	 * 
82
	 * @return une url pointant vers la racine de l'aide
95
	 * @return une url pointant vers la racine de l'aide
83
	 */
96
	 */
84
	public static String getAideBaseUrl() {
97
	public static String getAideBaseUrl() {
85
		return aideBaseUrl ;
98
		return aideBaseUrl ;
86
	}
99
	}
-
 
100
	
-
 
101
	/**
-
 
102
	 * Accesseur pour l'url de base de l'aide
-
 
103
	 * 
-
 
104
	 * @return une url pointant vers la racine de l'aide
-
 
105
	 */
-
 
106
	public static String getReferentielGeo() {
-
 
107
		return referentielGeo ;
-
 
108
	}
-
 
109
	
-
 
110
	/**
-
 
111
	 * Accesseur pour l'url de base de l'aide
-
 
112
	 * 
-
 
113
	 * @return une url pointant vers la racine de l'aide
-
 
114
	 */
-
 
115
	public static String getSystemeProj() {
-
 
116
		return systemeProj ;
-
 
117
	}
87
	
118
	
88
	
119
	
89
 
120
 
90
}
121
}