Subversion Repositories eFlore/Applications.coel

Rev

Rev 1136 | Rev 1237 | Go to most recent revision | Details | Compare with Previous | 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;
936 jpm 18
import org.tela_botanica.client.vues.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);
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());
1171 jpm 157
		identificationParams.set("i18n_acces", i18nC.acces());
158
		identificationParams.set("i18n_usage", i18nC.usage());
390 jp_milcent 159
 
602 jp_milcent 160
		identificationParams.set("i18n_titre_adresse", i18nC.adresse());
161
		identificationParams.set("i18n_adresse", i18nC.adresse());
1171 jpm 162
		identificationParams.set("i18n_adresse_complement", i18nC.adresseComplement());
602 jp_milcent 163
		identificationParams.set("i18n_cp", i18nC.codePostal());
164
		identificationParams.set("i18n_ville", i18nC.ville());
165
		identificationParams.set("i18n_region", i18nC.region());
166
		identificationParams.set("i18n_pays", i18nC.pays());
1171 jpm 167
		identificationParams.set("i18n_latitude", i18nC.latitude());
168
		identificationParams.set("i18n_longitude", i18nC.longitude());
390 jp_milcent 169
 
602 jp_milcent 170
		identificationParams.set("i18n_titre_communication", i18nC.titreCommunication());
171
		identificationParams.set("i18n_tel", i18nC.telephone());
696 jp_milcent 172
		identificationParams.set("i18n_fax", i18nC.FAX());
602 jp_milcent 173
		identificationParams.set("i18n_courriel", i18nC.courriel());
174
		identificationParams.set("i18n_web", i18nC.siteWeb());
420 jp_milcent 175
 
176
		String acronyme = construireTxtTruck(structure.getIdAlternatif());
177
		String typePrive = construireTxtListeOntologie(structure.getTypePrive());
178
		String typePublic = construireTxtListeOntologie(structure.getTypePublic());
179
		String pays = construireTxtListeOntologie(structure.getPays());
180
		String web = construireTxtTruck(structure.getUrl());
1171 jpm 181
		String latitude = structure.getLatitude();
182
		String longitude = structure.getLongitude();
183
		String latitudeLongitude = (!longitude.equals("") && !latitude.equals("")) ? latitude+" / "+longitude : "";
390 jp_milcent 184
 
420 jp_milcent 185
		identificationParams.set("acronyme", acronyme);
186
		identificationParams.set("statut", typePrive+typePublic);
406 jp_milcent 187
		identificationParams.set("date_fondation", structure.getDateFondationFormatLong());
188
		identificationParams.set("nbre_personnel", structure.getNbrePersonne());
390 jp_milcent 189
 
406 jp_milcent 190
		identificationParams.set("description", structure.getDescription());
1171 jpm 191
		identificationParams.set("acces", structure.getConditionAcces());
192
		identificationParams.set("usage", structure.getConditionUsage());
390 jp_milcent 193
 
406 jp_milcent 194
		identificationParams.set("adresse", structure.getAdresse());
1171 jpm 195
		identificationParams.set("adresse_complement", structure.getAdresseComplement());
406 jp_milcent 196
		identificationParams.set("cp", structure.getCodePostal());
197
		identificationParams.set("ville", structure.getVille());
198
		identificationParams.set("region", structure.getRegion());
420 jp_milcent 199
		identificationParams.set("pays", pays);
1171 jpm 200
		identificationParams.set("latitude_longitude", latitudeLongitude);
390 jp_milcent 201
 
602 jp_milcent 202
		identificationParams.set("tel", structure.getTelephoneFixe());
406 jp_milcent 203
		identificationParams.set("fax", structure.getFax());
204
		identificationParams.set("courriel", structure.getCourriel());
420 jp_milcent 205
		identificationParams.set("web", web);
379 jp_milcent 206
 
406 jp_milcent 207
		afficherOnglet(identificationTpl, identificationParams, identificationOnglet);
373 jp_milcent 208
	}
209
 
379 jp_milcent 210
	private void afficherPersonnel() {
390 jp_milcent 211
		String tableauPersonnelHtml = "";
212
		if (personnel.size() > 0) {
213
			tableauPersonnelHtml = construireTableauDuPersonnel();
214
		}
215
 
420 jp_milcent 216
		Params personnelParams = new Params();
406 jp_milcent 217
		personnelParams.set("i18n_titre_personnel", i18nC.titrePersonnel());
218
		personnelParams.set("i18n_nbre_personnel_collection", i18nC.nbrePersonnelCollection());
219
		personnelParams.set("nbre_personnel_collection", personnel.size());
220
		personnelParams.set("tableau_personnel", tableauPersonnelHtml);
379 jp_milcent 221
 
406 jp_milcent 222
		afficherOnglet(personnelTpl, personnelParams, personnelOnglet);
390 jp_milcent 223
	}
224
 
225
	private String construireTableauDuPersonnel() {
226
		Params contenuParams = new Params();
406 jp_milcent 227
		contenuParams.set("i18n_titre_membre", i18nC.titreMembre());
228
		contenuParams.set("i18n_fonction", i18nC.fonction());
696 jp_milcent 229
		contenuParams.set("i18n_prenom", i18nC.personnePrenom());
230
		contenuParams.set("i18n_nom", i18nC.personneNom());
231
		contenuParams.set("i18n_tel", i18nC.FIX());
232
		contenuParams.set("i18n_fax", i18nC.FAX());
406 jp_milcent 233
		contenuParams.set("i18n_courriel", i18nC.courrielPrincipal());
234
		contenuParams.set("i18n_statut", i18nC.statut());
235
		contenuParams.set("i18n_tps_w", i18nC.tpsTravail());
236
		contenuParams.set("i18n_specialite", i18nC.specialite());
237
		contenuParams.set("i18n_contact", i18nC.boolContact());
390 jp_milcent 238
 
379 jp_milcent 239
		String lignesPersonnel = "";
602 jp_milcent 240
 
379 jp_milcent 241
		Iterator<String> it = personnel.keySet().iterator();
242
		while (it.hasNext()) {
243
			StructureAPersonne personne = personnel.get(it.next());
244
			Params ligneParams = new Params();
420 jp_milcent 245
 
246
			String fonction = construireTxtListeOntologie(personne.getFonction());
247
			String statut = construireTxtListeOntologie(personne.getStatut());
248
			String contact = formaterOuiNon(personne.getContact());
249
 
250
			ligneParams.set("fonction", fonction);
379 jp_milcent 251
			ligneParams.set("prenom", personne.getPrenom());
252
			ligneParams.set("nom", personne.getNom());
602 jp_milcent 253
			ligneParams.set("tel_fix", personne.getTelephoneFixe());
254
			ligneParams.set("tel_fax", personne.getFax());
379 jp_milcent 255
			ligneParams.set("courriel", personne.getCourriel());
420 jp_milcent 256
			ligneParams.set("statut", statut);
379 jp_milcent 257
			ligneParams.set("tps_w", personne.getBotaTravailHebdoTps());
258
			ligneParams.set("specialite", personne.afficherSpecialite());
420 jp_milcent 259
			ligneParams.set("contact", contact);
379 jp_milcent 260
			lignesPersonnel += Format.substitute(lignePersonnelTpl, ligneParams);
261
		}
262
		contenuParams.set("lignes", lignesPersonnel);
263
 
390 jp_milcent 264
		String cHtml = Format.substitute(tableauPersonnelTpl, contenuParams);
265
		return cHtml;
379 jp_milcent 266
	}
406 jp_milcent 267
 
268
	private void afficherConservation() {
420 jp_milcent 269
		Params conservationParams  = new Params();
406 jp_milcent 270
		conservationParams.set("i18n_titre_conservation_personnel", i18nC.titreConservationPersonnel());
271
		conservationParams.set("i18n_formation", i18nC.formation());
272
		conservationParams.set("i18n_formation_interet", i18nC.formationInteret());
273
 
274
		conservationParams.set("i18n_titre_local", i18nC.titreLocal());
275
		conservationParams.set("i18n_local_specifique", i18nC.localSpecifique());
276
		conservationParams.set("i18n_meuble_specifique", i18nC.meubleSpecifique());
277
		conservationParams.set("i18n_local_parametre", i18nC.localParametre());
420 jp_milcent 278
		conservationParams.set("i18n_conservation_en_commun", i18nC.conservationEnCommun());
279
		conservationParams.set("i18n_acces_controle", i18nC.accesControle());
406 jp_milcent 280
 
420 jp_milcent 281
		conservationParams.set("i18n_titre_operation", i18nC.titreOperation());
282
		conservationParams.set("i18n_restauration", i18nC.restauration());
283
		conservationParams.set("i18n_materiel_conservation", i18nC.materielConservation());
284
		conservationParams.set("i18n_traitement", i18nC.traitement());
285
 
286
		conservationParams.set("i18n_titre_acquisition", i18nC.titreAcquisition());
287
		conservationParams.set("i18n_acquisition_collection", i18nC.acquisitionCollection());
288
		conservationParams.set("i18n_acquisition_echantillon", i18nC.acquisitionEchantillon());
289
 
406 jp_milcent 290
		conservationParams.set("formation", formaterOuiNon(conservation.getFormation()));
291
		conservationParams.set("formation_info", formaterSautDeLigne(conservation.getFormationInfo()));
292
		conservationParams.set("formation_interet", formaterOuiNon(conservation.getFormationInteret()));
293
		conservationParams.set("meuble_specifique", conservation.getStockageMeuble());
294
 
420 jp_milcent 295
		String chaineAAnalyser = conservation.getStockageLocal();
296
		String chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
297
		conservationParams.set("local_specifique", chaineAAfficher);
406 jp_milcent 298
 
420 jp_milcent 299
		chaineAAnalyser = conservation.getStockageMeuble();
300
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
301
		conservationParams.set("meuble_specifique", chaineAAfficher);
302
 
303
		chaineAAnalyser = conservation.getStockageParametre();
304
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
305
		conservationParams.set("local_parametre", chaineAAfficher);
306
 
307
		conservationParams.set("conservation_en_commun", formaterOuiNon(conservation.getCollectionCommune()));
308
		chaineAAnalyser = conservation.getCollectionAutre();
309
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
310
		conservationParams.set("collection_autre", formaterParenthese(chaineAAfficher));
311
 
312
		conservationParams.set("acces_controle", formaterOuiNon(conservation.getAccesControle()));
313
 
314
		conservationParams.set("restauration", formaterOuiNon(conservation.getRestauration()));
315
		chaineAAnalyser = conservation.getRestaurationOperation();
316
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
317
		conservationParams.set("restauration_operation", formaterParenthese(chaineAAfficher));
318
 
319
		chaineAAnalyser = conservation.getMaterielConservation();
320
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
321
		conservationParams.set("materiel_conservation", chaineAAfficher);
322
		chaineAAnalyser = conservation.getMaterielAutre();
323
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
324
		conservationParams.set("materiel_autre", formaterParenthese(chaineAAfficher));
325
 
326
		conservationParams.set("traitement", formaterOuiNon(conservation.getTraitement()));
327
		chaineAAnalyser = conservation.getTraitements();
328
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
329
		conservationParams.set("traitements", formaterParenthese(chaineAAfficher));
330
 
331
		conservationParams.set("acquisition_collection", formaterOuiNon(conservation.getAcquisitionCollection()));
332
		conservationParams.set("acquisition_echantillon", formaterOuiNon(conservation.getAcquisitionEchantillon()));
333
		conservationParams.set("acquisition_traitement_info", construireTraitement());
334
 
406 jp_milcent 335
		afficherOnglet(conservationTpl, conservationParams, conservationOnglet);
336
	}
337
 
420 jp_milcent 338
	private String construireTraitement() {
339
		String cHtml = "";
340
		String echantillon = conservation.getAcquisitionEchantillon();
341
 
342
		if (echantillon.equals("1")) {
343
			Params traitementConservationParams  = new Params();
344
			traitementConservationParams.set("i18n_acquisition_traitement", i18nC.acquisitionTraitement());
345
 
346
			traitementConservationParams.set("acquisition_traitement", formaterOuiNon(conservation.getAcquisitionTraitement()));
347
 
348
			traitementConservationParams.set("acquisition_traitement_type_info", construireTraitementType());
349
 
350
			cHtml = Format.substitute(traitementConservationTpl, traitementConservationParams);
351
		}
352
 
353
		return cHtml;
354
	}
355
 
356
	private String construireTraitementType() {
357
		String cHtml = "";
358
		String traitement = conservation.getAcquisitionTraitement();
359
 
360
		if (traitement.equals("1")) {
361
			Params typeTraitementParams  = new Params();
362
			typeTraitementParams.set("i18n_acquisition_traitement_insecte", i18nC.acquisitionTraitementInsecte());
363
			typeTraitementParams.set("i18n_acquisition_traitement_poison", i18nC.acquisitionTraitementPoison());
364
 
365
			String acquisitionTraitementInsecte = construireTxtListeOntologie(conservation.getAcquisitionTraitementInsecte());
366
			typeTraitementParams.set("acquisition_traitement_insecte", acquisitionTraitementInsecte);
367
			String acquisitionTraitementPoison = construireTxtListeOntologie(conservation.getAcquisitionTraitementPoison());
368
			typeTraitementParams.set("acquisition_traitement_poison", acquisitionTraitementPoison);
369
 
370
			cHtml = Format.substitute(typeTraitementConservationTpl, typeTraitementParams);
371
		}
372
 
373
		return cHtml;
374
	}
375
 
426 jp_milcent 376
	private void afficherValorisation() {
377
		Params valorisationParams  = new Params();
378
		valorisationParams.set("i18n_titre_action_valorisation", i18nC.titreActionValorisation());
379
		valorisationParams.set("i18n_action", i18nC.action());
380
		valorisationParams.set("i18n_action_publication", i18nC.actionPublication());
381
		valorisationParams.set("i18n_collection_autre", i18nC.collectionAutre());
382
		valorisationParams.set("i18n_action_future", i18nC.actionFuture());
383
 
384
		valorisationParams.set("action", formaterOuiNon(valorisation.getAction()));
385
		String actionInfo = construireTxtListeOntologie(valorisation.getActionInfo());
386
		valorisationParams.set("action_info", formaterParenthese(actionInfo));
387
		valorisationParams.set("action_publication", valorisation.getPublication());
388
		String collectionAutre = construireTxtListeOntologie(valorisation.getCollectionAutre());
389
		valorisationParams.set("collection_autre", collectionAutre);
390
		valorisationParams.set("action_future", formaterOuiNon(valorisation.getActionFuture()));
391
		valorisationParams.set("action_future_info", formaterParenthese(valorisation.getActionFutureInfo()));
392
 
393
		valorisationParams.set("i18n_titre_recherche_scientifique", i18nC.titreRechercherScientifique());
394
		valorisationParams.set("i18n_recherche", i18nC.recherche());
395
 
396
		valorisationParams.set("recherche", formaterOuiNon(valorisation.getRecherche()));
397
		valorisationParams.set("recherche_info", construireRecherche());
398
 
399
		valorisationParams.set("i18n_titre_acces_usage", i18nC.titreAccesUsage());
400
		valorisationParams.set("i18n_acces", i18nC.acces());
401
		valorisationParams.set("i18n_visite", i18nC.visite());
402
 
403
		valorisationParams.set("acces", formaterOuiNon(valorisation.getAccesSansMotif()));
404
		valorisationParams.set("acces_info", formaterParenthese(valorisation.getAccesSansMotifInfo()));
405
		valorisationParams.set("visite", formaterOuiNon(valorisation.getVisiteAvecMotif()));
406
		valorisationParams.set("visite_info", formaterParenthese(valorisation.getVisiteAvecMotifInfo()));
407
 
408
		afficherOnglet(valorisationTpl, valorisationParams, valorisationOnglet);
406 jp_milcent 409
	}
410
 
426 jp_milcent 411
	private String construireRecherche() {
412
		String cHtml = "";
413
		String recherche = valorisation.getRecherche();
414
 
415
		if (recherche.equals("1")) {
416
			Params rechercheParams  = new Params();
417
			rechercheParams.set("i18n_recherche_provenance", i18nC.rechercheProvenance());
418
			rechercheParams.set("i18n_recherche_type", i18nC.rechercheType());
419
 
420
			String rechercheProvenance = construireTxtListeOntologie(valorisation.getRechercheProvenance());
421
			rechercheParams.set("recherche_provenance", rechercheProvenance);
422
			String rechercheType = construireTxtListeOntologie(valorisation.getRechercheType());
423
			rechercheParams.set("recherche_type", rechercheType);
424
 
425
			cHtml = Format.substitute(rechercheValorisationTpl, rechercheParams);
420 jp_milcent 426
		}
426 jp_milcent 427
 
428
		return cHtml;
420 jp_milcent 429
	}
430
 
379 jp_milcent 431
	private void initialiserTousLesTpl() {
814 jpm 432
		initialiserEnteteTpl();
379 jp_milcent 433
		initialiserIdentificationTpl();
434
		initialiserPersonnelTpl();
390 jp_milcent 435
		initialiserTableauPersonnelTpl();
379 jp_milcent 436
		initialiserLignePersonnelTpl();
390 jp_milcent 437
		initialiserConservationTpl();
420 jp_milcent 438
		initialiserTraitementConservationTpl();
439
		initialiserTypeTraitementConservationTpl();
390 jp_milcent 440
		initialiserValorisationTpl();
426 jp_milcent 441
		initialiserRechercheValorisationTpl();
379 jp_milcent 442
	}
443
 
814 jpm 444
	private void initialiserEnteteTpl() {
420 jp_milcent 445
		enteteTpl =
446
			"<div id='{css_id}'>"+
447
			"	<h1>{nom}</h1>"+
814 jpm 448
			"	<h2>{ville}<span class='{css_meta}'>{projet} <br /> {i18n_id}:{id} - {guid}</span></h2>" +
420 jp_milcent 449
			"	" +
450
			"</div>";
373 jp_milcent 451
	}
452
 
379 jp_milcent 453
	private void initialiserIdentificationTpl() {
454
		identificationTpl =
420 jp_milcent 455
			"<div class='{css_corps}'>"+
456
			"	<div class='{css_fieldset}'>"+
457
			"		<h2>{i18n_titre_administratif}</h2>"+
458
			"		<span class='{css_label}'>{i18n_acronyme} :</span> {acronyme}<br />"+
459
			"		<span class='{css_label}'>{i18n_statut} :</span> {statut}<br />"+
460
			"		<span class='{css_label}'>{i18n_date_fondation} :</span> {date_fondation}<br />"+
461
			"		<span class='{css_label}'>{i18n_nbre_personnel} :</span> {nbre_personnel}<br />"+
462
			"	</div>"+
463
			"	<div class='{css_fieldset}'>"+
464
			"		<h2>{i18n_titre_description}</h2>"+
1171 jpm 465
			"		<span class='{css_label}'>{i18n_description} :</span> {description}<br />"+
466
			"		<span class='{css_label}'>{i18n_acces} :</span> {acces}<br />"+
467
			"		<span class='{css_label}'>{i18n_usage} :</span> {usage}<br />"+
420 jp_milcent 468
			"	</div>"+
469
			"	<hr class='{css_clear}'/>"+
470
			"	<div class='{css_fieldset}'>"+
471
			"		<h2>{i18n_titre_adresse}</h2>"+
472
			"		<span class='{css_label}'>{i18n_adresse} :</span> {adresse}<br />" +
1171 jpm 473
			"		<span class='{css_label}'>{i18n_adresse_complement} :</span> {adresse_complement}<br />" +
420 jp_milcent 474
			"		<span class='{css_label}'>{i18n_cp} :</span> {cp}<br />" +
475
			"		<span class='{css_label}'>{i18n_ville} :</span> {ville}<br />" +
476
			"		<span class='{css_label}'>{i18n_region} :</span> {region}<br />" +
477
			"		<span class='{css_label}'>{i18n_pays} :</span> {pays}<br />" +
1171 jpm 478
			"		<span class='{css_label}'>{i18n_latitude} / {i18n_longitude} :</span> {latitude_longitude}<br />" +
420 jp_milcent 479
			"	</div>"+
480
			"	<div class='{css_fieldset}'>"+
481
			"		<h2>{i18n_titre_communication}</h2>"+
482
			"		<span class='{css_label}'>{i18n_tel} :</span> {tel}<br />"+
483
			"		<span class='{css_label}'>{i18n_fax} :</span> {fax}<br />"+
484
			"		<span class='{css_label}'>{i18n_courriel} :</span> {courriel}<br />"+
485
			"		<span class='{css_label}'>{i18n_web} :</span> {web}<br />"+
486
			"	</div>"+
487
			"</div>";
373 jp_milcent 488
	}
489
 
379 jp_milcent 490
	private void initialiserPersonnelTpl() {
491
		personnelTpl =
420 jp_milcent 492
			"<div class='{css_corps}'>"+
493
			"	<h2>{i18n_titre_personnel}</h2>"+
494
			"	<p><span class='{css_label}'>{i18n_nbre_personnel_collection} :</span> {nbre_personnel_collection}</p>"+
495
			"	{tableau_personnel}"+
496
			"</div>";
379 jp_milcent 497
	}
498
 
390 jp_milcent 499
	private void initialiserTableauPersonnelTpl() {
500
		tableauPersonnelTpl =
420 jp_milcent 501
			"<h3>{i18n_titre_membre}</h3>"+
502
			"<table>"+
503
			"	<thead>"+
504
			"		<tr>" +
505
			"			<th>{i18n_fonction}</th>" +
506
			"			<th>{i18n_prenom}</th>" +
507
			"			<th>{i18n_nom}</th>" +
508
			"			<th>{i18n_tel}</th>" +
509
			"			<th>{i18n_fax}</th>" +
510
			"			<th>{i18n_courriel}</th>" +
511
			"			<th>{i18n_statut}</th>" +
512
			"			<th>{i18n_tps_w}</th>" +
513
			"			<th>{i18n_specialite}</th>" +
514
			"			<th>{i18n_contact}</th>" +
515
			"		</tr>"+
516
			"	</thead>"+
517
			"	<tbody>"+
518
			"		{lignes}"+
519
			"	</tbody>"+
520
			"</table>";
390 jp_milcent 521
	}
522
 
379 jp_milcent 523
	private void initialiserLignePersonnelTpl() {
524
		lignePersonnelTpl =
420 jp_milcent 525
			"<tr>"+
526
			"	<td>{fonction}</td>"+
527
			"	<td>{prenom}</td>"+
528
			"	<td>{nom}</td>"+
602 jp_milcent 529
			"	<td>{tel_fix}</td>" +
530
			"	<td>{tel_fax}</td>" +
420 jp_milcent 531
			"	<td>{courriel}</td>" +
532
			"	<td>{statut}</td>" +
533
			"	<td>{tps_w}</td>" +
534
			"	<td>{specialite}</td>" +
535
			"	<td>{contact}</td>" +
536
			"</tr>";
379 jp_milcent 537
	}
538
 
390 jp_milcent 539
	private void initialiserConservationTpl() {
540
		conservationTpl =
420 jp_milcent 541
			"<div class='{css_corps}'>"+
542
			"	<div class='{css_fieldset}'>"+
543
			"		<h2>{i18n_titre_conservation_personnel}</h2>"+
544
			"		<span class='{css_label}'>{i18n_formation} :</span> {formation}<br />"+
545
			"		{formation_info}<br />"+
546
			"		<span class='{css_label}'>{i18n_formation_interet} :</span> {formation_interet}<br />"+
547
			"	</div>"+
548
			"	<div class='{css_fieldset}'>"+
549
			"		<h2>{i18n_titre_local}</h2>"+
550
			"		<span class='{css_label}'>{i18n_local_specifique} :</span> {local_specifique}<br />"+
551
			"		<span class='{css_label}'>{i18n_meuble_specifique} :</span> {meuble_specifique}<br />"+
552
			"		<span class='{css_label}'>{i18n_local_parametre} :</span> {local_parametre}<br />"+
553
			"		<span class='{css_label}'>{i18n_conservation_en_commun} :</span> {conservation_en_commun} {collection_autre}<br />"+
554
			"		<span class='{css_label}'>{i18n_acces_controle} :</span> {acces_controle}<br />"+
555
			"	</div>"+
556
			"	<hr class='{css_clear}'/>"+
557
			"	<div class='{css_fieldset}'>"+
558
			"		<h2>{i18n_titre_operation}</h2>"+
559
			"		<span class='{css_label}'>{i18n_restauration} :</span> {restauration} {restauration_operation}<br />"+
560
			"		<span class='{css_label}'>{i18n_materiel_conservation} :</span> {materiel_conservation} {materiel_autre}<br />"+
561
			"		<span class='{css_label}'>{i18n_traitement} :</span> {traitement} {traitements}<br />"+
562
			"	</div>"+
563
			"	<div class='{css_fieldset}'>"+
564
			"		<h2>{i18n_titre_acquisition}</h2>"+
565
			"		<span class='{css_label}'>{i18n_acquisition_collection} :</span> {acquisition_collection}<br />"+
566
			"		<span class='{css_label}'>{i18n_acquisition_echantillon} :</span> {acquisition_echantillon}<br />"+
567
			"			{acquisition_traitement_info}" +
568
			"	</div>"+
569
			"</div>";
390 jp_milcent 570
	}
571
 
420 jp_milcent 572
	private void initialiserTraitementConservationTpl() {
573
		traitementConservationTpl =
426 jp_milcent 574
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement} :</span> {acquisition_traitement}<br />"+
575
			"	<div class='{css_indentation}'>"+
576
			"		{acquisition_traitement_type_info}"+
577
			"	</div>";
420 jp_milcent 578
	}
579
 
580
	private void initialiserTypeTraitementConservationTpl() {
581
		typeTraitementConservationTpl =
582
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_insecte} :</span> {acquisition_traitement_insecte}<br />"+
583
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_poison} :</span> {acquisition_traitement_poison}<br />";
584
	}
585
 
390 jp_milcent 586
	private void initialiserValorisationTpl() {
587
		valorisationTpl =
420 jp_milcent 588
			"<div class='{css_corps}'>"+
589
			"	<div class='{css_fieldset}'>"+
590
			"		<h2>{i18n_titre_action_valorisation}</h2>"+
426 jp_milcent 591
			"		<span class='{css_label}'>{i18n_action} :</span> {action} {action_info}<br />"+
592
			"		<span class='{css_label}'>{i18n_action_publication} :</span> {action_publication}<br />"+
593
			"		<span class='{css_label}'>{i18n_collection_autre} :</span> {collection_autre}<br />"+
594
			"		<span class='{css_label}'>{i18n_action_future} :</span> {action_future} {action_future_info}<br />"+
420 jp_milcent 595
			"	</div>"+
596
			"	<div class='{css_fieldset}'>"+
597
			"		<h2>{i18n_titre_recherche_scientifique}</h2>"+
426 jp_milcent 598
			"		<span class='{css_label}'>{i18n_recherche} :</span> {recherche}<br />"+
599
			"			{recherche_info}"+
420 jp_milcent 600
			"	</div>"+
601
			"	<hr class='{css_clear}'/>"+
602
			"	<div class='{css_fieldset}'>"+
603
			"		<h2>{i18n_titre_acces_usage}</h2>"+
426 jp_milcent 604
			"		<span class='{css_label}'>{i18n_visite} :</span> {visite} {visite_info}<br />"+
605
			"		<span class='{css_label}'>{i18n_acces} :</span> {acces} {acces_info}<br />"+
420 jp_milcent 606
			"	</div>"+
607
			"</div>";
390 jp_milcent 608
	}
609
 
426 jp_milcent 610
	private void initialiserRechercheValorisationTpl() {
611
		rechercheValorisationTpl =
612
			"<span class='{css_indentation} {css_label}'>{i18n_recherche_provenance} :</span> {recherche_provenance}<br />"+
613
			"<span class='{css_indentation} {css_label}'>{i18n_recherche_type} :</span> {recherche_type}<br />";
614
	}
615
 
814 jpm 616
	public void rafraichir(Object nouvellesDonnees) {
617
		if (nouvellesDonnees instanceof Structure) {
618
			structure = (Structure) nouvellesDonnees;
619
			structureChargementOk = true;
620
		} else if (nouvellesDonnees instanceof ProjetListe) {
621
			projets = (ProjetListe) nouvellesDonnees;
622
			projetsChargementOk = true;
623
		} else if (nouvellesDonnees instanceof ValeurListe) {
624
			ValeurListe listeValeursReceptionnee = (ValeurListe) nouvellesDonnees;
816 jpm 625
			receptionerListeValeurs(listeValeursReceptionnee);
814 jpm 626
		} else if (nouvellesDonnees instanceof Information) {
627
			Information info = (Information) nouvellesDonnees;
379 jp_milcent 628
			if (info.getType().equals("liste_structure_a_personne")) {
629
				allouerPersonnelAStructure((StructureAPersonneListe) info.getDonnee(0));
814 jpm 630
				personnelChargementOk = true;
379 jp_milcent 631
			}
373 jp_milcent 632
		} else {
883 jpm 633
			GWT.log(Mediateur.i18nM.erreurRafraichir(nouvellesDonnees.getClass(), this.getClass()), null);
60 jpm 634
		}
814 jpm 635
		if (avoirDonneesChargees()) {
636
			afficherDetailInstitution();
637
		}
60 jpm 638
	}
814 jpm 639
 
426 jp_milcent 640
	protected void allouerPersonnelAStructure(StructureAPersonneListe personnel) {
641
		structure.setPersonnel(personnel);
642
	}
814 jpm 643
 
644
	private boolean avoirDonneesChargees() {
645
		boolean ok = false;
646
		if (projetsChargementOk && structureChargementOk && personnelChargementOk && ontologieChargementOk) {
647
			ok = true;
420 jp_milcent 648
		}
814 jpm 649
		return ok;
420 jp_milcent 650
	}
426 jp_milcent 651
}