Subversion Repositories eFlore/Applications.coel

Rev

Rev 1764 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

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