Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1369 Rev 1373
1
package org.tela_botanica.client.vues.personne;
1
package org.tela_botanica.client.vues.personne;
2
 
2
 
3
import java.util.Collection;
3
import java.util.Collection;
4
import java.util.HashMap;
4
import java.util.HashMap;
5
import java.util.Iterator;
5
import java.util.Iterator;
6
import java.util.LinkedList;
6
import java.util.LinkedList;
7
import java.util.List;
7
import java.util.List;
8
 
8
 
9
import org.tela_botanica.client.ComposantId;
9
import org.tela_botanica.client.ComposantId;
10
import org.tela_botanica.client.Mediateur;
10
import org.tela_botanica.client.Mediateur;
11
import org.tela_botanica.client.RegistreId;
11
import org.tela_botanica.client.RegistreId;
12
import org.tela_botanica.client.configuration.Configuration;
12
import org.tela_botanica.client.configuration.Configuration;
13
import org.tela_botanica.client.interfaces.Rafraichissable;
13
import org.tela_botanica.client.interfaces.Rafraichissable;
14
import org.tela_botanica.client.modeles.Valeur;
14
import org.tela_botanica.client.modeles.Valeur;
15
import org.tela_botanica.client.modeles.ValeurListe;
15
import org.tela_botanica.client.modeles.ValeurListe;
16
import org.tela_botanica.client.modeles.personne.Personne;
16
import org.tela_botanica.client.modeles.personne.Personne;
17
import org.tela_botanica.client.modeles.publication.Publication;
17
import org.tela_botanica.client.modeles.publication.Publication;
18
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
18
import org.tela_botanica.client.modeles.publication.PublicationAPersonne;
19
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
19
import org.tela_botanica.client.modeles.publication.PublicationAPersonneListe;
20
import org.tela_botanica.client.synchronisation.Sequenceur;
20
import org.tela_botanica.client.synchronisation.Sequenceur;
21
import org.tela_botanica.client.util.Debug;
21
import org.tela_botanica.client.util.Debug;
22
import org.tela_botanica.client.vues.DetailVue;
22
import org.tela_botanica.client.vues.DetailVue;
23
 
23
 
24
import com.extjs.gxt.ui.client.Registry;
24
import com.extjs.gxt.ui.client.Registry;
25
import com.extjs.gxt.ui.client.Style.Scroll;
25
import com.extjs.gxt.ui.client.Style.Scroll;
26
import com.extjs.gxt.ui.client.util.Format;
26
import com.extjs.gxt.ui.client.util.Format;
27
import com.extjs.gxt.ui.client.util.Params;
27
import com.extjs.gxt.ui.client.util.Params;
28
import com.extjs.gxt.ui.client.widget.ContentPanel;
28
import com.extjs.gxt.ui.client.widget.ContentPanel;
29
import com.extjs.gxt.ui.client.widget.Html;
29
import com.extjs.gxt.ui.client.widget.Html;
30
import com.extjs.gxt.ui.client.widget.TabItem;
30
import com.extjs.gxt.ui.client.widget.TabItem;
31
import com.extjs.gxt.ui.client.widget.TabPanel;
31
import com.extjs.gxt.ui.client.widget.TabPanel;
32
import com.extjs.gxt.ui.client.widget.form.FieldSet;
32
import com.extjs.gxt.ui.client.widget.form.FieldSet;
33
import com.extjs.gxt.ui.client.widget.form.LabelField;
33
import com.extjs.gxt.ui.client.widget.form.LabelField;
34
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
34
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
35
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
35
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
36
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
36
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
37
import com.google.gwt.user.client.ui.Image;
37
import com.google.gwt.user.client.ui.Image;
38
 
38
 
39
public class PersonneDetailVue extends DetailVue implements Rafraichissable {
39
public class PersonneDetailVue extends DetailVue implements Rafraichissable {
40
 
40
 
41
	private TabPanel tabPanel;
41
	private TabPanel tabPanel;
42
	private Html entete;
42
	private Html entete;
43
	
43
	
44
	private TabItem tabIdentite;
44
	private TabItem tabIdentite;
45
	private TabItem tabAdresse;
45
	private TabItem tabAdresse;
46
	private TabItem tabInfosNat;
46
	private TabItem tabInfosNat;
47
	private TabItem tabLogos;
47
	private TabItem tabLogos;
48
	private TabItem tabPublications;
48
	private TabItem tabPublications;
49
	
49
	
50
	private HashMap hmLabelFieldRegion = new HashMap();
50
	private HashMap hmLabelFieldRegion = new HashMap();
51
	
51
	
52
	private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
52
	private Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
53
	private Personne personneAAfficher = null;
53
	private Personne personneAAfficher = null;
54
 
54
 
55
	private String tableauPublicationsLieesTpl = "";
55
	private String tableauPublicationsLieesTpl = "";
56
	private String lignePublicationLieeTpl = "";
56
	private String lignePublicationLieeTpl = "";
57
	
57
	
58
	private Sequenceur sequenceur = new Sequenceur();
58
	private Sequenceur sequenceur = new Sequenceur();
59
	
59
	
60
	public PersonneDetailVue(Mediateur mediateur) {
60
	public PersonneDetailVue(Mediateur mediateur) {
61
		super(mediateur);
61
		super(mediateur);
62
 
62
 
63
		setLayout(new FitLayout());
63
		setLayout(new FitLayout());
64
 
64
 
65
		entete = new Html();
65
		entete = new Html();
66
		entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
66
		entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
67
 
67
 
68
		ContentPanel panneauPrincipal = new ContentPanel();
68
		ContentPanel panneauPrincipal = new ContentPanel();
69
		panneauPrincipal.setLayout(new FitLayout());
69
		panneauPrincipal.setLayout(new FitLayout());
70
		panneauPrincipal.setHeaderVisible(false);
70
		panneauPrincipal.setHeaderVisible(false);
71
		panneauPrincipal.setBodyBorder(true);
71
		panneauPrincipal.setBodyBorder(true);
72
		panneauPrincipal.setTopComponent(entete);
72
		panneauPrincipal.setTopComponent(entete);
73
 
73
 
74
		tabIdentite = new TabItem(i18nC.personneIdentite());
74
		tabIdentite = new TabItem(i18nC.personneIdentite());
75
		tabIdentite.setTitle(i18nC.personneIdentite());
75
		tabIdentite.setTitle(i18nC.personneIdentite());
76
		tabIdentite.setLayout(new AnchorLayout());
76
		tabIdentite.setLayout(new AnchorLayout());
77
		tabIdentite.setScrollMode(Scroll.AUTO);
77
		tabIdentite.setScrollMode(Scroll.AUTO);
78
 
78
 
79
		tabAdresse = new TabItem(i18nC.personneAdresses());
79
		tabAdresse = new TabItem(i18nC.personneAdresses());
80
		tabAdresse.setTitle(i18nC.personneAdresses());
80
		tabAdresse.setTitle(i18nC.personneAdresses());
81
		tabAdresse.setLayout(new FitLayout());
81
		tabAdresse.setLayout(new FitLayout());
82
		tabAdresse.setScrollMode(Scroll.AUTO);
82
		tabAdresse.setScrollMode(Scroll.AUTO);
83
 
83
 
84
		tabInfosNat = new TabItem(i18nC.personneInfoNat());
84
		tabInfosNat = new TabItem(i18nC.personneInfoNat());
85
		tabInfosNat.setTitle(i18nC.personneInfoNat());
85
		tabInfosNat.setTitle(i18nC.personneInfoNat());
86
		tabInfosNat.setScrollMode(Scroll.AUTO);
86
		tabInfosNat.setScrollMode(Scroll.AUTO);
87
 
87
 
88
		tabPublications = new TabItem(i18nC.tabPublications());
88
		tabPublications = new TabItem(i18nC.tabPublications());
89
		tabPublications.setTitle(i18nC.tabPublications());
89
		tabPublications.setTitle(i18nC.tabPublications());
90
		tabPublications.setScrollMode(Scroll.AUTO);
90
		tabPublications.setScrollMode(Scroll.AUTO);
91
		tabPublications.setLayout(new FlowLayout());
91
		tabPublications.setLayout(new FlowLayout());
92
		
92
		
93
		tabLogos = new TabItem(i18nC.personneLogos());
93
		tabLogos = new TabItem(i18nC.personneLogos());
94
		tabLogos.setTitle(i18nC.personneLogos());
94
		tabLogos.setTitle(i18nC.personneLogos());
95
		tabLogos.setScrollMode(Scroll.AUTO);
95
		tabLogos.setScrollMode(Scroll.AUTO);
96
		tabLogos.setLayout(new FlowLayout());
96
		tabLogos.setLayout(new FlowLayout());
97
 
97
 
98
		tabPanel = new TabPanel();
98
		tabPanel = new TabPanel();
99
		tabPanel.setId(ComposantId.ZONE_DETAIL_CORPS);
99
		tabPanel.setId(ComposantId.ZONE_DETAIL_CORPS);
100
		tabPanel.setBodyBorder(false);
100
		tabPanel.setBodyBorder(false);
101
 
101
 
102
		tabPanel.add(tabIdentite);
102
		tabPanel.add(tabIdentite);
103
		tabPanel.add(tabAdresse);
103
		tabPanel.add(tabAdresse);
104
		tabPanel.add(tabInfosNat);
104
		tabPanel.add(tabInfosNat);
105
		tabPanel.add(tabPublications);
105
		tabPanel.add(tabPublications);
106
		tabPanel.add(tabLogos);
106
		tabPanel.add(tabLogos);
107
 
107
 
108
		panneauPrincipal.add(tabPanel);
108
		panneauPrincipal.add(tabPanel);
109
		add(panneauPrincipal);
109
		add(panneauPrincipal);
110
	}
110
	}
111
 
111
 
112
	public void afficherDetailPersonne(Personne personne) {
112
	public void afficherDetailPersonne(Personne personne) {
113
		if (personne != null) {
113
		if (personne != null) {
114
			String tplEntete = initialiserTplEntete();
114
			String tplEntete = initialiserTplEntete();
115
			
115
			
116
			//Sélection des publication à personne
116
			//Sélection des publication à personne
117
			mediateur.selectionnerPublicationAPersonne(this, null, personne.getId(), new LinkedList(), null);
117
			mediateur.selectionnerPublicationAPersonne(this, null, personne.getId(), new LinkedList(), null);
118
 
118
 
119
			Params enteteParams = new Params();
119
			Params enteteParams = new Params();
120
			enteteParams.set("nom", (String) personne.get("fmt_nom_complet"));
120
			enteteParams.set("nom", (String) personne.get("fmt_nom_complet"));
121
			enteteParams.set("mail", (String) personne.getCourrielPrinc());
121
			enteteParams.set("mail", (String) personne.getCourrielPrinc());
122
 
122
 
123
			LinkedList lstLogos = (LinkedList) personne
123
			LinkedList lstLogos = (LinkedList) personne
124
					.getChaineDenormaliseAsMapOrList("truk_logo");
124
					.getChaineDenormaliseAsMapOrList("truk_logo");
125
			if (lstLogos != null && lstLogos.size() > 0) {
125
			if (lstLogos != null && lstLogos.size() > 0) {
126
 
126
 
127
				tabLogos.removeAll();
127
				tabLogos.removeAll();
128
				String urlLogoPrinc = (String) lstLogos.get(0);
128
				String urlLogoPrinc = (String) lstLogos.get(0);
129
				if (!urlLogoPrinc.trim().equals("")) {
129
				if (!urlLogoPrinc.trim().equals("")) {
130
					tplEntete = "<div id='personne-logo-div'><img src='{image}' alt='logo' /></div>"
130
					tplEntete = "<div id='personne-logo-div'><img src='{image}' alt='logo' /></div>"
131
							+ tplEntete;
131
							+ tplEntete;
132
					enteteParams.set("image", urlLogoPrinc);
132
					enteteParams.set("image", urlLogoPrinc);
133
				}
133
				}
134
 
134
 
135
				Iterator<String> itLogo = lstLogos.iterator();
135
				Iterator<String> itLogo = lstLogos.iterator();
136
				while (itLogo.hasNext()) {
136
				while (itLogo.hasNext()) {
137
					String urlLogoCourant = itLogo.next();
137
					String urlLogoCourant = itLogo.next();
138
					Image imgCourante = new Image(urlLogoCourant);
138
					Image imgCourante = new Image(urlLogoCourant);
139
					tabLogos.add(imgCourante);
139
					tabLogos.add(imgCourante);
140
				}
140
				}
141
				tabLogos.enable();
141
				tabLogos.enable();
142
 
142
 
143
			} else {
143
			} else {
144
				enteteParams.set("image", "");
144
				enteteParams.set("image", "");
145
				tabLogos.disable();
145
				tabLogos.disable();
146
			}
146
			}
147
 
147
 
148
			entete.el().setInnerHtml(Format.substitute(tplEntete, enteteParams));
148
			entete.el().setInnerHtml(Format.substitute(tplEntete, enteteParams));
149
 
149
 
150
			String tplIdentite = initialiserTplIdentite();
150
			String tplIdentite = initialiserTplIdentite();
151
 
151
 
152
			Params tabIdentiteParams = new Params();
152
			Params tabIdentiteParams = new Params();
153
			tabIdentiteParams.set("nom_complet", personne.getString("fmt_nom_complet"));
153
			tabIdentiteParams.set("nom_complet", personne.getString("fmt_nom_complet"));
154
			tabIdentiteParams.set("abreviation", personne.getString("abreviation"));
154
			tabIdentiteParams.set("abreviation", personne.getString("abreviation"));
155
			tabIdentiteParams.set("naissance_date", personne.getAnneeOuDateNaiss().equals("") ? mediateur.i18nC.inconnue() : personne.getAnneeOuDateNaiss());
155
			tabIdentiteParams.set("naissance_date", personne.getAnneeOuDateNaiss().equals("") ? mediateur.i18nC.inconnue() : personne.getAnneeOuDateNaiss());
156
			tabIdentiteParams.set("naissance_lieu", personne.getString("naissance_lieu"));
156
			tabIdentiteParams.set("naissance_lieu", personne.getString("naissance_lieu"));
157
			String tplDeces = "";
157
			String tplDeces = "";
158
			if (personne.estDecedee())	{
158
			if (personne.estDecedee())	{
159
				tplDeces = " <h2>Décès:</h2>"
159
				tplDeces = " <h2>Décès:</h2>"
160
						+ " <span><b>"
160
						+ " <span><b>"
161
						+ i18nC.personneDateDeces()
161
						+ i18nC.personneDateDeces()
162
						+ ":</b></span> {deces_date}<br />"
162
						+ ":</b></span> {deces_date}<br />"
163
						+ " 	 <span><b>"
163
						+ " 	 <span><b>"
164
						+ i18nC.personneLieuDeces()
164
						+ i18nC.personneLieuDeces()
165
						+ ":</b></span> {deces_lieu}<br /><br />";
165
						+ ":</b></span> {deces_lieu}<br /><br />";
166
				
166
				
167
				tabIdentiteParams.set("deces_date", personne.getAnneeOuDateDeces().equals("") ? mediateur.i18nC.inconnue() : personne.getAnneeOuDateDeces());
167
				tabIdentiteParams.set("deces_date", personne.getAnneeOuDateDeces().equals("") ? mediateur.i18nC.inconnue() : personne.getAnneeOuDateDeces());
168
				tabIdentiteParams.set("deces_lieu", personne.getString("deces_lieu"));
168
				tabIdentiteParams.set("deces_lieu", personne.getString("deces_lieu"));
169
			}
169
			}
170
			
170
			
171
			Params paramsDeces = new Params();
171
			Params paramsDeces = new Params();
172
			paramsDeces.set("tplDeces", tplDeces);
172
			paramsDeces.set("tplDeces", tplDeces);
173
			tplIdentite = Format.substitute(tplIdentite, paramsDeces);
173
			tplIdentite = Format.substitute(tplIdentite, paramsDeces);
174
			
174
			
175
			tabIdentiteParams.set("description", personne.getString("description"));
175
			tabIdentiteParams.set("description", personne.getString("description"));
176
 
176
 
177
			tabInfosNat.removeAll();
177
			tabInfosNat.removeAll();
178
 
178
 
179
			tabIdentiteParams.set("nom_autre", construireTxtTruck(personne.getString("truk_nom_autre")));
179
			tabIdentiteParams.set("nom_autre", construireTxtTruck(personne.getString("truk_nom_autre")));
180
			tabIdentiteParams.set("abreviation_autre", construireTxtTruck(personne.getString("truk_abreviation_autre")));
180
			tabIdentiteParams.set("abreviation_autre", construireTxtTruck(personne.getString("truk_abreviation_autre")));
181
 
181
 
182
			tplIdentite += construireTxtListeOntologie(personne.getString("truk_telephone"));
182
			tplIdentite += construireTxtListeOntologie(personne.getString("truk_telephone"));
183
 
183
 
184
			// Courriel :Champ truk de la forme
184
			// Courriel :Champ truk de la forme
185
			// "Adresse@adr.com;; adr2@adr.fr ..."
185
			// "Adresse@adr.com;; adr2@adr.fr ..."
186
			LinkedList<String> listeCourriel = (LinkedList<String>) personne
186
			LinkedList<String> listeCourriel = (LinkedList<String>) personne
187
					.getChaineDenormaliseAsMapOrList("truk_courriel");
187
					.getChaineDenormaliseAsMapOrList("truk_courriel");
188
			if ((listeCourriel != null) && (listeCourriel.size() > 0)) {
188
			if ((listeCourriel != null) && (listeCourriel.size() > 0)) {
189
				String strLabelCourriel = "Courriel";
189
				String strLabelCourriel = "Courriel";
190
				if (listeCourriel.size() > 1) {
190
				if (listeCourriel.size() > 1) {
191
					strLabelCourriel += "s";
191
					strLabelCourriel += "s";
192
				}
192
				}
193
 
193
 
194
				String valeurCourriel = "";
194
				String valeurCourriel = "";
195
				Iterator<String> itCourriel = listeCourriel.iterator();
195
				Iterator<String> itCourriel = listeCourriel.iterator();
196
				while (itCourriel.hasNext()) {
196
				while (itCourriel.hasNext()) {
197
					String valeurCourante = itCourriel.next();
197
					String valeurCourante = itCourriel.next();
198
					valeurCourriel += "<br /><a href=\"mailto:"
198
					valeurCourriel += "<br /><a href=\"mailto:"
199
							+ valeurCourante + "\">" + valeurCourante + "</a>";
199
							+ valeurCourante + "\">" + valeurCourante + "</a>";
200
				}
200
				}
201
				tplIdentite += valeurCourriel;
201
				tplIdentite += valeurCourriel;
202
			}
202
			}
203
 
203
 
204
			// Url Site Webs
204
			// Url Site Webs
205
			LinkedList listeUrl = (LinkedList) personne
205
			LinkedList listeUrl = (LinkedList) personne
206
					.getChaineDenormaliseAsMapOrList("truk_url");
206
					.getChaineDenormaliseAsMapOrList("truk_url");
207
			if (listeUrl != null && listeUrl.size() > 0) {
207
			if (listeUrl != null && listeUrl.size() > 0) {
208
 
208
 
209
				tplIdentite += "<br /><br /><b>Sites web:</b><br /><span style='display:inline-block'>";
209
				tplIdentite += "<br /><br /><b>Sites web:</b><br /><span style='display:inline-block'>";
210
				String strUrl = "";
210
				String strUrl = "";
211
				Iterator<String> urlIt = listeUrl.iterator();
211
				Iterator<String> urlIt = listeUrl.iterator();
212
				while (urlIt.hasNext()) {
212
				while (urlIt.hasNext()) {
213
					String urlCourante = urlIt.next();
213
					String urlCourante = urlIt.next();
214
					strUrl += "<a href=\"" + urlCourante + "\">" + urlCourante
214
					strUrl += "<a href=\"" + urlCourante + "\">" + urlCourante
215
							+ "</a> <br/>";
215
							+ "</a> <br/>";
216
				}
216
				}
217
				tplIdentite += strUrl + "</span><br />";
217
				tplIdentite += strUrl + "</span><br />";
218
			}
218
			}
219
 
219
 
220
			tplIdentite += "</div>";
220
			tplIdentite += "</div>";
221
 
221
 
222
			afficherOnglet(tplIdentite, tabIdentiteParams, tabIdentite);
222
			afficherOnglet(tplIdentite, tabIdentiteParams, tabIdentite);
223
 
223
 
224
			String tabAdresseTpl = "<div class='{css_corps}'>"
224
			String tabAdresseTpl = "<div class='{css_corps}'>"
225
					+ "	<div class='{css_fieldset}'>"
225
					+ "	<div class='{css_fieldset}'>"
226
					+ "		<h2>Adresse personnelle:</h2>"
226
					+ "		<h2>Adresse personnelle:</h2>"
227
					+ "		<b>Adresse:</b> {adresse01} <br />" 
227
					+ "		<b>Adresse:</b> {adresse01} <br />" 
228
					+ "		<b>Complément d'adresse: </b>{adresse02} <br />"
228
					+ "		<b>Complément d'adresse: </b>{adresse02} <br />"
229
					+ "		<b>Boite postale: </b>{boitePostale}<br />"
229
					+ "		<b>Boite postale: </b>{boitePostale}<br />"
230
					+ "		<b>Code postal:</b>{codePostal} <br />" 
230
					+ "		<b>Code postal:</b>{codePostal} <br />" 
231
					+ "		<b>Région:</b>{region}<br />"
231
					+ "		<b>Région:</b>{region}<br />"
232
					+ "		<b>Pays :</b><span style='uppercase'>{pays}</span><br />"
232
					+ "		<b>Pays :</b><span style='uppercase'>{pays}</span><br />"
233
					+ "</div>";
233
					+ "</div>";
234
			// Adresses :
234
			// Adresses :
235
			Params paramAdresseTpl = new Params();
235
			Params paramAdresseTpl = new Params();
236
			paramAdresseTpl.set("adresse01", (String) personne
236
			paramAdresseTpl.set("adresse01", (String) personne
237
					.obtenirValeurChamp("adresse_01"));
237
					.obtenirValeurChamp("adresse_01"));
238
			paramAdresseTpl.set("adresse02", (String) personne
238
			paramAdresseTpl.set("adresse02", (String) personne
239
					.obtenirValeurChamp("adresse_02"));
239
					.obtenirValeurChamp("adresse_02"));
240
			paramAdresseTpl.set("boitePostale", (String) personne
240
			paramAdresseTpl.set("boitePostale", (String) personne
241
					.obtenirValeurChamp("bp"));
241
					.obtenirValeurChamp("bp"));
242
			paramAdresseTpl.set("codePostal", (String) personne
242
			paramAdresseTpl.set("codePostal", (String) personne
243
					.obtenirValeurChamp("code_postal"));
243
					.obtenirValeurChamp("code_postal"));
244
			paramAdresseTpl.set("ville", (String) personne
244
			paramAdresseTpl.set("ville", (String) personne
245
					.obtenirValeurChamp("ville"));
245
					.obtenirValeurChamp("ville"));
246
			paramAdresseTpl.set("region", (String) personne
246
			paramAdresseTpl.set("region", (String) personne
247
					.obtenirValeurChamp("ce_truk_region"));
247
					.obtenirValeurChamp("ce_truk_region"));
248
			paramAdresseTpl.set("pays", construireTxtListeOntologie((String) personne
248
			paramAdresseTpl.set("pays", construireTxtListeOntologie((String) personne
249
					.obtenirValeurChamp("ce_truk_pays")));
249
					.obtenirValeurChamp("ce_truk_pays")));
250
 
250
 
251
			afficherOnglet(tabAdresseTpl, paramAdresseTpl, tabAdresse);
251
			afficherOnglet(tabAdresseTpl, paramAdresseTpl, tabAdresse);
252
			tabAdresse.setStyleAttribute("padding", "15px");
252
			tabAdresse.setStyleAttribute("padding", "15px");
253
 
253
 
254
			// Infos naturalistes :Biographie, Spécialité (typé)
254
			// Infos naturalistes :Biographie, Spécialité (typé)
255
			String tplInfosNat = "<div class='{css_corps}'>"
255
			String tplInfosNat = "<div class='{css_corps}'>"
256
					+ "	<div class='{css_fieldset}'>" + "		<h2>"
256
					+ "	<div class='{css_fieldset}'>" + "		<h2>"
257
					+ i18nC.personneBiographie() + "</h2>"
257
					+ i18nC.personneBiographie() + "</h2>"
258
					+ "			{biographie}" + "		"
258
					+ "			{biographie}" + "		"
259
					+ "<h2>" + i18nC.personneSpecialite() + "</h2>"
259
					+ "<h2>" + i18nC.personneSpecialite() + "</h2>"
260
					+ "			{specialites}" + "	<h2>"
260
					+ "			{specialites}" + "	<h2>"
261
					+ i18nC.personneRecolte() + "</h2>"
261
					+ i18nC.personneRecolte() + "</h2>"
262
					+ "		{recoltes}" + "  </div>" + "</div>";
262
					+ "		{recoltes}" + "  </div>" + "</div>";
263
			Params prmInfosNat = new Params();
263
			Params prmInfosNat = new Params();
264
 
264
 
265
			prmInfosNat.set("biographie", personne.get("biographie"));
265
			prmInfosNat.set("biographie", personne.get("biographie"));
266
			
266
			
267
			String specialite = construireTxtTruck(personne.getSpecialite());
267
			String specialite = construireTxtTruck(personne.getSpecialite());
268
			prmInfosNat.set("specialites", specialite);
268
			prmInfosNat.set("specialites", specialite);
269
 
269
 
270
			String recolte = construireTxtListeOntologie(personne.getString("truk_recolte"));
270
			String recolte = construireTxtListeOntologie(personne.getString("truk_recolte"));
271
			prmInfosNat.set("recoltes", recolte);
271
			prmInfosNat.set("recoltes", recolte);
272
 
272
 
273
			afficherOnglet(tplInfosNat, prmInfosNat, tabInfosNat);
273
			afficherOnglet(tplInfosNat, prmInfosNat, tabInfosNat);
274
			tabAdresse.setStyleAttribute("padding", "15px");
274
			tabAdresse.setStyleAttribute("padding", "15px");
275
 
275
 
276
			changerLabelRegions();
276
			changerLabelRegions();
277
			layout();
277
			layout();
278
		}
278
		}
279
	}
279
	}
280
 
280
 
281
	public String initialiserTplEntete() {
281
	public String initialiserTplEntete() {
282
		return "<div id='{css_id}'>" + "<h1>{nom}</h1>"
282
		return "<div id='{css_id}'>" + "<h1>{nom}</h1>"
283
				+ "<h2><a href='{mail}'>{mail}</a></h2>" + "</div>";
283
				+ "<h2><a href='{mail}'>{mail}</a></h2>" + "</div>";
284
	}
284
	}
285
 
285
 
286
	public String initialiserTplIdentite() {
286
	public String initialiserTplIdentite() {
287
		return "<div class='{css_corps}'>" + "	<div class='{css_fieldset}'>"
287
		return "<div class='{css_corps}'>" + "	<div class='{css_fieldset}'>"
288
				+ "	 <h2>Noms:</h2>" + "	 <span><b>"
288
				+ "	 <h2>Noms:</h2>" + "	 <span><b>"
289
				+ i18nC.personneNomComplet()
289
				+ i18nC.personneNomComplet()
290
				+ ":</b></span> {nom_complet}<br />"
290
				+ ":</b></span> {nom_complet}<br />"
291
				+ "	 <span><b>"
291
				+ "	 <span><b>"
292
				+ i18nC.personneNomAutre()
292
				+ i18nC.personneNomAutre()
293
				+ ":</b></span> {nom_autre}<br />"
293
				+ ":</b></span> {nom_autre}<br />"
294
				+ "	 <span><b>"
294
				+ "	 <span><b>"
295
				+ i18nC.personneAbreviation()
295
				+ i18nC.personneAbreviation()
296
				+ ":</b></span> {abreviation}<br />"
296
				+ ":</b></span> {abreviation}<br />"
297
				+ " 	 <span><b>"
297
				+ " 	 <span><b>"
298
				+ i18nC.personneAbreviationAutre()
298
				+ i18nC.personneAbreviationAutre()
299
				+ ":</b></b></span> {abreviation_autre}<br /><br />"
299
				+ ":</b></b></span> {abreviation_autre}<br /><br />"
300
				+ "	 <h2>Naissance:</h2>"
300
				+ "	 <h2>Naissance:</h2>"
301
				+ " 	 <span><b>"
301
				+ " 	 <span><b>"
302
				+ i18nC.personneDateNaissance()
302
				+ i18nC.personneDateNaissance()
303
				+ ":</b></span> {naissance_date}<br />"
303
				+ ":</b></span> {naissance_date}<br />"
304
				+ " 	 <span><b>"
304
				+ " 	 <span><b>"
305
				+ i18nC.personneLieuNaissance()
305
				+ i18nC.personneLieuNaissance()
306
				+ ":</b></span> {naissance_lieu}<br /><br />"
306
				+ ":</b></span> {naissance_lieu}<br /><br />"
307
				+ "{tplDeces}"
307
				+ "{tplDeces}"
308
				+ " 	</div>"
308
				+ " 	</div>"
309
				+ "</div>"
309
				+ "</div>"
310
				+ "<div class='{css_corps}'>"
310
				+ "<div class='{css_corps}'>"
311
				+ "	<div class='css_fieldset'> "
311
				+ "	<div class='css_fieldset'> "
312
				+ "	<h2>Description:</h2>"
312
				+ "	<h2>Description:</h2>"
313
				+ " 		{description}<br />" + "	</div>" + "<br />";
313
				+ " 		{description}<br />" + "	</div>" + "<br />";
314
	}
314
	}
315
 
315
 
316
	private void changerLabelRegions() {
316
	private void changerLabelRegions() {
317
		Collection<String> colClesComposants = hmLabelFieldRegion.keySet();
317
		Collection<String> colClesComposants = hmLabelFieldRegion.keySet();
318
		Iterator<String> itComposants = colClesComposants.iterator();
318
		Iterator<String> itComposants = colClesComposants.iterator();
319
 
319
 
320
		while (itComposants.hasNext()) {
320
		while (itComposants.hasNext()) {
321
			String region = itComposants.next();
321
			String region = itComposants.next();
322
			mediateur.obtenirValeurEtRafraichir(this, "region", region, sequenceur);
322
			mediateur.obtenirValeurEtRafraichir(this, "region", region, sequenceur);
323
		}
323
		}
324
	}
324
	}
325
 
325
 
326
	private void ajouterLabelField(FieldSet fs, String tfLabel, Object tfValue) {
326
	private void ajouterLabelField(FieldSet fs, String tfLabel, Object tfValue) {
327
		if ((tfValue != null) && (!tfValue.toString().trim().equals(""))) {
327
		if ((tfValue != null) && (!tfValue.toString().trim().equals(""))) {
328
 
328
 
329
			LabelField tf = new LabelField();
329
			LabelField tf = new LabelField();
330
 
330
 
331
			tf.setFieldLabel(tfLabel + ":");
331
			tf.setFieldLabel(tfLabel + ":");
332
			if ((tfLabel == null) || ("".equals(tfLabel))) {
332
			if ((tfLabel == null) || ("".equals(tfLabel))) {
333
				tf.setHideLabel(true);
333
				tf.setHideLabel(true);
334
				tf.setStyleAttribute("margin", "0 0 0 105px");
334
				tf.setStyleAttribute("margin", "0 0 0 105px");
335
			}
335
			}
336
			tf.setValue(tfValue);
336
			tf.setValue(tfValue);
337
 
337
 
338
			// Ajout au fieldSet
338
			// Ajout au fieldSet
339
			fs.add(tf);
339
			fs.add(tf);
340
		}
340
		}
341
	}
341
	}
342
	
342
	
343
	
343
	
344
	private void initialiserTableauPublicationsLieesTpl() {
344
	private void initialiserTableauPublicationsLieesTpl() {
345
		
345
		
346
		tableauPublicationsLieesTpl =
346
		tableauPublicationsLieesTpl =
347
			"<div class='{css_corps}'>" +
347
			"<div class='{css_corps}'>" +
348
			"	<h2>{i18n_titre_publication}</h2>"+
348
			"	<h2>{i18n_titre_publication}</h2>"+
349
			"	<table>"+
349
			"	<table>"+
350
			"	<thead>"+
350
			"	<thead>"+
351
			"		<tr>" +
351
			"		<tr>" +
352
			"			<th>{i18n_relation}</th>" +
352
			"			<th>{i18n_relation}</th>" +
353
			"			<th>{i18n_auteur}</th>" +
353
			"			<th>{i18n_auteur}</th>" +
354
			"			<th>{i18n_titre}</th>" +
354
			"			<th>{i18n_titre}</th>" +
355
			"			<th>{i18n_revue}</th>" +
355
			"			<th>{i18n_revue}</th>" +
356
			"			<th>{i18n_editeur}</th>" +
356
			"			<th>{i18n_editeur}</th>" +
357
			"			<th>{i18n_annee}</th>" +
357
			"			<th>{i18n_annee}</th>" +
358
			"			<th>{i18n_nvt}</th>" +
358
			"			<th>{i18n_nvt}</th>" +
359
			"			<th>{i18n_fascicule}</th>" +
359
			"			<th>{i18n_fascicule}</th>" +
360
			"			<th>{i18n_page}</th>" +
360
			"			<th>{i18n_page}</th>" +
361
			"		</tr>"+
361
			"		</tr>"+
362
			"	</thead>"+
362
			"	</thead>"+
363
			"	<tbody>"+
363
			"	<tbody>"+
364
			"		{lignes}"+
364
			"		{lignes}"+
365
			"	</tbody>"+
365
			"	</tbody>"+
366
			"</table>";
366
			"</table>";
367
	}
367
	}
368
	
368
	
369
	private void initialiserLignePublicationLieeTpl() {
369
	private void initialiserLignePublicationLieeTpl() {
370
		lignePublicationLieeTpl =
370
		lignePublicationLieeTpl =
371
			"<tr>"+
371
			"<tr>"+
372
			"	<td>{relation}</td>"+
372
			"	<td>{relation}</td>"+
373
			"	<td>{auteur}</td>"+
373
			"	<td>{auteur}</td>"+
374
			"	<td>{titre}</td>"+
374
			"	<td>{titre}</td>"+
375
			"	<td>{revue}</td>"+
375
			"	<td>{revue}</td>"+
376
			"	<td>{editeur}</td>"+
376
			"	<td>{editeur}</td>"+
377
			"	<td>{annee}</td>"+
377
			"	<td>{annee}</td>"+
378
			"	<td>{nvt}</td>"+
378
			"	<td>{nvt}</td>"+
379
			"	<td>{fascicule}</td>"+
379
			"	<td>{fascicule}</td>"+
380
			"	<td>{page}</td>"+
380
			"	<td>{page}</td>"+
381
			"</tr>";
381
			"</tr>";
382
	}
382
	}
383
	/**
383
	/**
384
	 * @author greg
384
	 * @author greg
385
	 * Rempli l'onglet des publications liées
385
	 * Rempli l'onglet des publications liées
386
	 * @param listePublications la liste des publications
386
	 * @param listePublications la liste des publications
387
	 */
387
	 */
388
	private void afficherPublications(PublicationAPersonneListe listePublications)	{
388
	private void afficherPublications(PublicationAPersonneListe listePublications)	{
389
		List<PublicationAPersonne> publicationsLiees = listePublications.toList();
389
		List<PublicationAPersonne> publicationsLiees = listePublications.toList();
390
		Iterator<PublicationAPersonne> iterateur = publicationsLiees.iterator();
390
		Iterator<PublicationAPersonne> iterateur = publicationsLiees.iterator();
391
		
391
		
392
		//Onglet Publications
392
		//Onglet Publications
393
		initialiserTableauPublicationsLieesTpl();
393
		initialiserTableauPublicationsLieesTpl();
394
		Params paramsPublis = new Params();
394
		Params paramsPublis = new Params();
395
		
395
		
396
		String contenuLignes = "";
396
		String contenuLignes = "";
397
		while (iterateur.hasNext())	{
397
		while (iterateur.hasNext())	{
398
			initialiserLignePublicationLieeTpl();
398
			initialiserLignePublicationLieeTpl();
399
			
399
			
400
			PublicationAPersonne publicationAPersonneCourante = iterateur.next();
400
			PublicationAPersonne publicationAPersonneCourante = iterateur.next();
401
			Publication publication = publicationAPersonneCourante.getPublicationLiee();
401
			Publication publication = publicationAPersonneCourante.getPublicationLiee();
402
			
402
			
403
			Params ligneParams = new Params();
403
			Params ligneParams = new Params();
404
			ligneParams.set("relation", construireTxtListeOntologie(publicationAPersonneCourante.getRole()));
404
			ligneParams.set("relation", construireTxtListeOntologie(publicationAPersonneCourante.getRole()));
405
			ligneParams.set("auteur", publication.getAuteur());
405
			ligneParams.set("auteur", publication.getAuteur());
406
			ligneParams.set("titre", publication.getTitre());
406
			ligneParams.set("titre", publication.getTitre());
407
			ligneParams.set("revue", publication.getCollection());
407
			ligneParams.set("revue", publication.getCollection());
408
			ligneParams.set("editeur", publication.getEditeur());
408
			ligneParams.set("editeur", publication.getEditeur());
409
			ligneParams.set("annee", publication.getAnneeParution());
409
			ligneParams.set("annee", publication.getAnneeParution());
410
			ligneParams.set("nvt", publication.getIndicationNvt());
410
			ligneParams.set("nvt", publication.getIndicationNvt());
411
			ligneParams.set("fascicule", publication.getFascicule());
411
			ligneParams.set("fascicule", publication.getFascicule());
412
			ligneParams.set("page", publication.getPages());
412
			ligneParams.set("page", publication.getPages());
413
			contenuLignes += Format.substitute(lignePublicationLieeTpl, ligneParams);
413
			contenuLignes += Format.substitute(lignePublicationLieeTpl, ligneParams);
414
		}
414
		}
415
		
415
		
416
		paramsPublis.set("lignes", contenuLignes);
416
		paramsPublis.set("lignes", contenuLignes);
417
		paramsPublis.set("i18n_titre_publication", i18nC.tabPublications());
417
		paramsPublis.set("i18n_titre_publication", i18nC.tabPublications());
418
		paramsPublis.set("i18n_relation", i18nC.publicationAuteurs());
418
		paramsPublis.set("i18n_relation", i18nC.publicationAuteurs());
419
		paramsPublis.set("i18n_auteur", i18nC.publicationAuteurs());
419
		paramsPublis.set("i18n_auteur", i18nC.publicationAuteurs());
420
		paramsPublis.set("i18n_titre", i18nC.publicationTitre());
420
		paramsPublis.set("i18n_titre", i18nC.publicationTitre());
421
		paramsPublis.set("i18n_revue", i18nC.publicationRevueCollection());
421
		paramsPublis.set("i18n_revue", i18nC.publicationRevueCollection());
422
		paramsPublis.set("i18n_editeur", i18nC.publicationEditeur());
422
		paramsPublis.set("i18n_editeur", i18nC.publicationEditeur());
423
		paramsPublis.set("i18n_annee", i18nC.publicationDateParution());
423
		paramsPublis.set("i18n_annee", i18nC.publicationDateParution());
424
		paramsPublis.set("i18n_nvt", i18nC.publicationNvt());
424
		paramsPublis.set("i18n_nvt", i18nC.publicationNvt());
425
		paramsPublis.set("i18n_fascicule", i18nC.publicationFascicule());
425
		paramsPublis.set("i18n_fascicule", i18nC.publicationFascicule());
426
		paramsPublis.set("i18n_page", i18nC.publicationPage());
426
		paramsPublis.set("i18n_page", i18nC.publicationPage());
427
		afficherOnglet(tableauPublicationsLieesTpl, paramsPublis, tabPublications);
427
		afficherOnglet(tableauPublicationsLieesTpl, paramsPublis, tabPublications);
428
		
428
		
429
	}
429
	}
430
	
430
	
431
	public void rafraichir(Object nouvellesDonnees) {
431
	public void rafraichir(Object nouvellesDonnees) {
432
 
432
 
433
		if (nouvellesDonnees instanceof ValeurListe)	{
433
		if (nouvellesDonnees instanceof ValeurListe)	{
434
			ajouterListeValeursAOntologie((ValeurListe) nouvellesDonnees);
434
			ajouterListeValeursAOntologie((ValeurListe) nouvellesDonnees);
435
		} else if (nouvellesDonnees instanceof Personne) {
435
		} else if (nouvellesDonnees instanceof Personne) {
436
			afficherDetailPersonne((Personne) nouvellesDonnees);
436
			afficherDetailPersonne((Personne) nouvellesDonnees);
437
		} else if (nouvellesDonnees instanceof PublicationAPersonneListe)	{
437
		} else if (nouvellesDonnees instanceof PublicationAPersonneListe)	{
438
			afficherPublications((PublicationAPersonneListe) nouvellesDonnees);
438
			afficherPublications((PublicationAPersonneListe) nouvellesDonnees);
-
 
439
			layout();
439
		}
440
		}
440
	}
441
	}
441
 
442
 
442
}
443
}