Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 936 Rev 938
1
package org.tela_botanica.client.vues.collection;
1
package org.tela_botanica.client.vues.collection;
2
 
2
 
3
import java.util.Iterator;
3
import java.util.Iterator;
4
 
4
 
5
import org.tela_botanica.client.ComposantClass;
5
import org.tela_botanica.client.ComposantClass;
6
import org.tela_botanica.client.ComposantId;
6
import org.tela_botanica.client.ComposantId;
7
import org.tela_botanica.client.Mediateur;
7
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.interfaces.Rafraichissable;
8
import org.tela_botanica.client.interfaces.Rafraichissable;
9
import org.tela_botanica.client.modeles.Information;
9
import org.tela_botanica.client.modeles.Information;
10
import org.tela_botanica.client.modeles.ValeurListe;
10
import org.tela_botanica.client.modeles.ValeurListe;
11
import org.tela_botanica.client.modeles.collection.Collection;
11
import org.tela_botanica.client.modeles.collection.Collection;
12
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
12
import org.tela_botanica.client.modeles.collection.CollectionAPersonne;
13
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe;
13
import org.tela_botanica.client.modeles.collection.CollectionAPersonneListe;
14
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
14
import org.tela_botanica.client.modeles.collection.CollectionAPublication;
15
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe;
15
import org.tela_botanica.client.modeles.collection.CollectionAPublicationListe;
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.projet.ProjetListe;
17
import org.tela_botanica.client.modeles.projet.ProjetListe;
18
import org.tela_botanica.client.modeles.publication.Publication;
18
import org.tela_botanica.client.modeles.publication.Publication;
19
import org.tela_botanica.client.modeles.structure.Structure;
19
import org.tela_botanica.client.modeles.structure.Structure;
-
 
20
import org.tela_botanica.client.util.Debug;
20
import org.tela_botanica.client.vues.DetailVue;
21
import org.tela_botanica.client.vues.DetailVue;
21
 
22
 
22
import com.extjs.gxt.ui.client.Style.Scroll;
23
import com.extjs.gxt.ui.client.Style.Scroll;
23
import com.extjs.gxt.ui.client.util.Format;
24
import com.extjs.gxt.ui.client.util.Format;
24
import com.extjs.gxt.ui.client.util.Params;
25
import com.extjs.gxt.ui.client.util.Params;
25
import com.extjs.gxt.ui.client.widget.ContentPanel;
26
import com.extjs.gxt.ui.client.widget.ContentPanel;
26
import com.extjs.gxt.ui.client.widget.Html;
27
import com.extjs.gxt.ui.client.widget.Html;
27
import com.extjs.gxt.ui.client.widget.TabItem;
28
import com.extjs.gxt.ui.client.widget.TabItem;
28
import com.extjs.gxt.ui.client.widget.TabPanel;
29
import com.extjs.gxt.ui.client.widget.TabPanel;
29
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
30
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
-
 
31
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
30
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
32
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
31
import com.google.gwt.core.client.GWT;
33
import com.google.gwt.core.client.GWT;
32
 
34
 
33
public class CollectionDetailVue extends DetailVue implements Rafraichissable {
35
public class CollectionDetailVue extends DetailVue implements Rafraichissable {
34
 
36
 
35
	private Collection collection = null;
37
	private Collection collection = null;
36
	private boolean collectionChargementOk = false;
38
	private boolean collectionChargementOk = false;
37
	private boolean personnesLieesChargementOk = false;
39
	private boolean personnesLieesChargementOk = false;
38
	private boolean publicationsLieesChargementOk = false;
40
	private boolean publicationsLieesChargementOk = false;
39
	private Structure structure = null;
41
	private Structure structure = null;
40
 
42
 
41
	private String enteteTpl = null;
43
	private String enteteTpl = null;
42
	private String generalTpl = null;
44
	private String generalTpl = null;
43
	private String personneTpl = null;
45
	private String personneTpl = null;
44
	private String tableauPersonnesLieesTpl = null;
46
	private String tableauPersonnesLieesTpl = null;
45
	private String lignePersonneLieeTpl = null;
47
	private String lignePersonneLieeTpl = null;
46
	private String publicationTpl = null;
48
	private String publicationTpl = null;
47
	private String tableauPublicationsLieesTpl = null;
49
	private String tableauPublicationsLieesTpl = null;
48
	private String lignePublicationLieeTpl = null;
50
	private String lignePublicationLieeTpl = null;
49
	private String descriptionTpl = null;
51
	private String descriptionTpl = null;
50
	private String contenuTpl = null;
52
	private String contenuTpl = null;
51
	private String inventaireTpl = null;
53
	private String inventaireTpl = null;
52
	
54
	
53
	private ContentPanel panneauPrincipal = null;
55
	private ContentPanel panneauPrincipal = null;
54
	private Html entete = null;
56
	private Html entete = null;
55
	private TabPanel onglets = null;
57
	private TabPanel onglets = null;
56
	private TabItem generalOnglet = null;
58
	private TabItem generalOnglet = null;
57
	private TabItem personneOnglet = null;
59
	private TabItem personneOnglet = null;
58
	private TabItem publicationOnglet = null;
60
	private TabItem publicationOnglet = null;
59
	private TabItem descriptionOnglet = null;
61
	private TabItem descriptionOnglet = null;
60
	private TabItem contenuOnglet = null;
62
	private TabItem contenuOnglet = null;
61
	private TabItem inventaireOnglet = null;
63
	private TabItem inventaireOnglet = null;
62
 
64
 
63
	
65
	
64
	public CollectionDetailVue(Mediateur mediateurCourant) {
66
	public CollectionDetailVue(Mediateur mediateurCourant) {
65
		super(mediateurCourant);
67
		super(mediateurCourant);
66
		initialiserTousLesTpl();
68
		initialiserTousLesTpl();
67
		chargerOntologie();
69
		chargerOntologie();
68
		
70
		
69
		panneauPrincipal = new ContentPanel();
71
		panneauPrincipal = new ContentPanel();
70
		panneauPrincipal.setLayout(new FlowLayout());
72
		panneauPrincipal.setLayout(new FitLayout());
71
		panneauPrincipal.setHeaderVisible(false);
73
		panneauPrincipal.setHeaderVisible(false);
72
		panneauPrincipal.setBodyBorder(false);
74
		panneauPrincipal.setBodyBorder(false);
73
			
75
			
74
	    entete = new Html();
76
	    entete = new Html();
75
	    entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
77
	    entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
76
	    panneauPrincipal.setTopComponent(entete);
78
	    panneauPrincipal.setTopComponent(entete);
77
		
79
		
78
		onglets = new TabPanel();
80
		onglets = new TabPanel();
79
		onglets.setId(ComposantId.ZONE_DETAIL_CORPS);
81
		onglets.setId(ComposantId.ZONE_DETAIL_CORPS);
80
		onglets.setHeight("100%");
-
 
81
		onglets.setBodyBorder(false);
82
		onglets.setBodyBorder(false);
82
 
83
 
83
		generalOnglet = new TabItem(i18nC.structureInfoGeneral());
84
		generalOnglet = new TabItem(i18nC.structureInfoGeneral());
84
		generalOnglet.setLayout(new AnchorLayout());
85
		generalOnglet.setLayout(new AnchorLayout());
85
		generalOnglet.setScrollMode(Scroll.AUTO);
86
		generalOnglet.setScrollMode(Scroll.AUTO);
86
		onglets.add(generalOnglet);
87
		onglets.add(generalOnglet);
87
		
88
		
88
		personneOnglet = new TabItem(i18nC.collectionPersonne());
89
		personneOnglet = new TabItem(i18nC.collectionPersonne());
89
		personneOnglet.setLayout(new AnchorLayout());
90
		personneOnglet.setLayout(new AnchorLayout());
90
		personneOnglet.setScrollMode(Scroll.AUTO);
91
		personneOnglet.setScrollMode(Scroll.AUTO);
91
		onglets.add(personneOnglet);
92
		onglets.add(personneOnglet);
92
		
93
		
93
		publicationOnglet = new TabItem(i18nC.collectionPublication());
94
		publicationOnglet = new TabItem(i18nC.collectionPublication());
94
		publicationOnglet.setLayout(new AnchorLayout());
95
		publicationOnglet.setLayout(new AnchorLayout());
95
		publicationOnglet.setScrollMode(Scroll.AUTO);
96
		publicationOnglet.setScrollMode(Scroll.AUTO);
96
		onglets.add(publicationOnglet);
97
		onglets.add(publicationOnglet);
97
		
98
		
98
		descriptionOnglet = new TabItem(i18nC.collectionDescription());
99
		descriptionOnglet = new TabItem(i18nC.collectionDescription());
99
		descriptionOnglet.setLayout(new AnchorLayout());
100
		descriptionOnglet.setLayout(new AnchorLayout());
100
		descriptionOnglet.setScrollMode(Scroll.AUTO);
101
		descriptionOnglet.setScrollMode(Scroll.AUTO);
101
		onglets.add(descriptionOnglet);
102
		onglets.add(descriptionOnglet);
102
		
103
		
103
		contenuOnglet = new TabItem(i18nC.collectionContenu());
104
		contenuOnglet = new TabItem(i18nC.collectionContenu());
104
		contenuOnglet.setLayout(new AnchorLayout());
105
		contenuOnglet.setLayout(new AnchorLayout());
105
		contenuOnglet.setScrollMode(Scroll.AUTO);
106
		contenuOnglet.setScrollMode(Scroll.AUTO);
106
		onglets.add(contenuOnglet);
107
		onglets.add(contenuOnglet);
107
				
108
				
108
		inventaireOnglet = new TabItem(i18nC.collectionInventaire());
109
		inventaireOnglet = new TabItem(i18nC.collectionInventaire());
109
		inventaireOnglet.setLayout(new AnchorLayout());
110
		inventaireOnglet.setLayout(new AnchorLayout());
110
		inventaireOnglet.setScrollMode(Scroll.AUTO);
111
		inventaireOnglet.setScrollMode(Scroll.AUTO);
111
		onglets.add(inventaireOnglet);
112
		onglets.add(inventaireOnglet);
112
		
113
		
113
		panneauPrincipal.add(onglets);
114
		panneauPrincipal.add(onglets);
114
		add(panneauPrincipal);
115
		add(panneauPrincipal);
115
	}
116
	}
116
	
117
	
117
	private void initialiserTousLesTpl() {
118
	private void initialiserTousLesTpl() {
118
		initialiserEnteteHtmlTpl();
119
		initialiserEnteteHtmlTpl();
119
		initialiserGeneralTpl();
120
		initialiserGeneralTpl();
120
		initialiserPersonneTpl();
121
		initialiserPersonneTpl();
121
		initialiserTableauPersonnesLieesTpl();
122
		initialiserTableauPersonnesLieesTpl();
122
		initialiserLignePersonneLieeTpl();
123
		initialiserLignePersonneLieeTpl();
123
		initialiserPublicationTpl();
124
		initialiserPublicationTpl();
124
		initialiserTableauPublicationsLieesTpl();
125
		initialiserTableauPublicationsLieesTpl();
125
		initialiserLignePublicationLieeTpl();
126
		initialiserLignePublicationLieeTpl();
126
		initialiserContenuTpl();
127
		initialiserContenuTpl();
127
		initialiserDescriptionTpl();
128
		initialiserDescriptionTpl();
128
		initialiserInventaireTpl();
129
		initialiserInventaireTpl();
129
	}
130
	}
130
	
131
	
131
	private void initialiserEnteteHtmlTpl() {
132
	private void initialiserEnteteHtmlTpl() {
132
		enteteTpl = 	
133
		enteteTpl = 	
133
			"<div id='{css_id}'>"+
134
			"<div id='{css_id}'>"+
134
			"	<h1>{nom}</h1>"+
135
			"	<h1>{nom}</h1>"+
135
			"	<h2>{structure}<span class='{css_meta}'>{projet} <br /> {i18n_id}:{id} - {guid}</span></h2>" +
136
			"	<h2>{structure}<span class='{css_meta}'>{projet} <br /> {i18n_id}:{id} - {guid}</span></h2>" +
136
			"</div>";
137
			"</div>";
137
	}
138
	}
138
	
139
	
139
	private void initialiserGeneralTpl() {
140
	private void initialiserGeneralTpl() {
140
		generalTpl =
141
		generalTpl =
141
			"<div class='{css_corps}'>"+
142
			"<div class='{css_corps}'>"+
142
			"	<div class='{css_fieldset}'>"+
143
			"	<div class='{css_fieldset}'>"+
143
			"		<h2>{i18n_titre_identification}</h2>"+
144
			"		<h2>{i18n_titre_identification}</h2>"+
144
			"		<span class='{css_label}'>{i18n_nom_alternatif} :</span> {nom_alternatif}<br />"+
145
			"		<span class='{css_label}'>{i18n_nom_alternatif} :</span> {nom_alternatif}<br />"+
145
			"		<span class='{css_label}'>{i18n_acronyme} :</span> {acronyme}<br />"+
146
			"		<span class='{css_label}'>{i18n_acronyme} :</span> {acronyme}<br />"+
146
			"		<span class='{css_label}'>{i18n_code} :</span> {code}<br />"+
147
			"		<span class='{css_label}'>{i18n_code} :</span> {code}<br />"+
147
			"		<span class='{css_label}'>{i18n_cote} :</span> {cote}<br />"+
148
			"		<span class='{css_label}'>{i18n_cote} :</span> {cote}<br />"+
148
			"		<span class='{css_label}'>{i18n_mere} :</span> {mere}<br />"+
149
			"		<span class='{css_label}'>{i18n_mere} :</span> {mere}<br />"+
149
			"		<span class='{css_label}'>{i18n_type_ncd} :</span> {type_ncd}<br />"+
150
			"		<span class='{css_label}'>{i18n_type_ncd} :</span> {type_ncd}<br />"+
150
			"		<span class='{css_label}'>{i18n_type_depot} :</span> {type_depot}<br />"+
151
			"		<span class='{css_label}'>{i18n_type_depot} :</span> {type_depot}<br />"+
151
			"	</div>"+
152
			"	</div>"+
152
			"	<div class='{css_fieldset}'>"+
153
			"	<div class='{css_fieldset}'>"+
153
			"		<h2>{i18n_general_collection_titre}</h2>"+
154
			"		<h2>{i18n_general_collection_titre}</h2>"+
154
			"		<span class='{css_label}'>{i18n_description} :</span> {description}<br />"+
155
			"		<span class='{css_label}'>{i18n_description} :</span> {description}<br />"+
155
			"		<span class='{css_label}'>{i18n_description_specialiste} :</span> {description_specialiste}<br />"+
156
			"		<span class='{css_label}'>{i18n_description_specialiste} :</span> {description_specialiste}<br />"+
156
			"		<span class='{css_label}'>{i18n_historique} :</span> {historique}<br />"+
157
			"		<span class='{css_label}'>{i18n_historique} :</span> {historique}<br />"+
157
			"		<span class='{css_label}'>{i18n_web} :</span> {web}<br />"+
158
			"		<span class='{css_label}'>{i18n_web} :</span> {web}<br />"+
158
			"		<span class='{css_label}'>{i18n_groupement_principe} :</span> {groupement_principe}<br />"+
159
			"		<span class='{css_label}'>{i18n_groupement_principe} :</span> {groupement_principe}<br />"+
159
			"		<span class='{css_label}'>{i18n_groupement_but} :</span> {groupement_but}<br />"+
160
			"		<span class='{css_label}'>{i18n_groupement_but} :</span> {groupement_but}<br />"+
160
			"	</div>"+
161
			"	</div>"+
161
			"	<hr class='{css_clear}'/>"+
162
			"	<hr class='{css_clear}'/>"+
162
			"</div>";
163
			"</div>";
163
	}
164
	}
164
	
165
	
165
	private void initialiserPersonneTpl() {
166
	private void initialiserPersonneTpl() {
166
		personneTpl =
167
		personneTpl =
167
			"<div class='{css_corps}'>"+
168
			"<div class='{css_corps}'>"+
168
			"	<div class='{css_fieldset}'>"+
169
			"	<div class='{css_fieldset}'>"+
169
			"		<h2>{i18n_titre_personne}</h2>"+
170
			"		<h2>{i18n_titre_personne}</h2>"+
170
			"		{tableau_personnes_liees}"+
171
			"		{tableau_personnes_liees}"+
171
			"	</div>"+
172
			"	</div>"+
172
			"	<hr class='{css_clear}'/>"+
173
			"	<hr class='{css_clear}'/>"+
173
			"</div>";
174
			"</div>";
174
	}
175
	}
175
	
176
	
176
	
177
	
177
	private void initialiserTableauPersonnesLieesTpl() {
178
	private void initialiserTableauPersonnesLieesTpl() {
178
		tableauPersonnesLieesTpl =
179
		tableauPersonnesLieesTpl =
179
			"<h3>{i18n_titre_membre}</h3>"+
180
			"<h3>{i18n_titre_membre}</h3>"+
180
			"<table>"+
181
			"<table>"+
181
			"	<thead>"+
182
			"	<thead>"+
182
			"		<tr>" +
183
			"		<tr>" +
183
			"			<th>{i18n_prenom}</th>" +
184
			"			<th>{i18n_prenom}</th>" +
184
			"			<th>{i18n_nom}</th>" +
185
			"			<th>{i18n_nom}</th>" +
185
			"		</tr>"+
186
			"		</tr>"+
186
			"	</thead>"+
187
			"	</thead>"+
187
			"	<tbody>"+
188
			"	<tbody>"+
188
			"		{lignes}"+
189
			"		{lignes}"+
189
			"	</tbody>"+
190
			"	</tbody>"+
190
			"</table>";
191
			"</table>";
191
	}
192
	}
192
	
193
	
193
	private void initialiserLignePersonneLieeTpl() {
194
	private void initialiserLignePersonneLieeTpl() {
194
		lignePersonneLieeTpl =
195
		lignePersonneLieeTpl =
195
			"<tr>"+
196
			"<tr>"+
196
			"	<td>{prenom}</td>"+
197
			"	<td>{prenom}</td>"+
197
			"	<td>{nom}</td>"+
198
			"	<td>{nom}</td>"+
198
			"</tr>";
199
			"</tr>";
199
	}
200
	}
200
	
201
	
201
	private void initialiserPublicationTpl() {
202
	private void initialiserPublicationTpl() {
202
		publicationTpl =
203
		publicationTpl =
203
			"<div class='{css_corps}'>"+
204
			"<div class='{css_corps}'>"+
204
			"	<div class='{css_fieldset}'>"+
205
			"	<div class='{css_fieldset}'>"+
205
			"		<h2>{i18n_titre_publication}</h2>"+
206
			"		<h2>{i18n_titre_publication}</h2>"+
206
			"		{tableau_publications_liees}"+
207
			"		{tableau_publications_liees}"+
207
			"	</div>"+
208
			"	</div>"+
208
			"	<hr class='{css_clear}'/>"+
209
			"	<hr class='{css_clear}'/>"+
209
			"</div>";
210
			"</div>";
210
	}
211
	}
211
	
212
	
212
	private void initialiserTableauPublicationsLieesTpl() {
213
	private void initialiserTableauPublicationsLieesTpl() {
213
		tableauPublicationsLieesTpl =
214
		tableauPublicationsLieesTpl =
214
			"<table>"+
215
			"<table>"+
215
			"	<thead>"+
216
			"	<thead>"+
216
			"		<tr>" +
217
			"		<tr>" +
217
			"			<th>{i18n_auteur}</th>" +
218
			"			<th>{i18n_auteur}</th>" +
218
			"			<th>{i18n_titre}</th>" +
219
			"			<th>{i18n_titre}</th>" +
219
			"		</tr>"+
220
			"		</tr>"+
220
			"	</thead>"+
221
			"	</thead>"+
221
			"	<tbody>"+
222
			"	<tbody>"+
222
			"		{lignes}"+
223
			"		{lignes}"+
223
			"	</tbody>"+
224
			"	</tbody>"+
224
			"</table>";
225
			"</table>";
225
	}
226
	}
226
	
227
	
227
	private void initialiserLignePublicationLieeTpl() {
228
	private void initialiserLignePublicationLieeTpl() {
228
		lignePublicationLieeTpl =
229
		lignePublicationLieeTpl =
229
			"<tr>"+
230
			"<tr>"+
230
			"	<td>{auteur}</td>"+
231
			"	<td>{auteur}</td>"+
231
			"	<td>{titre}</td>"+
232
			"	<td>{titre}</td>"+
232
			"</tr>";
233
			"</tr>";
233
	}
234
	}
234
	
235
	
235
	private void initialiserDescriptionTpl() {
236
	private void initialiserDescriptionTpl() {
236
		descriptionTpl =
237
		descriptionTpl =
237
			"<div class='{css_corps}'>"+
238
			"<div class='{css_corps}'>"+
238
			"	<div class='{css_fieldset}'>"+
239
			"	<div class='{css_fieldset}'>"+
239
			"		<h2>{i18n_titre_description}</h2>"+
240
			"		<h2>{i18n_titre_description}</h2>"+
240
			"		<span class='{css_label}'>{i18n_type_botanique} :</span> {type_botanique}<br />"+
241
			"		<span class='{css_label}'>{i18n_type_botanique} :</span> {type_botanique}<br />"+
241
			"		<span class='{css_label}'>{i18n_nbre_echantillon} :</span> {nbre_echantillon}<br />"+
242
			"		<span class='{css_label}'>{i18n_nbre_echantillon} :</span> {nbre_echantillon}<br />"+
242
			"	</div>"+
243
			"	</div>"+
243
			"	<hr class='{css_clear}'/>"+
244
			"	<hr class='{css_clear}'/>"+
244
			"</div>";
245
			"</div>";
245
	}
246
	}
246
	
247
	
247
	private void initialiserContenuTpl() {
248
	private void initialiserContenuTpl() {
248
		contenuTpl =
249
		contenuTpl =
249
			"<div class='{css_corps}'>"+
250
			"<div class='{css_corps}'>"+
250
			"	<div class='{css_fieldset}'>"+
251
			"	<div class='{css_fieldset}'>"+
251
			"		<h2>{i18n_titre_contenu}</h2>"+
252
			"		<h2>{i18n_titre_contenu}</h2>"+
252
			"	</div>"+
253
			"	</div>"+
253
			"	<hr class='{css_clear}'/>"+
254
			"	<hr class='{css_clear}'/>"+
254
			"</div>";
255
			"</div>";
255
	}
256
	}
256
	
257
	
257
	private void initialiserInventaireTpl() {
258
	private void initialiserInventaireTpl() {
258
		inventaireTpl =
259
		inventaireTpl =
259
			"<div class='{css_corps}'>"+
260
			"<div class='{css_corps}'>"+
260
			"	<div class='{css_fieldset}'>"+
261
			"	<div class='{css_fieldset}'>"+
261
			"		<h2>{i18n_titre_inventaire}</h2>"+
262
			"		<h2>{i18n_titre_inventaire}</h2>"+
262
			"	</div>"+
263
			"	</div>"+
263
			"	<hr class='{css_clear}'/>"+
264
			"	<hr class='{css_clear}'/>"+
264
			"</div>";
265
			"</div>";
265
	}
266
	}
266
	
267
	
267
	private void chargerOntologie() {
268
	private void chargerOntologie() {
268
		String[] listesCodes = {"typeCollectionBota", "typeCollectionNcd", "typeDepot", "groupementPrincipe", "realisationBut"};
269
		String[] listesCodes = {"typeCollectionBota", "typeCollectionNcd", "typeDepot", "groupementPrincipe", "realisationBut"};
269
		lancerChargementListesValeurs(listesCodes);
270
		lancerChargementListesValeurs(listesCodes);
270
	}
271
	}
271
	
272
	
272
	public void rafraichir(Object nouvellesDonnees) {
273
	public void rafraichir(Object nouvellesDonnees) {
273
		if (nouvellesDonnees instanceof Collection) {
274
		if (nouvellesDonnees instanceof Collection) {
274
			collection = (Collection) nouvellesDonnees;
275
			collection = (Collection) nouvellesDonnees;
275
			collectionChargementOk = true;
276
			collectionChargementOk = true;
276
		} else if (nouvellesDonnees instanceof ProjetListe) {
277
		} else if (nouvellesDonnees instanceof ProjetListe) {
277
			projets = (ProjetListe) nouvellesDonnees;
278
			projets = (ProjetListe) nouvellesDonnees;
278
			projetsChargementOk = true;
279
			projetsChargementOk = true;
279
		} else if (nouvellesDonnees instanceof ValeurListe) {
280
		} else if (nouvellesDonnees instanceof ValeurListe) {
280
			ValeurListe listeValeursReceptionnee = (ValeurListe) nouvellesDonnees;
281
			ValeurListe listeValeursReceptionnee = (ValeurListe) nouvellesDonnees;
281
			receptionerListeValeurs(listeValeursReceptionnee);
282
			receptionerListeValeurs(listeValeursReceptionnee);
282
		} else if (nouvellesDonnees instanceof Information) {
283
		} else if (nouvellesDonnees instanceof Information) {
283
			Information info = (Information) nouvellesDonnees;
284
			Information info = (Information) nouvellesDonnees;
284
			if (info.getType().equals("liste_collection_a_personne")) {
285
			if (info.getType().equals("liste_collection_a_personne")) {
285
				lierCollectionAPersonne((CollectionAPersonneListe) info.getDonnee(0));
286
				lierCollectionAPersonne((CollectionAPersonneListe) info.getDonnee(0));
286
			} else if (info.getType().equals("liste_collection_a_publication")) {
287
			} else if (info.getType().equals("liste_collection_a_publication")) {
287
				lierCollectionAPublication((CollectionAPublicationListe) info.getDonnee(0));
288
				lierCollectionAPublication((CollectionAPublicationListe) info.getDonnee(0));
288
			}
289
			}
289
		} else {
290
		} else {
290
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
291
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
291
		}
292
		}
292
		
293
		
293
		if (avoirDonneesChargees()) {
294
		if (avoirDonneesChargees()) {
294
			afficherDetail();
295
			afficherDetail();
295
		}
296
		}
296
	}
297
	}
297
	
298
	
298
	protected void lierCollectionAPersonne(CollectionAPersonneListe personnes) {
299
	protected void lierCollectionAPersonne(CollectionAPersonneListe personnes) {
299
		collection.setPersonnesLiees(personnes);
300
		collection.setPersonnesLiees(personnes);
300
		personnesLieesChargementOk = true;
301
		personnesLieesChargementOk = true;
301
	}
302
	}
302
	
303
	
303
	protected void lierCollectionAPublication(CollectionAPublicationListe publications) {
304
	protected void lierCollectionAPublication(CollectionAPublicationListe publications) {
304
		collection.setPublicationsLiees(publications);
305
		collection.setPublicationsLiees(publications);
305
		publicationsLieesChargementOk = true;
306
		publicationsLieesChargementOk = true;
306
	}
307
	}
307
	
308
	
308
	private boolean avoirDonneesChargees() {
309
	private boolean avoirDonneesChargees() {
309
		boolean ok = false;
310
		boolean ok = false;
-
 
311
		Debug.log("projetsChargementOk:"+projetsChargementOk+"-collectionChargementOk:"+collectionChargementOk+"-ontologieChargementOk:"+ontologieChargementOk+"-personnesLieesChargementOk:"+personnesLieesChargementOk+"-publicationsLieesChargementOk:"+publicationsLieesChargementOk);
310
		if (projetsChargementOk && collectionChargementOk && ontologieChargementOk && personnesLieesChargementOk && publicationsLieesChargementOk) {
312
		if (projetsChargementOk && collectionChargementOk && ontologieChargementOk && personnesLieesChargementOk && publicationsLieesChargementOk) {
311
			ok = true;
313
			ok = true;
312
		}
314
		}
313
		return ok;
315
		return ok;
314
	}
316
	}
315
	
317
	
316
	private void afficherDetail() {
318
	private void afficherDetail() {
317
		if (collection != null) {
319
		if (collection != null) {
318
			afficherEntete();
320
			afficherEntete();
319
			afficherIdentification();
321
			afficherIdentification();
320
			afficherPersonne();
322
			afficherPersonne();
321
			afficherPublication();
323
			afficherPublication();
322
			afficherDescription();
324
			afficherDescription();
323
			afficherContenu();
325
			afficherContenu();
324
			afficherInventaire();
326
			afficherInventaire();
325
		}
327
		}
326
		layout();
328
		layout();
327
	}
329
	}
328
	
330
	
329
	private void afficherEntete() {
331
	private void afficherEntete() {
330
		Params enteteParams = new Params();
332
		Params enteteParams = new Params();
331
		enteteParams.set("css_id", ComposantId.ZONE_DETAIL_ENTETE);
333
		enteteParams.set("css_id", ComposantId.ZONE_DETAIL_ENTETE);
332
		enteteParams.set("css_meta", ComposantClass.META);
334
		enteteParams.set("css_meta", ComposantClass.META);
333
		
335
		
334
		enteteParams.set("i18n_id", i18nC.id());
336
		enteteParams.set("i18n_id", i18nC.id());
335
		
337
		
336
		enteteParams.set("nom", collection.getNom());
338
		enteteParams.set("nom", collection.getNom());
337
		enteteParams.set("structure", collection.getStructureNom());
339
		enteteParams.set("structure", collection.getStructureNom());
338
		enteteParams.set("id", collection.getId());
340
		enteteParams.set("id", collection.getId());
339
		enteteParams.set("guid", collection.getGuid());
341
		enteteParams.set("guid", collection.getGuid());
340
		enteteParams.set("projet", construireTxtProjet(collection.getIdProjet()));
342
		enteteParams.set("projet", construireTxtProjet(collection.getIdProjet()));
341
		
343
		
342
		String eHtml = Format.substitute(enteteTpl, enteteParams);
344
		String eHtml = Format.substitute(enteteTpl, enteteParams);
343
		entete.getElement().setInnerHTML(eHtml);
345
		entete.getElement().setInnerHTML(eHtml);
344
	}
346
	}
345
	
347
	
346
	private void afficherIdentification() {
348
	private void afficherIdentification() {
347
		Params generalParams = new Params();
349
		Params generalParams = new Params();
348
		generalParams.set("i18n_titre_identification", i18nC.titreAdministratif());
350
		generalParams.set("i18n_titre_identification", i18nC.titreAdministratif());
349
		generalParams.set("i18n_nom_alternatif", i18nC.nomAlternatif());
351
		generalParams.set("i18n_nom_alternatif", i18nC.nomAlternatif());
350
		generalParams.set("i18n_acronyme", i18nC.acronyme());
352
		generalParams.set("i18n_acronyme", i18nC.acronyme());
351
		generalParams.set("i18n_code", i18nC.code());
353
		generalParams.set("i18n_code", i18nC.code());
352
		generalParams.set("i18n_cote", i18nC.cote());
354
		generalParams.set("i18n_cote", i18nC.cote());
353
		generalParams.set("i18n_mere", i18nC.collectionMere());
355
		generalParams.set("i18n_mere", i18nC.collectionMere());
354
		generalParams.set("i18n_type_ncd", i18nC.typeCollectionNcd());
356
		generalParams.set("i18n_type_ncd", i18nC.typeCollectionNcd());
355
		generalParams.set("i18n_type_depot", i18nC.typeDepot());
357
		generalParams.set("i18n_type_depot", i18nC.typeDepot());
356
 
358
 
357
		generalParams.set("i18n_general_collection_titre", i18nC.collectionGeneralTitre());
359
		generalParams.set("i18n_general_collection_titre", i18nC.collectionGeneralTitre());
358
		generalParams.set("i18n_description", i18nC.description());
360
		generalParams.set("i18n_description", i18nC.description());
359
		generalParams.set("i18n_description_specialiste", i18nC.descriptionSpecialiste());
361
		generalParams.set("i18n_description_specialiste", i18nC.descriptionSpecialiste());
360
		generalParams.set("i18n_historique", i18nC.historique());
362
		generalParams.set("i18n_historique", i18nC.historique());
361
		generalParams.set("i18n_web", i18nC.siteWeb());
363
		generalParams.set("i18n_web", i18nC.siteWeb());
362
		generalParams.set("i18n_groupement_principe", i18nC.groupementPrincipe());
364
		generalParams.set("i18n_groupement_principe", i18nC.groupementPrincipe());
363
		generalParams.set("i18n_groupement_but", i18nC.groupementBut());
365
		generalParams.set("i18n_groupement_but", i18nC.groupementBut());
364
		
366
		
365
		String acronyme = construireTxtTruck(collection.getIdAlternatif());
367
		String acronyme = construireTxtTruck(collection.getIdAlternatif());
366
		String code = construireTxtTruck(collection.getCode());
368
		String code = construireTxtTruck(collection.getCode());
367
		String nomAlternatif = construireTxtTruck(collection.getNomAlternatif());
369
		String nomAlternatif = construireTxtTruck(collection.getNomAlternatif());
368
		String urls = construireTxtTruck(collection.getUrls());
370
		String urls = construireTxtTruck(collection.getUrls());
369
		String typeNcd = construireTxtListeOntologie(collection.getTypeNcd());
371
		String typeNcd = construireTxtListeOntologie(collection.getTypeNcd());
370
		String typeDepot = construireTxtListeOntologie(collection.getTypeDepot());
372
		String typeDepot = construireTxtListeOntologie(collection.getTypeDepot());
371
		String groupementBut = construireTxtListeOntologie(collection.getGroupementBut());
373
		String groupementBut = construireTxtListeOntologie(collection.getGroupementBut());
372
		String groupementPrincipe = construireTxtListeOntologie(collection.getGroupementPrincipe());
374
		String groupementPrincipe = construireTxtListeOntologie(collection.getGroupementPrincipe());
373
		
375
		
374
		generalParams.set("nom_alternatif", nomAlternatif);
376
		generalParams.set("nom_alternatif", nomAlternatif);
375
		generalParams.set("acronyme", acronyme);
377
		generalParams.set("acronyme", acronyme);
376
		generalParams.set("code", code);
378
		generalParams.set("code", code);
377
		generalParams.set("cote", collection.getCote());
379
		generalParams.set("cote", collection.getCote());
378
		generalParams.set("mere", collection.getCollectionMereNom());
380
		generalParams.set("mere", collection.getCollectionMereNom());
379
		generalParams.set("type_ncd", typeNcd);
381
		generalParams.set("type_ncd", typeNcd);
380
		generalParams.set("type_depot", typeDepot);
382
		generalParams.set("type_depot", typeDepot);
381
 
383
 
382
		generalParams.set("description", collection.getDescription());
384
		generalParams.set("description", collection.getDescription());
383
		generalParams.set("description_specialiste", collection.getDescriptionSpecialiste());
385
		generalParams.set("description_specialiste", collection.getDescriptionSpecialiste());
384
		generalParams.set("historique", collection.getHistorique());
386
		generalParams.set("historique", collection.getHistorique());
385
		generalParams.set("web", urls);
387
		generalParams.set("web", urls);
386
		generalParams.set("groupement_principe", groupementPrincipe);
388
		generalParams.set("groupement_principe", groupementPrincipe);
387
		generalParams.set("groupement_but", groupementBut);
389
		generalParams.set("groupement_but", groupementBut);
388
		
390
		
389
		afficherOnglet(generalTpl, generalParams, generalOnglet);
391
		afficherOnglet(generalTpl, generalParams, generalOnglet);
390
	}
392
	}
391
	
393
	
392
	private void afficherPersonne() {
394
	private void afficherPersonne() {
393
		String tableauPersonneHtml = "";
395
		String tableauPersonneHtml = "";
394
		if (collection.getPersonnesLiees() != null && collection.getPersonnesLiees().size() > 0) {
396
		if (collection.getPersonnesLiees() != null && collection.getPersonnesLiees().size() > 0) {
395
			tableauPersonneHtml = construireTableauPersonnesLiees();
397
			tableauPersonneHtml = construireTableauPersonnesLiees();
396
		}
398
		}
397
		
399
		
398
		Params personneParams = new Params();
400
		Params personneParams = new Params();
399
		personneParams.set("i18n_titre_personne", i18nC.collectionPersonneTitre());
401
		personneParams.set("i18n_titre_personne", i18nC.collectionPersonneTitre());
400
		personneParams.set("tableau_personnes_liees", tableauPersonneHtml);
402
		personneParams.set("tableau_personnes_liees", tableauPersonneHtml);
401
		
403
		
402
		afficherOnglet(personneTpl, personneParams, personneOnglet);
404
		afficherOnglet(personneTpl, personneParams, personneOnglet);
403
	}
405
	}
404
	
406
	
405
	private String construireTableauPersonnesLiees() {
407
	private String construireTableauPersonnesLiees() {
406
		Params contenuParams = new Params();
408
		Params contenuParams = new Params();
407
		contenuParams.set("i18n_prenom", i18nC.personnePrenom());
409
		contenuParams.set("i18n_prenom", i18nC.personnePrenom());
408
		contenuParams.set("i18n_nom", i18nC.personneNom());
410
		contenuParams.set("i18n_nom", i18nC.personneNom());
409
		
411
		
410
		String lignesPersonnel = ""; 
412
		String lignesPersonnel = ""; 
411
		
413
		
412
		Iterator<String> it = collection.getPersonnesLiees().keySet().iterator();
414
		Iterator<String> it = collection.getPersonnesLiees().keySet().iterator();
413
		while (it.hasNext()) {
415
		while (it.hasNext()) {
414
			CollectionAPersonne relationCollectionAPersonne = collection.getPersonnesLiees().get(it.next());
416
			CollectionAPersonne relationCollectionAPersonne = collection.getPersonnesLiees().get(it.next());
415
			Personne personne = relationCollectionAPersonne.getPersonne();
417
			Personne personne = relationCollectionAPersonne.getPersonne();
416
			Params ligneParams = new Params();
418
			Params ligneParams = new Params();
417
			
419
			
418
			ligneParams.set("prenom", personne.getPrenom());
420
			ligneParams.set("prenom", personne.getPrenom());
419
			ligneParams.set("nom", personne.getNom());
421
			ligneParams.set("nom", personne.getNom());
420
			lignesPersonnel += Format.substitute(lignePersonneLieeTpl, ligneParams);
422
			lignesPersonnel += Format.substitute(lignePersonneLieeTpl, ligneParams);
421
		}
423
		}
422
		contenuParams.set("lignes", lignesPersonnel);
424
		contenuParams.set("lignes", lignesPersonnel);
423
		
425
		
424
		String cHtml = Format.substitute(tableauPersonnesLieesTpl, contenuParams);
426
		String cHtml = Format.substitute(tableauPersonnesLieesTpl, contenuParams);
425
		return cHtml;
427
		return cHtml;
426
	}
428
	}
427
	
429
	
428
	private void afficherPublication() {
430
	private void afficherPublication() {
429
		Params publicationParams = new Params();
431
		Params publicationParams = new Params();
430
		publicationParams.set("i18n_titre_publication", i18nC.collectionPublicationTitre());
432
		publicationParams.set("i18n_titre_publication", i18nC.collectionPublicationTitre());
431
		
433
		
432
		String tableauPublicationHtml = "";
434
		String tableauPublicationHtml = "";
433
		if (collection.getPersonnesLiees() != null && collection.getPersonnesLiees().size() > 0) {
435
		if (collection.getPersonnesLiees() != null && collection.getPersonnesLiees().size() > 0) {
434
			tableauPublicationHtml = construireTableauPublicationsLiees();
436
			tableauPublicationHtml = construireTableauPublicationsLiees();
435
		}
437
		}
436
		publicationParams.set("tableau_publications_liees", tableauPublicationHtml);
438
		publicationParams.set("tableau_publications_liees", tableauPublicationHtml);
437
				
439
				
438
		afficherOnglet(publicationTpl, publicationParams, publicationOnglet);
440
		afficherOnglet(publicationTpl, publicationParams, publicationOnglet);
439
	}
441
	}
440
	
442
	
441
	private String construireTableauPublicationsLiees() {
443
	private String construireTableauPublicationsLiees() {
442
		Params contenuParams = new Params();
444
		Params contenuParams = new Params();
443
		contenuParams.set("i18n_auteur", i18nC.publicationAuteurs());
445
		contenuParams.set("i18n_auteur", i18nC.publicationAuteurs());
444
		contenuParams.set("i18n_titre", i18nC.publicationTitre());
446
		contenuParams.set("i18n_titre", i18nC.publicationTitre());
445
		
447
		
446
		String lignesPublication = ""; 
448
		String lignesPublication = ""; 
447
		
449
		
448
		Iterator<String> it = collection.getPublicationsLiees().keySet().iterator();
450
		Iterator<String> it = collection.getPublicationsLiees().keySet().iterator();
449
		while (it.hasNext()) {
451
		while (it.hasNext()) {
450
			CollectionAPublication relationCollectionAPublication = collection.getPublicationsLiees().get(it.next());
452
			CollectionAPublication relationCollectionAPublication = collection.getPublicationsLiees().get(it.next());
451
			Publication publication = relationCollectionAPublication.getPublication();
453
			Publication publication = relationCollectionAPublication.getPublication();
452
			Params ligneParams = new Params();
454
			Params ligneParams = new Params();
453
			
455
			
454
			ligneParams.set("auteur", publication.getAuteur());
456
			ligneParams.set("auteur", publication.getAuteur());
455
			ligneParams.set("titre", publication.getTitre());
457
			ligneParams.set("titre", publication.getTitre());
456
			lignesPublication += Format.substitute(lignePublicationLieeTpl, ligneParams);
458
			lignesPublication += Format.substitute(lignePublicationLieeTpl, ligneParams);
457
		}
459
		}
458
		contenuParams.set("lignes", lignesPublication);
460
		contenuParams.set("lignes", lignesPublication);
459
		
461
		
460
		String cHtml = Format.substitute(tableauPublicationsLieesTpl, contenuParams);
462
		String cHtml = Format.substitute(tableauPublicationsLieesTpl, contenuParams);
461
		return cHtml;
463
		return cHtml;
462
	}
464
	}
463
	
465
	
464
	private void afficherDescription() {
466
	private void afficherDescription() {
465
		Params descriptionParams = new Params();
467
		Params descriptionParams = new Params();
466
		descriptionParams.set("i18n_titre_description", i18nC.collectionDescriptionTitre());
468
		descriptionParams.set("i18n_titre_description", i18nC.collectionDescriptionTitre());
467
		descriptionParams.set("i18n_type_botanique", i18nC.typeCollectionBotanique());
469
		descriptionParams.set("i18n_type_botanique", i18nC.typeCollectionBotanique());
468
		descriptionParams.set("i18n_nbre_echantillon", i18nC.nbreEchantillon());
470
		descriptionParams.set("i18n_nbre_echantillon", i18nC.nbreEchantillon());
469
		
471
		
470
		String typeBota = construireTxtListeOntologie(collection.getBotanique().getType());
472
		String typeBota = construireTxtListeOntologie(collection.getBotanique().getType());
471
		
473
		
472
		descriptionParams.set("type_botanique", typeBota);
474
		descriptionParams.set("type_botanique", typeBota);
473
		descriptionParams.set("nbre_echantillon", collection.getBotanique().getNbreEchantillon());
475
		descriptionParams.set("nbre_echantillon", collection.getBotanique().getNbreEchantillon());
474
		
476
		
475
		afficherOnglet(descriptionTpl, descriptionParams, descriptionOnglet);
477
		afficherOnglet(descriptionTpl, descriptionParams, descriptionOnglet);
476
	}
478
	}
477
	
479
	
478
	private void afficherContenu() {
480
	private void afficherContenu() {
479
		Params contenuParams = new Params();
481
		Params contenuParams = new Params();
480
		contenuParams.set("i18n_titre_contenu", i18nC.collectionContenuTitre());
482
		contenuParams.set("i18n_titre_contenu", i18nC.collectionContenuTitre());
481
		
483
		
482
		afficherOnglet(contenuTpl, contenuParams, contenuOnglet);
484
		afficherOnglet(contenuTpl, contenuParams, contenuOnglet);
483
	}
485
	}
484
		
486
		
485
	private void afficherInventaire() {
487
	private void afficherInventaire() {
486
		Params inventaireParams = new Params();
488
		Params inventaireParams = new Params();
487
		inventaireParams.set("i18n_titre_inventaire", i18nC.collectionInventaireTitre());
489
		inventaireParams.set("i18n_titre_inventaire", i18nC.collectionInventaireTitre());
488
		
490
		
489
		afficherOnglet(inventaireTpl, inventaireParams, inventaireOnglet);
491
		afficherOnglet(inventaireTpl, inventaireParams, inventaireOnglet);
490
	}
492
	}
491
	
493
	
492
	protected String getNomStructure() {
494
	protected String getNomStructure() {
493
		String nomStructure = "";
495
		String nomStructure = "";
494
		if (structure != null) {
496
		if (structure != null) {
495
			nomStructure = structure.getNom();
497
			nomStructure = structure.getNom();
496
		} else {
498
		} else {
497
			nomStructure = collection.getIdStructure();
499
			nomStructure = collection.getIdStructure();
498
		}
500
		}
499
		return nomStructure;
501
		return nomStructure;
500
	}
502
	}
501
}
503
}