Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1685 Rev 1690
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
	
94
	
95
	public String getIdProjet() {
95
	public String getIdProjet() {
96
		return renvoyerValeurCorrecte("ce_projet");
96
		return renvoyerValeurCorrecte("ce_projet");
97
	}
97
	}
98
	public void setIdProjet(String idProjet) {
98
	public void setIdProjet(String idProjet) {
99
		this.set("ce_projet", idProjet);
99
		this.set("ce_projet", idProjet);
100
	}
100
	}
101
	
101
	
102
	public String getIdMere() {
102
	public String getIdMere() {
103
		return renvoyerValeurCorrecte("ce_mere");
103
		return renvoyerValeurCorrecte("ce_mere");
104
	}
104
	}
105
	public void setIdMere(String idMere) {
105
	public void setIdMere(String idMere) {
106
		this.set("ce_mere", idMere);
106
		this.set("ce_mere", idMere);
107
	}
107
	}
108
	
108
	
109
	public String getGuid() {
109
	public String getGuid() {
110
		return renvoyerValeurCorrecte("guid");
110
		return renvoyerValeurCorrecte("guid");
111
	}
111
	}
112
	public void setGuid(String guid) {
112
	public void setGuid(String guid) {
113
		this.set("guid", guid);
113
		this.set("guid", guid);
114
	}
114
	}
115
	
115
	
116
	public String getIdAlternatif() {
116
	public String getIdAlternatif() {
117
		return renvoyerValeurCorrecte("truk_identifiant_alternatif");
117
		return renvoyerValeurCorrecte("truk_identifiant_alternatif");
118
	}
118
	}
119
	public void setIdAlternatif(String idAlter) {
119
	public void setIdAlternatif(String idAlter) {
120
		this.set("truk_identifiant_alternatif", idAlter);
120
		this.set("truk_identifiant_alternatif", idAlter);
121
	}
121
	}
122
	
122
	
123
	public String getNom() {
123
	public String getNom() {
124
		return renvoyerValeurCorrecte("nom");
124
		return renvoyerValeurCorrecte("nom");
125
	}
125
	}
126
	public void setNom(String nom) {
126
	public void setNom(String nom) {
127
		this.set("nom", nom);
127
		this.set("nom", nom);
128
	}
128
	}
129
	
129
	
130
	public String getNomAlternatif() {
130
	public String getNomAlternatif() {
131
		return renvoyerValeurCorrecte("truk_nom_alternatif");
131
		return renvoyerValeurCorrecte("truk_nom_alternatif");
132
	}
132
	}
133
	
133
	
134
	public String getDescription() {
134
	public String getDescription() {
135
		return renvoyerValeurCorrecte("description");
135
		return renvoyerValeurCorrecte("description");
136
	}
136
	}
137
	public void setDescription(String description) {
137
	public void setDescription(String description) {
138
		this.set("description", description);
138
		this.set("description", description);
139
	}
139
	}
140
	
140
	
141
	public String getType() {
141
	public String getType() {
142
		return renvoyerValeurCorrecte("ce_type");
142
		return renvoyerValeurCorrecte("ce_type");
143
	}
143
	}
144
	public void setType(String type) {
144
	public void setType(String type) {
145
		this.set("ce_type", type);
145
		this.set("ce_type", type);
146
	}
146
	}
147
	
147
	
148
	public String getTypePrive() {
148
	public String getTypePrive() {
149
		return renvoyerValeurCorrecte("ce_truk_type_prive");
149
		return renvoyerValeurCorrecte("ce_truk_type_prive");
150
	}
150
	}
151
	public void setTypePrive(String typePrive) {
151
	public void setTypePrive(String typePrive) {
152
		this.set("ce_truk_type_prive", typePrive);
152
		this.set("ce_truk_type_prive", typePrive);
153
	}
153
	}
154
	
154
	
155
	public String getTypePublic() {
155
	public String getTypePublic() {
156
		return renvoyerValeurCorrecte("ce_truk_type_public");
156
		return renvoyerValeurCorrecte("ce_truk_type_public");
157
	}
157
	}
158
	public void setTypePublic(String typePublic) {
158
	public void setTypePublic(String typePublic) {
159
		this.set("ce_truk_type_public", typePublic);
159
		this.set("ce_truk_type_public", typePublic);
160
	}
160
	}
161
	
161
	
162
	public String getAbreviationProjet() {
162
	public String getAbreviationProjet() {
163
		return renvoyerValeurCorrecte("_abreviationprojet_");
163
		return renvoyerValeurCorrecte("_abreviationprojet_");
164
	}
164
	}
165
	public void setAbreviationProjet(String abreviation) {
165
	public void setAbreviationProjet(String abreviation) {
166
		this.set("_abreviationprojet_", abreviation);
166
		this.set("_abreviationprojet_", abreviation);
167
	}
167
	}
168
	
168
	
169
	public String getAdresse() {
169
	public String getAdresse() {
170
		return (String) renvoyerValeurCorrecte("adresse_01");
170
		return (String) renvoyerValeurCorrecte("adresse_01");
171
	}
171
	}
172
	public void setAdresse(String adr) {
172
	public void setAdresse(String adr) {
173
		this.set("adresse_01", adr);
173
		this.set("adresse_01", adr);
174
	}
174
	}
175
	
175
	
176
	public String getAdresseComplement() {
176
	public String getAdresseComplement() {
177
		return renvoyerValeurCorrecte("adresse_02");
177
		return renvoyerValeurCorrecte("adresse_02");
178
	}
178
	}
179
	public void setAdresseComplement(String adr) {
179
	public void setAdresseComplement(String adr) {
180
		this.set("adresse_02", adr);
180
		this.set("adresse_02", adr);
181
	}
181
	}
182
 
182
 
183
	public String getDateFondationFormatMysql() {
183
	public String getDateFondationFormatMysql() {
184
		return renvoyerValeurCorrecte("date_fondation");
184
		return renvoyerValeurCorrecte("date_fondation");
185
	}
185
	}
186
	public String getDateFondationFormatLong() {
186
	public String getDateFondationFormatLong() {
187
		String dateFormatee = "";
187
		String dateFormatee = "";
188
		Date dateFondation = getDateFondation();
188
		Date dateFondation = getDateFondation();
189
		if (dateFondation != null) {
189
		if (dateFondation != null) {
190
			dateFormatee = DateTimeFormat.getLongDateFormat().format(dateFondation);
190
			dateFormatee = DateTimeFormat.getLongDateFormat().format(dateFondation);
191
		}
191
		}
192
		return dateFormatee;
192
		return dateFormatee;
193
	}
193
	}
194
	
194
	
195
	public String getAnneOuDateFondationFormatLong() {
195
	public String getAnneOuDateFondationFormatLong() {
196
		String dateFormatee = "";
196
		String dateFormatee = "";
197
		String dateFondation =  renvoyerValeurCorrecte("date_fondation");
197
		String dateFondation =  renvoyerValeurCorrecte("date_fondation");
198
		if (!dateFondation.equals(""))	{
198
		if (!dateFondation.equals(""))	{
199
			if (dateFondation.endsWith("00-00"))	{
199
			if (dateFondation.endsWith("00-00"))	{
200
			dateFormatee = dateFondation.substring(0, 4);
200
			dateFormatee = dateFondation.substring(0, 4);
201
			} else {
201
			} else {
202
				Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);
202
				Date date = DateTimeFormat.getFormat("yyyy-MM-dd").parse(dateFondation);
203
				dateFormatee = DateTimeFormat.getLongDateFormat().format(date);
203
				dateFormatee = DateTimeFormat.getLongDateFormat().format(date);
204
			}
204
			}
205
		}
205
		}
206
		return dateFormatee;
206
		return dateFormatee;
207
	}
207
	}
208
	public Date getDateFondation() {
208
	public Date getDateFondation() {
209
		Date fondationDate = null;
209
		Date fondationDate = null;
210
		String fondationChaine = renvoyerValeurCorrecte("date_fondation");
210
		String fondationChaine = renvoyerValeurCorrecte("date_fondation");
211
		if (!fondationChaine.isEmpty() && !fondationChaine.equals("0000-00-00")) {
211
		if (!fondationChaine.isEmpty() && !fondationChaine.equals("0000-00-00")) {
212
			fondationDate = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(fondationChaine);
212
			fondationDate = DateTimeFormat.getFormat("yyyy-MM-dd").parseStrict(fondationChaine);
213
		}
213
		}
214
		return fondationDate;
214
		return fondationDate;
215
	}
215
	}
216
	
216
	
217
	/*
217
	/*
218
	public String getAnneeOuDateFondation()	{
218
	public String getAnneeOuDateFondation()	{
219
		 String valeurDateFondation = get("date_fondation");
219
		 String valeurDateFondation = get("date_fondation");
220
		 if (!UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.endsWith("00-00")) {
220
		 if (!UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.endsWith("00-00")) {
221
			 valeurDateFondation = valeurDateFondation.substring(0, 4);
221
			 valeurDateFondation = valeurDateFondation.substring(0, 4);
222
		 } else if (UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.equals("0000-00-00")) {
222
		 } else if (UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.equals("0000-00-00")) {
223
			 valeurDateFondation  = "";
223
			 valeurDateFondation  = "";
224
		 }
224
		 }
225
		 return valeurDateFondation;
225
		 return valeurDateFondation;
226
	}*/
226
	}*/
227
	
227
	
228
	public String getAnneeOuDateFondation()	{
228
	public String getAnneeOuDateFondation()	{
229
		 String valeurDateFondation = get("date_fondation");
229
		 String valeurDateFondation = get("date_fondation");
230
		 return getDateSouple(valeurDateFondation);
230
		 return getDateSouple(valeurDateFondation);
231
	}
231
	}
232
	
232
	
233
	public String getDateSouple(String date) {
233
	public String getDateSouple(String date) {
234
		String valeurDate = date;
234
		String valeurDate = date;
235
		
235
		
236
		String jour = "";
236
		String jour = "";
237
		String mois = "";
237
		String mois = "";
238
		String annee = "";
238
		String annee = "";
239
 
239
 
240
		// pas de date dans la BD
240
		// pas de date dans la BD
241
		if (UtilString.isEmpty(valeurDate) || valeurDate.equals("0000-00-00")) {
241
		if (UtilString.isEmpty(valeurDate) || valeurDate.equals("0000-00-00")) {
242
			valeurDate  = "";
242
			valeurDate  = "";
243
		
243
		
244
		// YYYY
244
		// YYYY
245
		} else if (valeurDate.endsWith("00-00")) {
245
		} else if (valeurDate.endsWith("00-00")) {
246
			valeurDate = valeurDate.substring(0, 4);
246
			valeurDate = valeurDate.substring(0, 4);
247
			if (valeurDate.matches("\\d{4}")) {
247
			if (valeurDate.matches("\\d{4}")) {
248
				jour = "";
248
				jour = "";
249
				mois = "";
249
				mois = "";
250
				annee = valeurDate.substring(0,4);
250
				annee = valeurDate.substring(0,4);
251
				valeurDate = annee;
251
				valeurDate = annee;
252
			}
252
			}
253
			
253
			
254
		// YYYY-MM
254
		// YYYY-MM
255
		} else if (valeurDate.endsWith("-00")) {
255
		} else if (valeurDate.endsWith("-00")) {
256
			valeurDate = valeurDate.substring(0, 7);
256
			valeurDate = valeurDate.substring(0, 7);
257
			if (valeurDate.matches("\\d{4}-\\d{2}")) {
257
			if (valeurDate.matches("\\d{4}-\\d{2}")) {
258
				jour = "";
258
				jour = "";
259
				mois = valeurDate.substring(5,7);
259
				mois = valeurDate.substring(5,7);
260
				annee = valeurDate.substring(0,4);
260
				annee = valeurDate.substring(0,4);
261
				valeurDate = mois+"/"+annee;
261
				valeurDate = mois+"/"+annee;
262
			}
262
			}
263
		}
263
		}
264
		
264
		
265
		// YYYY-MM-DD
265
		// YYYY-MM-DD
266
		else if (valeurDate.matches("\\d{4}-\\d{2}-\\d{2}")) {
266
		else if (valeurDate.matches("\\d{4}-\\d{2}-\\d{2}")) {
267
			Date objetDate = DateTimeFormat.getFormat("yyyy-MM-dd").parse(valeurDate);
267
			Date objetDate = DateTimeFormat.getFormat("yyyy-MM-dd").parse(valeurDate);
268
			DateTimeFormat fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
268
			DateTimeFormat fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
269
			valeurDate = fmt.format(objetDate);
269
			valeurDate = fmt.format(objetDate);
270
		}
270
		}
271
		 
271
		 
272
		 return valeurDate;
272
		 return valeurDate;
273
	}
273
	}
274
	
274
	
275
	public void setDateFondation(Date dateFondation) {
275
	public void setDateFondation(Date dateFondation) {
276
		if (dateFondation != null) {
276
		if (dateFondation != null) {
277
			this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
277
			this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
278
		}
278
		}
279
	}
279
	}
280
	public void setDateFondation(String dateFondation) {
280
	public void setDateFondation(String dateFondation) {
281
		if (dateFondation != null) {
281
		if (dateFondation != null) {
282
			this.set("date_fondation", dateFondation);
282
			this.set("date_fondation", dateFondation);
283
		}
283
		}
284
	}
284
	}
285
		
285
		
286
	public String getCodePostal() {
286
	public String getCodePostal() {
287
		return renvoyerValeurCorrecte("code_postal");
287
		return renvoyerValeurCorrecte("code_postal");
288
	}
288
	}
289
	public void setCodePostal(String codePostal) {
289
	public void setCodePostal(String codePostal) {
290
		this.set("code_postal", codePostal);
290
		this.set("code_postal", codePostal);
291
	}
291
	}
292
	
292
	
293
	public String getVille() {
293
	public String getVille() {
294
		return renvoyerValeurCorrecte("ville");
294
		return renvoyerValeurCorrecte("ville");
295
	}
295
	}
296
	public void setVille(String ville) {
296
	public void setVille(String ville) {
297
		this.set("ville", ville);
297
		this.set("ville", ville);
298
	}
298
	}
299
	
299
	
300
	public String getRegion() {
300
	public String getRegion() {
301
		return getChaineDenormaliseUnique("ce_truk_region");
301
		return getChaineDenormaliseUnique("ce_truk_region");
302
	}
302
	}
303
	public void setRegion(String region) {
303
	public void setRegion(String region) {
304
		this.set("ce_truk_region", region);
304
		this.set("ce_truk_region", region);
305
	}
305
	}
306
	
306
	
307
	public String getPays() {
307
	public String getPays() {
308
		return getChaineDenormaliseUnique("ce_truk_pays");
308
		return getChaineDenormaliseUnique("ce_truk_pays");
309
	}
309
	}
310
	public void setPays(String pays) {
310
	public void setPays(String pays) {
311
		this.set("ce_truk_pays", pays);
311
		this.set("ce_truk_pays", pays);
312
	}
312
	}
313
	
313
	
314
	public String getLatitude() {
314
	public String getLatitude() {
315
		return renvoyerValeurCorrecte("latitude");
315
		return renvoyerValeurCorrecte("latitude");
316
	}
316
	}
317
	public void setLatitude(String latitude) {
317
	public void setLatitude(String latitude) {
318
		if (latitude != null)	{
318
		if (latitude != null)	{
319
			latitude = latitude.replace(".", ",");
319
			latitude = latitude.replace(".", ",");
320
		}
320
		}
321
		this.set("latitude", latitude);
321
		this.set("latitude", latitude);
322
	}
322
	}
323
 
323
 
324
	public String getLongitude() {
324
	public String getLongitude() {
325
		return renvoyerValeurCorrecte("longitude");
325
		return renvoyerValeurCorrecte("longitude");
326
	}
326
	}
327
	public void setLongitude(String longitude) {
327
	public void setLongitude(String longitude) {
328
		if (longitude != null)	{
328
		if (longitude != null)	{
329
			longitude = longitude.replace(".", ",");
329
			longitude = longitude.replace(".", ",");
330
		}
330
		}
331
		this.set("longitude", longitude);
331
		this.set("longitude", longitude);
332
	}
332
	}
333
	
333
	
334
	// TELEPHONE
334
	// TELEPHONE
335
	public String getTelephone() {
335
	public String getTelephone() {
336
		return renvoyerValeurCorrecte("truk_telephone");
336
		return renvoyerValeurCorrecte("truk_telephone");
337
	}
337
	}
338
	public void setTelephone(String tel) {
338
	public void setTelephone(String tel) {
339
		this.set("truk_telephone", tel);
339
		this.set("truk_telephone", tel);
340
	}	
340
	}	
341
 
341
 
342
	// TELEPHONE FIXE
342
	// TELEPHONE FIXE
343
	public String getTelephoneFixe() {
343
	public String getTelephoneFixe() {
344
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FIXE);
344
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FIXE);
345
	}
345
	}
346
	public void setTelephoneFixe(String fixe) {
346
	public void setTelephoneFixe(String fixe) {
347
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FIXE, fixe);
347
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FIXE, fixe);
348
	}
348
	}
349
	
349
	
350
	//TELEPHONE FAX
350
	//TELEPHONE FAX
351
	public String getFax() {
351
	public String getFax() {
352
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FAX);
352
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FAX);
353
	}
353
	}
354
	public void setFax(String fax) {
354
	public void setFax(String fax) {
355
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FAX, fax);
355
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FAX, fax);
356
	}
356
	}
357
 
357
 
358
	
358
	
359
	// COURRIEL
359
	// COURRIEL
360
	public String getCourriel() {
360
	public String getCourriel() {
361
		return renvoyerValeurCorrecte("courriel");
361
		return renvoyerValeurCorrecte("courriel");
362
	}
362
	}
363
	public void setCourriel(String courriel) {
363
	public void setCourriel(String courriel) {
364
		this.set("courriel", courriel);
364
		this.set("courriel", courriel);
365
	}
365
	}
366
	
366
	
367
	// URL
367
	// URL
368
	public String getUrl(String type) {
368
	public String getUrl(String type) {
369
		return urls.get(type);
369
		return urls.get(type);
370
	}
370
	}
371
	public String getUrl() {
371
	public String getUrl() {
372
		String urlsDenormalise = "";
372
		String urlsDenormalise = "";
373
		Set<String> proprietes = urls.getProperties().keySet();
373
		Set<String> proprietes = urls.getProperties().keySet();
374
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
374
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
375
			String cle = it.next();
375
			String cle = it.next();
376
			urlsDenormalise += cle+"##"+urls.get(cle)+";;";
376
			urlsDenormalise += cle+"##"+urls.get(cle)+";;";
377
		}
377
		}
378
		urlsDenormalise = urlsDenormalise.replaceFirst(";;$", "");
378
		urlsDenormalise = urlsDenormalise.replaceFirst(";;$", "");
379
		return urlsDenormalise;
379
		return urlsDenormalise;
380
	}
380
	}
381
	public void setUrl(String urlsDenormalise) {
381
	public void setUrl(String urlsDenormalise) {
382
		if (urlsDenormalise != null && !urlsDenormalise.equals("")) {
382
		if (urlsDenormalise != null && !urlsDenormalise.equals("")) {
383
			//GWT.log(urlsDenormalise, null);
383
			//GWT.log(urlsDenormalise, null);
384
			String[] tableauUrls = urlsDenormalise.split(";;");
384
			String[] tableauUrls = urlsDenormalise.split(";;");
385
			for (int i = 0; i < tableauUrls.length; i++) {
385
			for (int i = 0; i < tableauUrls.length; i++) {
386
				String url = tableauUrls[i];
386
				String url = tableauUrls[i];
387
				//GWT.log("\t"+url, null);
387
				//GWT.log("\t"+url, null);
388
				String[] tableauUrl = url.split("##");
388
				String[] tableauUrl = url.split("##");
389
				if (tableauUrl.length == 2) {
389
				if (tableauUrl.length == 2) {
390
					//GWT.log("\t\t"+tableauUrl[0]+"-"+tableauUrl[1], null);
390
					//GWT.log("\t\t"+tableauUrl[0]+"-"+tableauUrl[1], null);
391
					urls.set(tableauUrl[0], tableauUrl[1]);
391
					urls.set(tableauUrl[0], tableauUrl[1]);
392
				}
392
				}
393
			}
393
			}
394
		}
394
		}
395
	}
395
	}
396
	public void setUrl(String type, String url) {
396
	public void setUrl(String type, String url) {
397
		if (url != null) {
397
		if (url != null) {
398
			urls.set(type, url);
398
			urls.set(type, url);
399
		}
399
		}
400
	}
400
	}
401
 
401
 
402
	public Integer getNbrePersonne() {
402
	public Integer getNbrePersonne() {
403
		if (renvoyerValeurCorrecte("nbre_personne").equals("")) {
403
		if (renvoyerValeurCorrecte("nbre_personne").equals("")) {
404
			return null;
404
			return null;
405
		}
405
		}
406
		return Integer.parseInt(renvoyerValeurCorrecte("nbre_personne"));
406
		return Integer.parseInt(renvoyerValeurCorrecte("nbre_personne"));
407
	}
407
	}
408
	public void setNbrePersonne(int nbrePersonne) {
408
	public void setNbrePersonne(Number nbrePersonne) {
409
		this.set("nbre_personne", Integer.toString(nbrePersonne));
409
		this.set("nbre_personne", nbrePersonne != null ? nbrePersonne.intValue() : null);
410
	}
410
	}
411
	
411
	
412
	public String getConditionAcces() {
412
	public String getConditionAcces() {
413
		return renvoyerValeurCorrecte("condition_acces");
413
		return renvoyerValeurCorrecte("condition_acces");
414
	}
414
	}
415
	public void setConditionAcces(String acces) {
415
	public void setConditionAcces(String acces) {
416
		this.set("condition_acces", acces);
416
		this.set("condition_acces", acces);
417
	}
417
	}
418
 
418
 
419
	public String getConditionUsage() {
419
	public String getConditionUsage() {
420
		return renvoyerValeurCorrecte("condition_usage");
420
		return renvoyerValeurCorrecte("condition_usage");
421
	}
421
	}
422
	public void setConditionUsage(String usage) {
422
	public void setConditionUsage(String usage) {
423
		this.set("condition_usage", usage);
423
		this.set("condition_usage", usage);
424
	}
424
	}
425
	
425
	
426
	public StructureAPersonneListe getPersonnel() {
426
	public StructureAPersonneListe getPersonnel() {
427
		return personnel;
427
		return personnel;
428
	}
428
	}
429
	public void setPersonnel(StructureAPersonneListe personnelAStocker) {
429
	public void setPersonnel(StructureAPersonneListe personnelAStocker) {
430
		personnel = personnelAStocker;
430
		personnel = personnelAStocker;
431
	}
431
	}
432
	
432
	
433
	public StructureValorisation getValorisation() {
433
	public StructureValorisation getValorisation() {
434
		return valorisation;
434
		return valorisation;
435
	}
435
	}
436
	public void setValorisation(StructureValorisation valorisationAStocker) {
436
	public void setValorisation(StructureValorisation valorisationAStocker) {
437
		valorisation = valorisationAStocker;
437
		valorisation = valorisationAStocker;
438
	}
438
	}
439
	
439
	
440
	public StructureConservation getConservation() {
440
	public StructureConservation getConservation() {
441
		return conservation;
441
		return conservation;
442
	}
442
	}
443
	public void setConservation(StructureConservation conservationAStocker) {
443
	public void setConservation(StructureConservation conservationAStocker) {
444
		conservation = conservationAStocker;
444
		conservation = conservationAStocker;
445
	}
445
	}
446
	
446
	
447
	public String toString() {
447
	public String toString() {
448
		String sortie = "";
448
		String sortie = "";
449
		
449
		
450
		// Champs du BaseModelData
450
		// Champs du BaseModelData
451
		Set<String> proprietes = this.getProperties().keySet();
451
		Set<String> proprietes = this.getProperties().keySet();
452
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
452
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
453
			String cle = it.next();
453
			String cle = it.next();
454
			sortie += cle+" : "+this.get(cle)+"\n";
454
			sortie += cle+" : "+this.get(cle)+"\n";
455
		}
455
		}
456
		
456
		
457
		// Champs spéciaux
457
		// Champs spéciaux
458
		sortie += getUrl();
458
		sortie += getUrl();
459
		
459
		
460
		return sortie;
460
		return sortie;
461
	}
461
	}
462
	
462
	
463
}
463
}