Subversion Repositories eFlore/Applications.coel

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 1
package org.tela_botanica.client.vues;
2
 
379 jp_milcent 3
import java.util.Iterator;
4
 
5
import org.tela_botanica.client.ComposantClass;
373 jp_milcent 6
import org.tela_botanica.client.ComposantId;
7
import org.tela_botanica.client.Mediateur;
60 jpm 8
import org.tela_botanica.client.interfaces.Rafraichissable;
379 jp_milcent 9
import org.tela_botanica.client.modeles.Information;
420 jp_milcent 10
import org.tela_botanica.client.modeles.Projet;
11
import org.tela_botanica.client.modeles.ProjetListe;
60 jpm 12
import org.tela_botanica.client.modeles.Structure;
379 jp_milcent 13
import org.tela_botanica.client.modeles.StructureAPersonne;
14
import org.tela_botanica.client.modeles.StructureAPersonneListe;
15
import org.tela_botanica.client.modeles.StructureConservation;
16
import org.tela_botanica.client.modeles.StructureValorisation;
406 jp_milcent 17
import org.tela_botanica.client.modeles.ValeurListe;
60 jpm 18
 
19
import com.extjs.gxt.ui.client.Style.Scroll;
20
import com.extjs.gxt.ui.client.util.Format;
21
import com.extjs.gxt.ui.client.util.Params;
22
import com.extjs.gxt.ui.client.widget.ContentPanel;
374 jp_milcent 23
import com.extjs.gxt.ui.client.widget.Html;
373 jp_milcent 24
import com.extjs.gxt.ui.client.widget.TabItem;
25
import com.extjs.gxt.ui.client.widget.TabPanel;
390 jp_milcent 26
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
60 jpm 27
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
373 jp_milcent 28
import com.google.gwt.core.client.GWT;
60 jpm 29
 
453 jp_milcent 30
public class StructureDetailVue extends DetailVue implements Rafraichissable {
60 jpm 31
 
374 jp_milcent 32
	private String enteteTpl = null;
379 jp_milcent 33
	private String identificationTpl = null;
34
	private String personnelTpl = null;
390 jp_milcent 35
	private String tableauPersonnelTpl = null;
379 jp_milcent 36
	private String lignePersonnelTpl = null;
390 jp_milcent 37
	private String conservationTpl = null;
420 jp_milcent 38
	private String traitementConservationTpl = null;
390 jp_milcent 39
	private String valorisationTpl = null;
426 jp_milcent 40
	private String typeTraitementConservationTpl = null;
41
	private String rechercheValorisationTpl = null;
373 jp_milcent 42
 
43
	private Structure structure = null;
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());
696 jp_milcent 176
		identificationParams.set("i18n_fax", i18nC.FAX());
602 jp_milcent 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());
696 jp_milcent 228
		contenuParams.set("i18n_prenom", i18nC.personnePrenom());
229
		contenuParams.set("i18n_nom", i18nC.personneNom());
230
		contenuParams.set("i18n_tel", i18nC.FIX());
231
		contenuParams.set("i18n_fax", i18nC.FAX());
406 jp_milcent 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());
243
			Params ligneParams = new Params();
420 jp_milcent 244
 
245
			String fonction = construireTxtListeOntologie(personne.getFonction());
246
			String statut = construireTxtListeOntologie(personne.getStatut());
247
			String contact = formaterOuiNon(personne.getContact());
248
 
249
			ligneParams.set("fonction", fonction);
379 jp_milcent 250
			ligneParams.set("prenom", personne.getPrenom());
251
			ligneParams.set("nom", personne.getNom());
602 jp_milcent 252
			ligneParams.set("tel_fix", personne.getTelephoneFixe());
253
			ligneParams.set("tel_fax", personne.getFax());
379 jp_milcent 254
			ligneParams.set("courriel", personne.getCourriel());
420 jp_milcent 255
			ligneParams.set("statut", statut);
379 jp_milcent 256
			ligneParams.set("tps_w", personne.getBotaTravailHebdoTps());
257
			ligneParams.set("specialite", personne.afficherSpecialite());
420 jp_milcent 258
			ligneParams.set("contact", contact);
379 jp_milcent 259
			lignesPersonnel += Format.substitute(lignePersonnelTpl, ligneParams);
260
		}
261
		contenuParams.set("lignes", lignesPersonnel);
262
 
390 jp_milcent 263
		String cHtml = Format.substitute(tableauPersonnelTpl, contenuParams);
264
		return cHtml;
379 jp_milcent 265
	}
406 jp_milcent 266
 
267
	private void afficherConservation() {
420 jp_milcent 268
		Params conservationParams  = new Params();
406 jp_milcent 269
		conservationParams.set("i18n_titre_conservation_personnel", i18nC.titreConservationPersonnel());
270
		conservationParams.set("i18n_formation", i18nC.formation());
271
		conservationParams.set("i18n_formation_interet", i18nC.formationInteret());
272
 
273
		conservationParams.set("i18n_titre_local", i18nC.titreLocal());
274
		conservationParams.set("i18n_local_specifique", i18nC.localSpecifique());
275
		conservationParams.set("i18n_meuble_specifique", i18nC.meubleSpecifique());
276
		conservationParams.set("i18n_local_parametre", i18nC.localParametre());
420 jp_milcent 277
		conservationParams.set("i18n_conservation_en_commun", i18nC.conservationEnCommun());
278
		conservationParams.set("i18n_acces_controle", i18nC.accesControle());
406 jp_milcent 279
 
420 jp_milcent 280
		conservationParams.set("i18n_titre_operation", i18nC.titreOperation());
281
		conservationParams.set("i18n_restauration", i18nC.restauration());
282
		conservationParams.set("i18n_materiel_conservation", i18nC.materielConservation());
283
		conservationParams.set("i18n_traitement", i18nC.traitement());
284
 
285
		conservationParams.set("i18n_titre_acquisition", i18nC.titreAcquisition());
286
		conservationParams.set("i18n_acquisition_collection", i18nC.acquisitionCollection());
287
		conservationParams.set("i18n_acquisition_echantillon", i18nC.acquisitionEchantillon());
288
 
406 jp_milcent 289
		conservationParams.set("formation", formaterOuiNon(conservation.getFormation()));
290
		conservationParams.set("formation_info", formaterSautDeLigne(conservation.getFormationInfo()));
291
		conservationParams.set("formation_interet", formaterOuiNon(conservation.getFormationInteret()));
292
		conservationParams.set("meuble_specifique", conservation.getStockageMeuble());
293
 
420 jp_milcent 294
		String chaineAAnalyser = conservation.getStockageLocal();
295
		String chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
296
		conservationParams.set("local_specifique", chaineAAfficher);
406 jp_milcent 297
 
420 jp_milcent 298
		chaineAAnalyser = conservation.getStockageMeuble();
299
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
300
		conservationParams.set("meuble_specifique", chaineAAfficher);
301
 
302
		chaineAAnalyser = conservation.getStockageParametre();
303
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
304
		conservationParams.set("local_parametre", chaineAAfficher);
305
 
306
		conservationParams.set("conservation_en_commun", formaterOuiNon(conservation.getCollectionCommune()));
307
		chaineAAnalyser = conservation.getCollectionAutre();
308
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
309
		conservationParams.set("collection_autre", formaterParenthese(chaineAAfficher));
310
 
311
		conservationParams.set("acces_controle", formaterOuiNon(conservation.getAccesControle()));
312
 
313
		conservationParams.set("restauration", formaterOuiNon(conservation.getRestauration()));
314
		chaineAAnalyser = conservation.getRestaurationOperation();
315
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
316
		conservationParams.set("restauration_operation", formaterParenthese(chaineAAfficher));
317
 
318
		chaineAAnalyser = conservation.getMaterielConservation();
319
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
320
		conservationParams.set("materiel_conservation", chaineAAfficher);
321
		chaineAAnalyser = conservation.getMaterielAutre();
322
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
323
		conservationParams.set("materiel_autre", formaterParenthese(chaineAAfficher));
324
 
325
		conservationParams.set("traitement", formaterOuiNon(conservation.getTraitement()));
326
		chaineAAnalyser = conservation.getTraitements();
327
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
328
		conservationParams.set("traitements", formaterParenthese(chaineAAfficher));
329
 
330
		conservationParams.set("acquisition_collection", formaterOuiNon(conservation.getAcquisitionCollection()));
331
		conservationParams.set("acquisition_echantillon", formaterOuiNon(conservation.getAcquisitionEchantillon()));
332
		conservationParams.set("acquisition_traitement_info", construireTraitement());
333
 
406 jp_milcent 334
		afficherOnglet(conservationTpl, conservationParams, conservationOnglet);
335
	}
336
 
420 jp_milcent 337
	private String construireTraitement() {
338
		String cHtml = "";
339
		String echantillon = conservation.getAcquisitionEchantillon();
340
 
341
		if (echantillon.equals("1")) {
342
			Params traitementConservationParams  = new Params();
343
			traitementConservationParams.set("i18n_acquisition_traitement", i18nC.acquisitionTraitement());
344
 
345
			traitementConservationParams.set("acquisition_traitement", formaterOuiNon(conservation.getAcquisitionTraitement()));
346
 
347
			traitementConservationParams.set("acquisition_traitement_type_info", construireTraitementType());
348
 
349
			cHtml = Format.substitute(traitementConservationTpl, traitementConservationParams);
350
		}
351
 
352
		return cHtml;
353
	}
354
 
355
	private String construireTraitementType() {
356
		String cHtml = "";
357
		String traitement = conservation.getAcquisitionTraitement();
358
 
359
		if (traitement.equals("1")) {
360
			Params typeTraitementParams  = new Params();
361
			typeTraitementParams.set("i18n_acquisition_traitement_insecte", i18nC.acquisitionTraitementInsecte());
362
			typeTraitementParams.set("i18n_acquisition_traitement_poison", i18nC.acquisitionTraitementPoison());
363
 
364
			String acquisitionTraitementInsecte = construireTxtListeOntologie(conservation.getAcquisitionTraitementInsecte());
365
			typeTraitementParams.set("acquisition_traitement_insecte", acquisitionTraitementInsecte);
366
			String acquisitionTraitementPoison = construireTxtListeOntologie(conservation.getAcquisitionTraitementPoison());
367
			typeTraitementParams.set("acquisition_traitement_poison", acquisitionTraitementPoison);
368
 
369
			cHtml = Format.substitute(typeTraitementConservationTpl, typeTraitementParams);
370
		}
371
 
372
		return cHtml;
373
	}
374
 
426 jp_milcent 375
	private void afficherValorisation() {
376
		Params valorisationParams  = new Params();
377
		valorisationParams.set("i18n_titre_action_valorisation", i18nC.titreActionValorisation());
378
		valorisationParams.set("i18n_action", i18nC.action());
379
		valorisationParams.set("i18n_action_publication", i18nC.actionPublication());
380
		valorisationParams.set("i18n_collection_autre", i18nC.collectionAutre());
381
		valorisationParams.set("i18n_action_future", i18nC.actionFuture());
382
 
383
		valorisationParams.set("action", formaterOuiNon(valorisation.getAction()));
384
		String actionInfo = construireTxtListeOntologie(valorisation.getActionInfo());
385
		valorisationParams.set("action_info", formaterParenthese(actionInfo));
386
		valorisationParams.set("action_publication", valorisation.getPublication());
387
		String collectionAutre = construireTxtListeOntologie(valorisation.getCollectionAutre());
388
		valorisationParams.set("collection_autre", collectionAutre);
389
		valorisationParams.set("action_future", formaterOuiNon(valorisation.getActionFuture()));
390
		valorisationParams.set("action_future_info", formaterParenthese(valorisation.getActionFutureInfo()));
391
 
392
		valorisationParams.set("i18n_titre_recherche_scientifique", i18nC.titreRechercherScientifique());
393
		valorisationParams.set("i18n_recherche", i18nC.recherche());
394
 
395
		valorisationParams.set("recherche", formaterOuiNon(valorisation.getRecherche()));
396
		valorisationParams.set("recherche_info", construireRecherche());
397
 
398
		valorisationParams.set("i18n_titre_acces_usage", i18nC.titreAccesUsage());
399
		valorisationParams.set("i18n_acces", i18nC.acces());
400
		valorisationParams.set("i18n_visite", i18nC.visite());
401
 
402
		valorisationParams.set("acces", formaterOuiNon(valorisation.getAccesSansMotif()));
403
		valorisationParams.set("acces_info", formaterParenthese(valorisation.getAccesSansMotifInfo()));
404
		valorisationParams.set("visite", formaterOuiNon(valorisation.getVisiteAvecMotif()));
405
		valorisationParams.set("visite_info", formaterParenthese(valorisation.getVisiteAvecMotifInfo()));
406
 
407
		afficherOnglet(valorisationTpl, valorisationParams, valorisationOnglet);
406 jp_milcent 408
	}
409
 
426 jp_milcent 410
	private String construireRecherche() {
411
		String cHtml = "";
412
		String recherche = valorisation.getRecherche();
413
 
414
		if (recherche.equals("1")) {
415
			Params rechercheParams  = new Params();
416
			rechercheParams.set("i18n_recherche_provenance", i18nC.rechercheProvenance());
417
			rechercheParams.set("i18n_recherche_type", i18nC.rechercheType());
418
 
419
			String rechercheProvenance = construireTxtListeOntologie(valorisation.getRechercheProvenance());
420
			rechercheParams.set("recherche_provenance", rechercheProvenance);
421
			String rechercheType = construireTxtListeOntologie(valorisation.getRechercheType());
422
			rechercheParams.set("recherche_type", rechercheType);
423
 
424
			cHtml = Format.substitute(rechercheValorisationTpl, rechercheParams);
420 jp_milcent 425
		}
426 jp_milcent 426
 
427
		return cHtml;
420 jp_milcent 428
	}
429
 
379 jp_milcent 430
	private void initialiserTousLesTpl() {
431
		initialiserEnteteHtmlTpl();
432
		initialiserIdentificationTpl();
433
		initialiserPersonnelTpl();
390 jp_milcent 434
		initialiserTableauPersonnelTpl();
379 jp_milcent 435
		initialiserLignePersonnelTpl();
390 jp_milcent 436
		initialiserConservationTpl();
420 jp_milcent 437
		initialiserTraitementConservationTpl();
438
		initialiserTypeTraitementConservationTpl();
390 jp_milcent 439
		initialiserValorisationTpl();
426 jp_milcent 440
		initialiserRechercheValorisationTpl();
379 jp_milcent 441
	}
442
 
373 jp_milcent 443
	private void initialiserEnteteHtmlTpl() {
420 jp_milcent 444
		enteteTpl =
445
			"<div id='{css_id}'>"+
446
			"	<h1>{nom}</h1>"+
447
			"	<h2>{ville}<span class='{css_meta}'>{projet} - {id} - {guid}</span></h2>" +
448
			"	" +
449
			"</div>";
373 jp_milcent 450
	}
451
 
379 jp_milcent 452
	private void initialiserIdentificationTpl() {
453
		identificationTpl =
420 jp_milcent 454
			"<div class='{css_corps}'>"+
455
			"	<div class='{css_fieldset}'>"+
456
			"		<h2>{i18n_titre_administratif}</h2>"+
457
			"		<span class='{css_label}'>{i18n_acronyme} :</span> {acronyme}<br />"+
458
			"		<span class='{css_label}'>{i18n_acces} :</span> {acces}<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>"+
465
			"		{description}"+
466
			"	</div>"+
467
			"	<hr class='{css_clear}'/>"+
468
			"	<div class='{css_fieldset}'>"+
469
			"		<h2>{i18n_titre_adresse}</h2>"+
470
			"		<span class='{css_label}'>{i18n_adresse} :</span> {adresse}<br />" +
471
			"		<span class='{css_label}'>{i18n_cp} :</span> {cp}<br />" +
472
			"		<span class='{css_label}'>{i18n_ville} :</span> {ville}<br />" +
473
			"		<span class='{css_label}'>{i18n_region} :</span> {region}<br />" +
474
			"		<span class='{css_label}'>{i18n_pays} :</span> {pays}<br />" +
475
			"	</div>"+
476
			"	<div class='{css_fieldset}'>"+
477
			"		<h2>{i18n_titre_communication}</h2>"+
478
			"		<span class='{css_label}'>{i18n_tel} :</span> {tel}<br />"+
479
			"		<span class='{css_label}'>{i18n_fax} :</span> {fax}<br />"+
480
			"		<span class='{css_label}'>{i18n_courriel} :</span> {courriel}<br />"+
481
			"		<span class='{css_label}'>{i18n_web} :</span> {web}<br />"+
482
			"	</div>"+
483
			"</div>";
373 jp_milcent 484
	}
485
 
379 jp_milcent 486
	private void initialiserPersonnelTpl() {
487
		personnelTpl =
420 jp_milcent 488
			"<div class='{css_corps}'>"+
489
			"	<h2>{i18n_titre_personnel}</h2>"+
490
			"	<p><span class='{css_label}'>{i18n_nbre_personnel_collection} :</span> {nbre_personnel_collection}</p>"+
491
			"	{tableau_personnel}"+
492
			"</div>";
379 jp_milcent 493
	}
494
 
390 jp_milcent 495
	private void initialiserTableauPersonnelTpl() {
496
		tableauPersonnelTpl =
420 jp_milcent 497
			"<h3>{i18n_titre_membre}</h3>"+
498
			"<table>"+
499
			"	<thead>"+
500
			"		<tr>" +
501
			"			<th>{i18n_fonction}</th>" +
502
			"			<th>{i18n_prenom}</th>" +
503
			"			<th>{i18n_nom}</th>" +
504
			"			<th>{i18n_tel}</th>" +
505
			"			<th>{i18n_fax}</th>" +
506
			"			<th>{i18n_courriel}</th>" +
507
			"			<th>{i18n_statut}</th>" +
508
			"			<th>{i18n_tps_w}</th>" +
509
			"			<th>{i18n_specialite}</th>" +
510
			"			<th>{i18n_contact}</th>" +
511
			"		</tr>"+
512
			"	</thead>"+
513
			"	<tbody>"+
514
			"		{lignes}"+
515
			"	</tbody>"+
516
			"</table>";
390 jp_milcent 517
	}
518
 
379 jp_milcent 519
	private void initialiserLignePersonnelTpl() {
520
		lignePersonnelTpl =
420 jp_milcent 521
			"<tr>"+
522
			"	<td>{fonction}</td>"+
523
			"	<td>{prenom}</td>"+
524
			"	<td>{nom}</td>"+
602 jp_milcent 525
			"	<td>{tel_fix}</td>" +
526
			"	<td>{tel_fax}</td>" +
420 jp_milcent 527
			"	<td>{courriel}</td>" +
528
			"	<td>{statut}</td>" +
529
			"	<td>{tps_w}</td>" +
530
			"	<td>{specialite}</td>" +
531
			"	<td>{contact}</td>" +
532
			"</tr>";
379 jp_milcent 533
	}
534
 
390 jp_milcent 535
	private void initialiserConservationTpl() {
536
		conservationTpl =
420 jp_milcent 537
			"<div class='{css_corps}'>"+
538
			"	<div class='{css_fieldset}'>"+
539
			"		<h2>{i18n_titre_conservation_personnel}</h2>"+
540
			"		<span class='{css_label}'>{i18n_formation} :</span> {formation}<br />"+
541
			"		{formation_info}<br />"+
542
			"		<span class='{css_label}'>{i18n_formation_interet} :</span> {formation_interet}<br />"+
543
			"	</div>"+
544
			"	<div class='{css_fieldset}'>"+
545
			"		<h2>{i18n_titre_local}</h2>"+
546
			"		<span class='{css_label}'>{i18n_local_specifique} :</span> {local_specifique}<br />"+
547
			"		<span class='{css_label}'>{i18n_meuble_specifique} :</span> {meuble_specifique}<br />"+
548
			"		<span class='{css_label}'>{i18n_local_parametre} :</span> {local_parametre}<br />"+
549
			"		<span class='{css_label}'>{i18n_conservation_en_commun} :</span> {conservation_en_commun} {collection_autre}<br />"+
550
			"		<span class='{css_label}'>{i18n_acces_controle} :</span> {acces_controle}<br />"+
551
			"	</div>"+
552
			"	<hr class='{css_clear}'/>"+
553
			"	<div class='{css_fieldset}'>"+
554
			"		<h2>{i18n_titre_operation}</h2>"+
555
			"		<span class='{css_label}'>{i18n_restauration} :</span> {restauration} {restauration_operation}<br />"+
556
			"		<span class='{css_label}'>{i18n_materiel_conservation} :</span> {materiel_conservation} {materiel_autre}<br />"+
557
			"		<span class='{css_label}'>{i18n_traitement} :</span> {traitement} {traitements}<br />"+
558
			"	</div>"+
559
			"	<div class='{css_fieldset}'>"+
560
			"		<h2>{i18n_titre_acquisition}</h2>"+
561
			"		<span class='{css_label}'>{i18n_acquisition_collection} :</span> {acquisition_collection}<br />"+
562
			"		<span class='{css_label}'>{i18n_acquisition_echantillon} :</span> {acquisition_echantillon}<br />"+
563
			"			{acquisition_traitement_info}" +
564
			"	</div>"+
565
			"</div>";
390 jp_milcent 566
	}
567
 
420 jp_milcent 568
	private void initialiserTraitementConservationTpl() {
569
		traitementConservationTpl =
426 jp_milcent 570
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement} :</span> {acquisition_traitement}<br />"+
571
			"	<div class='{css_indentation}'>"+
572
			"		{acquisition_traitement_type_info}"+
573
			"	</div>";
420 jp_milcent 574
	}
575
 
576
	private void initialiserTypeTraitementConservationTpl() {
577
		typeTraitementConservationTpl =
578
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_insecte} :</span> {acquisition_traitement_insecte}<br />"+
579
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_poison} :</span> {acquisition_traitement_poison}<br />";
580
	}
581
 
390 jp_milcent 582
	private void initialiserValorisationTpl() {
583
		valorisationTpl =
420 jp_milcent 584
			"<div class='{css_corps}'>"+
585
			"	<div class='{css_fieldset}'>"+
586
			"		<h2>{i18n_titre_action_valorisation}</h2>"+
426 jp_milcent 587
			"		<span class='{css_label}'>{i18n_action} :</span> {action} {action_info}<br />"+
588
			"		<span class='{css_label}'>{i18n_action_publication} :</span> {action_publication}<br />"+
589
			"		<span class='{css_label}'>{i18n_collection_autre} :</span> {collection_autre}<br />"+
590
			"		<span class='{css_label}'>{i18n_action_future} :</span> {action_future} {action_future_info}<br />"+
420 jp_milcent 591
			"	</div>"+
592
			"	<div class='{css_fieldset}'>"+
593
			"		<h2>{i18n_titre_recherche_scientifique}</h2>"+
426 jp_milcent 594
			"		<span class='{css_label}'>{i18n_recherche} :</span> {recherche}<br />"+
595
			"			{recherche_info}"+
420 jp_milcent 596
			"	</div>"+
597
			"	<hr class='{css_clear}'/>"+
598
			"	<div class='{css_fieldset}'>"+
599
			"		<h2>{i18n_titre_acces_usage}</h2>"+
426 jp_milcent 600
			"		<span class='{css_label}'>{i18n_visite} :</span> {visite} {visite_info}<br />"+
601
			"		<span class='{css_label}'>{i18n_acces} :</span> {acces} {acces_info}<br />"+
420 jp_milcent 602
			"	</div>"+
603
			"</div>";
390 jp_milcent 604
	}
605
 
426 jp_milcent 606
	private void initialiserRechercheValorisationTpl() {
607
		rechercheValorisationTpl =
608
			"<span class='{css_indentation} {css_label}'>{i18n_recherche_provenance} :</span> {recherche_provenance}<br />"+
609
			"<span class='{css_indentation} {css_label}'>{i18n_recherche_type} :</span> {recherche_type}<br />";
610
	}
611
 
60 jpm 612
	public void rafraichir(Object nouvelleDonnees) {
613
		if (nouvelleDonnees instanceof Structure) {
390 jp_milcent 614
			structure = (Structure) nouvelleDonnees;
615
			afficherDetailInstitution();
420 jp_milcent 616
		} else if (nouvelleDonnees instanceof ProjetListe) {
617
			projets = (ProjetListe) nouvelleDonnees;
618
		} else if (nouvelleDonnees instanceof ValeurListe) {
619
			ValeurListe ontologieReceptionnee = (ValeurListe) nouvelleDonnees;
620
			ajouterListeValeursAOntologie(ontologieReceptionnee);
406 jp_milcent 621
		} else if (nouvelleDonnees instanceof Information) {
379 jp_milcent 622
			Information info = (Information) nouvelleDonnees;
623
			if (info.getType().equals("liste_structure_a_personne")) {
624
				allouerPersonnelAStructure((StructureAPersonneListe) info.getDonnee(0));
390 jp_milcent 625
				afficherDetailInstitution();
379 jp_milcent 626
			}
373 jp_milcent 627
		} else {
628
			GWT.log("Pas de correspondance dans la méthode rafraichir() de la classe "+this.getClass(), null);
60 jpm 629
		}
630
	}
420 jp_milcent 631
 
426 jp_milcent 632
	protected void allouerPersonnelAStructure(StructureAPersonneListe personnel) {
633
		structure.setPersonnel(personnel);
634
	}
635
 
448 jp_milcent 636
	protected String construireTxtProjet(String idProjet) {
420 jp_milcent 637
		String chaineARetourner = idProjet;
638
 
639
		if (projets != null) {
640
			Projet projet = projets.get(idProjet);
641
			String nomDuProjet = projet.getNom();
642
			if  (!nomDuProjet.equals("")) {
643
				chaineARetourner = nomDuProjet;
644
			}
645
		}
646
 
647
		return chaineARetourner;
648
	}
426 jp_milcent 649
}