Subversion Repositories eFlore/Applications.coel

Rev

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

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