Subversion Repositories eFlore/Applications.coel

Rev

Rev 1590 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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