Subversion Repositories eFlore/Applications.coel

Rev

Details | Last modification | View Log | RSS feed

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