| Line 12... |
Line 12... |
| 12 |
*
|
12 |
*
|
| 13 |
*/
|
13 |
*/
|
| 14 |
public class Configuration {
|
14 |
public class Configuration {
|
| Line 15... |
Line 15... |
| 15 |
|
15 |
|
| 16 |
/**
|
16 |
/**
|
| 17 |
* L'url de base du serveur jrest
|
17 |
* Tableau associatif contenant les identifiants des listes
|
| 18 |
*/
|
18 |
*/
|
| Line 19... |
Line 19... |
| 19 |
private String serviceBaseUrl;
|
19 |
private LinkedHashMap<String, Integer> listesId = new LinkedHashMap<String, Integer>();
|
| 20 |
|
20 |
|
| 21 |
/**
|
21 |
/**
|
| 22 |
* L'url de base du Carnet en Ligne
|
- |
|
| 23 |
*/
|
- |
|
| 24 |
private String celUrl;
|
- |
|
| 25 |
|
- |
|
| 26 |
/**
|
- |
|
| 27 |
* Tableau associatif contenant les identifiants des listes
|
22 |
* Tableau associatif contenant les identifiants des urls externes
|
| Line 28... |
Line 23... |
| 28 |
*/
|
23 |
*/
|
| 29 |
private LinkedHashMap<String, Integer> listesId = new LinkedHashMap<String, Integer>();
|
24 |
private LinkedHashMap<String, String> urls = new LinkedHashMap<String, String>();
|
| 30 |
|
25 |
|
| 31 |
/**
|
26 |
/**
|
| 32 |
* Constructeur sans argument
|
27 |
* Constructeur sans argument
|
| 33 |
*/
|
28 |
*/
|
| 34 |
public Configuration() {
|
- |
|
| 35 |
// on utilise le dictionnaire d'internationalisation pour lire les variables du fichier javascript
|
- |
|
| 36 |
Dictionary configuration = Dictionary.getDictionary("configuration");
|
29 |
public Configuration() {
|
| 37 |
serviceBaseUrl = configuration.get("serviceBaseUrl");
|
30 |
// on utilise le dictionnaire d'internationalisation pour lire les variables du fichier javascript
|
| 38 |
celUrl = configuration.get("celUrl");
|
31 |
Dictionary configuration = Dictionary.getDictionary("configuration");
|
| 39 |
listesId.put("stpr", Integer.valueOf(configuration.get("listeStpr")));
|
32 |
listesId.put("stpr", Integer.valueOf(configuration.get("listeStpr")));
|
| 40 |
listesId.put("stpu", Integer.valueOf(configuration.get("listeStpu")));
|
33 |
listesId.put("stpu", Integer.valueOf(configuration.get("listeStpu")));
|
| Line 84... |
Line 77... |
| 84 |
listesId.put("inventaireEtat", Integer.valueOf(configuration.get("listeInventaireEtat")));
|
77 |
listesId.put("inventaireEtat", Integer.valueOf(configuration.get("listeInventaireEtat")));
|
| 85 |
listesId.put("groupementPrincipe", Integer.valueOf(configuration.get("listeGroupementPrincipe")));
|
78 |
listesId.put("groupementPrincipe", Integer.valueOf(configuration.get("listeGroupementPrincipe")));
|
| 86 |
listesId.put("realisationBut", Integer.valueOf(configuration.get("listeRealisationBut")));
|
79 |
listesId.put("realisationBut", Integer.valueOf(configuration.get("listeRealisationBut")));
|
| 87 |
listesId.put("ion", Integer.valueOf(configuration.get("listeION")));
|
80 |
listesId.put("ion", Integer.valueOf(configuration.get("listeION")));
|
| 88 |
listesId.put("typeCommentaireCollection", Integer.valueOf(configuration.get("listeTypeCommentaireCollection")));
|
81 |
listesId.put("typeCommentaireCollection", Integer.valueOf(configuration.get("listeTypeCommentaireCollection")));
|
| 89 |
|
- |
|
| 90 |
listesId.put("prefixe", Integer.valueOf(configuration.get("listePrefixes")));
|
82 |
listesId.put("prefixe", Integer.valueOf(configuration.get("listePrefixes")));
|
| 91 |
listesId.put("suffixes", Integer.valueOf(configuration.get("listeSuffixes")));
|
83 |
listesId.put("suffixes", Integer.valueOf(configuration.get("listeSuffixes")));
|
| 92 |
listesId.put("sexe", Integer.valueOf(configuration.get("listeSexe")));
|
84 |
listesId.put("sexe", Integer.valueOf(configuration.get("listeSexe")));
|
| 93 |
listesId.put("tel", Integer.valueOf(configuration.get("listeTel")));
|
85 |
listesId.put("tel", Integer.valueOf(configuration.get("listeTel")));
|
| 94 |
listesId.put("region", Integer.valueOf(configuration.get("listeRegions")));
|
86 |
listesId.put("region", Integer.valueOf(configuration.get("listeRegions")));
|
| 95 |
|
- |
|
| 96 |
listesId.put("dureesIndexation", Integer.valueOf(configuration.get("listeDureesIndexation")));
|
87 |
listesId.put("dureesIndexation", Integer.valueOf(configuration.get("listeDureesIndexation")));
|
| 97 |
listesId.put("frequencesIndexation", Integer.valueOf(configuration.get("listeFrequencesIndexation")));
|
88 |
listesId.put("frequencesIndexation", Integer.valueOf(configuration.get("listeFrequencesIndexation")));
|
| 98 |
|
- |
|
| 99 |
listesId.put("langues", Integer.valueOf(configuration.get("listeLangues")));
|
89 |
listesId.put("langues", Integer.valueOf(configuration.get("listeLangues")));
|
| 100 |
|
- |
|
| 101 |
listesId.put("nbElementsPage", Integer.valueOf(configuration.get("nbElementsPage")));
|
90 |
listesId.put("nbElementsPage", Integer.valueOf(configuration.get("nbElementsPage")));
|
| Line 102... |
Line -... |
| 102 |
|
- |
|
| 103 |
}
|
- |
|
| 104 |
|
- |
|
| 105 |
/**
|
- |
|
| 106 |
* Accesseur pour l'url de base du serveur jrest
|
- |
|
| 107 |
*
|
- |
|
| 108 |
* @return une url de la forme http://emplacement_serveur/jrest
|
- |
|
| 109 |
*/
|
91 |
|
| 110 |
public String getServiceBaseUrl() {
|
92 |
urls.put("base", configuration.get("serviceBaseUrl"));
|
| 111 |
return serviceBaseUrl;
|
- |
|
| 112 |
}
|
- |
|
| 113 |
|
- |
|
| 114 |
/**
|
93 |
urls.put("cel", configuration.get("celUrl"));
|
| 115 |
* Accesseur pour l'url de base du Carnet en Ligne
|
- |
|
| 116 |
*
|
94 |
urls.put("bogue", configuration.get("bogueUrl"));
|
| 117 |
* @return une url de la forme http://emplacement_serveur/
|
- |
|
| 118 |
*/
|
- |
|
| 119 |
public String getCelUrl() {
|
- |
|
| 120 |
return celUrl;
|
95 |
urls.put("commentaire", configuration.get("commentaireUrl"));
|
| Line 121... |
Line 96... |
| 121 |
}
|
96 |
}
|
| 122 |
|
97 |
|
| 123 |
/**
|
98 |
/**
|
| Line 129... |
Line 104... |
| 129 |
if (listesId.containsKey(code)) {
|
104 |
if (listesId.containsKey(code)) {
|
| 130 |
return listesId.get(code);
|
105 |
return listesId.get(code);
|
| 131 |
}
|
106 |
}
|
| 132 |
return null;
|
107 |
return null;
|
| 133 |
}
|
108 |
}
|
| - |
|
109 |
|
| - |
|
110 |
/**
|
| - |
|
111 |
* Accesseur pour l'url de base du serveur jrest
|
| - |
|
112 |
*
|
| - |
|
113 |
* @return une url de la forme http://emplacement_serveur/jrest
|
| - |
|
114 |
*/
|
| - |
|
115 |
public String getServiceBaseUrl() {
|
| - |
|
116 |
return getUrl("base");
|
| - |
|
117 |
}
|
| - |
|
118 |
|
| - |
|
119 |
public String getUrl(String code) {
|
| - |
|
120 |
if (urls.containsKey(code)) {
|
| - |
|
121 |
return urls.get(code);
|
| - |
|
122 |
}
|
| - |
|
123 |
return null;
|
| - |
|
124 |
}
|
| Line 134... |
Line 125... |
| 134 |
|
125 |
|
| 135 |
}
|
126 |
}
|