Subversion Repositories eFlore/Applications.coel

Rev

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