Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1690 Rev 1764
1
package org.tela_botanica.client.modeles.structure;
1
package org.tela_botanica.client.modeles.structure;
2
 
2
 
3
import java.util.Date;
3
import java.util.Date;
4
import java.util.Iterator;
4
import java.util.Iterator;
5
import java.util.Map;
5
import java.util.Map;
6
import java.util.Set;
6
import java.util.Set;
7
 
7
 
8
import org.tela_botanica.client.modeles.aDonnee;
8
import org.tela_botanica.client.modeles.aDonnee;
9
import org.tela_botanica.client.modeles.personne.Personne;
9
import org.tela_botanica.client.modeles.personne.Personne;
10
import org.tela_botanica.client.util.UtilString;
10
import org.tela_botanica.client.util.UtilString;
11
 
11
 
12
import com.extjs.gxt.ui.client.data.BaseModelData;
12
import com.extjs.gxt.ui.client.data.BaseModelData;
13
import com.extjs.gxt.ui.client.data.ModelData;
13
import com.extjs.gxt.ui.client.data.ModelData;
14
import com.google.gwt.i18n.client.DateTimeFormat;
14
import com.google.gwt.i18n.client.DateTimeFormat;
15
import com.google.gwt.json.client.JSONObject;
15
import com.google.gwt.json.client.JSONObject;
16
 
16
 
17
public class Structure extends aDonnee {
17
public class Structure extends aDonnee {
18
	
18
	
19
	private static final long serialVersionUID = -5623886668593288218L;
19
	private static final long serialVersionUID = -5623886668593288218L;
20
 
20
 
21
	public static final String PREFIXE = "cs";
21
	public static final String PREFIXE = "cs";
22
	public static final String URL_SITE = "WEB";
22
	public static final String URL_SITE = "WEB";
23
	public static final String URL_LOGO = "LOGO";
23
	public static final String URL_LOGO = "LOGO";
24
	
24
	
25
	private BaseModelData urls = null;
25
	private BaseModelData urls = null;
26
	private StructureAPersonneListe personnel = null;
26
	private StructureAPersonneListe personnel = null;
27
	private StructureValorisation valorisation = null;
27
	private StructureValorisation valorisation = null;
28
	private StructureConservation conservation = null;
28
	private StructureConservation conservation = null;
29
	public static String[] champsObligatoires = {"cs_id_structure", "csc_id_structure", "csv_id_structure"};
29
	public static String[] champsObligatoires = {"cs_id_structure", "csc_id_structure", "csv_id_structure"};
30
	
30
	
31
	public Structure() {
31
	public Structure() {
32
		// Constructions du tableau des urls interne
32
		// Constructions du tableau des urls interne
33
		urls = new BaseModelData();
33
		urls = new BaseModelData();
34
	}
34
	}
35
	
35
	
36
	public Structure(ModelData model)
36
	public Structure(ModelData model)
37
	{		
37
	{		
38
		Map<String, Object> a = model.getProperties();
38
		Map<String, Object> a = model.getProperties();
39
 
39
 
40
		Set<String> cles = a.keySet();
40
		Set<String> cles = a.keySet();
41
		Iterator<String> it = cles.iterator();
41
		Iterator<String> it = cles.iterator();
42
		while (it.hasNext()) {
42
		while (it.hasNext()) {
43
			String cle = it.next();			
43
			String cle = it.next();			
44
			if (a.get(cle) != null) {
44
			if (a.get(cle) != null) {
45
				String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
45
				String cleObjet = cle.replaceFirst("^"+getPrefixe()+"_", "");
46
				this.set(cleObjet, a.get(cle));
46
				this.set(cleObjet, a.get(cle));
47
			}
47
			}
48
		}
48
		}
49
	}
49
	}
50
	
50
	
51
	public Structure(JSONObject institution) {
51
	public Structure(JSONObject institution) {
52
		// Constructions du tableau des urls interne
52
		// Constructions du tableau des urls interne
53
		urls = new BaseModelData();
53
		urls = new BaseModelData();
54
 
54
 
55
		// l'objet JSON est une table de hachage
55
		// l'objet JSON est une table de hachage
56
		Set<String> im = institution.keySet();
56
		Set<String> im = institution.keySet();
57
 
57
 
58
		// Parcourt pour chaque clé
58
		// Parcourt pour chaque clé
59
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
59
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
60
			// Si elle est associée à une valeur, nous l'ajoutons
60
			// Si elle est associée à une valeur, nous l'ajoutons
61
			String cle = it.next();
61
			String cle = it.next();
62
			if (cle.startsWith(PREFIXE+"_")) {
62
			if (cle.startsWith(PREFIXE+"_")) {
63
				// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
63
				// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
64
				String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
64
				String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
65
				// Sinon, nous ajoutons la clé avec une valeur vide
65
				// Sinon, nous ajoutons la clé avec une valeur vide
66
				String valeur = "";
66
				String valeur = "";
67
				if (institution.get(cle).isString() != null) {
67
				if (institution.get(cle).isString() != null) {
68
					valeur = institution.get(cle).isString().stringValue();
68
					valeur = institution.get(cle).isString().stringValue();
69
				}
69
				}
70
				if (cleObjet.equals("truk_url")) {
70
				if (cleObjet.equals("truk_url")) {
71
					this.setUrl(valeur);
71
					this.setUrl(valeur);
72
				} else {
72
				} else {
73
					this.set(cleObjet, valeur);
73
					this.set(cleObjet, valeur);
74
				}
74
				}
75
			}
75
			}
76
		}
76
		}
77
	}
77
	}
78
	
78
	
79
	@Override
79
	@Override
80
	protected String getPrefixe() {
80
	protected String getPrefixe() {
81
		return PREFIXE;
81
		return PREFIXE;
82
	}
82
	}
83
	
83
	
84
	protected String[] getChampsObligatoires()	{
84
	protected String[] getChampsObligatoires()	{
85
		return champsObligatoires;
85
		return champsObligatoires;
86
	}
86
	}
87
	
87
	
88
	public String getId() {
88
	public String getId() {
89
		return renvoyerValeurCorrecte("id_structure");
89
		return renvoyerValeurCorrecte("id_structure");
90
	}
90
	}
91
	public void setId(String idStructure) {
91
	public void setId(String idStructure) {
92
		this.set("id_structure", idStructure);
92
		this.set("id_structure", idStructure);
93
	}
93
	}
94
	
-
 
95
	public String getIdProjet() {
-
 
96
		return renvoyerValeurCorrecte("ce_projet");
-
 
97
	}
-
 
98
	public void setIdProjet(String idProjet) {
-
 
99
		this.set("ce_projet", idProjet);
-
 
100
	}
-
 
101
	
94
	
102
	public String getIdMere() {
95
	public String getIdMere() {
103
		return renvoyerValeurCorrecte("ce_mere");
96
		return renvoyerValeurCorrecte("ce_mere");
104
	}
97
	}
105
	public void setIdMere(String idMere) {
98
	public void setIdMere(String idMere) {
106
		this.set("ce_mere", idMere);
99
		this.set("ce_mere", idMere);
107
	}
100
	}
108
	
101
	
109
	public String getGuid() {
102
	public String getGuid() {
110
		return renvoyerValeurCorrecte("guid");
103
		return renvoyerValeurCorrecte("guid");
111
	}
104
	}
112
	public void setGuid(String guid) {
105
	public void setGuid(String guid) {
113
		this.set("guid", guid);
106
		this.set("guid", guid);
114
	}
107
	}
115
	
108
	
116
	public String getIdAlternatif() {
109
	public String getIdAlternatif() {
117
		return renvoyerValeurCorrecte("truk_identifiant_alternatif");
110
		return renvoyerValeurCorrecte("truk_identifiant_alternatif");
118
	}
111
	}
119
	public void setIdAlternatif(String idAlter) {
112
	public void setIdAlternatif(String idAlter) {
120
		this.set("truk_identifiant_alternatif", idAlter);
113
		this.set("truk_identifiant_alternatif", idAlter);
121
	}
114
	}
122
	
115
	
123
	public String getNom() {
116
	public String getNom() {
124
		return renvoyerValeurCorrecte("nom");
117
		return renvoyerValeurCorrecte("nom");
125
	}
118
	}
126
	public void setNom(String nom) {
119
	public void setNom(String nom) {
127
		this.set("nom", nom);
120
		this.set("nom", nom);
128
	}
121
	}
129
	
122
	
130
	public String getNomAlternatif() {
123
	public String getNomAlternatif() {
131
		return renvoyerValeurCorrecte("truk_nom_alternatif");
124
		return renvoyerValeurCorrecte("truk_nom_alternatif");
132
	}
125
	}
133
	
126
	
134
	public String getDescription() {
127
	public String getDescription() {
135
		return renvoyerValeurCorrecte("description");
128
		return renvoyerValeurCorrecte("description");
136
	}
129
	}
137
	public void setDescription(String description) {
130
	public void setDescription(String description) {
138
		this.set("description", description);
131
		this.set("description", description);
139
	}
132
	}
140
	
133
	
141
	public String getType() {
134
	public String getType() {
142
		return renvoyerValeurCorrecte("ce_type");
135
		return renvoyerValeurCorrecte("ce_type");
143
	}
136
	}
144
	public void setType(String type) {
137
	public void setType(String type) {
145
		this.set("ce_type", type);
138
		this.set("ce_type", type);
146
	}
139
	}
147
	
140
	
148
	public String getTypePrive() {
141
	public String getTypePrive() {
149
		return renvoyerValeurCorrecte("ce_truk_type_prive");
142
		return renvoyerValeurCorrecte("ce_truk_type_prive");
150
	}
143
	}
151
	public void setTypePrive(String typePrive) {
144
	public void setTypePrive(String typePrive) {
152
		this.set("ce_truk_type_prive", typePrive);
145
		this.set("ce_truk_type_prive", typePrive);
153
	}
146
	}
154
	
147
	
155
	public String getTypePublic() {
148
	public String getTypePublic() {
156
		return renvoyerValeurCorrecte("ce_truk_type_public");
149
		return renvoyerValeurCorrecte("ce_truk_type_public");
157
	}
150
	}
158
	public void setTypePublic(String typePublic) {
151
	public void setTypePublic(String typePublic) {
159
		this.set("ce_truk_type_public", typePublic);
152
		this.set("ce_truk_type_public", typePublic);
160
	}
153
	}
161
	
-
 
162
	public String getAbreviationProjet() {
-
 
163
		return renvoyerValeurCorrecte("_abreviationprojet_");
-
 
164
	}
-
 
165
	public void setAbreviationProjet(String abreviation) {
-
 
166
		this.set("_abreviationprojet_", abreviation);
-
 
167
	}
-
 
168
	
154
	
169
	public String getAdresse() {
155
	public String getAdresse() {
170
		return (String) renvoyerValeurCorrecte("adresse_01");
156
		return (String) renvoyerValeurCorrecte("adresse_01");
171
	}
157
	}
172
	public void setAdresse(String adr) {
158
	public void setAdresse(String adr) {
173
		this.set("adresse_01", adr);
159
		this.set("adresse_01", adr);
174
	}
160
	}
175
	
161
	
176
	public String getAdresseComplement() {
162
	public String getAdresseComplement() {
177
		return renvoyerValeurCorrecte("adresse_02");
163
		return renvoyerValeurCorrecte("adresse_02");
178
	}
164
	}
179
	public void setAdresseComplement(String adr) {
165
	public void setAdresseComplement(String adr) {
180
		this.set("adresse_02", adr);
166
		this.set("adresse_02", adr);
181
	}
167
	}
182
 
168
 
183
	public String getDateFondationFormatMysql() {
169
	public String getDateFondationFormatMysql() {
184
		return renvoyerValeurCorrecte("date_fondation");
170
		return renvoyerValeurCorrecte("date_fondation");
185
	}
171
	}
186
	public String getDateFondationFormatLong() {
172
	public String getDateFondationFormatLong() {
187
		String dateFormatee = "";
173
		String dateFormatee = "";
188
		Date dateFondation = getDateFondation();
174
		Date dateFondation = getDateFondation();
189
		if (dateFondation != null) {
175
		if (dateFondation != null) {
190
			dateFormatee = DateTimeFormat.getLongDateFormat().format(dateFondation);
176
			dateFormatee = DateTimeFormat.getLongDateFormat().format(dateFondation);
191
		}
177
		}
192
		return dateFormatee;
178
		return dateFormatee;
193
	}
179
	}
194
	
180
	
195
	public String getAnneOuDateFondationFormatLong() {
181
	public String getAnneOuDateFondationFormatLong() {
196
		String dateFormatee = "";
182
		String dateFormatee = "";
197
		String dateFondation =  renvoyerValeurCorrecte("date_fondation");
183
		String dateFondation =  renvoyerValeurCorrecte("date_fondation");
198
		if (!dateFondation.equals(""))	{
184
		if (!dateFondation.equals(""))	{
199
			if (dateFondation.endsWith("00-00"))	{
185
			if (dateFondation.endsWith("00-00"))	{
200
			dateFormatee = dateFondation.substring(0, 4);
186
			dateFormatee = dateFondation.substring(0, 4);
201
			} else {
187
			} else {
202
				Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);
188
				Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);
203
				dateFormatee = DateTimeFormat.getLongDateFormat().format(date);
189
				dateFormatee = DateTimeFormat.getLongDateFormat().format(date);
204
			}
190
			}
205
		}
191
		}
206
		return dateFormatee;
192
		return dateFormatee;
207
	}
193
	}
208
	public Date getDateFondation() {
194
	public Date getDateFondation() {
209
		Date fondationDate = null;
195
		Date fondationDate = null;
210
		String fondationChaine = renvoyerValeurCorrecte("date_fondation");
196
		String fondationChaine = renvoyerValeurCorrecte("date_fondation");
211
		if (!fondationChaine.isEmpty() && !fondationChaine.equals("0000-00-00")) {
197
		if (!fondationChaine.isEmpty() && !fondationChaine.equals("0000-00-00")) {
212
			fondationDate = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(fondationChaine);
198
			fondationDate = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(fondationChaine);
213
		}
199
		}
214
		return fondationDate;
200
		return fondationDate;
215
	}
201
	}
216
	
202
	
217
	/*
203
	/*
218
	public String getAnneeOuDateFondation()	{
204
	public String getAnneeOuDateFondation()	{
219
		 String valeurDateFondation = get("date_fondation");
205
		 String valeurDateFondation = get("date_fondation");
220
		 if (!UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.endsWith("00-00")) {
206
		 if (!UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.endsWith("00-00")) {
221
			 valeurDateFondation = valeurDateFondation.substring(0, 4);
207
			 valeurDateFondation = valeurDateFondation.substring(0, 4);
222
		 } else if (UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.equals("0000-00-00")) {
208
		 } else if (UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.equals("0000-00-00")) {
223
			 valeurDateFondation  = "";
209
			 valeurDateFondation  = "";
224
		 }
210
		 }
225
		 return valeurDateFondation;
211
		 return valeurDateFondation;
226
	}*/
212
	}*/
227
	
213
	
228
	public String getAnneeOuDateFondation()	{
214
	public String getAnneeOuDateFondation()	{
229
		 String valeurDateFondation = get("date_fondation");
215
		 String valeurDateFondation = get("date_fondation");
230
		 return getDateSouple(valeurDateFondation);
216
		 return getDateSouple(valeurDateFondation);
231
	}
217
	}
232
	
218
	
233
	public String getDateSouple(String date) {
219
	public String getDateSouple(String date) {
234
		String valeurDate = date;
220
		String valeurDate = date;
235
		
221
		
236
		String jour = "";
222
		String jour = "";
237
		String mois = "";
223
		String mois = "";
238
		String annee = "";
224
		String annee = "";
239
 
225
 
240
		// pas de date dans la BD
226
		// pas de date dans la BD
241
		if (UtilString.isEmpty(valeurDate) || valeurDate.equals("0000-00-00")) {
227
		if (UtilString.isEmpty(valeurDate) || valeurDate.equals("0000-00-00")) {
242
			valeurDate  = "";
228
			valeurDate  = "";
243
		
229
		
244
		// YYYY
230
		// YYYY
245
		} else if (valeurDate.endsWith("00-00")) {
231
		} else if (valeurDate.endsWith("00-00")) {
246
			valeurDate = valeurDate.substring(0, 4);
232
			valeurDate = valeurDate.substring(0, 4);
247
			if (valeurDate.matches("\\d{4}")) {
233
			if (valeurDate.matches("\\d{4}")) {
248
				jour = "";
234
				jour = "";
249
				mois = "";
235
				mois = "";
250
				annee = valeurDate.substring(0,4);
236
				annee = valeurDate.substring(0,4);
251
				valeurDate = annee;
237
				valeurDate = annee;
252
			}
238
			}
253
			
239
			
254
		// YYYY-MM
240
		// YYYY-MM
255
		} else if (valeurDate.endsWith("-00")) {
241
		} else if (valeurDate.endsWith("-00")) {
256
			valeurDate = valeurDate.substring(0, 7);
242
			valeurDate = valeurDate.substring(0, 7);
257
			if (valeurDate.matches("\\d{4}-\\d{2}")) {
243
			if (valeurDate.matches("\\d{4}-\\d{2}")) {
258
				jour = "";
244
				jour = "";
259
				mois = valeurDate.substring(5,7);
245
				mois = valeurDate.substring(5,7);
260
				annee = valeurDate.substring(0,4);
246
				annee = valeurDate.substring(0,4);
261
				valeurDate = mois+"/"+annee;
247
				valeurDate = mois+"/"+annee;
262
			}
248
			}
263
		}
249
		}
264
		
250
		
265
		// YYYY-MM-DD
251
		// YYYY-MM-DD
266
		else if (valeurDate.matches("\\d{4}-\\d{2}-\\d{2}")) {
252
		else if (valeurDate.matches("\\d{4}-\\d{2}-\\d{2}")) {
267
			Date objetDate = DateTimeFormat.getFormat("yyyy-MM-dd").parse(valeurDate);
253
			Date objetDate = DateTimeFormat.getFormat("yyyy-MM-dd").parse(valeurDate);
268
			DateTimeFormat fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
254
			DateTimeFormat fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
269
			valeurDate = fmt.format(objetDate);
255
			valeurDate = fmt.format(objetDate);
270
		}
256
		}
271
		 
257
		 
272
		 return valeurDate;
258
		 return valeurDate;
273
	}
259
	}
274
	
260
	
275
	public void setDateFondation(Date dateFondation) {
261
	public void setDateFondation(Date dateFondation) {
276
		if (dateFondation != null) {
262
		if (dateFondation != null) {
277
			this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
263
			this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
278
		}
264
		}
279
	}
265
	}
280
	public void setDateFondation(String dateFondation) {
266
	public void setDateFondation(String dateFondation) {
281
		if (dateFondation != null) {
267
		if (dateFondation != null) {
282
			this.set("date_fondation", dateFondation);
268
			this.set("date_fondation", dateFondation);
283
		}
269
		}
284
	}
270
	}
285
		
271
		
286
	public String getCodePostal() {
272
	public String getCodePostal() {
287
		return renvoyerValeurCorrecte("code_postal");
273
		return renvoyerValeurCorrecte("code_postal");
288
	}
274
	}
289
	public void setCodePostal(String codePostal) {
275
	public void setCodePostal(String codePostal) {
290
		this.set("code_postal", codePostal);
276
		this.set("code_postal", codePostal);
291
	}
277
	}
292
	
278
	
293
	public String getVille() {
279
	public String getVille() {
294
		return renvoyerValeurCorrecte("ville");
280
		return renvoyerValeurCorrecte("ville");
295
	}
281
	}
296
	public void setVille(String ville) {
282
	public void setVille(String ville) {
297
		this.set("ville", ville);
283
		this.set("ville", ville);
298
	}
284
	}
299
	
285
	
300
	public String getRegion() {
286
	public String getRegion() {
301
		return getChaineDenormaliseUnique("ce_truk_region");
287
		return getChaineDenormaliseUnique("ce_truk_region");
302
	}
288
	}
303
	public void setRegion(String region) {
289
	public void setRegion(String region) {
304
		this.set("ce_truk_region", region);
290
		this.set("ce_truk_region", region);
305
	}
291
	}
306
	
292
	
307
	public String getPays() {
293
	public String getPays() {
308
		return getChaineDenormaliseUnique("ce_truk_pays");
294
		return getChaineDenormaliseUnique("ce_truk_pays");
309
	}
295
	}
310
	public void setPays(String pays) {
296
	public void setPays(String pays) {
311
		this.set("ce_truk_pays", pays);
297
		this.set("ce_truk_pays", pays);
312
	}
298
	}
313
	
299
	
314
	public String getLatitude() {
300
	public String getLatitude() {
315
		return renvoyerValeurCorrecte("latitude");
301
		return renvoyerValeurCorrecte("latitude");
316
	}
302
	}
317
	public void setLatitude(String latitude) {
303
	public void setLatitude(String latitude) {
318
		if (latitude != null)	{
304
		if (latitude != null)	{
319
			latitude = latitude.replace(".", ",");
305
			latitude = latitude.replace(".", ",");
320
		}
306
		}
321
		this.set("latitude", latitude);
307
		this.set("latitude", latitude);
322
	}
308
	}
323
 
309
 
324
	public String getLongitude() {
310
	public String getLongitude() {
325
		return renvoyerValeurCorrecte("longitude");
311
		return renvoyerValeurCorrecte("longitude");
326
	}
312
	}
327
	public void setLongitude(String longitude) {
313
	public void setLongitude(String longitude) {
328
		if (longitude != null)	{
314
		if (longitude != null)	{
329
			longitude = longitude.replace(".", ",");
315
			longitude = longitude.replace(".", ",");
330
		}
316
		}
331
		this.set("longitude", longitude);
317
		this.set("longitude", longitude);
332
	}
318
	}
333
	
319
	
334
	// TELEPHONE
320
	// TELEPHONE
335
	public String getTelephone() {
321
	public String getTelephone() {
336
		return renvoyerValeurCorrecte("truk_telephone");
322
		return renvoyerValeurCorrecte("truk_telephone");
337
	}
323
	}
338
	public void setTelephone(String tel) {
324
	public void setTelephone(String tel) {
339
		this.set("truk_telephone", tel);
325
		this.set("truk_telephone", tel);
340
	}	
326
	}	
341
 
327
 
342
	// TELEPHONE FIXE
328
	// TELEPHONE FIXE
343
	public String getTelephoneFixe() {
329
	public String getTelephoneFixe() {
344
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FIXE);
330
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FIXE);
345
	}
331
	}
346
	public void setTelephoneFixe(String fixe) {
332
	public void setTelephoneFixe(String fixe) {
347
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FIXE, fixe);
333
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FIXE, fixe);
348
	}
334
	}
349
	
335
	
350
	//TELEPHONE FAX
336
	//TELEPHONE FAX
351
	public String getFax() {
337
	public String getFax() {
352
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FAX);
338
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FAX);
353
	}
339
	}
354
	public void setFax(String fax) {
340
	public void setFax(String fax) {
355
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FAX, fax);
341
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FAX, fax);
356
	}
342
	}
357
 
343
 
358
	
344
	
359
	// COURRIEL
345
	// COURRIEL
360
	public String getCourriel() {
346
	public String getCourriel() {
361
		return renvoyerValeurCorrecte("courriel");
347
		return renvoyerValeurCorrecte("courriel");
362
	}
348
	}
363
	public void setCourriel(String courriel) {
349
	public void setCourriel(String courriel) {
364
		this.set("courriel", courriel);
350
		this.set("courriel", courriel);
365
	}
351
	}
366
	
352
	
367
	// URL
353
	// URL
368
	public String getUrl(String type) {
354
	public String getUrl(String type) {
369
		return urls.get(type);
355
		return urls.get(type);
370
	}
356
	}
371
	public String getUrl() {
357
	public String getUrl() {
372
		String urlsDenormalise = "";
358
		String urlsDenormalise = "";
373
		Set<String> proprietes = urls.getProperties().keySet();
359
		Set<String> proprietes = urls.getProperties().keySet();
374
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
360
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
375
			String cle = it.next();
361
			String cle = it.next();
376
			urlsDenormalise += cle+"##"+urls.get(cle)+";;";
362
			urlsDenormalise += cle+"##"+urls.get(cle)+";;";
377
		}
363
		}
378
		urlsDenormalise = urlsDenormalise.replaceFirst(";;$", "");
364
		urlsDenormalise = urlsDenormalise.replaceFirst(";;$", "");
379
		return urlsDenormalise;
365
		return urlsDenormalise;
380
	}
366
	}
381
	public void setUrl(String urlsDenormalise) {
367
	public void setUrl(String urlsDenormalise) {
382
		if (urlsDenormalise != null && !urlsDenormalise.equals("")) {
368
		if (urlsDenormalise != null && !urlsDenormalise.equals("")) {
383
			//GWT.log(urlsDenormalise, null);
369
			//GWT.log(urlsDenormalise, null);
384
			String[] tableauUrls = urlsDenormalise.split(";;");
370
			String[] tableauUrls = urlsDenormalise.split(";;");
385
			for (int i = 0; i < tableauUrls.length; i++) {
371
			for (int i = 0; i < tableauUrls.length; i++) {
386
				String url = tableauUrls[i];
372
				String url = tableauUrls[i];
387
				//GWT.log("\t"+url, null);
373
				//GWT.log("\t"+url, null);
388
				String[] tableauUrl = url.split("##");
374
				String[] tableauUrl = url.split("##");
389
				if (tableauUrl.length == 2) {
375
				if (tableauUrl.length == 2) {
390
					//GWT.log("\t\t"+tableauUrl[0]+"-"+tableauUrl[1], null);
376
					//GWT.log("\t\t"+tableauUrl[0]+"-"+tableauUrl[1], null);
391
					urls.set(tableauUrl[0], tableauUrl[1]);
377
					urls.set(tableauUrl[0], tableauUrl[1]);
392
				}
378
				}
393
			}
379
			}
394
		}
380
		}
395
	}
381
	}
396
	public void setUrl(String type, String url) {
382
	public void setUrl(String type, String url) {
397
		if (url != null) {
383
		if (url != null) {
398
			urls.set(type, url);
384
			urls.set(type, url);
399
		}
385
		}
400
	}
386
	}
401
 
387
 
402
	public Integer getNbrePersonne() {
388
	public Integer getNbrePersonne() {
403
		if (renvoyerValeurCorrecte("nbre_personne").equals("")) {
389
		if (renvoyerValeurCorrecte("nbre_personne").equals("")) {
404
			return null;
390
			return null;
405
		}
391
		}
406
		return Integer.parseInt(renvoyerValeurCorrecte("nbre_personne"));
392
		return Integer.parseInt(renvoyerValeurCorrecte("nbre_personne"));
407
	}
393
	}
408
	public void setNbrePersonne(Number nbrePersonne) {
394
	public void setNbrePersonne(Number nbrePersonne) {
409
		this.set("nbre_personne", nbrePersonne != null ? nbrePersonne.intValue() : null);
395
		this.set("nbre_personne", nbrePersonne != null ? nbrePersonne.intValue() : null);
410
	}
396
	}
411
	
397
	
412
	public String getConditionAcces() {
398
	public String getConditionAcces() {
413
		return renvoyerValeurCorrecte("condition_acces");
399
		return renvoyerValeurCorrecte("condition_acces");
414
	}
400
	}
415
	public void setConditionAcces(String acces) {
401
	public void setConditionAcces(String acces) {
416
		this.set("condition_acces", acces);
402
		this.set("condition_acces", acces);
417
	}
403
	}
418
 
404
 
419
	public String getConditionUsage() {
405
	public String getConditionUsage() {
420
		return renvoyerValeurCorrecte("condition_usage");
406
		return renvoyerValeurCorrecte("condition_usage");
421
	}
407
	}
422
	public void setConditionUsage(String usage) {
408
	public void setConditionUsage(String usage) {
423
		this.set("condition_usage", usage);
409
		this.set("condition_usage", usage);
424
	}
410
	}
425
	
411
	
426
	public StructureAPersonneListe getPersonnel() {
412
	public StructureAPersonneListe getPersonnel() {
427
		return personnel;
413
		return personnel;
428
	}
414
	}
429
	public void setPersonnel(StructureAPersonneListe personnelAStocker) {
415
	public void setPersonnel(StructureAPersonneListe personnelAStocker) {
430
		personnel = personnelAStocker;
416
		personnel = personnelAStocker;
431
	}
417
	}
432
	
418
	
433
	public StructureValorisation getValorisation() {
419
	public StructureValorisation getValorisation() {
434
		return valorisation;
420
		return valorisation;
435
	}
421
	}
436
	public void setValorisation(StructureValorisation valorisationAStocker) {
422
	public void setValorisation(StructureValorisation valorisationAStocker) {
437
		valorisation = valorisationAStocker;
423
		valorisation = valorisationAStocker;
438
	}
424
	}
439
	
425
	
440
	public StructureConservation getConservation() {
426
	public StructureConservation getConservation() {
441
		return conservation;
427
		return conservation;
442
	}
428
	}
443
	public void setConservation(StructureConservation conservationAStocker) {
429
	public void setConservation(StructureConservation conservationAStocker) {
444
		conservation = conservationAStocker;
430
		conservation = conservationAStocker;
445
	}
431
	}
446
	
432
	
447
	public String toString() {
433
	public String toString() {
448
		String sortie = "";
434
		String sortie = "";
449
		
435
		
450
		// Champs du BaseModelData
436
		// Champs du BaseModelData
451
		Set<String> proprietes = this.getProperties().keySet();
437
		Set<String> proprietes = this.getProperties().keySet();
452
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
438
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
453
			String cle = it.next();
439
			String cle = it.next();
454
			sortie += cle+" : "+this.get(cle)+"\n";
440
			sortie += cle+" : "+this.get(cle)+"\n";
455
		}
441
		}
456
		
442
		
457
		// Champs spéciaux
443
		// Champs spéciaux
458
		sortie += getUrl();
444
		sortie += getUrl();
459
		
445
		
460
		return sortie;
446
		return sortie;
461
	}
447
	}
462
	
448
	
463
}
449
}