Subversion Repositories eFlore/Applications.coel

Rev

Rev 1306 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1306 Rev 1344
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
		return construireTxtTruck(chaineAAnalyser, true);
-
 
87
	}
-
 
88
	
-
 
89
	protected String construireTxtTruck(String chaineAAnalyser, boolean ucFirst) {
86
		ArrayList<String> termes = new ArrayList<String>();
90
		ArrayList<String> termes = new ArrayList<String>();
87
		
91
		
88
		if ((chaineAAnalyser != null) && (!chaineAAnalyser.trim().equals("")))	{
92
		if ((chaineAAnalyser != null) && (!chaineAAnalyser.trim().equals("")))	{
89
			String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
93
			String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
90
			int nbreValeurs = valeurs.length;
94
			int nbreValeurs = valeurs.length;
91
			if (nbreValeurs > 0)	{
95
			if (nbreValeurs > 0)	{
92
				for (int i = 0; i < nbreValeurs; i++)	{
96
				for (int i = 0; i < nbreValeurs; i++)	{
93
					String valeur = valeurs[i];
97
					String valeur = valeurs[i];
94
					String valeurFormatee = formaterValeurTruck(valeur);
98
					String valeurFormatee = formaterValeurTruck(valeur);
95
					termes.add(valeurFormatee);
99
					termes.add(valeurFormatee);
96
				}
100
				}
97
			}
101
			}
98
		}
102
		}
99
		
103
		
100
		String chaineARetourner = formaterTableauDeTxt(termes);
104
		String chaineARetourner = formaterTableauDeTxt(termes, ucFirst);
101
		return chaineARetourner;
105
		return chaineARetourner;
102
	}
106
	}
103
	
107
	
104
	private String formaterValeurTruck(String valeur) {
108
	private String formaterValeurTruck(String valeur) {
105
		String chaineARetourner = "";
109
		String chaineARetourner = "";
106
		
110
		
107
		if (valeur.matches("^[^#]+##[^$]+$"))	{
111
		if (valeur.matches("^[^#]+##[^$]+$"))	{
108
			String[] cleValeur = valeur.split(aDonnee.SEPARATEUR_TYPE_VALEUR);
112
			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]);
113
			chaineARetourner = (UtilString.isEmpty(cleValeur[1]) || cleValeur[1].equals("null") ? aDonnee.VALEUR_NULL : cleValeur[1]) +" "+formaterParenthese(cleValeur[0]);
110
		} else if (!valeur.equals(""))	{
114
		} else if (!valeur.equals(""))	{
111
			chaineARetourner = valeur;
115
			chaineARetourner = valeur;
112
		} else {
116
		} else {
113
			GWT.log("Valeur truck posant problème :"+valeur, null);
117
			GWT.log("Valeur truck posant problème :"+valeur, null);
114
		}
118
		}
115
		
119
		
116
		return chaineARetourner;
120
		return chaineARetourner;
117
	}
121
	}
118
	
122
	
119
	protected String formaterParenthese(String chaineAAfficher) {
123
	protected String formaterParenthese(String chaineAAfficher) {
120
		if (!chaineAAfficher.equals("")) {
124
		if (!chaineAAfficher.equals("")) {
121
			chaineAAfficher = "("+chaineAAfficher+")";
125
			chaineAAfficher = "("+chaineAAfficher+")";
122
		}
126
		}
123
		return chaineAAfficher;
127
		return chaineAAfficher;
124
	}
128
	}
125
	
129
	
126
	protected String formaterTableauDeTxt(ArrayList<String> tableauDeTxt) {
130
	protected String formaterTableauDeTxt(ArrayList<String> tableauDeTxt, boolean ucFirst) {
127
		String chaineAAfficher = "";
131
		String chaineAAfficher = "";
128
		int tailleDuTableau = tableauDeTxt.size();
132
		int tailleDuTableau = tableauDeTxt.size();
129
		if (tailleDuTableau > 0) {
133
		if (tailleDuTableau > 0) {
130
			int indexAvtDernier = tailleDuTableau - 1;
134
			int indexAvtDernier = tailleDuTableau - 1;
131
			for (int i = 0; i < tailleDuTableau; i++)	{
135
			for (int i = 0; i < tailleDuTableau; i++)	{
132
				String mot = tableauDeTxt.get(i);
136
				String mot = tableauDeTxt.get(i);
133
				if (i != indexAvtDernier) {
137
				if (i != indexAvtDernier) {
134
					chaineAAfficher += mot+", ";
138
					chaineAAfficher += mot+", ";
135
				} else {
139
				} else {
136
					chaineAAfficher += nettoyerPointFinal(mot)+".";
140
					chaineAAfficher += nettoyerPointFinal(mot)+".";
137
				}
141
				}
138
			}
142
			}
139
		}
143
		}
140
		return UtilString.ucFirst(chaineAAfficher);
144
		if (ucFirst) return UtilString.ucFirst(chaineAAfficher);
-
 
145
		else return chaineAAfficher;
141
	}
146
	}
142
	
147
	
143
	protected String nettoyerPointFinal(String mot) {
148
	protected String nettoyerPointFinal(String mot) {
144
		mot = mot.replaceAll("[.]$", "");
149
		mot = mot.replaceAll("[.]$", "");
145
		return mot;
150
		return mot;
146
	}
151
	}
147
	
152
	
148
	protected String formaterContenu(String template, Params parametres) {
153
	protected String formaterContenu(String template, Params parametres) {
149
		String cHtml = Format.substitute(template, parametres);
154
		String cHtml = Format.substitute(template, parametres);
150
		
155
		
151
		Params cssParams = new Params();
156
		Params cssParams = new Params();
152
		cssParams.set("css_lien_ext", ComposantClass.LIEN_EXTERNE);
157
		cssParams.set("css_lien_ext", ComposantClass.LIEN_EXTERNE);
153
		cssParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
158
		cssParams.set("css_corps", ComposantClass.DETAIL_CORPS_CONTENU);
154
		cssParams.set("css_label", ComposantClass.LABEL);
159
		cssParams.set("css_label", ComposantClass.LABEL);
155
		cssParams.set("css_indentation", ComposantClass.INDENTATION);
160
		cssParams.set("css_indentation", ComposantClass.INDENTATION);
156
		cssParams.set("css_fieldset", ComposantClass.FIELDSET);
161
		cssParams.set("css_fieldset", ComposantClass.FIELDSET);
157
		cssParams.set("css_clear", ComposantClass.CLEAR);
162
		cssParams.set("css_clear", ComposantClass.CLEAR);
158
		cHtml = Format.substitute(cHtml, cssParams);
163
		cHtml = Format.substitute(cHtml, cssParams);
159
		
164
		
160
		return cHtml;		
165
		return cHtml;		
161
	}
166
	}
162
	
167
	
163
	protected void afficherOnglet(String template, Params parametres, TabItem onglet) {
168
	protected void afficherOnglet(String template, Params parametres, TabItem onglet) {
164
		String cHtml = formaterContenu(template, parametres);
169
		String cHtml = formaterContenu(template, parametres);
165
		
170
		
166
		HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
171
		HtmlContainer corpsConteneurDuHtml = new HtmlContainer(cHtml);
167
		onglet.removeAll();
172
		onglet.removeAll();
168
		onglet.add(corpsConteneurDuHtml);		
173
		onglet.add(corpsConteneurDuHtml);		
169
	}
174
	}
170
	
175
	
171
	protected String formaterAutre(String chaineAAfficher) {
176
	protected String formaterAutre(String chaineAAfficher) {
172
		if (!chaineAAfficher.equals("")) {
177
		if (!chaineAAfficher.equals("")) {
173
			chaineAAfficher = " ["+i18nC.autres()+" : "+chaineAAfficher+"]";
178
			chaineAAfficher = " ["+i18nC.autres()+" : "+chaineAAfficher+"]";
174
		}
179
		}
175
		return chaineAAfficher;
180
		return chaineAAfficher;
176
	}
181
	}
177
	
182
	
178
	protected String formaterOuiNon(String chaineAFormater) {
183
	protected String formaterOuiNon(String chaineAFormater) {
179
		String txtARetourner = "";
184
		String txtARetourner = "";
180
		if (chaineAFormater.equals("0")) {
185
		if (chaineAFormater.equals("0")) {
181
			txtARetourner = i18nC.non();
186
			txtARetourner = i18nC.non();
182
		} else if (chaineAFormater.equals("1")) {
187
		} else if (chaineAFormater.equals("1")) {
183
			txtARetourner = i18nC.oui();
188
			txtARetourner = i18nC.oui();
184
		}
189
		}
185
		return txtARetourner;
190
		return txtARetourner;
186
	}
191
	}
187
	
192
	
188
	protected String formaterSautDeLigne(String chaineAFormater) {
193
	protected String formaterSautDeLigne(String chaineAFormater) {
189
		String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl);
194
		String txtARetourner = chaineAFormater.replaceAll("\n", sautLigneTpl);
190
		return txtARetourner;
195
		return txtARetourner;
191
	}
196
	}
192
	
197
	
193
	protected void lancerChargementListesValeurs(String[] listesCodes) {
198
	protected void lancerChargementListesValeurs(String[] listesCodes) {
194
		Configuration configuration = (Configuration) Registry.get(RegistreId.CONFIG);
199
		Configuration configuration = (Configuration) Registry.get(RegistreId.CONFIG);
195
		for (int i = 0; i < listesCodes.length ; i++) {
200
		for (int i = 0; i < listesCodes.length ; i++) {
196
			String code = listesCodes[i];
201
			String code = listesCodes[i];
197
			ontologiesEnAttenteDeReception.put(configuration.getListeId(code), code);
202
			ontologiesEnAttenteDeReception.put(configuration.getListeId(code), code);
198
			mediateur.obtenirListeValeurEtRafraichir(this, code);
203
			mediateur.obtenirListeValeurEtRafraichir(this, code);
199
		}
204
		}
200
	}
205
	}
201
	
206
	
202
	protected void receptionerListeValeurs(ValeurListe listeValeursReceptionnee) {
207
	protected void receptionerListeValeurs(ValeurListe listeValeursReceptionnee) {
203
		mettreAJourOntologieEnAttenteDeReception(listeValeursReceptionnee);
208
		mettreAJourOntologieEnAttenteDeReception(listeValeursReceptionnee);
204
		ajouterListeValeursAOntologie(listeValeursReceptionnee);
209
		ajouterListeValeursAOntologie(listeValeursReceptionnee);
205
	}
210
	}
206
	
211
	
207
	protected void mettreAJourOntologieEnAttenteDeReception(ValeurListe listeValeursReceptionnee) {
212
	protected void mettreAJourOntologieEnAttenteDeReception(ValeurListe listeValeursReceptionnee) {
208
		ontologiesEnAttenteDeReception.remove(listeValeursReceptionnee.getId());
213
		ontologiesEnAttenteDeReception.remove(listeValeursReceptionnee.getId());
209
		if (ontologiesEnAttenteDeReception.size() == 0) {
214
		if (ontologiesEnAttenteDeReception.size() == 0) {
210
			ontologieChargementOk = true;
215
			ontologieChargementOk = true;
211
		}
216
		}
212
	}
217
	}
213
	
218
	
214
	protected void ajouterListeValeursAOntologie(ValeurListe listeValeursReceptionnee) {
219
	protected void ajouterListeValeursAOntologie(ValeurListe listeValeursReceptionnee) {
215
		Iterator<String> it = listeValeursReceptionnee.keySet().iterator();
220
		Iterator<String> it = listeValeursReceptionnee.keySet().iterator();
216
		while (it.hasNext()) {
221
		while (it.hasNext()) {
217
			String cle = it.next();
222
			String cle = it.next();
218
			Valeur valeur = listeValeursReceptionnee.get(cle);
223
			Valeur valeur = listeValeursReceptionnee.get(cle);
219
			if (valeur != null) {
224
			if (valeur != null) {
220
				ontologie.put(cle, valeur);
225
				ontologie.put(cle, valeur);
221
			}
226
			}
222
		}
227
		}
223
	}
228
	}
224
	
229
	
225
	public String construireTxtListeOntologie(String chaineAAnalyser) {
230
	public String construireTxtListeOntologie(String chaineAAnalyser) {
226
		return construireTxtListeOntologie(chaineAAnalyser, true, true, false);
231
		return construireTxtListeOntologie(chaineAAnalyser, true, true, false);
227
	}
232
	}
228
	
233
	
229
	public String construireTxtListeOntologie(String chaineAAnalyser, boolean valeurEstOntologie, boolean typeEstOntologie, boolean donneeEstOntologie) {
234
	public String construireTxtListeOntologie(String chaineAAnalyser, boolean valeurEstOntologie, boolean typeEstOntologie, boolean donneeEstOntologie) {
230
		ArrayList<String> termes = new ArrayList<String>();
235
		ArrayList<String> termes = new ArrayList<String>();
231
		ArrayList<String> autres = new ArrayList<String>();
236
		ArrayList<String> autres = new ArrayList<String>();
232
		chaineAAnalyser = chaineAAnalyser.trim();
237
		chaineAAnalyser = chaineAAnalyser.trim();
233
		if (!UtilString.isEmpty(chaineAAnalyser)) {
238
		if (!UtilString.isEmpty(chaineAAnalyser)) {
234
			String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
239
			String[] valeurs = chaineAAnalyser.split(aDonnee.SEPARATEUR_VALEURS);
235
			int nbreValeurs = valeurs.length;
240
			int nbreValeurs = valeurs.length;
236
			if (nbreValeurs > 0)	{
241
			if (nbreValeurs > 0)	{
237
				for (int i = 0; i < nbreValeurs; i++)	{
242
				for (int i = 0; i < nbreValeurs; i++)	{
238
					String valeur = valeurs[i];
243
					String valeur = valeurs[i];
239
					
244
					
240
					// VALEUR SANS TYPE 
245
					// VALEUR SANS TYPE 
241
					// La valeur sans type est une entrée de l'ontologie
246
					// La valeur sans type est une entrée de l'ontologie
242
					if (valeurEstOntologie && valeur.matches("^[0-9]+$"))	{
247
					if (valeurEstOntologie && valeur.matches("^[0-9]+$"))	{
243
						if (valeur.equals("0")) {
248
						if (valeur.equals("0")) {
244
							valeur = "";
249
							valeur = "";
245
						} else if (ontologie != null) {
250
						} else if (ontologie != null) {
246
							Valeur valeurOntologie = ontologie.get(valeur);
251
							Valeur valeurOntologie = ontologie.get(valeur);
247
							if (valeurOntologie != null) {
252
							if (valeurOntologie != null) {
248
								valeur = valeurOntologie.getNom();
253
								valeur = valeurOntologie.getNom();
249
							}
254
							}
250
						}
255
						}
251
					}
256
					}
252
					
257
					
253
					// VALEUR AVEC TYPE
258
					// VALEUR AVEC TYPE
254
					// Type : AUTRE
259
					// Type : AUTRE
255
					String valeurTypeAutre = aDonnee.TYPE_AUTRE+aDonnee.SEPARATEUR_TYPE_VALEUR;
260
					String valeurTypeAutre = aDonnee.TYPE_AUTRE+aDonnee.SEPARATEUR_TYPE_VALEUR;
256
					if (valeur.matches("^"+valeurTypeAutre+".*$")) {
261
					if (valeur.matches("^"+valeurTypeAutre+".*$")) {
257
						String txtAutre = valeur.replaceFirst("^"+valeurTypeAutre, "");
262
						String txtAutre = valeur.replaceFirst("^"+valeurTypeAutre, "");
258
						if (!txtAutre.equals("")) {
263
						if (!txtAutre.equals("")) {
259
							autres.add(txtAutre);
264
							autres.add(txtAutre);
260
						}
265
						}
261
						valeur = "";
266
						valeur = "";
262
					}
267
					}
263
					// Type correspondant à une entrée de l'ontologie
268
					// Type correspondant à une entrée de l'ontologie
264
					if (typeEstOntologie) {
269
					if (typeEstOntologie) {
265
						String valeurTypeOntologie = "[0-9]+"+aDonnee.SEPARATEUR_TYPE_VALEUR;
270
						String valeurTypeOntologie = "[0-9]+"+aDonnee.SEPARATEUR_TYPE_VALEUR;
266
						if (valeur.matches("^"+valeurTypeOntologie+".+$")) {
271
						if (valeur.matches("^"+valeurTypeOntologie+".+$")) {
267
							String type = valeur.substring(0, valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR));
272
							String type = valeur.substring(0, valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR));
268
							if (ontologie != null && ontologie.get(type) != null) {
273
							if (ontologie != null && ontologie.get(type) != null) {
269
								Valeur valeurOntologie = ontologie.get(type);
274
								Valeur valeurOntologie = ontologie.get(type);
270
								valeur = valeur.replaceFirst("^"+type, valeurOntologie.getNom()+": ");
275
								valeur = valeur.replaceFirst("^"+type, valeurOntologie.getNom()+": ");
271
							}
276
							}
272
						}
277
						}
273
					}
278
					}
274
					// Donnée correspondant à une entrée de l'ontologie
279
					// Donnée correspondant à une entrée de l'ontologie
275
					if (donneeEstOntologie) {
280
					if (donneeEstOntologie) {
276
						String donneeOntologie = aDonnee.SEPARATEUR_TYPE_VALEUR+"[0-9]+";
281
						String donneeOntologie = aDonnee.SEPARATEUR_TYPE_VALEUR+"[0-9]+";
277
						if (valeur.matches("^.+"+donneeOntologie+"$")) {
282
						if (valeur.matches("^.+"+donneeOntologie+"$")) {
278
							String donnee = valeur.substring(valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR), valeur.length());
283
							String donnee = valeur.substring(valeur.indexOf(aDonnee.SEPARATEUR_TYPE_VALEUR), valeur.length());
279
							donnee = donnee.replaceFirst("^"+aDonnee.SEPARATEUR_TYPE_VALEUR, "");
284
							donnee = donnee.replaceFirst("^"+aDonnee.SEPARATEUR_TYPE_VALEUR, "");
280
							if (ontologie != null && ontologie.get(donnee) != null) {
285
							if (ontologie != null && ontologie.get(donnee) != null) {
281
								Valeur valeurOntologie = ontologie.get(donnee);
286
								Valeur valeurOntologie = ontologie.get(donnee);
282
								valeur = valeur.replaceFirst(donnee+"$", valeurOntologie.getNom());
287
								valeur = valeur.replaceFirst(donnee+"$", valeurOntologie.getNom());
283
							}
288
							}
284
						}
289
						}
285
					}
290
					}
286
					
291
					
287
					// Nettoyage final
292
					// Nettoyage final
288
					valeur = valeur.replaceFirst(aDonnee.SEPARATEUR_TYPE_VALEUR, "");
293
					valeur = valeur.replaceFirst(aDonnee.SEPARATEUR_TYPE_VALEUR, "");
289
					
294
					
290
					if (!UtilString.isEmpty(valeur)) {
295
					if (!UtilString.isEmpty(valeur)) {
291
						termes.add(valeur);
296
						termes.add(valeur);
292
					}
297
					}
293
				}
298
				}
294
			}
299
			}
295
		}
300
		}
296
		
301
		
297
		String chaineTermes = formaterTableauDeTxt(termes);
302
		String chaineTermes = formaterTableauDeTxt(termes, true);
298
		String chaineAutres = formaterTableauDeTxt(autres);
303
		String chaineAutres = formaterTableauDeTxt(autres, true);
299
		String chaineARetourner = chaineTermes+formaterAutre(chaineAutres);
304
		String chaineARetourner = chaineTermes+formaterAutre(chaineAutres);
300
		
305
		
301
		return chaineARetourner;
306
		return chaineARetourner;
302
	}
307
	}
303
}
308
}