| Line 32... |
Line 32... |
| 32 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
32 |
import com.extjs.gxt.ui.client.widget.layout.FormLayout;
|
| 33 |
import com.google.gwt.user.client.ui.Image;
|
33 |
import com.google.gwt.user.client.ui.Image;
|
| Line 34... |
Line 34... |
| 34 |
|
34 |
|
| Line 35... |
Line -... |
| 35 |
public class PersonneDetailVue extends DetailVue implements Rafraichissable {
|
- |
|
| 36 |
|
35 |
public class PersonneDetailVue extends DetailVue implements Rafraichissable {
|
| 37 |
|
36 |
|
| 38 |
private TabPanel tabPanel;
|
37 |
private TabPanel tabPanel;
|
| 39 |
private Html entete;
|
38 |
private Html entete;
|
| 40 |
|
39 |
|
| 41 |
private TabItem tabIdentite;
|
40 |
private TabItem tabIdentite;
|
| 42 |
private TabItem tabAdresse;
|
41 |
private TabItem tabAdresse;
|
| - |
|
42 |
private TabItem tabInfosNat;
|
| - |
|
43 |
private TabItem tabLogos;
|
| - |
|
44 |
|
| - |
|
45 |
private void chargerOntologie() {
|
| - |
|
46 |
mediateur.obtenirListeValeurEtRafraichir(this, "pays");
|
| Line 43... |
Line 47... |
| 43 |
private TabItem tabInfosNat;
|
47 |
}
|
| 44 |
private TabItem tabLogos;
|
48 |
|
| 45 |
|
49 |
|
| 46 |
public PersonneDetailVue(Mediateur mediateur) {
|
50 |
public PersonneDetailVue(Mediateur mediateur) {
|
| Line -... |
Line 51... |
| - |
|
51 |
|
| - |
|
52 |
super(mediateur);
|
| - |
|
53 |
chargerOntologie();
|
| - |
|
54 |
|
| 47 |
|
55 |
mediateur.obtenirListeValeurEtRafraichir(this, "pays");
|
| 48 |
super(mediateur);
|
56 |
|
| 49 |
setLayout(new FitLayout());
|
57 |
setLayout(new FitLayout());
|
| 50 |
|
58 |
|
| 51 |
entete = new Html();
|
59 |
entete = new Html();
|
| 52 |
entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
|
60 |
entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
|
| 53 |
|
61 |
|
| 54 |
ContentPanel panneauPrincipal = new ContentPanel();
|
62 |
ContentPanel panneauPrincipal = new ContentPanel();
|
| 55 |
panneauPrincipal.setLayout(new FitLayout());
|
63 |
panneauPrincipal.setLayout(new FitLayout());
|
| 56 |
panneauPrincipal.setHeaderVisible(false);
|
64 |
panneauPrincipal.setHeaderVisible(false);
|
| 57 |
panneauPrincipal.setBodyBorder(true);
|
65 |
panneauPrincipal.setBodyBorder(true);
|
| 58 |
panneauPrincipal.setTopComponent(entete);
|
66 |
panneauPrincipal.setTopComponent(entete);
|
| 59 |
|
67 |
|
| 60 |
tabIdentite = new TabItem(mediateur.i18nC.personneIdentite());
|
68 |
tabIdentite = new TabItem(mediateur.i18nC.personneIdentite());
|
| 61 |
tabIdentite.setLayout(new AnchorLayout());
|
69 |
tabIdentite.setLayout(new AnchorLayout());
|
| 62 |
tabIdentite.setScrollMode(Scroll.AUTO);
|
70 |
tabIdentite.setScrollMode(Scroll.AUTO);
|
| 63 |
|
71 |
|
| 64 |
tabAdresse = new TabItem(mediateur.i18nC.personneAdresses());
|
72 |
tabAdresse = new TabItem(mediateur.i18nC.personneAdresses());
|
| 65 |
tabAdresse.setLayout(new FitLayout());
|
73 |
tabAdresse.setLayout(new FitLayout());
|
| 66 |
tabAdresse.setScrollMode(Scroll.AUTO);
|
74 |
tabAdresse.setScrollMode(Scroll.AUTO);
|
| 67 |
|
75 |
|
| 68 |
tabInfosNat = new TabItem(mediateur.i18nC.personneInfoNat());
|
76 |
tabInfosNat = new TabItem(mediateur.i18nC.personneInfoNat());
|
| 69 |
tabInfosNat.setScrollMode(Scroll.AUTO);
|
77 |
tabInfosNat.setScrollMode(Scroll.AUTO);
|
| 70 |
|
78 |
|
| 71 |
tabLogos = new TabItem(mediateur.i18nC.personneLogos());
|
79 |
tabLogos = new TabItem(mediateur.i18nC.personneLogos());
|
| 72 |
tabLogos.setScrollMode(Scroll.AUTO);
|
80 |
tabLogos.setScrollMode(Scroll.AUTO);
|
| 73 |
tabLogos.setLayout(new FlowLayout());
|
81 |
tabLogos.setLayout(new FlowLayout());
|
| 74 |
|
82 |
|
| 75 |
tabPanel = new TabPanel();
|
83 |
tabPanel = new TabPanel();
|
| 76 |
tabPanel.setId(ComposantId.ZONE_DETAIL_CORPS);
|
84 |
tabPanel.setId(ComposantId.ZONE_DETAIL_CORPS);
|
| 77 |
tabPanel.setBodyBorder(false);
|
85 |
tabPanel.setBodyBorder(false);
|
| 78 |
|
86 |
|
| 79 |
tabPanel.add(tabIdentite);
|
87 |
tabPanel.add(tabIdentite);
|
| 80 |
tabPanel.add(tabAdresse);
|
88 |
tabPanel.add(tabAdresse);
|
| 81 |
tabPanel.add(tabInfosNat);
|
89 |
tabPanel.add(tabInfosNat);
|
| 82 |
tabPanel.add(tabLogos);
|
90 |
tabPanel.add(tabLogos);
|
| Line 83... |
Line 91... |
| 83 |
|
91 |
|
| 84 |
panneauPrincipal.add(tabPanel);
|
92 |
panneauPrincipal.add(tabPanel);
|
| 85 |
add(panneauPrincipal);
|
93 |
add(panneauPrincipal);
|
| 86 |
}
|
94 |
}
|
| 87 |
|
95 |
|
| 88 |
private HashMap hmLabelFieldRegion = new HashMap();
|
96 |
private HashMap hmLabelFieldRegion = new HashMap();
|
| 89 |
|
97 |
|
| 90 |
public void afficherDetailPersonne(Personne personne) {
|
98 |
public void afficherDetailPersonne(Personne personne) {
|
| 91 |
if (personne != null) {
|
99 |
if (personne != null) {
|
| 92 |
|
100 |
|
| 93 |
String tplEntete = initialiserTplEntete();
|
101 |
String tplEntete = initialiserTplEntete();
|
| - |
|
102 |
|
| 94 |
|
103 |
Params enteteParams = new Params();
|
| 95 |
Params enteteParams = new Params();
|
104 |
enteteParams.set("nom", (String) personne.get("fmt_nom_complet"));
|
| 96 |
enteteParams.set("nom", (String) personne.get("fmt_nom_complet"));
|
105 |
enteteParams.set("mail", (String) personne.get("courriel_princ"));
|
| 97 |
enteteParams.set("mail", (String) personne.get("courriel_princ"));
|
106 |
|
| 98 |
|
107 |
LinkedList lstLogos = (LinkedList) personne
|
| 99 |
LinkedList lstLogos = (LinkedList) personne.getChaineDenormaliseAsMapOrList("truk_logo");
|
108 |
.getChaineDenormaliseAsMapOrList("truk_logo");
|
| 100 |
if (lstLogos!=null && lstLogos.size() > 0) {
|
109 |
if (lstLogos != null && lstLogos.size() > 0) {
|
| - |
|
110 |
|
| 101 |
|
111 |
tabLogos.removeAll();
|
| 102 |
tabLogos.removeAll();
|
112 |
String urlLogoPrinc = (String) lstLogos.get(0);
|
| 103 |
String urlLogoPrinc = (String) lstLogos.get(0);
|
113 |
if (!urlLogoPrinc.trim().equals("")) {
|
| 104 |
if (!urlLogoPrinc.trim().equals("")) {
|
114 |
tplEntete = "<div id='personne-logo-div'><img src='{image}' alt='logo' /></div>"
|
| 105 |
tplEntete = "<div id='personne-logo-div'><img src='{image}' alt='logo' /></div>" + tplEntete;
|
115 |
+ tplEntete;
|
| 106 |
enteteParams.set("image", urlLogoPrinc);
|
116 |
enteteParams.set("image", urlLogoPrinc);
|
| 107 |
}
|
117 |
}
|
| 108 |
|
118 |
|
| 109 |
Iterator<String> itLogo = lstLogos.iterator();
|
119 |
Iterator<String> itLogo = lstLogos.iterator();
|
| 110 |
while (itLogo.hasNext()){
|
120 |
while (itLogo.hasNext()) {
|
| 111 |
String urlLogoCourant = itLogo.next();
|
121 |
String urlLogoCourant = itLogo.next();
|
| 112 |
Image imgCourante = new Image(urlLogoCourant);
|
122 |
Image imgCourante = new Image(urlLogoCourant);
|
| 113 |
tabLogos.add(imgCourante);
|
123 |
tabLogos.add(imgCourante);
|
| 114 |
}
|
124 |
}
|
| 115 |
tabLogos.enable();
|
125 |
tabLogos.enable();
|
| 116 |
|
126 |
|
| - |
|
127 |
} else {
|
| 117 |
} else {
|
128 |
enteteParams.set("image", "");
|
| 118 |
enteteParams.set("image", "");
|
129 |
tabLogos.disable();
|
| 119 |
tabLogos.disable();
|
130 |
}
|
| 120 |
}
|
131 |
|
| 121 |
|
132 |
entete.el()
|
| 122 |
entete.el().setInnerHtml(Format.substitute(tplEntete, enteteParams));
|
133 |
.setInnerHtml(Format.substitute(tplEntete, enteteParams));
|
| - |
|
134 |
|
| 123 |
|
135 |
String tplIdentite = initialiserTplIdentite();
|
| - |
|
136 |
|
| 124 |
String tplIdentite = initialiserTplIdentite();
|
137 |
Params tabIdentiteParams = new Params();
|
| - |
|
138 |
tabIdentiteParams.set("nom_complet", personne
|
| 125 |
|
139 |
.getString("fmt_nom_complet"));
|
| - |
|
140 |
tabIdentiteParams.set("abreviation", personne
|
| 126 |
Params tabIdentiteParams = new Params();
|
141 |
.getString("abreviation"));
|
| - |
|
142 |
tabIdentiteParams.set("naissance_date", personne
|
| 127 |
tabIdentiteParams.set("nom_complet", personne.getString("fmt_nom_complet"));
|
143 |
.getString("naissance_date"));
|
| - |
|
144 |
tabIdentiteParams.set("naissance_lieu", personne
|
| 128 |
tabIdentiteParams.set("abreviation", personne.getString("abreviation"));
|
145 |
.getString("naissance_lieu"));
|
| - |
|
146 |
tabIdentiteParams.set("deces_date", personne
|
| 129 |
tabIdentiteParams.set("naissance_date", personne.getString("naissance_date"));
|
147 |
.getString("deces_date"));
|
| 130 |
tabIdentiteParams.set("naissance_lieu", personne.getString("naissance_lieu"));
|
148 |
tabIdentiteParams.set("deces_lieu", personne
|
| 131 |
tabIdentiteParams.set("deces_date", personne.getString("deces_date"));
|
149 |
.getString("deces_lieu"));
|
| 132 |
tabIdentiteParams.set("deces_lieu", personne.getString("deces_lieu"));
|
150 |
tabIdentiteParams.set("description", personne
|
| 133 |
tabIdentiteParams.set("description", personne.getString("description"));
|
151 |
.getString("description"));
|
| - |
|
152 |
|
| 134 |
|
153 |
tabInfosNat.removeAll();
|
| 135 |
tabInfosNat.removeAll();
|
154 |
|
| 136 |
|
155 |
/*// Nom autre : champ truk; non-typé
|
| 137 |
// Nom autre : champ truk; non-typé
|
156 |
LinkedList<String> nomsAutre = (LinkedList<String>) personne
|
| 138 |
LinkedList<String> nomsAutre = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_nom_autre");
|
157 |
.getChaineDenormaliseAsMapOrList("truk_nom_autre");
|
| 139 |
String listeNoms = "";
|
158 |
String listeNoms = "";
|
| 140 |
if ((nomsAutre != null)&&(nomsAutre.size() > 0)) {
|
159 |
if ((nomsAutre != null) && (nomsAutre.size() > 0)) {
|
| 141 |
listeNoms = UtilTruk.traiterTrukListe(nomsAutre, ", ");
|
160 |
listeNoms = UtilTruk.traiterTrukListe(nomsAutre, ", ");
|
| - |
|
161 |
}
|
| 142 |
}
|
162 |
tabIdentiteParams.set("nom_autre", listeNoms);
|
| 143 |
tabIdentiteParams.set("nom_autre", listeNoms);
|
163 |
|
| 144 |
|
164 |
// Abréviations, autre : non-typé
|
| 145 |
// Abréviations, autre : non-typé
|
165 |
LinkedList<String> abrevAutres = (LinkedList<String>) personne
|
| - |
|
166 |
.getChaineDenormaliseAsMapOrList("truk_abreviation_autre");
|
| 146 |
LinkedList<String> abrevAutres = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_abreviation_autre");
|
167 |
String listeAbrev = "";
|
| 147 |
String listeAbrev = "";
|
168 |
if ((abrevAutres != null) && (abrevAutres.size() > 0)) {
|
| 148 |
if ((abrevAutres != null)&&(abrevAutres.size() > 0)) {
|
169 |
listeAbrev = UtilTruk.traiterTrukListe(abrevAutres, ", ");
|
| - |
|
170 |
}*/
|
| 149 |
listeAbrev = UtilTruk.traiterTrukListe(abrevAutres, ", ");
|
171 |
tabIdentiteParams.set("nom_autre", construireTxtTruck(personne.getString("truk_nom_autre")));
|
| 150 |
}
|
172 |
tabIdentiteParams.set("abreviation_autre", construireTxtTruck(personne.getString("truk_abreviation_autre")));
|
| 151 |
tabIdentiteParams.set("abreviation_autre", listeAbrev);
|
173 |
|
| 152 |
|
174 |
HashMap<String, String> mapTelephones = (HashMap<String, String>) personne
|
| 153 |
HashMap<String, String> mapTelephones = (HashMap<String, String>) personne.getChaineDenormaliseAsMapOrList("truk_telephone");
|
175 |
.getChaineDenormaliseAsMapOrList("truk_telephone");
|
| 154 |
if ((mapTelephones != null)&&(mapTelephones.size() > 0)) {
|
176 |
if ((mapTelephones != null) && (mapTelephones.size() > 0)) {
|
| 155 |
|
177 |
|
| 156 |
Collection<String> telephoneKeys = mapTelephones.keySet();
|
178 |
Collection<String> telephoneKeys = mapTelephones.keySet();
|
| 157 |
Iterator<String> itTelephones = telephoneKeys.iterator();
|
179 |
Iterator<String> itTelephones = telephoneKeys.iterator();
|
| 158 |
|
180 |
|
| 159 |
while (itTelephones.hasNext()) {
|
181 |
while (itTelephones.hasNext()) {
|
| - |
|
182 |
String key = itTelephones.next();
|
| 160 |
String key = itTelephones.next();
|
183 |
String label = mapTelephones.get(key);
|
| 161 |
String label = mapTelephones.get(key);
|
- |
|
| 162 |
|
- |
|
| 163 |
try {
|
184 |
|
| 164 |
label = mediateur.i18nC.getString(label);
|
185 |
try {
|
| 165 |
}
|
186 |
label = mediateur.i18nC.getString(label);
|
| 166 |
catch (MissingResourceException e) {
|
187 |
} catch (MissingResourceException e) {
|
| 167 |
}
|
188 |
}
|
| 168 |
|
189 |
|
| - |
|
190 |
tplIdentite += "<b>" + label + ":</b> " + key;
|
| 169 |
tplIdentite += "<b>" + label + ":</b> " + key;
|
191 |
tplIdentite += "<br />";
|
| 170 |
tplIdentite += "<br />";
|
192 |
}
|
| - |
|
193 |
}
|
| 171 |
}
|
194 |
|
| 172 |
}
|
195 |
// Courriel :Champ truk de la forme
|
| 173 |
|
196 |
// "Adresse@adr.com;; adr2@adr.fr ..."
|
| 174 |
// Courriel :Champ truk de la forme "Adresse@adr.com;; adr2@adr.fr ..."
|
197 |
LinkedList<String> listeCourriel = (LinkedList<String>) personne
|
| 175 |
LinkedList<String> listeCourriel = (LinkedList<String>) personne.getChaineDenormaliseAsMapOrList("truk_courriel");
|
198 |
.getChaineDenormaliseAsMapOrList("truk_courriel");
|
| 176 |
if ((listeCourriel!=null)&&(listeCourriel.size() > 0)) {
|
199 |
if ((listeCourriel != null) && (listeCourriel.size() > 0)) {
|
| 177 |
String strLabelCourriel = "Courriel";
|
200 |
String strLabelCourriel = "Courriel";
|
| 178 |
if (listeCourriel.size() > 1) {
|
201 |
if (listeCourriel.size() > 1) {
|
| 179 |
strLabelCourriel += "s";
|
202 |
strLabelCourriel += "s";
|
| 180 |
}
|
203 |
}
|
| - |
|
204 |
|
| 181 |
|
205 |
String valeurCourriel = "";
|
| 182 |
String valeurCourriel = "";
|
206 |
Iterator<String> itCourriel = listeCourriel.iterator();
|
| 183 |
Iterator<String> itCourriel = listeCourriel.iterator();
|
207 |
while (itCourriel.hasNext()) {
|
| 184 |
while (itCourriel.hasNext()) {
|
208 |
String valeurCourante = itCourriel.next();
|
| Line 185... |
Line 209... |
| 185 |
String valeurCourante = itCourriel.next();
|
209 |
valeurCourriel += "<br /><a href=\"mailto:"
|
| - |
|
210 |
+ valeurCourante + "\">" + valeurCourante + "</a>";
|
| 186 |
valeurCourriel += "<br /><a href=\"mailto:" + valeurCourante + "\">" + valeurCourante + "</a>";
|
211 |
}
|
| 187 |
}
|
212 |
tplIdentite += valeurCourriel;
|
| 188 |
tplIdentite += valeurCourriel;
|
213 |
}
|
| 189 |
}
|
214 |
|
| 190 |
|
215 |
// Url Site Webs
|
| 191 |
// Url Site Webs
|
216 |
LinkedList listeUrl = (LinkedList) personne
|
| 192 |
LinkedList listeUrl = (LinkedList) personne.getChaineDenormaliseAsMapOrList("truk_url");
|
217 |
.getChaineDenormaliseAsMapOrList("truk_url");
|
| 193 |
if (listeUrl!=null && listeUrl.size() > 0) {
|
218 |
if (listeUrl != null && listeUrl.size() > 0) {
|
| 194 |
|
219 |
|
| - |
|
220 |
tplIdentite += "<br /><br /><b>Sites web:</b><br /><span style='display:inline-block'>";
|
| 195 |
tplIdentite += "<br /><br /><b>Sites web:</b><br /><span style='display:inline-block'>";
|
221 |
String strUrl = "";
|
| 196 |
String strUrl = "";
|
222 |
Iterator<String> urlIt = listeUrl.iterator();
|
| 197 |
Iterator<String> urlIt = listeUrl.iterator();
|
223 |
while (urlIt.hasNext()) {
|
| 198 |
while (urlIt.hasNext()) {
|
224 |
String urlCourante = urlIt.next();
|
| 199 |
String urlCourante = urlIt.next();
|
225 |
strUrl += "<a href=\"" + urlCourante + "\">" + urlCourante
|
| 200 |
strUrl += "<a href=\""+urlCourante+"\">" + urlCourante + "</a> <br/>";
|
226 |
+ "</a> <br/>";
|
| 201 |
}
|
227 |
}
|
| 202 |
tplIdentite += strUrl + "</span><br />";
|
228 |
tplIdentite += strUrl + "</span><br />";
|
| 203 |
}
|
229 |
}
|
| 204 |
|
230 |
|
| 205 |
tplIdentite += "</div>";
|
231 |
tplIdentite += "</div>";
|
| 206 |
|
- |
|
| 207 |
afficherOnglet(tplIdentite, tabIdentiteParams, tabIdentite);
|
232 |
|
| 208 |
|
233 |
afficherOnglet(tplIdentite, tabIdentiteParams, tabIdentite);
|
| 209 |
String tabAdresseTpl = "<div class='{css_corps}'>" +
|
234 |
|
| 210 |
" <div class='{css_fieldset}'>" +
|
235 |
String tabAdresseTpl = "<div class='{css_corps}'>"
|
| 211 |
" <h2>Adresse personnelle:</h2>" +
|
236 |
+ " <div class='{css_fieldset}'>"
|
| 212 |
" {adresse01} <br />" +
|
237 |
+ " <h2>Adresse personnelle:</h2>"
|
| 213 |
" {adresse02} <br />" +
|
238 |
+ " {adresse01} <br />" + " {adresse02} <br />"
|
| 214 |
" {boitePostale}<br />" +
|
239 |
+ " {boitePostale}<br />"
|
| - |
|
240 |
+ " {codePostal} {region}<br />"
|
| 215 |
" {codePostal} {region}<br />" +
|
241 |
+ " <span style='uppercase'>{pays}</span><br />"
|
| - |
|
242 |
+ "</div>";
|
| 216 |
" <span style='uppercase'>{pays}</span><br />" +
|
243 |
// Adresses :
|
| - |
|
244 |
Params paramAdresseTpl = new Params();
|
| 217 |
"</div>";
|
245 |
paramAdresseTpl.set("adresse01", (String) personne
|
| - |
|
246 |
.obtenirValeurChamp("adresse_01"));
|
| 218 |
//Adresses :
|
247 |
paramAdresseTpl.set("adresse02", (String) personne
|
| - |
|
248 |
.obtenirValeurChamp("adresse_02"));
|
| 219 |
Params paramAdresseTpl = new Params();
|
249 |
paramAdresseTpl.set("boitePostale", (String) personne
|
| - |
|
250 |
.obtenirValeurChamp("bp"));
|
| 220 |
paramAdresseTpl.set("adresse01", (String) personne.obtenirValeurChamp("adresse_01"));
|
251 |
paramAdresseTpl.set("codePostal", (String) personne
|
| - |
|
252 |
.obtenirValeurChamp("code_postal"));
|
| 221 |
paramAdresseTpl.set("adresse02", (String) personne.obtenirValeurChamp("adresse_02"));
|
253 |
paramAdresseTpl.set("ville", (String) personne
|
| 222 |
paramAdresseTpl.set("boitePostale", (String) personne.obtenirValeurChamp("bp"));
|
254 |
.obtenirValeurChamp("ville"));
|
| 223 |
paramAdresseTpl.set("codePostal", (String) personne.obtenirValeurChamp("code_postal"));
|
255 |
paramAdresseTpl.set("region", (String) personne
|
| Line 224... |
Line 256... |
| 224 |
paramAdresseTpl.set("ville", (String) personne.obtenirValeurChamp("ville"));
|
256 |
.obtenirValeurChamp("region"));
|
| 225 |
paramAdresseTpl.set("region", (String) personne.obtenirValeurChamp("region"));
|
257 |
paramAdresseTpl.set("pays", (String) personne
|
| 226 |
paramAdresseTpl.set("pays", (String) personne.obtenirValeurChamp("pays"));
|
258 |
.obtenirValeurChamp("pays"));
|
| 227 |
|
259 |
|
| 228 |
afficherOnglet(tabAdresseTpl, paramAdresseTpl, tabAdresse);
|
260 |
afficherOnglet(tabAdresseTpl, paramAdresseTpl, tabAdresse);
|
| 229 |
tabAdresse.setStyleAttribute("padding", "15px");
|
261 |
tabAdresse.setStyleAttribute("padding", "15px");
|
| 230 |
|
262 |
|
| 231 |
// Infos naturalistes :Biographie, Spécialité (typé)
|
- |
|
| 232 |
String tplInfosNat = "<div class='{css_corps}'>" +
|
- |
|
| 233 |
" <div class='{css_fieldset}'>" +
|
263 |
// Infos naturalistes :Biographie, Spécialité (typé)
|
| 234 |
" <h2>" + mediateur.i18nC.personneSpecialite() + "</h1>"+
|
264 |
String tplInfosNat = "<div class='{css_corps}'>"
|
| 235 |
" {specialites}" +
|
265 |
+ " <div class='{css_fieldset}'>" + " <h2>"
|
| 236 |
" <h2>" + mediateur.i18nC.personneRecolte() + "</h2>" +
|
266 |
+ mediateur.i18nC.personneSpecialite() + "</h1>"
|
| 237 |
" {recoltes}" +
|
267 |
+ " {specialites}" + " <h2>"
|
| 238 |
" </div>" +
|
268 |
+ mediateur.i18nC.personneRecolte() + "</h2>"
|
| 239 |
"</div>";
|
269 |
+ " {recoltes}" + " </div>" + "</div>";
|
| 240 |
Params prmInfosNat = new Params();
|
270 |
Params prmInfosNat = new Params();
|
| 241 |
|
271 |
|
| 242 |
//TODO : replace id region par valeur
|
272 |
// TODO : replace id region par valeur
|
| 243 |
|
273 |
|
| 244 |
String specialite = construireTxtTruck(personne.getSpecialite());
|
274 |
String specialite = construireTxtTruck(personne.getSpecialite());
|
| 245 |
prmInfosNat.set("specialites", specialite);
|
- |
|
| 246 |
|
275 |
prmInfosNat.set("specialites", specialite);
|
| 247 |
String recolte = construireTxtTruck(personne.getString("truk_recolte"));
|
276 |
|
| 248 |
prmInfosNat.set("recoltes", recolte);
|
277 |
String recolte = construireTxtListeOntologie(personne.getString("truk_recolte"));
|
| 249 |
|
278 |
prmInfosNat.set("recoltes", recolte);
|
| 250 |
afficherOnglet(tplInfosNat, prmInfosNat, tabInfosNat);
|
279 |
|
| 251 |
tabAdresse.setStyleAttribute("padding", "15px");
|
280 |
afficherOnglet(tplInfosNat, prmInfosNat, tabInfosNat);
|
| 252 |
|
281 |
tabAdresse.setStyleAttribute("padding", "15px");
|
| 253 |
|
282 |
|
| 254 |
changerLabelRegions();
|
283 |
changerLabelRegions();
|
| 255 |
layout();
|
- |
|
| 256 |
}
|
284 |
layout();
|
| 257 |
}
|
- |
|
| 258 |
|
285 |
}
|
| 259 |
public String initialiserTplEntete() {
|
- |
|
| 260 |
|
286 |
}
|
| 261 |
return "<div id='{css_id}'>"+
|
287 |
|
| 262 |
"<h1>{nom}</h1>"+
|
288 |
public String initialiserTplEntete() {
|
| 263 |
"<h2><a href='{mail}'>{mail}</a></h2>" +
|
289 |
|
| - |
|
290 |
return "<div id='{css_id}'>" + "<h1>{nom}</h1>"
|
| - |
|
291 |
+ "<h2><a href='{mail}'>{mail}</a></h2>" + "</div>";
|
| 264 |
"</div>";
|
292 |
}
|
| 265 |
}
|
293 |
|
| 266 |
|
294 |
public String initialiserTplIdentite() {
|
| 267 |
|
295 |
|
| - |
|
296 |
return "<div class='{css_corps}'>" + " <div class='{css_fieldset}'>"
|
| - |
|
297 |
+ " <h2>Noms:</h2>" + " <span><b>"
|
| - |
|
298 |
+ mediateur.i18nC.personneNomComplet()
|
| - |
|
299 |
+ ":</b></span> {nom_complet}<br />"
|
| 268 |
public String initialiserTplIdentite() {
|
300 |
+ " <span><b>"
|
| 269 |
|
301 |
+ mediateur.i18nC.personneNomAutre()
|
| 270 |
return "<div class='{css_corps}'>" +
|
302 |
+ ":</b></span> {nom_autre}<br />"
|
| - |
|
303 |
+ " <span><b>"
|
| 271 |
" <div class='{css_fieldset}'>" +
|
304 |
+ mediateur.i18nC.personneAbreviation()
|
| - |
|
305 |
+ ":</b></span> {abreviation}<br />"
|
| - |
|
306 |
+ " <span><b>"
|
| - |
|
307 |
+ mediateur.i18nC.personneAbreviationAutre()
|
| 272 |
" <h2>Noms:</h2>" +
|
308 |
+ ":</b></b></span> {abreviation_autre}<br /><br />"
|
| 273 |
" <span><b>" + mediateur.i18nC.personneNomComplet() + ":</b></span> {nom_complet}<br />" +
|
309 |
+ " <h2>Naissance:</h2>"
|
| - |
|
310 |
+ " <span><b>"
|
| 274 |
" <span><b>" + mediateur.i18nC.personneNomAutre() + ":</b></span> {nom_autre}<br />" +
|
311 |
+ mediateur.i18nC.personneDateNaissance()
|
| - |
|
312 |
+ "</b></span> {naissance_date}<br />"
|
| - |
|
313 |
+ " <span><b>"
|
| - |
|
314 |
+ mediateur.i18nC.personneLieuNaissance()
|
| 275 |
" <span><b>" + mediateur.i18nC.personneAbreviation() + ":</b></span> {abreviation}<br />" +
|
315 |
+ ":</b></span> {naissance_lieu}<br /><br />"
|
| 276 |
" <span><b>" + mediateur.i18nC.personneAbreviationAutre() + ":</b></b></span> {abreviation_autre}<br /><br />" +
|
316 |
+ " <h2>Décès:</h2>"
|
| 277 |
" <h2>Naissance:</h2>" +
|
317 |
+ " <span><b>"
|
| 278 |
" <span><b>" + mediateur.i18nC.personneDateNaissance() + "</b></span> {naissance_date}<br />" +
|
318 |
+ mediateur.i18nC.personneDateDeces()
|
| 279 |
" <span><b>" + mediateur.i18nC.personneLieuNaissance() + ":</b></span> {naissance_lieu}<br /><br />" +
|
319 |
+ ":</b></span> {deces_date}<br />"
|
| 280 |
" <h2>Décès:</h2>" +
|
320 |
+ " <span><b>"
|
| 281 |
" <span><b>" + mediateur.i18nC.personneDateDeces() + ":</b></span> {deces_date}<br />" +
|
321 |
+ mediateur.i18nC.personneLieuDeces()
|
| 282 |
" <span><b>" + mediateur.i18nC.personneLieuDeces() + ":</b></span> {deces_lieu}<br /><br />" +
|
- |
|
| 283 |
" </div>" +
|
- |
|
| 284 |
"</div>" +
|
322 |
+ ":</b></span> {deces_lieu}<br /><br />"
|
| 285 |
"<div class='{css_corps}'>" +
|
323 |
+ " </div>"
|
| 286 |
" <div class='css_fieldset'> " +
|
324 |
+ "</div>"
|
| 287 |
" <h2>Description:</h2>" +
|
325 |
+ "<div class='{css_corps}'>"
|
| 288 |
" {description}<br />" +
|
326 |
+ " <div class='css_fieldset'> "
|
| 289 |
" </div>" +
|
327 |
+ " <h2>Description:</h2>"
|
| 290 |
"<br />";
|
328 |
+ " {description}<br />" + " </div>" + "<br />";
|
| 291 |
}
|
329 |
}
|
| 292 |
|
330 |
|
| 293 |
private void changerLabelRegions() {
|
331 |
private void changerLabelRegions() {
|
| 294 |
|
332 |
|
| 295 |
Collection<String> colClesComposants = hmLabelFieldRegion.keySet();
|
333 |
Collection<String> colClesComposants = hmLabelFieldRegion.keySet();
|
| Line 296... |
Line 334... |
| 296 |
Iterator<String> itComposants = colClesComposants.iterator();
|
334 |
Iterator<String> itComposants = colClesComposants.iterator();
|
| 297 |
|
335 |
|
| 298 |
while (itComposants.hasNext()) {
|
336 |
while (itComposants.hasNext()) {
|
| 299 |
String region = itComposants.next();
|
- |
|
| 300 |
mediateur.obtenirValeurEtRafraichir(this, "region", region);
|
337 |
String region = itComposants.next();
|
| 301 |
}
|
338 |
mediateur.obtenirValeurEtRafraichir(this, "region", region);
|
| 302 |
}
|
339 |
}
|
| 303 |
|
340 |
}
|
| 304 |
private void ajouterLabelField(FieldSet fs, String tfLabel, Object tfValue) {
|
341 |
|
| 305 |
|
342 |
private void ajouterLabelField(FieldSet fs, String tfLabel, Object tfValue) {
|
| 306 |
if ((tfValue!=null)&&(!tfValue.toString().trim().equals(""))) {
|
343 |
|
| 307 |
|
344 |
if ((tfValue != null) && (!tfValue.toString().trim().equals(""))) {
|
| 308 |
|
345 |
|
| 309 |
LabelField tf = new LabelField();
|
346 |
LabelField tf = new LabelField();
|
| 310 |
|
347 |
|
| 311 |
tf.setFieldLabel(tfLabel + ":");
|
348 |
tf.setFieldLabel(tfLabel + ":");
|
| 312 |
if ((tfLabel==null)||("".equals(tfLabel))) {
|
349 |
if ((tfLabel == null) || ("".equals(tfLabel))) {
|
| 313 |
tf.setHideLabel(true);
|
350 |
tf.setHideLabel(true);
|
| 314 |
tf.setStyleAttribute("margin", "0 0 0 105px");
|
- |
|
| 315 |
}
|
351 |
tf.setStyleAttribute("margin", "0 0 0 105px");
|
| - |
|
352 |
}
|
| - |
|
353 |
tf.setValue(tfValue);
|
| 316 |
tf.setValue(tfValue);
|
354 |
|
| 317 |
|
355 |
// Ajout au fieldSet
|
| - |
|
356 |
fs.add(tf);
|
| Line 318... |
Line 357... |
| 318 |
//Ajout au fieldSet
|
357 |
}
|
| 319 |
fs.add(tf);
|
358 |
}
|
| 320 |
}
|
359 |
|
| 321 |
}
|
360 |
private Configuration config = (Configuration) Registry
|
| - |
|
361 |
.get(RegistreId.CONFIG);
|
| 322 |
|
362 |
|
| - |
|
363 |
private boolean ontologieRecue = false;
|
| - |
|
364 |
private Personne personneAAfficher = null;
|
| - |
|
365 |
|
| 323 |
|
366 |
public void rafraichir(Object nouvellesDonnees) {
|
| - |
|
367 |
|
| - |
|
368 |
// Si on a reçu une personne on en affiche les détails
|
| Line -... |
Line 369... |
| - |
|
369 |
if (nouvellesDonnees instanceof Personne) {
|
| - |
|
370 |
if (ontologieRecue) {
|
| - |
|
371 |
afficherDetailPersonne((Personne) nouvellesDonnees);
|
| - |
|
372 |
} else {
|
| - |
|
373 |
personneAAfficher = (Personne) nouvellesDonnees;
|
| - |
|
374 |
}
|
| 324 |
|
375 |
} else if (nouvellesDonnees instanceof ValeurListe) {
|
| 325 |
private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
|
376 |
ValeurListe ontologieReceptionnee = (ValeurListe) nouvellesDonnees;
|
| 326 |
|
377 |
ajouterListeValeursAOntologie(ontologieReceptionnee);
|
| 327 |
public void rafraichir(Object nouvellesDonnees) {
|
378 |
|
| 328 |
|
- |
|
| 329 |
// Si on a reçu une personne on en affiche les détails
|
379 |
if (personneAAfficher != null) {
|
| 330 |
if (nouvellesDonnees instanceof Personne) {
|
- |
|
| 331 |
afficherDetailPersonne((Personne) nouvellesDonnees);
|
380 |
afficherDetailPersonne(personneAAfficher);
|
| 332 |
} else if (nouvellesDonnees instanceof ValeurListe) {
|
381 |
}
|
| 333 |
|
382 |
ontologieRecue = true;
|
| 334 |
ValeurListe listeValeur = (ValeurListe) nouvellesDonnees;
|
- |
|
| 335 |
if (listeValeur.getId().equals(config.getListeId("region"))) {
|
383 |
|
| 336 |
|
- |
|
| 337 |
Collection colCleListeValeur = listeValeur.keySet();
|
384 |
// Remplacer ci-dessous par Ontologie
|
| 338 |
|
385 |
ValeurListe listeValeur = (ValeurListe) nouvellesDonnees;
|
| 339 |
Iterator<String> itLv = colCleListeValeur.iterator();
|
386 |
if (listeValeur.getId().equals(config.getListeId("region"))) {
|
| 340 |
|
387 |
|
| 341 |
while (itLv.hasNext()) {
|
388 |
Collection colCleListeValeur = listeValeur.keySet();
|
| 342 |
String idRegion = itLv.next();
|
389 |
Iterator<String> itLv = colCleListeValeur.iterator();
|
| 343 |
Valeur region = listeValeur.get(idRegion);
|
390 |
while (itLv.hasNext()) {
|
| 344 |
|
391 |
String idRegion = itLv.next();
|
| 345 |
|
392 |
Valeur region = listeValeur.get(idRegion);
|
| 346 |
|
393 |
|
| 347 |
if (region != null) {
|
394 |
if (region != null) {
|
| 348 |
|
395 |
|
| 349 |
String strRegionId = region.getAbreviation();
|
396 |
String strRegionId = region.getAbreviation();
|
| 350 |
|
397 |
|
| 351 |
LinkedList<LabelField> listComposantsRegion = (LinkedList) hmLabelFieldRegion.get(strRegionId);
|
398 |
LinkedList<LabelField> listComposantsRegion = (LinkedList) hmLabelFieldRegion.get(strRegionId);
|