Subversion Repositories eFlore/Applications.coel

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
935 jpm 1
package org.tela_botanica.client.vues.structure;
60 jpm 2
 
379 jp_milcent 3
import java.util.Iterator;
4
 
5
import org.tela_botanica.client.ComposantClass;
373 jp_milcent 6
import org.tela_botanica.client.ComposantId;
7
import org.tela_botanica.client.Mediateur;
60 jpm 8
import org.tela_botanica.client.interfaces.Rafraichissable;
379 jp_milcent 9
import org.tela_botanica.client.modeles.Information;
406 jp_milcent 10
import org.tela_botanica.client.modeles.ValeurListe;
935 jpm 11
import org.tela_botanica.client.modeles.projet.Projet;
12
import org.tela_botanica.client.modeles.projet.ProjetListe;
13
import org.tela_botanica.client.modeles.structure.Structure;
14
import org.tela_botanica.client.modeles.structure.StructureAPersonne;
15
import org.tela_botanica.client.modeles.structure.StructureAPersonneListe;
16
import org.tela_botanica.client.modeles.structure.StructureConservation;
17
import org.tela_botanica.client.modeles.structure.StructureValorisation;
934 jpm 18
import org.tela_botanica.client.vues.collection.DetailVue;
60 jpm 19
 
20
import com.extjs.gxt.ui.client.Style.Scroll;
21
import com.extjs.gxt.ui.client.util.Format;
22
import com.extjs.gxt.ui.client.util.Params;
23
import com.extjs.gxt.ui.client.widget.ContentPanel;
374 jp_milcent 24
import com.extjs.gxt.ui.client.widget.Html;
373 jp_milcent 25
import com.extjs.gxt.ui.client.widget.TabItem;
26
import com.extjs.gxt.ui.client.widget.TabPanel;
390 jp_milcent 27
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
60 jpm 28
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
373 jp_milcent 29
import com.google.gwt.core.client.GWT;
60 jpm 30
 
453 jp_milcent 31
public class StructureDetailVue extends DetailVue implements Rafraichissable {
60 jpm 32
 
374 jp_milcent 33
	private String enteteTpl = null;
379 jp_milcent 34
	private String identificationTpl = null;
35
	private String personnelTpl = null;
390 jp_milcent 36
	private String tableauPersonnelTpl = null;
379 jp_milcent 37
	private String lignePersonnelTpl = null;
390 jp_milcent 38
	private String conservationTpl = null;
420 jp_milcent 39
	private String traitementConservationTpl = null;
390 jp_milcent 40
	private String valorisationTpl = null;
426 jp_milcent 41
	private String typeTraitementConservationTpl = null;
42
	private String rechercheValorisationTpl = null;
373 jp_milcent 43
 
44
	private Structure structure = null;
814 jpm 45
	private boolean structureChargementOk = false;
379 jp_milcent 46
	private StructureAPersonneListe personnel = null;
814 jpm 47
	private boolean personnelChargementOk = false;
379 jp_milcent 48
	private StructureValorisation valorisation = null;
49
	private StructureConservation conservation = null;
373 jp_milcent 50
 
51
	private ContentPanel panneauPrincipal = null;
374 jp_milcent 52
	private Html entete = null;
373 jp_milcent 53
	private TabPanel onglets = null;
54
	private TabItem identificationOnglet = null;
379 jp_milcent 55
	private TabItem personnelOnglet = null;
390 jp_milcent 56
	private TabItem conservationOnglet = null;
57
	private TabItem valorisationOnglet = null;
406 jp_milcent 58
 
441 jp_milcent 59
	public StructureDetailVue(Mediateur mediateurCourant) {
453 jp_milcent 60
		super(mediateurCourant);
61
 
379 jp_milcent 62
		initialiserTousLesTpl();
420 jp_milcent 63
		chargerOntologie();
60 jpm 64
 
373 jp_milcent 65
		panneauPrincipal = new ContentPanel();
522 gduche 66
		panneauPrincipal.setLayout(new FitLayout());
374 jp_milcent 67
		panneauPrincipal.setHeaderVisible(false);
68
		panneauPrincipal.setBodyBorder(false);
390 jp_milcent 69
 
374 jp_milcent 70
	    entete = new Html();
379 jp_milcent 71
	    entete.setId(ComposantId.ZONE_DETAIL_ENTETE);
374 jp_milcent 72
	    panneauPrincipal.setTopComponent(entete);
73
 
373 jp_milcent 74
		onglets = new TabPanel();
379 jp_milcent 75
		onglets.setId(ComposantId.ZONE_DETAIL_CORPS);
522 gduche 76
 
374 jp_milcent 77
		onglets.setBodyBorder(false);
522 gduche 78
 
426 jp_milcent 79
		identificationOnglet = new TabItem(i18nC.structureInfoGeneral());
390 jp_milcent 80
		identificationOnglet.setLayout(new AnchorLayout());
379 jp_milcent 81
		identificationOnglet.setScrollMode(Scroll.AUTO);
373 jp_milcent 82
		onglets.add(identificationOnglet);
83
 
426 jp_milcent 84
		personnelOnglet = new TabItem(i18nC.structureInfoPersonnel());
390 jp_milcent 85
		personnelOnglet.setLayout(new AnchorLayout());
379 jp_milcent 86
		personnelOnglet.setScrollMode(Scroll.AUTO);
87
		onglets.add(personnelOnglet);
88
 
426 jp_milcent 89
		conservationOnglet = new TabItem(i18nC.structureInfoConservation());
390 jp_milcent 90
		conservationOnglet.setLayout(new AnchorLayout());
91
		conservationOnglet.setScrollMode(Scroll.AUTO);
92
		onglets.add(conservationOnglet);
93
 
426 jp_milcent 94
		valorisationOnglet = new TabItem(i18nC.structureInfoValorisation());
390 jp_milcent 95
		valorisationOnglet.setLayout(new AnchorLayout());
96
		valorisationOnglet.setScrollMode(Scroll.AUTO);
97
		onglets.add(valorisationOnglet);
98
 
373 jp_milcent 99
		panneauPrincipal.add(onglets);
100
		add(panneauPrincipal);
60 jpm 101
	}
102
 
420 jp_milcent 103
	private void chargerOntologie() {
814 jpm 104
		String[] listesCodes = {"stpr", "stpu", "statut", "fonction", "pays", "localStockage", "meubleStockage",
105
			"parametreStockage", "autreCollection", "onep", "opRestau", "autreMateriel", "poisonTraitement",
106
			"insecteTraitement", "actionValorisation", "continentEtFr", "typeRecherche"};
107
		lancerChargementListesValeurs(listesCodes);
420 jp_milcent 108
	}
109
 
390 jp_milcent 110
	private void afficherDetailInstitution() {
111
		if (structure != null) {
379 jp_milcent 112
			personnel = structure.getPersonnel();
113
			valorisation = structure.getValorisation();
114
			conservation = structure.getConservation();
115
 
373 jp_milcent 116
			afficherEntete();
117
			afficherIdentification();
390 jp_milcent 118
			if (personnel != null) {
119
				afficherPersonnel();
120
			}
121
			if (conservation != null) {
406 jp_milcent 122
				afficherConservation();
390 jp_milcent 123
			}
124
			if (valorisation != null) {
426 jp_milcent 125
				afficherValorisation();
390 jp_milcent 126
			}
60 jpm 127
		}
374 jp_milcent 128
		layout();
60 jpm 129
	}
373 jp_milcent 130
 
131
	private void afficherEntete() {
132
		Params enteteParams = new Params();
390 jp_milcent 133
		enteteParams.set("css_id", ComposantId.ZONE_DETAIL_ENTETE);
134
		enteteParams.set("css_meta", ComposantClass.META);
135
 
814 jpm 136
		enteteParams.set("i18n_id", i18nC.id());
137
 
379 jp_milcent 138
		enteteParams.set("nom", structure.getNom());
139
		enteteParams.set("ville", structure.getVille());
390 jp_milcent 140
		enteteParams.set("id", structure.getId());
141
		enteteParams.set("guid", structure.getGuid());
448 jp_milcent 142
		enteteParams.set("projet", construireTxtProjet(structure.getIdProjet()));
373 jp_milcent 143
 
374 jp_milcent 144
		String eHtml = Format.substitute(enteteTpl, enteteParams);
373 jp_milcent 145
		entete.getElement().setInnerHTML(eHtml);
146
	}
147
 
148
	private void afficherIdentification() {
420 jp_milcent 149
		Params identificationParams = new Params();
406 jp_milcent 150
		identificationParams.set("i18n_titre_administratif", i18nC.titreAdministratif());
151
		identificationParams.set("i18n_acronyme", i18nC.acronyme());
152
		identificationParams.set("i18n_statut", i18nC.statut());
602 jp_milcent 153
		identificationParams.set("i18n_date_fondation", i18nC.dateFondation());
154
		identificationParams.set("i18n_nbre_personnel", i18nC.nbrePersonnel());
390 jp_milcent 155
 
602 jp_milcent 156
		identificationParams.set("i18n_titre_description", i18nC.description());
157
		identificationParams.set("i18n_description", i18nC.description());
390 jp_milcent 158
 
602 jp_milcent 159
		identificationParams.set("i18n_titre_adresse", i18nC.adresse());
160
		identificationParams.set("i18n_adresse", i18nC.adresse());
161
		identificationParams.set("i18n_cp", i18nC.codePostal());
162
		identificationParams.set("i18n_ville", i18nC.ville());
163
		identificationParams.set("i18n_region", i18nC.region());
164
		identificationParams.set("i18n_pays", i18nC.pays());
390 jp_milcent 165
 
602 jp_milcent 166
		identificationParams.set("i18n_titre_communication", i18nC.titreCommunication());
167
		identificationParams.set("i18n_tel", i18nC.telephone());
696 jp_milcent 168
		identificationParams.set("i18n_fax", i18nC.FAX());
602 jp_milcent 169
		identificationParams.set("i18n_courriel", i18nC.courriel());
170
		identificationParams.set("i18n_acces", i18nC.acces());
171
		identificationParams.set("i18n_web", i18nC.siteWeb());
420 jp_milcent 172
 
173
		String acronyme = construireTxtTruck(structure.getIdAlternatif());
174
		String typePrive = construireTxtListeOntologie(structure.getTypePrive());
175
		String typePublic = construireTxtListeOntologie(structure.getTypePublic());
176
		String pays = construireTxtListeOntologie(structure.getPays());
177
		String web = construireTxtTruck(structure.getUrl());
390 jp_milcent 178
 
420 jp_milcent 179
		identificationParams.set("acronyme", acronyme);
180
		identificationParams.set("statut", typePrive+typePublic);
406 jp_milcent 181
		identificationParams.set("date_fondation", structure.getDateFondationFormatLong());
182
		identificationParams.set("nbre_personnel", structure.getNbrePersonne());
390 jp_milcent 183
 
406 jp_milcent 184
		identificationParams.set("description", structure.getDescription());
390 jp_milcent 185
 
406 jp_milcent 186
		identificationParams.set("adresse", structure.getAdresse());
187
		identificationParams.set("cp", structure.getCodePostal());
188
		identificationParams.set("ville", structure.getVille());
189
		identificationParams.set("region", structure.getRegion());
420 jp_milcent 190
		identificationParams.set("pays", pays);
390 jp_milcent 191
 
602 jp_milcent 192
		identificationParams.set("tel", structure.getTelephoneFixe());
406 jp_milcent 193
		identificationParams.set("fax", structure.getFax());
194
		identificationParams.set("courriel", structure.getCourriel());
195
		identificationParams.set("acces", structure.getConditionAcces());
420 jp_milcent 196
		identificationParams.set("web", web);
379 jp_milcent 197
 
406 jp_milcent 198
		afficherOnglet(identificationTpl, identificationParams, identificationOnglet);
373 jp_milcent 199
	}
200
 
379 jp_milcent 201
	private void afficherPersonnel() {
390 jp_milcent 202
		String tableauPersonnelHtml = "";
203
		if (personnel.size() > 0) {
204
			tableauPersonnelHtml = construireTableauDuPersonnel();
205
		}
206
 
420 jp_milcent 207
		Params personnelParams = new Params();
406 jp_milcent 208
		personnelParams.set("i18n_titre_personnel", i18nC.titrePersonnel());
209
		personnelParams.set("i18n_nbre_personnel_collection", i18nC.nbrePersonnelCollection());
210
		personnelParams.set("nbre_personnel_collection", personnel.size());
211
		personnelParams.set("tableau_personnel", tableauPersonnelHtml);
379 jp_milcent 212
 
406 jp_milcent 213
		afficherOnglet(personnelTpl, personnelParams, personnelOnglet);
390 jp_milcent 214
	}
215
 
216
	private String construireTableauDuPersonnel() {
217
		Params contenuParams = new Params();
406 jp_milcent 218
		contenuParams.set("i18n_titre_membre", i18nC.titreMembre());
219
		contenuParams.set("i18n_fonction", i18nC.fonction());
696 jp_milcent 220
		contenuParams.set("i18n_prenom", i18nC.personnePrenom());
221
		contenuParams.set("i18n_nom", i18nC.personneNom());
222
		contenuParams.set("i18n_tel", i18nC.FIX());
223
		contenuParams.set("i18n_fax", i18nC.FAX());
406 jp_milcent 224
		contenuParams.set("i18n_courriel", i18nC.courrielPrincipal());
225
		contenuParams.set("i18n_statut", i18nC.statut());
226
		contenuParams.set("i18n_tps_w", i18nC.tpsTravail());
227
		contenuParams.set("i18n_specialite", i18nC.specialite());
228
		contenuParams.set("i18n_contact", i18nC.boolContact());
390 jp_milcent 229
 
379 jp_milcent 230
		String lignesPersonnel = "";
602 jp_milcent 231
 
379 jp_milcent 232
		Iterator<String> it = personnel.keySet().iterator();
233
		while (it.hasNext()) {
234
			StructureAPersonne personne = personnel.get(it.next());
235
			Params ligneParams = new Params();
420 jp_milcent 236
 
237
			String fonction = construireTxtListeOntologie(personne.getFonction());
238
			String statut = construireTxtListeOntologie(personne.getStatut());
239
			String contact = formaterOuiNon(personne.getContact());
240
 
241
			ligneParams.set("fonction", fonction);
379 jp_milcent 242
			ligneParams.set("prenom", personne.getPrenom());
243
			ligneParams.set("nom", personne.getNom());
602 jp_milcent 244
			ligneParams.set("tel_fix", personne.getTelephoneFixe());
245
			ligneParams.set("tel_fax", personne.getFax());
379 jp_milcent 246
			ligneParams.set("courriel", personne.getCourriel());
420 jp_milcent 247
			ligneParams.set("statut", statut);
379 jp_milcent 248
			ligneParams.set("tps_w", personne.getBotaTravailHebdoTps());
249
			ligneParams.set("specialite", personne.afficherSpecialite());
420 jp_milcent 250
			ligneParams.set("contact", contact);
379 jp_milcent 251
			lignesPersonnel += Format.substitute(lignePersonnelTpl, ligneParams);
252
		}
253
		contenuParams.set("lignes", lignesPersonnel);
254
 
390 jp_milcent 255
		String cHtml = Format.substitute(tableauPersonnelTpl, contenuParams);
256
		return cHtml;
379 jp_milcent 257
	}
406 jp_milcent 258
 
259
	private void afficherConservation() {
420 jp_milcent 260
		Params conservationParams  = new Params();
406 jp_milcent 261
		conservationParams.set("i18n_titre_conservation_personnel", i18nC.titreConservationPersonnel());
262
		conservationParams.set("i18n_formation", i18nC.formation());
263
		conservationParams.set("i18n_formation_interet", i18nC.formationInteret());
264
 
265
		conservationParams.set("i18n_titre_local", i18nC.titreLocal());
266
		conservationParams.set("i18n_local_specifique", i18nC.localSpecifique());
267
		conservationParams.set("i18n_meuble_specifique", i18nC.meubleSpecifique());
268
		conservationParams.set("i18n_local_parametre", i18nC.localParametre());
420 jp_milcent 269
		conservationParams.set("i18n_conservation_en_commun", i18nC.conservationEnCommun());
270
		conservationParams.set("i18n_acces_controle", i18nC.accesControle());
406 jp_milcent 271
 
420 jp_milcent 272
		conservationParams.set("i18n_titre_operation", i18nC.titreOperation());
273
		conservationParams.set("i18n_restauration", i18nC.restauration());
274
		conservationParams.set("i18n_materiel_conservation", i18nC.materielConservation());
275
		conservationParams.set("i18n_traitement", i18nC.traitement());
276
 
277
		conservationParams.set("i18n_titre_acquisition", i18nC.titreAcquisition());
278
		conservationParams.set("i18n_acquisition_collection", i18nC.acquisitionCollection());
279
		conservationParams.set("i18n_acquisition_echantillon", i18nC.acquisitionEchantillon());
280
 
406 jp_milcent 281
		conservationParams.set("formation", formaterOuiNon(conservation.getFormation()));
282
		conservationParams.set("formation_info", formaterSautDeLigne(conservation.getFormationInfo()));
283
		conservationParams.set("formation_interet", formaterOuiNon(conservation.getFormationInteret()));
284
		conservationParams.set("meuble_specifique", conservation.getStockageMeuble());
285
 
420 jp_milcent 286
		String chaineAAnalyser = conservation.getStockageLocal();
287
		String chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
288
		conservationParams.set("local_specifique", chaineAAfficher);
406 jp_milcent 289
 
420 jp_milcent 290
		chaineAAnalyser = conservation.getStockageMeuble();
291
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
292
		conservationParams.set("meuble_specifique", chaineAAfficher);
293
 
294
		chaineAAnalyser = conservation.getStockageParametre();
295
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
296
		conservationParams.set("local_parametre", chaineAAfficher);
297
 
298
		conservationParams.set("conservation_en_commun", formaterOuiNon(conservation.getCollectionCommune()));
299
		chaineAAnalyser = conservation.getCollectionAutre();
300
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
301
		conservationParams.set("collection_autre", formaterParenthese(chaineAAfficher));
302
 
303
		conservationParams.set("acces_controle", formaterOuiNon(conservation.getAccesControle()));
304
 
305
		conservationParams.set("restauration", formaterOuiNon(conservation.getRestauration()));
306
		chaineAAnalyser = conservation.getRestaurationOperation();
307
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
308
		conservationParams.set("restauration_operation", formaterParenthese(chaineAAfficher));
309
 
310
		chaineAAnalyser = conservation.getMaterielConservation();
311
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
312
		conservationParams.set("materiel_conservation", chaineAAfficher);
313
		chaineAAnalyser = conservation.getMaterielAutre();
314
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
315
		conservationParams.set("materiel_autre", formaterParenthese(chaineAAfficher));
316
 
317
		conservationParams.set("traitement", formaterOuiNon(conservation.getTraitement()));
318
		chaineAAnalyser = conservation.getTraitements();
319
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
320
		conservationParams.set("traitements", formaterParenthese(chaineAAfficher));
321
 
322
		conservationParams.set("acquisition_collection", formaterOuiNon(conservation.getAcquisitionCollection()));
323
		conservationParams.set("acquisition_echantillon", formaterOuiNon(conservation.getAcquisitionEchantillon()));
324
		conservationParams.set("acquisition_traitement_info", construireTraitement());
325
 
406 jp_milcent 326
		afficherOnglet(conservationTpl, conservationParams, conservationOnglet);
327
	}
328
 
420 jp_milcent 329
	private String construireTraitement() {
330
		String cHtml = "";
331
		String echantillon = conservation.getAcquisitionEchantillon();
332
 
333
		if (echantillon.equals("1")) {
334
			Params traitementConservationParams  = new Params();
335
			traitementConservationParams.set("i18n_acquisition_traitement", i18nC.acquisitionTraitement());
336
 
337
			traitementConservationParams.set("acquisition_traitement", formaterOuiNon(conservation.getAcquisitionTraitement()));
338
 
339
			traitementConservationParams.set("acquisition_traitement_type_info", construireTraitementType());
340
 
341
			cHtml = Format.substitute(traitementConservationTpl, traitementConservationParams);
342
		}
343
 
344
		return cHtml;
345
	}
346
 
347
	private String construireTraitementType() {
348
		String cHtml = "";
349
		String traitement = conservation.getAcquisitionTraitement();
350
 
351
		if (traitement.equals("1")) {
352
			Params typeTraitementParams  = new Params();
353
			typeTraitementParams.set("i18n_acquisition_traitement_insecte", i18nC.acquisitionTraitementInsecte());
354
			typeTraitementParams.set("i18n_acquisition_traitement_poison", i18nC.acquisitionTraitementPoison());
355
 
356
			String acquisitionTraitementInsecte = construireTxtListeOntologie(conservation.getAcquisitionTraitementInsecte());
357
			typeTraitementParams.set("acquisition_traitement_insecte", acquisitionTraitementInsecte);
358
			String acquisitionTraitementPoison = construireTxtListeOntologie(conservation.getAcquisitionTraitementPoison());
359
			typeTraitementParams.set("acquisition_traitement_poison", acquisitionTraitementPoison);
360
 
361
			cHtml = Format.substitute(typeTraitementConservationTpl, typeTraitementParams);
362
		}
363
 
364
		return cHtml;
365
	}
366
 
426 jp_milcent 367
	private void afficherValorisation() {
368
		Params valorisationParams  = new Params();
369
		valorisationParams.set("i18n_titre_action_valorisation", i18nC.titreActionValorisation());
370
		valorisationParams.set("i18n_action", i18nC.action());
371
		valorisationParams.set("i18n_action_publication", i18nC.actionPublication());
372
		valorisationParams.set("i18n_collection_autre", i18nC.collectionAutre());
373
		valorisationParams.set("i18n_action_future", i18nC.actionFuture());
374
 
375
		valorisationParams.set("action", formaterOuiNon(valorisation.getAction()));
376
		String actionInfo = construireTxtListeOntologie(valorisation.getActionInfo());
377
		valorisationParams.set("action_info", formaterParenthese(actionInfo));
378
		valorisationParams.set("action_publication", valorisation.getPublication());
379
		String collectionAutre = construireTxtListeOntologie(valorisation.getCollectionAutre());
380
		valorisationParams.set("collection_autre", collectionAutre);
381
		valorisationParams.set("action_future", formaterOuiNon(valorisation.getActionFuture()));
382
		valorisationParams.set("action_future_info", formaterParenthese(valorisation.getActionFutureInfo()));
383
 
384
		valorisationParams.set("i18n_titre_recherche_scientifique", i18nC.titreRechercherScientifique());
385
		valorisationParams.set("i18n_recherche", i18nC.recherche());
386
 
387
		valorisationParams.set("recherche", formaterOuiNon(valorisation.getRecherche()));
388
		valorisationParams.set("recherche_info", construireRecherche());
389
 
390
		valorisationParams.set("i18n_titre_acces_usage", i18nC.titreAccesUsage());
391
		valorisationParams.set("i18n_acces", i18nC.acces());
392
		valorisationParams.set("i18n_visite", i18nC.visite());
393
 
394
		valorisationParams.set("acces", formaterOuiNon(valorisation.getAccesSansMotif()));
395
		valorisationParams.set("acces_info", formaterParenthese(valorisation.getAccesSansMotifInfo()));
396
		valorisationParams.set("visite", formaterOuiNon(valorisation.getVisiteAvecMotif()));
397
		valorisationParams.set("visite_info", formaterParenthese(valorisation.getVisiteAvecMotifInfo()));
398
 
399
		afficherOnglet(valorisationTpl, valorisationParams, valorisationOnglet);
406 jp_milcent 400
	}
401
 
426 jp_milcent 402
	private String construireRecherche() {
403
		String cHtml = "";
404
		String recherche = valorisation.getRecherche();
405
 
406
		if (recherche.equals("1")) {
407
			Params rechercheParams  = new Params();
408
			rechercheParams.set("i18n_recherche_provenance", i18nC.rechercheProvenance());
409
			rechercheParams.set("i18n_recherche_type", i18nC.rechercheType());
410
 
411
			String rechercheProvenance = construireTxtListeOntologie(valorisation.getRechercheProvenance());
412
			rechercheParams.set("recherche_provenance", rechercheProvenance);
413
			String rechercheType = construireTxtListeOntologie(valorisation.getRechercheType());
414
			rechercheParams.set("recherche_type", rechercheType);
415
 
416
			cHtml = Format.substitute(rechercheValorisationTpl, rechercheParams);
420 jp_milcent 417
		}
426 jp_milcent 418
 
419
		return cHtml;
420 jp_milcent 420
	}
421
 
379 jp_milcent 422
	private void initialiserTousLesTpl() {
814 jpm 423
		initialiserEnteteTpl();
379 jp_milcent 424
		initialiserIdentificationTpl();
425
		initialiserPersonnelTpl();
390 jp_milcent 426
		initialiserTableauPersonnelTpl();
379 jp_milcent 427
		initialiserLignePersonnelTpl();
390 jp_milcent 428
		initialiserConservationTpl();
420 jp_milcent 429
		initialiserTraitementConservationTpl();
430
		initialiserTypeTraitementConservationTpl();
390 jp_milcent 431
		initialiserValorisationTpl();
426 jp_milcent 432
		initialiserRechercheValorisationTpl();
379 jp_milcent 433
	}
434
 
814 jpm 435
	private void initialiserEnteteTpl() {
420 jp_milcent 436
		enteteTpl =
437
			"<div id='{css_id}'>"+
438
			"	<h1>{nom}</h1>"+
814 jpm 439
			"	<h2>{ville}<span class='{css_meta}'>{projet} <br /> {i18n_id}:{id} - {guid}</span></h2>" +
420 jp_milcent 440
			"	" +
441
			"</div>";
373 jp_milcent 442
	}
443
 
379 jp_milcent 444
	private void initialiserIdentificationTpl() {
445
		identificationTpl =
420 jp_milcent 446
			"<div class='{css_corps}'>"+
447
			"	<div class='{css_fieldset}'>"+
448
			"		<h2>{i18n_titre_administratif}</h2>"+
449
			"		<span class='{css_label}'>{i18n_acronyme} :</span> {acronyme}<br />"+
450
			"		<span class='{css_label}'>{i18n_acces} :</span> {acces}<br />"+
451
			"		<span class='{css_label}'>{i18n_statut} :</span> {statut}<br />"+
452
			"		<span class='{css_label}'>{i18n_date_fondation} :</span> {date_fondation}<br />"+
453
			"		<span class='{css_label}'>{i18n_nbre_personnel} :</span> {nbre_personnel}<br />"+
454
			"	</div>"+
455
			"	<div class='{css_fieldset}'>"+
456
			"		<h2>{i18n_titre_description}</h2>"+
457
			"		{description}"+
458
			"	</div>"+
459
			"	<hr class='{css_clear}'/>"+
460
			"	<div class='{css_fieldset}'>"+
461
			"		<h2>{i18n_titre_adresse}</h2>"+
462
			"		<span class='{css_label}'>{i18n_adresse} :</span> {adresse}<br />" +
463
			"		<span class='{css_label}'>{i18n_cp} :</span> {cp}<br />" +
464
			"		<span class='{css_label}'>{i18n_ville} :</span> {ville}<br />" +
465
			"		<span class='{css_label}'>{i18n_region} :</span> {region}<br />" +
466
			"		<span class='{css_label}'>{i18n_pays} :</span> {pays}<br />" +
467
			"	</div>"+
468
			"	<div class='{css_fieldset}'>"+
469
			"		<h2>{i18n_titre_communication}</h2>"+
470
			"		<span class='{css_label}'>{i18n_tel} :</span> {tel}<br />"+
471
			"		<span class='{css_label}'>{i18n_fax} :</span> {fax}<br />"+
472
			"		<span class='{css_label}'>{i18n_courriel} :</span> {courriel}<br />"+
473
			"		<span class='{css_label}'>{i18n_web} :</span> {web}<br />"+
474
			"	</div>"+
475
			"</div>";
373 jp_milcent 476
	}
477
 
379 jp_milcent 478
	private void initialiserPersonnelTpl() {
479
		personnelTpl =
420 jp_milcent 480
			"<div class='{css_corps}'>"+
481
			"	<h2>{i18n_titre_personnel}</h2>"+
482
			"	<p><span class='{css_label}'>{i18n_nbre_personnel_collection} :</span> {nbre_personnel_collection}</p>"+
483
			"	{tableau_personnel}"+
484
			"</div>";
379 jp_milcent 485
	}
486
 
390 jp_milcent 487
	private void initialiserTableauPersonnelTpl() {
488
		tableauPersonnelTpl =
420 jp_milcent 489
			"<h3>{i18n_titre_membre}</h3>"+
490
			"<table>"+
491
			"	<thead>"+
492
			"		<tr>" +
493
			"			<th>{i18n_fonction}</th>" +
494
			"			<th>{i18n_prenom}</th>" +
495
			"			<th>{i18n_nom}</th>" +
496
			"			<th>{i18n_tel}</th>" +
497
			"			<th>{i18n_fax}</th>" +
498
			"			<th>{i18n_courriel}</th>" +
499
			"			<th>{i18n_statut}</th>" +
500
			"			<th>{i18n_tps_w}</th>" +
501
			"			<th>{i18n_specialite}</th>" +
502
			"			<th>{i18n_contact}</th>" +
503
			"		</tr>"+
504
			"	</thead>"+
505
			"	<tbody>"+
506
			"		{lignes}"+
507
			"	</tbody>"+
508
			"</table>";
390 jp_milcent 509
	}
510
 
379 jp_milcent 511
	private void initialiserLignePersonnelTpl() {
512
		lignePersonnelTpl =
420 jp_milcent 513
			"<tr>"+
514
			"	<td>{fonction}</td>"+
515
			"	<td>{prenom}</td>"+
516
			"	<td>{nom}</td>"+
602 jp_milcent 517
			"	<td>{tel_fix}</td>" +
518
			"	<td>{tel_fax}</td>" +
420 jp_milcent 519
			"	<td>{courriel}</td>" +
520
			"	<td>{statut}</td>" +
521
			"	<td>{tps_w}</td>" +
522
			"	<td>{specialite}</td>" +
523
			"	<td>{contact}</td>" +
524
			"</tr>";
379 jp_milcent 525
	}
526
 
390 jp_milcent 527
	private void initialiserConservationTpl() {
528
		conservationTpl =
420 jp_milcent 529
			"<div class='{css_corps}'>"+
530
			"	<div class='{css_fieldset}'>"+
531
			"		<h2>{i18n_titre_conservation_personnel}</h2>"+
532
			"		<span class='{css_label}'>{i18n_formation} :</span> {formation}<br />"+
533
			"		{formation_info}<br />"+
534
			"		<span class='{css_label}'>{i18n_formation_interet} :</span> {formation_interet}<br />"+
535
			"	</div>"+
536
			"	<div class='{css_fieldset}'>"+
537
			"		<h2>{i18n_titre_local}</h2>"+
538
			"		<span class='{css_label}'>{i18n_local_specifique} :</span> {local_specifique}<br />"+
539
			"		<span class='{css_label}'>{i18n_meuble_specifique} :</span> {meuble_specifique}<br />"+
540
			"		<span class='{css_label}'>{i18n_local_parametre} :</span> {local_parametre}<br />"+
541
			"		<span class='{css_label}'>{i18n_conservation_en_commun} :</span> {conservation_en_commun} {collection_autre}<br />"+
542
			"		<span class='{css_label}'>{i18n_acces_controle} :</span> {acces_controle}<br />"+
543
			"	</div>"+
544
			"	<hr class='{css_clear}'/>"+
545
			"	<div class='{css_fieldset}'>"+
546
			"		<h2>{i18n_titre_operation}</h2>"+
547
			"		<span class='{css_label}'>{i18n_restauration} :</span> {restauration} {restauration_operation}<br />"+
548
			"		<span class='{css_label}'>{i18n_materiel_conservation} :</span> {materiel_conservation} {materiel_autre}<br />"+
549
			"		<span class='{css_label}'>{i18n_traitement} :</span> {traitement} {traitements}<br />"+
550
			"	</div>"+
551
			"	<div class='{css_fieldset}'>"+
552
			"		<h2>{i18n_titre_acquisition}</h2>"+
553
			"		<span class='{css_label}'>{i18n_acquisition_collection} :</span> {acquisition_collection}<br />"+
554
			"		<span class='{css_label}'>{i18n_acquisition_echantillon} :</span> {acquisition_echantillon}<br />"+
555
			"			{acquisition_traitement_info}" +
556
			"	</div>"+
557
			"</div>";
390 jp_milcent 558
	}
559
 
420 jp_milcent 560
	private void initialiserTraitementConservationTpl() {
561
		traitementConservationTpl =
426 jp_milcent 562
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement} :</span> {acquisition_traitement}<br />"+
563
			"	<div class='{css_indentation}'>"+
564
			"		{acquisition_traitement_type_info}"+
565
			"	</div>";
420 jp_milcent 566
	}
567
 
568
	private void initialiserTypeTraitementConservationTpl() {
569
		typeTraitementConservationTpl =
570
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_insecte} :</span> {acquisition_traitement_insecte}<br />"+
571
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_poison} :</span> {acquisition_traitement_poison}<br />";
572
	}
573
 
390 jp_milcent 574
	private void initialiserValorisationTpl() {
575
		valorisationTpl =
420 jp_milcent 576
			"<div class='{css_corps}'>"+
577
			"	<div class='{css_fieldset}'>"+
578
			"		<h2>{i18n_titre_action_valorisation}</h2>"+
426 jp_milcent 579
			"		<span class='{css_label}'>{i18n_action} :</span> {action} {action_info}<br />"+
580
			"		<span class='{css_label}'>{i18n_action_publication} :</span> {action_publication}<br />"+
581
			"		<span class='{css_label}'>{i18n_collection_autre} :</span> {collection_autre}<br />"+
582
			"		<span class='{css_label}'>{i18n_action_future} :</span> {action_future} {action_future_info}<br />"+
420 jp_milcent 583
			"	</div>"+
584
			"	<div class='{css_fieldset}'>"+
585
			"		<h2>{i18n_titre_recherche_scientifique}</h2>"+
426 jp_milcent 586
			"		<span class='{css_label}'>{i18n_recherche} :</span> {recherche}<br />"+
587
			"			{recherche_info}"+
420 jp_milcent 588
			"	</div>"+
589
			"	<hr class='{css_clear}'/>"+
590
			"	<div class='{css_fieldset}'>"+
591
			"		<h2>{i18n_titre_acces_usage}</h2>"+
426 jp_milcent 592
			"		<span class='{css_label}'>{i18n_visite} :</span> {visite} {visite_info}<br />"+
593
			"		<span class='{css_label}'>{i18n_acces} :</span> {acces} {acces_info}<br />"+
420 jp_milcent 594
			"	</div>"+
595
			"</div>";
390 jp_milcent 596
	}
597
 
426 jp_milcent 598
	private void initialiserRechercheValorisationTpl() {
599
		rechercheValorisationTpl =
600
			"<span class='{css_indentation} {css_label}'>{i18n_recherche_provenance} :</span> {recherche_provenance}<br />"+
601
			"<span class='{css_indentation} {css_label}'>{i18n_recherche_type} :</span> {recherche_type}<br />";
602
	}
603
 
814 jpm 604
	public void rafraichir(Object nouvellesDonnees) {
605
		if (nouvellesDonnees instanceof Structure) {
606
			structure = (Structure) nouvellesDonnees;
607
			structureChargementOk = true;
608
		} else if (nouvellesDonnees instanceof ProjetListe) {
609
			projets = (ProjetListe) nouvellesDonnees;
610
			projetsChargementOk = true;
611
		} else if (nouvellesDonnees instanceof ValeurListe) {
612
			ValeurListe listeValeursReceptionnee = (ValeurListe) nouvellesDonnees;
816 jpm 613
			receptionerListeValeurs(listeValeursReceptionnee);
814 jpm 614
		} else if (nouvellesDonnees instanceof Information) {
615
			Information info = (Information) nouvellesDonnees;
379 jp_milcent 616
			if (info.getType().equals("liste_structure_a_personne")) {
617
				allouerPersonnelAStructure((StructureAPersonneListe) info.getDonnee(0));
814 jpm 618
				personnelChargementOk = true;
379 jp_milcent 619
			}
373 jp_milcent 620
		} else {
883 jpm 621
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
60 jpm 622
		}
814 jpm 623
		if (avoirDonneesChargees()) {
624
			afficherDetailInstitution();
625
		}
60 jpm 626
	}
814 jpm 627
 
426 jp_milcent 628
	protected void allouerPersonnelAStructure(StructureAPersonneListe personnel) {
629
		structure.setPersonnel(personnel);
630
	}
814 jpm 631
 
632
	private boolean avoirDonneesChargees() {
633
		boolean ok = false;
634
		if (projetsChargementOk && structureChargementOk && personnelChargementOk && ontologieChargementOk) {
635
			ok = true;
420 jp_milcent 636
		}
814 jpm 637
		return ok;
420 jp_milcent 638
	}
426 jp_milcent 639
}