Subversion Repositories eFlore/Applications.coel

Rev

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