Subversion Repositories eFlore/Applications.coel

Rev

Rev 406 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 406 Rev 420
Line 1... Line 1...
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
Line 2... Line 2...
2
 
2
 
-
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.HashMap;
4
import java.util.Iterator;
-
 
5
import java.util.List;
-
 
Line 6... Line 5...
6
import java.util.Map.Entry;
5
import java.util.Iterator;
7
 
6
 
8
import org.tela_botanica.client.ComposantClass;
7
import org.tela_botanica.client.ComposantClass;
9
import org.tela_botanica.client.ComposantId;
-
 
10
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.ComposantId;
11
import org.tela_botanica.client.RegistreId;
9
import org.tela_botanica.client.Mediateur;
12
import org.tela_botanica.client.i18n.Constantes;
-
 
13
import org.tela_botanica.client.interfaces.Rafraichissable;
10
import org.tela_botanica.client.i18n.Constantes;
-
 
11
import org.tela_botanica.client.interfaces.Rafraichissable;
-
 
12
import org.tela_botanica.client.modeles.Information;
14
import org.tela_botanica.client.modeles.Configuration;
13
import org.tela_botanica.client.modeles.Projet;
15
import org.tela_botanica.client.modeles.Information;
14
import org.tela_botanica.client.modeles.ProjetListe;
16
import org.tela_botanica.client.modeles.Structure;
15
import org.tela_botanica.client.modeles.Structure;
17
import org.tela_botanica.client.modeles.StructureAPersonne;
16
import org.tela_botanica.client.modeles.StructureAPersonne;
18
import org.tela_botanica.client.modeles.StructureAPersonneListe;
17
import org.tela_botanica.client.modeles.StructureAPersonneListe;
19
import org.tela_botanica.client.modeles.StructureConservation;
18
import org.tela_botanica.client.modeles.StructureConservation;
20
import org.tela_botanica.client.modeles.StructureValorisation;
19
import org.tela_botanica.client.modeles.StructureValorisation;
Line 21... Line -...
21
import org.tela_botanica.client.modeles.Valeur;
-
 
22
import org.tela_botanica.client.modeles.ValeurListe;
-
 
23
 
20
import org.tela_botanica.client.modeles.Valeur;
24
import com.extjs.gxt.ui.client.Events;
21
import org.tela_botanica.client.modeles.ValeurListe;
25
import com.extjs.gxt.ui.client.Registry;
22
 
26
import com.extjs.gxt.ui.client.Style.Scroll;
23
import com.extjs.gxt.ui.client.Style.Scroll;
27
import com.extjs.gxt.ui.client.util.Format;
-
 
28
import com.extjs.gxt.ui.client.util.Params;
24
import com.extjs.gxt.ui.client.util.Format;
29
import com.extjs.gxt.ui.client.widget.ContentPanel;
25
import com.extjs.gxt.ui.client.util.Params;
30
import com.extjs.gxt.ui.client.widget.HorizontalPanel;
26
import com.extjs.gxt.ui.client.widget.ContentPanel;
31
import com.extjs.gxt.ui.client.widget.Html;
27
import com.extjs.gxt.ui.client.widget.Html;
32
import com.extjs.gxt.ui.client.widget.HtmlContainer;
28
import com.extjs.gxt.ui.client.widget.HtmlContainer;
33
import com.extjs.gxt.ui.client.widget.LayoutContainer;
29
import com.extjs.gxt.ui.client.widget.LayoutContainer;
34
import com.extjs.gxt.ui.client.widget.TabItem;
30
import com.extjs.gxt.ui.client.widget.TabItem;
35
import com.extjs.gxt.ui.client.widget.TabPanel;
31
import com.extjs.gxt.ui.client.widget.TabPanel;
36
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
32
import com.extjs.gxt.ui.client.widget.layout.AnchorLayout;
37
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
-
 
Line 38... Line 33...
38
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
33
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
Line 39... Line 34...
39
import com.google.gwt.core.client.GWT;
34
import com.extjs.gxt.ui.client.widget.layout.FlowLayout;
40
import com.google.gwt.i18n.client.DateTimeFormat;
35
import com.google.gwt.core.client.GWT;
-
 
36
 
-
 
37
public class StructureDetailPanneauVue extends LayoutContainer implements Rafraichissable {
Line 41... Line 38...
41
 
38
 
42
public class StructureDetailPanneauVue extends LayoutContainer implements Rafraichissable {
39
	private Mediateur mediateur = null;
43
 
40
	private Constantes i18nC = null;
44
	private Mediateur mediateur = null;
41
	private HashMap<String, Valeur> ontologie = null;
45
	private Constantes i18nC = null;
42
	private ProjetListe projets = null;
46
	
43
	
-
 
44
	private String enteteTpl = null;
47
	private String enteteTpl = null;
45
	private String identificationTpl = null;
48
	private String identificationTpl = null;
46
	private String personnelTpl = null;
Line 49... Line 47...
49
	private String personnelTpl = null;
47
	private String tableauPersonnelTpl = null;
50
	private String tableauPersonnelTpl = null;
48
	private String lignePersonnelTpl = null;
Line 63... Line 61...
63
	private TabPanel onglets = null;
61
	private TabPanel onglets = null;
64
	private TabItem identificationOnglet = null;
62
	private TabItem identificationOnglet = null;
65
	private TabItem personnelOnglet = null;
63
	private TabItem personnelOnglet = null;
66
	private TabItem conservationOnglet = null;
64
	private TabItem conservationOnglet = null;
67
	private TabItem valorisationOnglet = null;
65
	private TabItem valorisationOnglet = null;
68
	
-
 
69
	private Params identificationParams = null;
66
	private String typeTraitementConservationTpl;
70
	private Params personnelParams = null;
-
 
71
	private Params conservationParams = null;
-
 
Line 72... Line 67...
72
	
67
	
73
	public StructureDetailPanneauVue(Mediateur mediateurCourant) {
68
	public StructureDetailPanneauVue(Mediateur mediateurCourant) {
74
		mediateur = mediateurCourant;
69
		mediateur = mediateurCourant;
75
		i18nC = mediateur.i18nC; 
70
		i18nC = mediateur.i18nC; 
-
 
71
		initialiserTousLesTpl();
-
 
72
		ontologie = new HashMap<String, Valeur>();
Line 76... Line 73...
76
		initialiserTousLesTpl();
73
		chargerOntologie();
77
		
74
		
78
		setLayout(new FitLayout());
75
		setLayout(new FitLayout());
Line 79... Line -...
79
		setBorders(false);
-
 
80
		setScrollMode(Scroll.AUTO);
-
 
81
		
-
 
82
		conservationParams  = new Params();
-
 
83
		
-
 
84
		mediateur.obtenirListeValeurEtRafraichir(this, "localStockage");
-
 
85
		mediateur.obtenirListeValeurEtRafraichir(this, "meubleStockage");
76
		setBorders(false);
86
		mediateur.obtenirListeValeurEtRafraichir(this, "parametreStockage");
77
		setScrollMode(Scroll.AUTO);
87
		
78
		
88
		panneauPrincipal = new ContentPanel();
79
		panneauPrincipal = new ContentPanel();
Line 121... Line 112...
121
		
112
		
122
		panneauPrincipal.add(onglets);
113
		panneauPrincipal.add(onglets);
123
		add(panneauPrincipal);
114
		add(panneauPrincipal);
Line -... Line 115...
-
 
115
	}
-
 
116
 
-
 
117
	private void chargerOntologie() {
-
 
118
		mediateur.selectionnerProjets(this);
-
 
119
		mediateur.obtenirListeValeurEtRafraichir(this, "stpr");
-
 
120
		mediateur.obtenirListeValeurEtRafraichir(this, "stpu");
-
 
121
		mediateur.obtenirListeValeurEtRafraichir(this, "statut");
-
 
122
		mediateur.obtenirListeValeurEtRafraichir(this, "fonction");
-
 
123
		mediateur.obtenirListeValeurEtRafraichir(this, "pays");
-
 
124
		mediateur.obtenirListeValeurEtRafraichir(this, "localStockage");
-
 
125
		mediateur.obtenirListeValeurEtRafraichir(this, "meubleStockage");
-
 
126
		mediateur.obtenirListeValeurEtRafraichir(this, "parametreStockage");
-
 
127
		mediateur.obtenirListeValeurEtRafraichir(this, "autreCollection");
-
 
128
		mediateur.obtenirListeValeurEtRafraichir(this, "onep");
-
 
129
		mediateur.obtenirListeValeurEtRafraichir(this, "opRestau");
-
 
130
		mediateur.obtenirListeValeurEtRafraichir(this, "autreMateriel");
-
 
131
		mediateur.obtenirListeValeurEtRafraichir(this, "poisonTraitement");
-
 
132
		mediateur.obtenirListeValeurEtRafraichir(this, "insecteTraitement");
-
 
133
		mediateur.obtenirListeValeurEtRafraichir(this, "actionValorisation");
-
 
134
		mediateur.obtenirListeValeurEtRafraichir(this, "continentEtFr");
-
 
135
		mediateur.obtenirListeValeurEtRafraichir(this, "typeRecherche");
124
	}
136
	}
125
 
137
 
126
	private void afficherDetailInstitution() {
138
	private void afficherDetailInstitution() {
127
		if (structure != null) {
139
		if (structure != null) {
128
			personnel = structure.getPersonnel();
140
			personnel = structure.getPersonnel();
Line 151... Line 163...
151
		
163
		
152
		enteteParams.set("nom", structure.getNom());
164
		enteteParams.set("nom", structure.getNom());
153
		enteteParams.set("ville", structure.getVille());
165
		enteteParams.set("ville", structure.getVille());
154
		enteteParams.set("id", structure.getId());
166
		enteteParams.set("id", structure.getId());
155
		enteteParams.set("guid", structure.getGuid());
167
		enteteParams.set("guid", structure.getGuid());
Line 156... Line 168...
156
		enteteParams.set("projet", structure.getIdProjet());
168
		enteteParams.set("projet", construireTxtprojet(structure.getIdProjet()));
157
		
169
		
158
		String eHtml = Format.substitute(enteteTpl, enteteParams);
170
		String eHtml = Format.substitute(enteteTpl, enteteParams);
Line 159... Line 171...
159
		entete.getElement().setInnerHTML(eHtml);
171
		entete.getElement().setInnerHTML(eHtml);
160
	}
172
	}
161
	
173
	
162
	private void afficherIdentification() {
174
	private void afficherIdentification() {
163
		identificationParams = new Params();
175
		Params identificationParams = new Params();
164
		identificationParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
176
		identificationParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
Line 187... Line 199...
187
		identificationParams.set("i18n_fax", mediateur.i18nC.fax());
199
		identificationParams.set("i18n_fax", mediateur.i18nC.fax());
188
		identificationParams.set("i18n_courriel", mediateur.i18nC.courriel());
200
		identificationParams.set("i18n_courriel", mediateur.i18nC.courriel());
189
		identificationParams.set("i18n_acces", mediateur.i18nC.acces());
201
		identificationParams.set("i18n_acces", mediateur.i18nC.acces());
190
		identificationParams.set("i18n_web", mediateur.i18nC.siteWeb());
202
		identificationParams.set("i18n_web", mediateur.i18nC.siteWeb());
Line -... Line 203...
-
 
203
 
-
 
204
		String acronyme = construireTxtTruck(structure.getIdAlternatif());
-
 
205
		String typePrive = construireTxtListeOntologie(structure.getTypePrive());
-
 
206
		String typePublic = construireTxtListeOntologie(structure.getTypePublic());
-
 
207
		String pays = construireTxtListeOntologie(structure.getPays());
-
 
208
		String web = construireTxtTruck(structure.getUrl());
191
		
209
		
192
		identificationParams.set("acronyme", structure.getIdAlternatif());
210
		identificationParams.set("acronyme", acronyme);
193
		identificationParams.set("statut", structure.getTypePrive()+structure.getTypePublic());
211
		identificationParams.set("statut", typePrive+typePublic);
194
		identificationParams.set("date_fondation", structure.getDateFondationFormatLong());
212
		identificationParams.set("date_fondation", structure.getDateFondationFormatLong());
Line 195... Line 213...
195
		identificationParams.set("nbre_personnel", structure.getNbrePersonne());
213
		identificationParams.set("nbre_personnel", structure.getNbrePersonne());
Line 196... Line 214...
196
		
214
		
197
		identificationParams.set("description", structure.getDescription());
215
		identificationParams.set("description", structure.getDescription());
198
		
216
		
199
		identificationParams.set("adresse", structure.getAdresse());
217
		identificationParams.set("adresse", structure.getAdresse());
200
		identificationParams.set("cp", structure.getCodePostal());
218
		identificationParams.set("cp", structure.getCodePostal());
Line 201... Line 219...
201
		identificationParams.set("ville", structure.getVille());
219
		identificationParams.set("ville", structure.getVille());
202
		identificationParams.set("region", structure.getRegion());
220
		identificationParams.set("region", structure.getRegion());
203
		identificationParams.set("pays", structure.getPays());
221
		identificationParams.set("pays", pays);
204
		
222
		
205
		identificationParams.set("tel", structure.getTelephone());
223
		identificationParams.set("tel", structure.getTelephone());
Line 206... Line 224...
206
		identificationParams.set("fax", structure.getFax());
224
		identificationParams.set("fax", structure.getFax());
207
		identificationParams.set("courriel", structure.getCourriel());
225
		identificationParams.set("courriel", structure.getCourriel());
Line 208... Line 226...
208
		identificationParams.set("acces", structure.getConditionAcces());
226
		identificationParams.set("acces", structure.getConditionAcces());
209
		identificationParams.set("web", structure.getUrl());
227
		identificationParams.set("web", web);
210
		
228
		
211
		afficherOnglet(identificationTpl, identificationParams, identificationOnglet);
229
		afficherOnglet(identificationTpl, identificationParams, identificationOnglet);
212
	}
230
	}
Line 213... Line 231...
213
	
231
	
214
	private void afficherPersonnel() {
232
	private void afficherPersonnel() {
215
		String tableauPersonnelHtml = "";
233
		String tableauPersonnelHtml = "";
216
		if (personnel.size() > 0) {
234
		if (personnel.size() > 0) {
217
			tableauPersonnelHtml = construireTableauDuPersonnel();
235
			tableauPersonnelHtml = construireTableauDuPersonnel();
218
		}
236
		}
Line 244... Line 262...
244
		String lignesPersonnel = ""; 
262
		String lignesPersonnel = ""; 
245
		Iterator<String> it = personnel.keySet().iterator();
263
		Iterator<String> it = personnel.keySet().iterator();
246
		while (it.hasNext()) {
264
		while (it.hasNext()) {
247
			StructureAPersonne personne = personnel.get(it.next());
265
			StructureAPersonne personne = personnel.get(it.next());
248
			Params ligneParams = new Params();
266
			Params ligneParams = new Params();
-
 
267
			
-
 
268
			String fonction = construireTxtListeOntologie(personne.getFonction());
-
 
269
			String statut = construireTxtListeOntologie(personne.getStatut());
-
 
270
			String contact = formaterOuiNon(personne.getContact());
-
 
271
			
249
			ligneParams.set("fonction", personne.getFonction());
272
			ligneParams.set("fonction", fonction);
250
			ligneParams.set("prenom", personne.getPrenom());
273
			ligneParams.set("prenom", personne.getPrenom());
251
			ligneParams.set("nom", personne.getNom());
274
			ligneParams.set("nom", personne.getNom());
252
			ligneParams.set("tel", personne.getTelephone());
275
			ligneParams.set("tel", personne.getTelephone());
253
			ligneParams.set("fax", personne.getFax());
276
			ligneParams.set("fax", personne.getFax());
254
			ligneParams.set("courriel", personne.getCourriel());
277
			ligneParams.set("courriel", personne.getCourriel());
255
			ligneParams.set("statut", personne.getStatut());
278
			ligneParams.set("statut", statut);
256
			ligneParams.set("tps_w", personne.getBotaTravailHebdoTps());
279
			ligneParams.set("tps_w", personne.getBotaTravailHebdoTps());
257
			ligneParams.set("specialite", personne.afficherSpecialite());
280
			ligneParams.set("specialite", personne.afficherSpecialite());
258
			ligneParams.set("contact", personne.getContact());
281
			ligneParams.set("contact", contact);
259
			lignesPersonnel += Format.substitute(lignePersonnelTpl, ligneParams);
282
			lignesPersonnel += Format.substitute(lignePersonnelTpl, ligneParams);
260
		}
283
		}
261
		contenuParams.set("lignes", lignesPersonnel);
284
		contenuParams.set("lignes", lignesPersonnel);
Line 262... Line 285...
262
		
285
		
263
		String cHtml = Format.substitute(tableauPersonnelTpl, contenuParams);
286
		String cHtml = Format.substitute(tableauPersonnelTpl, contenuParams);
264
		return cHtml;
287
		return cHtml;
Line 265... Line 288...
265
	}
288
	}
-
 
289
	
266
	
290
	private void afficherConservation() {
267
	private void afficherConservation() {
291
		Params conservationParams  = new Params();
268
		conservationParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
292
		conservationParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
269
		conservationParams.set("css_label", ComposantClass.LABEL);
293
		conservationParams.set("css_label", ComposantClass.LABEL);
Line 276... Line 300...
276
		
300
		
277
		conservationParams.set("i18n_titre_local", i18nC.titreLocal());
301
		conservationParams.set("i18n_titre_local", i18nC.titreLocal());
278
		conservationParams.set("i18n_local_specifique", i18nC.localSpecifique());
302
		conservationParams.set("i18n_local_specifique", i18nC.localSpecifique());
279
		conservationParams.set("i18n_meuble_specifique", i18nC.meubleSpecifique());
303
		conservationParams.set("i18n_meuble_specifique", i18nC.meubleSpecifique());
-
 
304
		conservationParams.set("i18n_local_parametre", i18nC.localParametre());
-
 
305
		conservationParams.set("i18n_conservation_en_commun", i18nC.conservationEnCommun());
-
 
306
		conservationParams.set("i18n_acces_controle", i18nC.accesControle());
-
 
307
		
-
 
308
		conservationParams.set("i18n_titre_operation", i18nC.titreOperation());
-
 
309
		conservationParams.set("i18n_restauration", i18nC.restauration());
-
 
310
		conservationParams.set("i18n_materiel_conservation", i18nC.materielConservation());
-
 
311
		conservationParams.set("i18n_traitement", i18nC.traitement());
-
 
312
		
-
 
313
		conservationParams.set("i18n_titre_acquisition", i18nC.titreAcquisition());
-
 
314
		conservationParams.set("i18n_acquisition_collection", i18nC.acquisitionCollection());
Line 280... Line 315...
280
		conservationParams.set("i18n_local_parametre", i18nC.localParametre());
315
		conservationParams.set("i18n_acquisition_echantillon", i18nC.acquisitionEchantillon());
281
		
316
		
282
		conservationParams.set("formation", formaterOuiNon(conservation.getFormation()));
317
		conservationParams.set("formation", formaterOuiNon(conservation.getFormation()));
283
		conservationParams.set("formation_info", formaterSautDeLigne(conservation.getFormationInfo()));
318
		conservationParams.set("formation_info", formaterSautDeLigne(conservation.getFormationInfo()));
Line -... Line 319...
-
 
319
		conservationParams.set("formation_interet", formaterOuiNon(conservation.getFormationInteret()));
-
 
320
		conservationParams.set("meuble_specifique", conservation.getStockageMeuble());
-
 
321
		
-
 
322
		String chaineAAnalyser = conservation.getStockageLocal();
-
 
323
		String chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
-
 
324
		conservationParams.set("local_specifique", chaineAAfficher);
284
		conservationParams.set("formation_interet", formaterOuiNon(conservation.getFormationInteret()));
325
		
-
 
326
		chaineAAnalyser = conservation.getStockageMeuble();
-
 
327
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
-
 
328
		conservationParams.set("meuble_specifique", chaineAAfficher);
285
		conservationParams.set("meuble_specifique", conservation.getStockageMeuble());
329
		
-
 
330
		chaineAAnalyser = conservation.getStockageParametre();
-
 
331
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
-
 
332
		conservationParams.set("local_parametre", chaineAAfficher);
-
 
333
		
-
 
334
		conservationParams.set("conservation_en_commun", formaterOuiNon(conservation.getCollectionCommune()));
-
 
335
		chaineAAnalyser = conservation.getCollectionAutre();
-
 
336
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
-
 
337
		conservationParams.set("collection_autre", formaterParenthese(chaineAAfficher));
-
 
338
		
-
 
339
		conservationParams.set("acces_controle", formaterOuiNon(conservation.getAccesControle()));
-
 
340
		
-
 
341
		conservationParams.set("restauration", formaterOuiNon(conservation.getRestauration()));
-
 
342
		chaineAAnalyser = conservation.getRestaurationOperation();
-
 
343
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
-
 
344
		conservationParams.set("restauration_operation", formaterParenthese(chaineAAfficher));
-
 
345
		
-
 
346
		chaineAAnalyser = conservation.getMaterielConservation();
-
 
347
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
-
 
348
		conservationParams.set("materiel_conservation", chaineAAfficher);
-
 
349
		chaineAAnalyser = conservation.getMaterielAutre();
-
 
350
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
-
 
351
		conservationParams.set("materiel_autre", formaterParenthese(chaineAAfficher));
-
 
352
		
-
 
353
		conservationParams.set("traitement", formaterOuiNon(conservation.getTraitement()));
-
 
354
		chaineAAnalyser = conservation.getTraitements();
-
 
355
		chaineAAfficher = construireTxtListeOntologie(chaineAAnalyser);
-
 
356
		conservationParams.set("traitements", formaterParenthese(chaineAAfficher));
-
 
357
		
Line 286... Line 358...
286
		
358
		conservationParams.set("acquisition_collection", formaterOuiNon(conservation.getAcquisitionCollection()));
287
		conservationParams.set("meuble_specifique", conservation.getStockageMeuble());
359
		conservationParams.set("acquisition_echantillon", formaterOuiNon(conservation.getAcquisitionEchantillon()));
Line -... Line 360...
-
 
360
		conservationParams.set("acquisition_traitement_info", construireTraitement());
-
 
361
		
-
 
362
		afficherOnglet(conservationTpl, conservationParams, conservationOnglet);
-
 
363
	}
-
 
364
	
-
 
365
	private String construireTraitement() {
-
 
366
		String cHtml = "";
-
 
367
		String echantillon = conservation.getAcquisitionEchantillon();
-
 
368
		
-
 
369
		if (echantillon.equals("1")) {
-
 
370
			Params traitementConservationParams  = new Params();
-
 
371
			traitementConservationParams.set("css_label", ComposantClass.LABEL);
-
 
372
			traitementConservationParams.set("i18n_acquisition_traitement", i18nC.acquisitionTraitement());
-
 
373
			
-
 
374
			traitementConservationParams.set("acquisition_traitement", formaterOuiNon(conservation.getAcquisitionTraitement()));
-
 
375
			
-
 
376
			traitementConservationParams.set("acquisition_traitement_type_info", construireTraitementType());
-
 
377
			
-
 
378
			cHtml = Format.substitute(traitementConservationTpl, traitementConservationParams);
-
 
379
		}
-
 
380
		
-
 
381
		return cHtml;
-
 
382
	}
-
 
383
	
-
 
384
	private String construireTraitementType() {
-
 
385
		String cHtml = "";
-
 
386
		String traitement = conservation.getAcquisitionTraitement();
-
 
387
		
-
 
388
		if (traitement.equals("1")) {
-
 
389
			Params typeTraitementParams  = new Params();
-
 
390
			typeTraitementParams.set("css_indentation", ComposantClass.INDENTATION);
-
 
391
			typeTraitementParams.set("css_label", ComposantClass.LABEL);
-
 
392
			typeTraitementParams.set("i18n_acquisition_traitement_insecte", i18nC.acquisitionTraitementInsecte());
-
 
393
			typeTraitementParams.set("i18n_acquisition_traitement_poison", i18nC.acquisitionTraitementPoison());
-
 
394
			
-
 
395
			String acquisitionTraitementInsecte = construireTxtListeOntologie(conservation.getAcquisitionTraitementInsecte());
-
 
396
			typeTraitementParams.set("acquisition_traitement_insecte", acquisitionTraitementInsecte);
-
 
397
			String acquisitionTraitementPoison = construireTxtListeOntologie(conservation.getAcquisitionTraitementPoison());
-
 
398
			typeTraitementParams.set("acquisition_traitement_poison", acquisitionTraitementPoison);
-
 
399
			
-
 
400
			cHtml = Format.substitute(typeTraitementConservationTpl, typeTraitementParams);
288
		conservationParams.set("local_parametre", conservation.getStockageParametre());
401
		}
289
		
402
		
290
		afficherOnglet(conservationTpl, conservationParams, conservationOnglet);
403
		return cHtml;
291
	}
404
	}
292
	
405
	
293
	private void afficherOnglet(String template, Params parametres, TabItem onglet) {
406
	private void afficherOnglet(String template, Params parametres, TabItem onglet) {
Line -... Line 407...
-
 
407
		String cHtml = Format.substitute(template, parametres);
-
 
408
		HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
-
 
409
		onglet.removeAll();
-
 
410
		onglet.add(corpsConteneurDuHtml);		
-
 
411
	}
-
 
412
	
-
 
413
	private String formaterParenthese(String chaineAAfficher) {
-
 
414
		if (!chaineAAfficher.equals("")) {
-
 
415
			chaineAAfficher = "("+chaineAAfficher+")";
-
 
416
		}
-
 
417
		return chaineAAfficher;
-
 
418
	}
-
 
419
	
-
 
420
	private String formaterAutre(String chaineAAfficher) {
-
 
421
		if (!chaineAAfficher.equals("")) {
-
 
422
			chaineAAfficher = " ["+i18nC.autres()+" : "+chaineAAfficher+"]";
-
 
423
		}
-
 
424
		return chaineAAfficher;
-
 
425
	}
-
 
426
	
-
 
427
	private String formaterTableauDeTxt(ArrayList<String> tableauDeTxt) {
-
 
428
		String chaineAAfficher = "";
-
 
429
		int tailleDuTableau = tableauDeTxt.size();
-
 
430
		if (tailleDuTableau > 0) {
-
 
431
			int indexAvtDernier = tailleDuTableau - 1;
-
 
432
			for (int i = 0; i < tailleDuTableau; i++)	{
-
 
433
				String mot = tableauDeTxt.get(i);
-
 
434
				if (i != indexAvtDernier) {
-
 
435
					chaineAAfficher += mot+", ";
-
 
436
				} else {
-
 
437
					chaineAAfficher += nettoyerPointFinal(mot)+".";
294
		String cHtml = Format.substitute(template, parametres);
438
				}
295
		HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
439
			}
296
		onglet.removeAll();
440
		}
297
		onglet.add(corpsConteneurDuHtml);		
441
		return chaineAAfficher;
298
	}
442
	}
Line 310... Line 454...
310
	private String formaterSautDeLigne(String chaineAFormater) {
454
	private String formaterSautDeLigne(String chaineAFormater) {
311
		String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl);
455
		String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl);
312
		return txtARetourner;
456
		return txtARetourner;
313
	}
457
	}
Line -... Line 458...
-
 
458
 
-
 
459
	private String formaterValeurTruck(String valeur) {
-
 
460
		String chaineARetourner = "";
-
 
461
		
-
 
462
		if (valeur.matches("^[^#]+##[^$]+$"))	{
-
 
463
			String[] cleValeur = valeur.split("##");
-
 
464
			chaineARetourner = cleValeur[1]+" "+formaterParenthese(cleValeur[0]);
-
 
465
		} else if (!valeur.equals(""))	{
-
 
466
			chaineARetourner = valeur;
-
 
467
		} else {
-
 
468
			GWT.log("Valeur truck posant problèlme :"+valeur, null);
-
 
469
		}
-
 
470
		
-
 
471
		return chaineARetourner;
-
 
472
	}
-
 
473
 
-
 
474
	private String nettoyerPointFinal(String mot) {
-
 
475
		mot = mot.replaceAll("[.]$", "");
-
 
476
		return mot;
-
 
477
	}
314
 
478
	
315
	private void initialiserTousLesTpl() {
479
	private void initialiserTousLesTpl() {
316
		initialiserEnteteHtmlTpl();
480
		initialiserEnteteHtmlTpl();
317
		initialiserIdentificationTpl();
481
		initialiserIdentificationTpl();
318
		initialiserPersonnelTpl();
482
		initialiserPersonnelTpl();
319
		initialiserTableauPersonnelTpl();
483
		initialiserTableauPersonnelTpl();
320
		initialiserLignePersonnelTpl();
484
		initialiserLignePersonnelTpl();
-
 
485
		initialiserConservationTpl();
-
 
486
		initialiserTraitementConservationTpl();
321
		initialiserConservationTpl();
487
		initialiserTypeTraitementConservationTpl();
322
		initialiserValorisationTpl();
488
		initialiserValorisationTpl();
323
		initialiserSautLigneTpl();
489
		initialiserSautLigneTpl();
Line 324... Line 490...
324
	}
490
	}
-
 
491
	
325
	
492
	private void initialiserEnteteHtmlTpl() {
326
	private void initialiserEnteteHtmlTpl() {
493
		enteteTpl = 	
327
		enteteTpl = 	"<div id='{css_id}'>"+
494
			"<div id='{css_id}'>"+
328
						"	<h1>{nom}</h1>"+
495
			"	<h1>{nom}</h1>"+
329
						"	<h2>{ville}<span class='{css_meta}'>{projet} - {id} - {guid}</span></h2>" +
496
			"	<h2>{ville}<span class='{css_meta}'>{projet} - {id} - {guid}</span></h2>" +
330
						"	" +
497
			"	" +
Line 426... Line 593...
426
						"	<div class='{css_fieldset}'>"+
593
			"	<div class='{css_fieldset}'>"+
427
						"		<h2>{i18n_titre_local}</h2>"+
594
			"		<h2>{i18n_titre_local}</h2>"+
428
						"		<span class='{css_label}'>{i18n_local_specifique} :</span> {local_specifique}<br />"+
595
			"		<span class='{css_label}'>{i18n_local_specifique} :</span> {local_specifique}<br />"+
429
						"		<span class='{css_label}'>{i18n_meuble_specifique} :</span> {meuble_specifique}<br />"+
596
			"		<span class='{css_label}'>{i18n_meuble_specifique} :</span> {meuble_specifique}<br />"+
430
						"		<span class='{css_label}'>{i18n_local_parametre} :</span> {local_parametre}<br />"+
597
			"		<span class='{css_label}'>{i18n_local_parametre} :</span> {local_parametre}<br />"+
431
						"		<span class='{css_label}'>{i18n_conservation_en_commun} :</span> {conservation_en_commun}<br />"+
598
			"		<span class='{css_label}'>{i18n_conservation_en_commun} :</span> {conservation_en_commun} {collection_autre}<br />"+
432
						"		<span class='{css_label}'>{i18n_acces_control} :</span> {acces_control}<br />"+
599
			"		<span class='{css_label}'>{i18n_acces_controle} :</span> {acces_controle}<br />"+
433
						"	</div>"+
600
			"	</div>"+
434
						"	<hr class='{css_clear}'/>"+
601
			"	<hr class='{css_clear}'/>"+
-
 
602
			"	<div class='{css_fieldset}'>"+
-
 
603
			"		<h2>{i18n_titre_operation}</h2>"+
-
 
604
			"		<span class='{css_label}'>{i18n_restauration} :</span> {restauration} {restauration_operation}<br />"+
-
 
605
			"		<span class='{css_label}'>{i18n_materiel_conservation} :</span> {materiel_conservation} {materiel_autre}<br />"+
-
 
606
			"		<span class='{css_label}'>{i18n_traitement} :</span> {traitement} {traitements}<br />"+
-
 
607
			"	</div>"+
-
 
608
			"	<div class='{css_fieldset}'>"+
-
 
609
			"		<h2>{i18n_titre_acquisition}</h2>"+
-
 
610
			"		<span class='{css_label}'>{i18n_acquisition_collection} :</span> {acquisition_collection}<br />"+
-
 
611
			"		<span class='{css_label}'>{i18n_acquisition_echantillon} :</span> {acquisition_echantillon}<br />"+
-
 
612
			"			{acquisition_traitement_info}" +	
-
 
613
			"	</div>"+
435
						"</div>";
614
			"</div>";
436
	}
615
	}
Line -... Line 616...
-
 
616
	
-
 
617
	private void initialiserTraitementConservationTpl() {
-
 
618
		traitementConservationTpl =
-
 
619
			"<span class='{css_label}'>{i18n_acquisition_traitement} :</span> {acquisition_traitement}<br />"+
-
 
620
			"	{acquisition_traitement_type_info}";
-
 
621
	}
-
 
622
	
-
 
623
	private void initialiserTypeTraitementConservationTpl() {
-
 
624
		typeTraitementConservationTpl =
-
 
625
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_insecte} :</span> {acquisition_traitement_insecte}<br />"+
-
 
626
			"<span class='{css_indentation} {css_label}'>{i18n_acquisition_traitement_poison} :</span> {acquisition_traitement_poison}<br />";
-
 
627
	}
437
	
628
	
438
	private void initialiserValorisationTpl() {
629
	private void initialiserValorisationTpl() {
439
		valorisationTpl =
630
		valorisationTpl =
440
						"<div class='{css_corps}'>"+
631
			"<div class='{css_corps}'>"+
441
						"	<div class='{css_fieldset}'>"+
632
			"	<div class='{css_fieldset}'>"+
Line 457... Line 648...
457
		
648
		
458
	public void rafraichir(Object nouvelleDonnees) {
649
	public void rafraichir(Object nouvelleDonnees) {
459
		if (nouvelleDonnees instanceof Structure) {
650
		if (nouvelleDonnees instanceof Structure) {
460
			structure = (Structure) nouvelleDonnees;
651
			structure = (Structure) nouvelleDonnees;
-
 
652
			afficherDetailInstitution();
-
 
653
		} else if (nouvelleDonnees instanceof ProjetListe) {
-
 
654
			projets = (ProjetListe) nouvelleDonnees;
-
 
655
		} else if (nouvelleDonnees instanceof ValeurListe) {
-
 
656
			ValeurListe ontologieReceptionnee = (ValeurListe) nouvelleDonnees;
461
			afficherDetailInstitution();
657
			ajouterListeValeursAOntologie(ontologieReceptionnee);
462
		} else if (nouvelleDonnees instanceof Information) {
658
		} else if (nouvelleDonnees instanceof Information) {
463
			Information info = (Information) nouvelleDonnees;
659
			Information info = (Information) nouvelleDonnees;
464
			if (info.getType().equals("liste_structure_a_personne")) {
660
			if (info.getType().equals("liste_structure_a_personne")) {
465
				allouerPersonnelAStructure((StructureAPersonneListe) info.getDonnee(0));
661
				allouerPersonnelAStructure((StructureAPersonneListe) info.getDonnee(0));
466
				afficherDetailInstitution();
662
				afficherDetailInstitution();
467
			}
663
			}
468
		} else if (nouvelleDonnees instanceof ValeurListe) {
664
		} else {
-
 
665
			GWT.log("Pas de correspondance dans la méthode rafraichir() de la classe "+this.getClass(), null);
469
			ValeurListe ontologie = (ValeurListe) nouvelleDonnees;
666
		}
470
			
-
 
471
			if (ontologie.size() > 0) {
-
 
Line 472... Line 667...
472
				Configuration config = (Configuration) Registry.get(RegistreId.CONFIG);
667
	}
473
				
668
	
-
 
669
	private void ajouterListeValeursAOntologie(ValeurListe ontologieReceptionnee) {
474
				if (ontologie.getId().equals(config.getListeId("localStockage"))) {
670
		Iterator<String> it = ontologieReceptionnee.keySet().iterator();
475
					String chaineAAnalyser = conservation.getStockageLocal();
671
		while (it.hasNext()) {
-
 
672
			String cle = it.next();
476
					String chaineAAfficher = construireTxtListeOntologie(ontologie, chaineAAnalyser);
673
			Valeur valeur = ontologieReceptionnee.get(cle);
477
					conservationParams.set("local_specifique", chaineAAfficher);
674
			if (valeur != null) {
478
					GWT.log(chaineAAfficher, null);
675
				ontologie.put(cle, valeur);
-
 
676
			}
-
 
677
		}
-
 
678
	}
-
 
679
 
-
 
680
	protected String construireTxtprojet(String idProjet) {
479
				}
681
		String chaineARetourner = idProjet;
480
			}
682
		
-
 
683
		if (projets != null) {
-
 
684
			Projet projet = projets.get(idProjet);
-
 
685
			String nomDuProjet = projet.getNom();
481
		} else {
686
			if  (!nomDuProjet.equals("")) {
482
			GWT.log("Pas de correspondance dans la méthode rafraichir() de la classe "+this.getClass(), null);
687
				chaineARetourner = nomDuProjet;
Line -... Line 688...
-
 
688
			}
-
 
689
		}
-
 
690
		
483
		}
691
		return chaineARetourner;
-
 
692
	}
484
	}
693
	
485
	
694
	protected String construireTxtListeOntologie(String chaineAAnalyser) {
486
	protected String construireTxtListeOntologie(ValeurListe ontologie, String chaineAAnalyser) {
695
		ArrayList<String> termes = new ArrayList<String>();
487
		String chaineAAfficher = "";
696
		ArrayList<String> autres = new ArrayList<String>();
488
		if ((chaineAAnalyser != null) && (!chaineAAnalyser.trim().equals("")))	{
697
		if ((chaineAAnalyser != null) && (!chaineAAnalyser.trim().equals("")))	{
489
			String[] valeurs = chaineAAnalyser.split(";;");
698
			String[] valeurs = chaineAAnalyser.split(";;");
-
 
699
			int nbreValeurs = valeurs.length;
490
			int nbreValeurs = valeurs.length;
700
			if (nbreValeurs > 0)	{
-
 
701
				for (int i = 0; i < nbreValeurs; i++)	{
-
 
702
					String id = valeurs[i];
-
 
703
					if (id.contains("AUTRE##"))	{
491
			if (nbreValeurs > 0)	{
704
						String txt = id.replaceFirst("^AUTRE##", "");
-
 
705
						if (!txt.equals("")) {
492
				for (int i = 0; i < nbreValeurs; i++)	{
706
							autres.add(txt);
493
					if (valeurs[i].contains("##"))	{
707
						}
494
						
708
					} else if (id.matches("^[0-9]+$"))	{
495
					} else {
709
						if (ontologie != null) {
496
						Valeur valeur = ontologie.get(valeurs[i]);
-
 
497
						if (valeur != null) {
710
							Valeur valeur = ontologie.get(id);
498
							String termeOntologie = valeur.getNom();
711
							if (valeur != null) {
499
							if (i != (nbreValeurs - 1)) {
-
 
500
								termeOntologie += ", ";
-
 
501
							}
712
								String termeOntologie = valeur.getNom();
502
							chaineAAfficher += termeOntologie;
713
								termes.add(termeOntologie);
503
							GWT.log("Valeur :"+valeurs[i]+" - Ontologie :"+valeur.getNom(), null);
714
							}
504
						}
715
						}
505
					}
716
					}
-
 
717
				}
-
 
718
			}
-
 
719
		}
-
 
720
		
-
 
721
		String chaineTermes = formaterTableauDeTxt(termes);
506
				}
722
		String chaineAutres = formaterTableauDeTxt(autres);
-
 
723
		String chaineARetourner = chaineTermes+formaterAutre(chaineAutres);
-
 
724
		
-
 
725
		return chaineARetourner;
-
 
726
	}
-
 
727
	
-
 
728
	protected String construireTxtTruck(String chaineAAnalyser) {
-
 
729
		ArrayList<String> termes = new ArrayList<String>();
-
 
730
		
-
 
731
		if ((chaineAAnalyser != null) && (!chaineAAnalyser.trim().equals("")))	{
-
 
732
			String[] valeurs = chaineAAnalyser.split(";;");
-
 
733
			int nbreValeurs = valeurs.length;
-
 
734
			if (nbreValeurs > 0)	{
-
 
735
				for (int i = 0; i < nbreValeurs; i++)	{
-
 
736
					String valeur = valeurs[i];
-
 
737
					String valeurFormatee = formaterValeurTruck(valeur);
-
 
738
					termes.add(valeurFormatee);
-
 
739
				}
-
 
740
			}
-
 
741
		}
507
			}
742
		
Line 508... Line 743...
508
		}
743
		String chaineARetourner = formaterTableauDeTxt(termes);
509
		return chaineAAfficher;
744
		return chaineARetourner;
510
	}
745
	}