Subversion Repositories eFlore/Applications.coel

Rev

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

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