Subversion Repositories eFlore/Applications.coel

Rev

Rev 1044 | Rev 1292 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1044 Rev 1121
1
package org.tela_botanica.client.vues;
1
package org.tela_botanica.client.vues;
2
 
2
 
3
import java.util.ArrayList;
3
import java.util.ArrayList;
4
import java.util.HashMap;
4
import java.util.HashMap;
5
import java.util.Iterator;
5
import java.util.Iterator;
6
 
6
 
7
import org.tela_botanica.client.ComposantClass;
7
import org.tela_botanica.client.ComposantClass;
8
import org.tela_botanica.client.Mediateur;
8
import org.tela_botanica.client.Mediateur;
9
import org.tela_botanica.client.RegistreId;
9
import org.tela_botanica.client.RegistreId;
10
import org.tela_botanica.client.configuration.Configuration;
10
import org.tela_botanica.client.configuration.Configuration;
11
import org.tela_botanica.client.i18n.Constantes;
11
import org.tela_botanica.client.i18n.Constantes;
12
import org.tela_botanica.client.interfaces.Rafraichissable;
12
import org.tela_botanica.client.interfaces.Rafraichissable;
13
import org.tela_botanica.client.modeles.Valeur;
13
import org.tela_botanica.client.modeles.Valeur;
14
import org.tela_botanica.client.modeles.ValeurListe;
14
import org.tela_botanica.client.modeles.ValeurListe;
15
import org.tela_botanica.client.modeles.aDonnee;
15
import org.tela_botanica.client.modeles.aDonnee;
16
import org.tela_botanica.client.modeles.projet.Projet;
16
import org.tela_botanica.client.modeles.projet.Projet;
17
import org.tela_botanica.client.modeles.projet.ProjetListe;
17
import org.tela_botanica.client.modeles.projet.ProjetListe;
18
import org.tela_botanica.client.util.Debug;
18
import org.tela_botanica.client.util.Debug;
19
import org.tela_botanica.client.util.UtilString;
19
import org.tela_botanica.client.util.UtilString;
20
 
20
 
21
import com.extjs.gxt.ui.client.Registry;
21
import com.extjs.gxt.ui.client.Registry;
22
import com.extjs.gxt.ui.client.Style.Scroll;
22
import com.extjs.gxt.ui.client.Style.Scroll;
23
import com.extjs.gxt.ui.client.util.Format;
23
import com.extjs.gxt.ui.client.util.Format;
24
import com.extjs.gxt.ui.client.util.Params;
24
import com.extjs.gxt.ui.client.util.Params;
25
import com.extjs.gxt.ui.client.widget.HtmlContainer;
25
import com.extjs.gxt.ui.client.widget.HtmlContainer;
26
import com.extjs.gxt.ui.client.widget.LayoutContainer;
26
import com.extjs.gxt.ui.client.widget.LayoutContainer;
27
import com.extjs.gxt.ui.client.widget.TabItem;
27
import com.extjs.gxt.ui.client.widget.TabItem;
28
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
28
import com.extjs.gxt.ui.client.widget.layout.FitLayout;
29
import com.google.gwt.core.client.GWT;
29
import com.google.gwt.core.client.GWT;
30
 
30
 
31
public abstract class DetailVue extends LayoutContainer implements Rafraichissable {
31
public abstract class DetailVue extends LayoutContainer implements Rafraichissable {
32
 
32
 
33
	protected Mediateur mediateur = null;
33
	protected Mediateur mediateur = null;
34
	protected Constantes i18nC = null;
34
	protected Constantes i18nC = null;
35
 
35
 
36
	protected HashMap<String, Valeur> ontologie = null;
36
	protected HashMap<String, Valeur> ontologie = null;
37
	protected boolean ontologieChargementOk = false;
37
	protected boolean ontologieChargementOk = false;
38
	private HashMap<Integer, String> ontologiesEnAttenteDeReception = null;
38
	private HashMap<Integer, String> ontologiesEnAttenteDeReception = null;
39
	
39
	
40
	protected ProjetListe projets = null;
40
	protected ProjetListe projets = null;
41
	protected boolean projetsChargementOk = false;
41
	protected boolean projetsChargementOk = false;
42
	
42
	
43
	protected String sautLigneTpl = null;
43
	protected String sautLigneTpl = null;
44
	
44
	
45
	public DetailVue(Mediateur mediateurCourant) {
45
	public DetailVue(Mediateur mediateurCourant) {
46
		mediateur = mediateurCourant;
46
		mediateur = mediateurCourant;
47
		i18nC = Mediateur.i18nC;
47
		i18nC = Mediateur.i18nC;
48
		
48
		
49
		initialiserSautLigneTpl();
49
		initialiserSautLigneTpl();
50
		
50
		
51
		ontologie = new HashMap<String, Valeur>();
51
		ontologie = new HashMap<String, Valeur>();
52
		ontologieChargementOk = false;
52
		ontologieChargementOk = false;
53
		ontologiesEnAttenteDeReception = new HashMap<Integer, String>();
53
		ontologiesEnAttenteDeReception = new HashMap<Integer, String>();
54
		chargerProjets();
54
		chargerProjets();
55
		
55
		
56
		setLayout(new FitLayout());
56
		setLayout(new FitLayout());
57
		setBorders(false);
57
		setBorders(false);
58
		setScrollMode(Scroll.AUTO);
58
		setScrollMode(Scroll.AUTO);
59
	}
59
	}
60
	
60
	
61
	private void initialiserSautLigneTpl() {
61
	private void initialiserSautLigneTpl() {
62
		sautLigneTpl = "<br />\n";
62
		sautLigneTpl = "<br />\n";
63
	}
63
	}
64
	
64
	
65
	private void chargerProjets() {
65
	private void chargerProjets() {
66
		mediateur.selectionnerProjet(this, null);
66
		mediateur.selectionnerProjet(this, null);
67
	}
67
	}
68
		
68
		
69
	protected String construireTxtProjet(String idProjet) {
69
	protected String construireTxtProjet(String idProjet) {
70
		String chaineARetourner = idProjet;
70
		String chaineARetourner = idProjet;
71
		
71
		
72
		if (projets != null) {
72
		if (projets != null) {
73
			Projet projet = projets.get(idProjet);
73
			Projet projet = projets.get(idProjet);
74
			if (projet != null) {
74
			if (projet != null) {
75
				String nomDuProjet = projet.getNom();
75
				String nomDuProjet = projet.getNom();
76
				if  (!nomDuProjet.equals("")) {
76
				if  (!nomDuProjet.equals("")) {
77
					chaineARetourner = nomDuProjet;
77
					chaineARetourner = nomDuProjet;
78
				}
78
				}
79
			}
79
			}
80
		}
80
		}
81
		
81
		
82
		return chaineARetourner;
82
		return chaineARetourner;
83
	}
83
	}
84
		
84
		
85
	protected String construireTxtTruck(String chaineAAnalyser) {
85
	protected String construireTxtTruck(String chaineAAnalyser) {
86
		ArrayList<String> termes = new ArrayList<String>();
86
		ArrayList<String> termes = new ArrayList<String>();
87
		
87
		
88
		if ((chaineAAnalyser != null) && (!chaineAAnalyser.trim().equals("")))	{
88
		if ((chaineAAnalyser != null) && (!chaineAAnalyser.trim().equals("")))	{
89
			String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
89
			String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
90
			int nbreValeurs = valeurs.length;
90
			int nbreValeurs = valeurs.length;
91
			if (nbreValeurs > 0)	{
91
			if (nbreValeurs > 0)	{
92
				for (int i = 0; i < nbreValeurs; i++)	{
92
				for (int i = 0; i < nbreValeurs; i++)	{
93
					String valeur = valeurs[i];
93
					String valeur = valeurs[i];
94
					String valeurFormatee = formaterValeurTruck(valeur);
94
					String valeurFormatee = formaterValeurTruck(valeur);
95
					termes.add(valeurFormatee);
95
					termes.add(valeurFormatee);
96
				}
96
				}
97
			}
97
			}
98
		}
98
		}
99
		
99
		
100
		String chaineARetourner = formaterTableauDeTxt(termes);
100
		String chaineARetourner = formaterTableauDeTxt(termes);
101
		return chaineARetourner;
101
		return chaineARetourner;
102
	}
102
	}
103
	
103
	
104
	private String formaterValeurTruck(String valeur) {
104
	private String formaterValeurTruck(String valeur) {
105
		String chaineARetourner = "";
105
		String chaineARetourner = "";
106
		
106
		
107
		if (valeur.matches("^[^#]+##[^$]+$"))	{
107
		if (valeur.matches("^[^#]+##[^$]+$"))	{
108
			String[] cleValeur = valeur.split(aDonnee.SEPARATEUR_TYPE_VALEUR);
108
			String[] cleValeur = valeur.split(aDonnee.SEPARATEUR_TYPE_VALEUR);
109
			chaineARetourner = (UtilString.isEmpty(cleValeur[1]) || cleValeur[1].equals("null") ? aDonnee.VALEUR_NULL : cleValeur[1]) +" "+formaterParenthese(cleValeur[0]);
109
			chaineARetourner = (UtilString.isEmpty(cleValeur[1]) || cleValeur[1].equals("null") ? aDonnee.VALEUR_NULL : cleValeur[1]) +" "+formaterParenthese(cleValeur[0]);
110
		} else if (!valeur.equals(""))	{
110
		} else if (!valeur.equals(""))	{
111
			chaineARetourner = valeur;
111
			chaineARetourner = valeur;
112
		} else {
112
		} else {
113
			GWT.log("Valeur truck posant problème :"+valeur, null);
113
			GWT.log("Valeur truck posant problème :"+valeur, null);
114
		}
114
		}
115
		
115
		
116
		return chaineARetourner;
116
		return chaineARetourner;
117
	}
117
	}
118
	
118
	
119
	protected String formaterParenthese(String chaineAAfficher) {
119
	protected String formaterParenthese(String chaineAAfficher) {
120
		if (!chaineAAfficher.equals("")) {
120
		if (!chaineAAfficher.equals("")) {
121
			chaineAAfficher = "("+chaineAAfficher+")";
121
			chaineAAfficher = "("+chaineAAfficher+")";
122
		}
122
		}
123
		return chaineAAfficher;
123
		return chaineAAfficher;
124
	}
124
	}
125
	
125
	
126
	protected String formaterTableauDeTxt(ArrayList<String> tableauDeTxt) {
126
	protected String formaterTableauDeTxt(ArrayList<String> tableauDeTxt) {
127
		String chaineAAfficher = "";
127
		String chaineAAfficher = "";
128
		int tailleDuTableau = tableauDeTxt.size();
128
		int tailleDuTableau = tableauDeTxt.size();
129
		if (tailleDuTableau > 0) {
129
		if (tailleDuTableau > 0) {
130
			int indexAvtDernier = tailleDuTableau - 1;
130
			int indexAvtDernier = tailleDuTableau - 1;
131
			for (int i = 0; i < tailleDuTableau; i++)	{
131
			for (int i = 0; i < tailleDuTableau; i++)	{
132
				String mot = tableauDeTxt.get(i);
132
				String mot = tableauDeTxt.get(i);
133
				if (i != indexAvtDernier) {
133
				if (i != indexAvtDernier) {
134
					chaineAAfficher += mot+", ";
134
					chaineAAfficher += mot+", ";
135
				} else {
135
				} else {
136
					chaineAAfficher += nettoyerPointFinal(mot)+".";
136
					chaineAAfficher += nettoyerPointFinal(mot)+".";
137
				}
137
				}
138
			}
138
			}
139
		}
139
		}
140
		return UtilString.ucFirst(chaineAAfficher);
140
		return UtilString.ucFirst(chaineAAfficher);
141
	}
141
	}
142
	
142
	
143
	protected String nettoyerPointFinal(String mot) {
143
	protected String nettoyerPointFinal(String mot) {
144
		mot = mot.replaceAll("[.]$", "");
144
		mot = mot.replaceAll("[.]$", "");
145
		return mot;
145
		return mot;
146
	}
146
	}
147
	
147
	
148
	protected String formaterContenu(String template, Params parametres) {
148
	protected String formaterContenu(String template, Params parametres) {
149
		String cHtml = Format.substitute(template, parametres);
149
		String cHtml = Format.substitute(template, parametres);
150
		
150
		
151
		Params cssParams = new Params();
151
		Params cssParams = new Params();
-
 
152
		cssParams.set("css_lien_ext", ComposantClass.LIEN_EXTERNE);
152
		cssParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
153
		cssParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
153
		cssParams.set("css_label", ComposantClass.LABEL);
154
		cssParams.set("css_label", ComposantClass.LABEL);
154
		cssParams.set("css_indentation", ComposantClass.INDENTATION);
155
		cssParams.set("css_indentation", ComposantClass.INDENTATION);
155
		cssParams.set("css_fieldset", ComposantClass.FIELDSET);
156
		cssParams.set("css_fieldset", ComposantClass.FIELDSET);
156
		cssParams.set("css_clear", ComposantClass.CLEAR);
157
		cssParams.set("css_clear", ComposantClass.CLEAR);
157
		cHtml = Format.substitute(cHtml, cssParams);
158
		cHtml = Format.substitute(cHtml, cssParams);
158
		
159
		
159
		return cHtml;		
160
		return cHtml;		
160
	}
161
	}
161
	
162
	
162
	protected void afficherOnglet(String template, Params parametres, TabItem onglet) {
163
	protected void afficherOnglet(String template, Params parametres, TabItem onglet) {
163
		String cHtml = formaterContenu(template, parametres);
164
		String cHtml = formaterContenu(template, parametres);
164
		
165
		
165
		HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
166
		HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
166
		onglet.removeAll();
167
		onglet.removeAll();
167
		onglet.add(corpsConteneurDuHtml);		
168
		onglet.add(corpsConteneurDuHtml);		
168
	}
169
	}
169
	
170
	
170
	protected String formaterAutre(String chaineAAfficher) {
171
	protected String formaterAutre(String chaineAAfficher) {
171
		if (!chaineAAfficher.equals("")) {
172
		if (!chaineAAfficher.equals("")) {
172
			chaineAAfficher = " ["+i18nC.autres()+" : "+chaineAAfficher+"]";
173
			chaineAAfficher = " ["+i18nC.autres()+" : "+chaineAAfficher+"]";
173
		}
174
		}
174
		return chaineAAfficher;
175
		return chaineAAfficher;
175
	}
176
	}
176
	
177
	
177
	protected String formaterOuiNon(String chaineAFormater) {
178
	protected String formaterOuiNon(String chaineAFormater) {
178
		String txtARetourner = "";
179
		String txtARetourner = "";
179
		if (chaineAFormater.equals("0")) {
180
		if (chaineAFormater.equals("0")) {
180
			txtARetourner = i18nC.non();
181
			txtARetourner = i18nC.non();
181
		} else if (chaineAFormater.equals("1")) {
182
		} else if (chaineAFormater.equals("1")) {
182
			txtARetourner = i18nC.oui();
183
			txtARetourner = i18nC.oui();
183
		}
184
		}
184
		return txtARetourner;
185
		return txtARetourner;
185
	}
186
	}
186
	
187
	
187
	protected String formaterSautDeLigne(String chaineAFormater) {
188
	protected String formaterSautDeLigne(String chaineAFormater) {
188
		String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl);
189
		String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl);
189
		return txtARetourner;
190
		return txtARetourner;
190
	}
191
	}
191
	
192
	
192
	protected void lancerChargementListesValeurs(String[] listesCodes) {
193
	protected void lancerChargementListesValeurs(String[] listesCodes) {
193
		Configuration configuration = (Configuration) Registry.get(RegistreId.CONFIG);
194
		Configuration configuration = (Configuration) Registry.get(RegistreId.CONFIG);
194
		for (int i = 0; i < listesCodes.length ; i++) {
195
		for (int i = 0; i < listesCodes.length ; i++) {
195
			String code = listesCodes[i];
196
			String code = listesCodes[i];
196
			ontologiesEnAttenteDeReception.put(configuration.getListeId(code), code);
197
			ontologiesEnAttenteDeReception.put(configuration.getListeId(code), code);
197
			mediateur.obtenirListeValeurEtRafraichir(this, code);
198
			mediateur.obtenirListeValeurEtRafraichir(this, code);
198
		}
199
		}
199
	}
200
	}
200
	
201
	
201
	protected void receptionerListeValeurs(ValeurListe listeValeursReceptionnee) {
202
	protected void receptionerListeValeurs(ValeurListe listeValeursReceptionnee) {
202
		mettreAJourOntologieEnAttenteDeReception(listeValeursReceptionnee);
203
		mettreAJourOntologieEnAttenteDeReception(listeValeursReceptionnee);
203
		ajouterListeValeursAOntologie(listeValeursReceptionnee);
204
		ajouterListeValeursAOntologie(listeValeursReceptionnee);
204
	}
205
	}
205
	
206
	
206
	protected void mettreAJourOntologieEnAttenteDeReception(ValeurListe listeValeursReceptionnee) {
207
	protected void mettreAJourOntologieEnAttenteDeReception(ValeurListe listeValeursReceptionnee) {
207
		ontologiesEnAttenteDeReception.remove(listeValeursReceptionnee.getId());
208
		ontologiesEnAttenteDeReception.remove(listeValeursReceptionnee.getId());
208
		if (ontologiesEnAttenteDeReception.size() == 0) {
209
		if (ontologiesEnAttenteDeReception.size() == 0) {
209
			ontologieChargementOk = true;
210
			ontologieChargementOk = true;
210
		}
211
		}
211
	}
212
	}
212
	
213
	
213
	protected void ajouterListeValeursAOntologie(ValeurListe listeValeursReceptionnee) {
214
	protected void ajouterListeValeursAOntologie(ValeurListe listeValeursReceptionnee) {
214
		Iterator<String> it = listeValeursReceptionnee.keySet().iterator();
215
		Iterator<String> it = listeValeursReceptionnee.keySet().iterator();
215
		while (it.hasNext()) {
216
		while (it.hasNext()) {
216
			String cle = it.next();
217
			String cle = it.next();
217
			Valeur valeur = listeValeursReceptionnee.get(cle);
218
			Valeur valeur = listeValeursReceptionnee.get(cle);
218
			if (valeur != null) {
219
			if (valeur != null) {
219
				ontologie.put(cle, valeur);
220
				ontologie.put(cle, valeur);
220
			}
221
			}
221
		}
222
		}
222
	}
223
	}
223
	
224
	
224
	public String construireTxtListeOntologie(String chaineAAnalyser) {
225
	public String construireTxtListeOntologie(String chaineAAnalyser) {
225
		return construireTxtListeOntologie(chaineAAnalyser, true, true, false);
226
		return construireTxtListeOntologie(chaineAAnalyser, true, true, false);
226
	}
227
	}
227
	
228
	
228
	public String construireTxtListeOntologie(String chaineAAnalyser, boolean valeurEstOntologie, boolean typeEstOntologie, boolean donneeEstOntologie) {
229
	public String construireTxtListeOntologie(String chaineAAnalyser, boolean valeurEstOntologie, boolean typeEstOntologie, boolean donneeEstOntologie) {
229
		ArrayList<String> termes = new ArrayList<String>();
230
		ArrayList<String> termes = new ArrayList<String>();
230
		ArrayList<String> autres = new ArrayList<String>();
231
		ArrayList<String> autres = new ArrayList<String>();
231
		chaineAAnalyser = chaineAAnalyser.trim();
232
		chaineAAnalyser = chaineAAnalyser.trim();
232
		if (!UtilString.isEmpty(chaineAAnalyser)) {
233
		if (!UtilString.isEmpty(chaineAAnalyser)) {
233
			String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
234
			String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
234
			int nbreValeurs = valeurs.length;
235
			int nbreValeurs = valeurs.length;
235
			if (nbreValeurs > 0)	{
236
			if (nbreValeurs > 0)	{
236
				for (int i = 0; i < nbreValeurs; i++)	{
237
				for (int i = 0; i < nbreValeurs; i++)	{
237
					String valeur = valeurs[i];
238
					String valeur = valeurs[i];
238
					
239
					
239
					// VALEUR SANS TYPE 
240
					// VALEUR SANS TYPE 
240
					// La valeur sans type est une entrée de l'ontologie
241
					// La valeur sans type est une entrée de l'ontologie
241
					if (valeurEstOntologie && valeur.matches("^[0-9]+$"))	{
242
					if (valeurEstOntologie && valeur.matches("^[0-9]+$"))	{
242
						if (valeur.equals("0")) {
243
						if (valeur.equals("0")) {
243
							valeur = "";
244
							valeur = "";
244
						} else if (ontologie != null) {
245
						} else if (ontologie != null) {
245
							Valeur valeurOntologie = ontologie.get(valeur);
246
							Valeur valeurOntologie = ontologie.get(valeur);
246
							if (valeurOntologie != null) {
247
							if (valeurOntologie != null) {
247
								valeur = valeurOntologie.getNom();
248
								valeur = valeurOntologie.getNom();
248
							}
249
							}
249
						}
250
						}
250
					}
251
					}
251
					
252
					
252
					// VALEUR AVEC TYPE
253
					// VALEUR AVEC TYPE
253
					// Type : AUTRE
254
					// Type : AUTRE
254
					String valeurTypeAutre = aDonnee.TYPE_AUTRE+aDonnee.SEPARATEUR_TYPE_VALEUR;
255
					String valeurTypeAutre = aDonnee.TYPE_AUTRE+aDonnee.SEPARATEUR_TYPE_VALEUR;
255
					if (valeur.matches("^"+valeurTypeAutre+".+$")) {
256
					if (valeur.matches("^"+valeurTypeAutre+".+$")) {
256
						String txtAutre = valeur.replaceFirst("^"+valeurTypeAutre, "");
257
						String txtAutre = valeur.replaceFirst("^"+valeurTypeAutre, "");
257
						if (!txtAutre.equals("")) {
258
						if (!txtAutre.equals("")) {
258
							autres.add(txtAutre);
259
							autres.add(txtAutre);
259
						}
260
						}
260
						valeur = "";
261
						valeur = "";
261
					}
262
					}
262
					// Type correspondant à une entrée de l'ontologie
263
					// Type correspondant à une entrée de l'ontologie
263
					if (typeEstOntologie) {
264
					if (typeEstOntologie) {
264
						String valeurTypeOntologie = "[0-9]+"+aDonnee.SEPARATEUR_TYPE_VALEUR;
265
						String valeurTypeOntologie = "[0-9]+"+aDonnee.SEPARATEUR_TYPE_VALEUR;
265
						if (valeur.matches("^"+valeurTypeOntologie+".+$")) {
266
						if (valeur.matches("^"+valeurTypeOntologie+".+$")) {
266
							String type = valeur.substring(0, valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR));
267
							String type = valeur.substring(0, valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR));
267
							if (ontologie != null && ontologie.get(type) != null) {
268
							if (ontologie != null && ontologie.get(type) != null) {
268
								Valeur valeurOntologie = ontologie.get(type);
269
								Valeur valeurOntologie = ontologie.get(type);
269
								valeur = valeur.replaceFirst("^"+type, valeurOntologie.getNom()+": ");
270
								valeur = valeur.replaceFirst("^"+type, valeurOntologie.getNom()+": ");
270
							}
271
							}
271
						}
272
						}
272
					}
273
					}
273
					// Donnée correspondant à une entrée de l'ontologie
274
					// Donnée correspondant à une entrée de l'ontologie
274
					if (donneeEstOntologie) {
275
					if (donneeEstOntologie) {
275
						String donneeOntologie = aDonnee.SEPARATEUR_TYPE_VALEUR+"[0-9]+";
276
						String donneeOntologie = aDonnee.SEPARATEUR_TYPE_VALEUR+"[0-9]+";
276
						if (valeur.matches("^.+"+donneeOntologie+"$")) {
277
						if (valeur.matches("^.+"+donneeOntologie+"$")) {
277
							String donnee = valeur.substring(valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR), valeur.length());
278
							String donnee = valeur.substring(valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR), valeur.length());
278
							donnee = donnee.replaceFirst("^"+aDonnee.SEPARATEUR_TYPE_VALEUR, "");
279
							donnee = donnee.replaceFirst("^"+aDonnee.SEPARATEUR_TYPE_VALEUR, "");
279
							if (ontologie != null && ontologie.get(donnee) != null) {
280
							if (ontologie != null && ontologie.get(donnee) != null) {
280
								Valeur valeurOntologie = ontologie.get(donnee);
281
								Valeur valeurOntologie = ontologie.get(donnee);
281
								valeur = valeur.replaceFirst(donnee+"$", valeurOntologie.getNom());
282
								valeur = valeur.replaceFirst(donnee+"$", valeurOntologie.getNom());
282
							}
283
							}
283
						}
284
						}
284
					}
285
					}
285
					
286
					
286
					// Nettoyage final
287
					// Nettoyage final
287
					valeur = valeur.replaceFirst(aDonnee.SEPARATEUR_TYPE_VALEUR, "");
288
					valeur = valeur.replaceFirst(aDonnee.SEPARATEUR_TYPE_VALEUR, "");
288
					
289
					
289
					if (!UtilString.isEmpty(valeur)) {
290
					if (!UtilString.isEmpty(valeur)) {
290
						termes.add(valeur);
291
						termes.add(valeur);
291
					}
292
					}
292
				}
293
				}
293
			}
294
			}
294
		}
295
		}
295
		
296
		
296
		String chaineTermes = formaterTableauDeTxt(termes);
297
		String chaineTermes = formaterTableauDeTxt(termes);
297
		String chaineAutres = formaterTableauDeTxt(autres);
298
		String chaineAutres = formaterTableauDeTxt(autres);
298
		String chaineARetourner = chaineTermes+formaterAutre(chaineAutres);
299
		String chaineARetourner = chaineTermes+formaterAutre(chaineAutres);
299
		
300
		
300
		return chaineARetourner;
301
		return chaineARetourner;
301
	}
302
	}
302
}
303
}