Subversion Repositories eFlore/Applications.coel

Rev

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

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