Subversion Repositories eFlore/Applications.coel

Rev

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

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