Subversion Repositories eFlore/Applications.coel

Rev

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

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