Subversion Repositories eFlore/Applications.coel

Rev

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

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