Subversion Repositories eFlore/Applications.coel

Rev

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

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