Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1417 Rev 1513
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
	public String getAnneeOuDateFondation()	{
218
	public String getAnneeOuDateFondation()	{
218
		 String valeurDateFondation = get("date_fondation");
219
		 String valeurDateFondation = get("date_fondation");
219
		 if (!UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.endsWith("00-00")) {
220
		 if (!UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.endsWith("00-00")) {
220
			 valeurDateFondation = valeurDateFondation.substring(0, 4);
221
			 valeurDateFondation = valeurDateFondation.substring(0, 4);
221
		 } else if (UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.equals("0000-00-00")) {
222
		 } else if (UtilString.isEmpty(valeurDateFondation) && valeurDateFondation.equals("0000-00-00")) {
222
			 valeurDateFondation  = "";
223
			 valeurDateFondation  = "";
223
		 }
224
		 }
224
		 return valeurDateFondation;
225
		 return valeurDateFondation;
-
 
226
	}*/
-
 
227
	
-
 
228
	public String getAnneeOuDateFondation()	{
-
 
229
		 String valeurDateFondation = get("date_fondation");
-
 
230
		 return getDateSouple(valeurDateFondation);
-
 
231
	}
-
 
232
	
-
 
233
	public String getDateSouple(String date) {
-
 
234
		String valeurDate = date;
-
 
235
		
-
 
236
		String jour = "";
-
 
237
		String mois = "";
-
 
238
		String annee = "";
-
 
239
 
-
 
240
		// pas de date dans la BD
-
 
241
		if (UtilString.isEmpty(valeurDate) || valeurDate.equals("0000-00-00")) {
-
 
242
			valeurDate  = "";
-
 
243
		
-
 
244
		// YYYY
-
 
245
		} else if (valeurDate.endsWith("00-00")) {
-
 
246
			valeurDate = valeurDate.substring(0, 4);
-
 
247
			if (valeurDate.matches("\\d{4}")) {
-
 
248
				jour = "";
-
 
249
				mois = "";
-
 
250
				annee = valeurDate.substring(0,4);
-
 
251
				valeurDate = annee;
-
 
252
			}
-
 
253
			
-
 
254
		// YYYY-MM
-
 
255
		} else if (valeurDate.endsWith("-00")) {
-
 
256
			valeurDate = valeurDate.substring(0, 7);
-
 
257
			if (valeurDate.matches("\\d{4}-\\d{2}")) {
-
 
258
				jour = "";
-
 
259
				mois = valeurDate.substring(5,7);
-
 
260
				annee = valeurDate.substring(0,4);
-
 
261
				valeurDate = mois+"/"+annee;
-
 
262
			}
-
 
263
		}
-
 
264
		
-
 
265
		// YYYY-MM-DD
-
 
266
		else if (valeurDate.matches("\\d{4}-\\d{2}-\\d{2}")) {
-
 
267
			Date objetDate = DateTimeFormat.getFormat("yyyy-MM-dd").parse(valeurDate);
-
 
268
			DateTimeFormat fmt = DateTimeFormat.getFormat("dd/MM/yyyy");
-
 
269
			valeurDate = fmt.format(objetDate);
-
 
270
		}
-
 
271
		 
-
 
272
		 return valeurDate;
225
	}
273
	}
226
	
274
	
227
	public void setDateFondation(Date dateFondation) {
275
	public void setDateFondation(Date dateFondation) {
228
		if (dateFondation != null) {
276
		if (dateFondation != null) {
229
			this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
277
			this.set("date_fondation", DateTimeFormat.getFormat("yyyy-MM-dd").format(dateFondation));
230
		}
278
		}
231
	}
279
	}
232
	public void setDateFondation(String dateFondation) {
280
	public void setDateFondation(String dateFondation) {
233
		if (dateFondation != null) {
281
		if (dateFondation != null) {
234
			this.set("date_fondation", dateFondation);
282
			this.set("date_fondation", dateFondation);
235
		}
283
		}
236
	}
284
	}
237
		
285
		
238
	public String getCodePostal() {
286
	public String getCodePostal() {
239
		return renvoyerValeurCorrecte("code_postal");
287
		return renvoyerValeurCorrecte("code_postal");
240
	}
288
	}
241
	public void setCodePostal(String codePostal) {
289
	public void setCodePostal(String codePostal) {
242
		this.set("code_postal", codePostal);
290
		this.set("code_postal", codePostal);
243
	}
291
	}
244
	
292
	
245
	public String getVille() {
293
	public String getVille() {
246
		return renvoyerValeurCorrecte("ville");
294
		return renvoyerValeurCorrecte("ville");
247
	}
295
	}
248
	public void setVille(String ville) {
296
	public void setVille(String ville) {
249
		this.set("ville", ville);
297
		this.set("ville", ville);
250
	}
298
	}
251
	
299
	
252
	public String getRegion() {
300
	public String getRegion() {
253
		return getChaineDenormaliseUnique("ce_truk_region");
301
		return getChaineDenormaliseUnique("ce_truk_region");
254
	}
302
	}
255
	public void setRegion(String region) {
303
	public void setRegion(String region) {
256
		this.set("ce_truk_region", region);
304
		this.set("ce_truk_region", region);
257
	}
305
	}
258
	
306
	
259
	public String getPays() {
307
	public String getPays() {
260
		return getChaineDenormaliseUnique("ce_truk_pays");
308
		return getChaineDenormaliseUnique("ce_truk_pays");
261
	}
309
	}
262
	public void setPays(String pays) {
310
	public void setPays(String pays) {
263
		this.set("ce_truk_pays", pays);
311
		this.set("ce_truk_pays", pays);
264
	}
312
	}
265
	
313
	
266
	public String getLatitude() {
314
	public String getLatitude() {
267
		return renvoyerValeurCorrecte("latitude");
315
		return renvoyerValeurCorrecte("latitude");
268
	}
316
	}
269
	public void setLatitude(String latitude) {
317
	public void setLatitude(String latitude) {
270
		if (latitude != null)	{
318
		if (latitude != null)	{
271
			latitude = latitude.replace(".", ",");
319
			latitude = latitude.replace(".", ",");
272
		}
320
		}
273
		this.set("latitude", latitude);
321
		this.set("latitude", latitude);
274
	}
322
	}
275
 
323
 
276
	public String getLongitude() {
324
	public String getLongitude() {
277
		return renvoyerValeurCorrecte("longitude");
325
		return renvoyerValeurCorrecte("longitude");
278
	}
326
	}
279
	public void setLongitude(String longitude) {
327
	public void setLongitude(String longitude) {
280
		if (longitude != null)	{
328
		if (longitude != null)	{
281
			longitude = longitude.replace(".", ",");
329
			longitude = longitude.replace(".", ",");
282
		}
330
		}
283
		this.set("longitude", longitude);
331
		this.set("longitude", longitude);
284
	}
332
	}
285
	
333
	
286
	// TELEPHONE
334
	// TELEPHONE
287
	public String getTelephone() {
335
	public String getTelephone() {
288
		return renvoyerValeurCorrecte("truk_telephone");
336
		return renvoyerValeurCorrecte("truk_telephone");
289
	}
337
	}
290
	public void setTelephone(String tel) {
338
	public void setTelephone(String tel) {
291
		this.set("truk_telephone", tel);
339
		this.set("truk_telephone", tel);
292
	}	
340
	}	
293
 
341
 
294
	// TELEPHONE FIXE
342
	// TELEPHONE FIXE
295
	public String getTelephoneFixe() {
343
	public String getTelephoneFixe() {
296
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FIXE);
344
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FIXE);
297
	}
345
	}
298
	public void setTelephoneFixe(String fixe) {
346
	public void setTelephoneFixe(String fixe) {
299
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FIXE, fixe);
347
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FIXE, fixe);
300
	}
348
	}
301
	
349
	
302
	//TELEPHONE FAX
350
	//TELEPHONE FAX
303
	public String getFax() {
351
	public String getFax() {
304
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FAX);
352
		return getInfoDenormaliseParType(renvoyerValeurCorrecte("truk_telephone"), Personne.TELEPHONE_FAX);
305
	}
353
	}
306
	public void setFax(String fax) {
354
	public void setFax(String fax) {
307
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FAX, fax);
355
		modifierChaineDenormaliseParType("truk_telephone", Personne.TELEPHONE_FAX, fax);
308
	}
356
	}
309
 
357
 
310
	
358
	
311
	// COURRIEL
359
	// COURRIEL
312
	public String getCourriel() {
360
	public String getCourriel() {
313
		return renvoyerValeurCorrecte("courriel");
361
		return renvoyerValeurCorrecte("courriel");
314
	}
362
	}
315
	public void setCourriel(String courriel) {
363
	public void setCourriel(String courriel) {
316
		this.set("courriel", courriel);
364
		this.set("courriel", courriel);
317
	}
365
	}
318
	
366
	
319
	// URL
367
	// URL
320
	public String getUrl(String type) {
368
	public String getUrl(String type) {
321
		return urls.get(type);
369
		return urls.get(type);
322
	}
370
	}
323
	public String getUrl() {
371
	public String getUrl() {
324
		String urlsDenormalise = "";
372
		String urlsDenormalise = "";
325
		Set<String> proprietes = urls.getProperties().keySet();
373
		Set<String> proprietes = urls.getProperties().keySet();
326
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
374
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
327
			String cle = it.next();
375
			String cle = it.next();
328
			urlsDenormalise += cle+"##"+urls.get(cle)+";;";
376
			urlsDenormalise += cle+"##"+urls.get(cle)+";;";
329
		}
377
		}
330
		urlsDenormalise = urlsDenormalise.replaceFirst(";;$", "");
378
		urlsDenormalise = urlsDenormalise.replaceFirst(";;$", "");
331
		return urlsDenormalise;
379
		return urlsDenormalise;
332
	}
380
	}
333
	public void setUrl(String urlsDenormalise) {
381
	public void setUrl(String urlsDenormalise) {
334
		if (urlsDenormalise != null && !urlsDenormalise.equals("")) {
382
		if (urlsDenormalise != null && !urlsDenormalise.equals("")) {
335
			//GWT.log(urlsDenormalise, null);
383
			//GWT.log(urlsDenormalise, null);
336
			String[] tableauUrls = urlsDenormalise.split(";;");
384
			String[] tableauUrls = urlsDenormalise.split(";;");
337
			for (int i = 0; i < tableauUrls.length; i++) {
385
			for (int i = 0; i < tableauUrls.length; i++) {
338
				String url = tableauUrls[i];
386
				String url = tableauUrls[i];
339
				//GWT.log("\t"+url, null);
387
				//GWT.log("\t"+url, null);
340
				String[] tableauUrl = url.split("##");
388
				String[] tableauUrl = url.split("##");
341
				if (tableauUrl.length == 2) {
389
				if (tableauUrl.length == 2) {
342
					//GWT.log("\t\t"+tableauUrl[0]+"-"+tableauUrl[1], null);
390
					//GWT.log("\t\t"+tableauUrl[0]+"-"+tableauUrl[1], null);
343
					urls.set(tableauUrl[0], tableauUrl[1]);
391
					urls.set(tableauUrl[0], tableauUrl[1]);
344
				}
392
				}
345
			}
393
			}
346
		}
394
		}
347
	}
395
	}
348
	public void setUrl(String type, String url) {
396
	public void setUrl(String type, String url) {
349
		if (url != null) {
397
		if (url != null) {
350
			urls.set(type, url);
398
			urls.set(type, url);
351
		}
399
		}
352
	}
400
	}
353
	
401
	
354
	public int getNbrePersonne() {
402
	public int getNbrePersonne() {
355
		if (renvoyerValeurCorrecte("nbre_personne").equals("")) {
403
		if (renvoyerValeurCorrecte("nbre_personne").equals("")) {
356
			return 0;
404
			return 0;
357
		} else {
405
		} else {
358
			return Integer.parseInt(renvoyerValeurCorrecte("nbre_personne"));
406
			return Integer.parseInt(renvoyerValeurCorrecte("nbre_personne"));
359
		}
407
		}
360
	}
408
	}
361
	public void setNbrePersonne(int nbrePersonne) {
409
	public void setNbrePersonne(int nbrePersonne) {
362
		this.set("nbre_personne", Integer.toString(nbrePersonne));
410
		this.set("nbre_personne", Integer.toString(nbrePersonne));
363
	}
411
	}
364
	
412
	
365
	public String getConditionAcces() {
413
	public String getConditionAcces() {
366
		return renvoyerValeurCorrecte("condition_acces");
414
		return renvoyerValeurCorrecte("condition_acces");
367
	}
415
	}
368
	public void setConditionAcces(String acces) {
416
	public void setConditionAcces(String acces) {
369
		this.set("condition_acces", acces);
417
		this.set("condition_acces", acces);
370
	}
418
	}
371
 
419
 
372
	public String getConditionUsage() {
420
	public String getConditionUsage() {
373
		return renvoyerValeurCorrecte("condition_usage");
421
		return renvoyerValeurCorrecte("condition_usage");
374
	}
422
	}
375
	public void setConditionUsage(String usage) {
423
	public void setConditionUsage(String usage) {
376
		this.set("condition_usage", usage);
424
		this.set("condition_usage", usage);
377
	}
425
	}
378
	
426
	
379
	public StructureAPersonneListe getPersonnel() {
427
	public StructureAPersonneListe getPersonnel() {
380
		return personnel;
428
		return personnel;
381
	}
429
	}
382
	public void setPersonnel(StructureAPersonneListe personnelAStocker) {
430
	public void setPersonnel(StructureAPersonneListe personnelAStocker) {
383
		personnel = personnelAStocker;
431
		personnel = personnelAStocker;
384
	}
432
	}
385
	
433
	
386
	public StructureValorisation getValorisation() {
434
	public StructureValorisation getValorisation() {
387
		return valorisation;
435
		return valorisation;
388
	}
436
	}
389
	public void setValorisation(StructureValorisation valorisationAStocker) {
437
	public void setValorisation(StructureValorisation valorisationAStocker) {
390
		valorisation = valorisationAStocker;
438
		valorisation = valorisationAStocker;
391
	}
439
	}
392
	
440
	
393
	public StructureConservation getConservation() {
441
	public StructureConservation getConservation() {
394
		return conservation;
442
		return conservation;
395
	}
443
	}
396
	public void setConservation(StructureConservation conservationAStocker) {
444
	public void setConservation(StructureConservation conservationAStocker) {
397
		conservation = conservationAStocker;
445
		conservation = conservationAStocker;
398
	}
446
	}
399
	
447
	
400
	public String toString() {
448
	public String toString() {
401
		String sortie = "";
449
		String sortie = "";
402
		
450
		
403
		// Champs du BaseModelData
451
		// Champs du BaseModelData
404
		Set<String> proprietes = this.getProperties().keySet();
452
		Set<String> proprietes = this.getProperties().keySet();
405
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
453
		for (Iterator<String> it = proprietes.iterator(); it.hasNext();) {
406
			String cle = it.next();
454
			String cle = it.next();
407
			sortie += cle+" : "+this.get(cle)+"\n";
455
			sortie += cle+" : "+this.get(cle)+"\n";
408
		}
456
		}
409
		
457
		
410
		// Champs spéciaux
458
		// Champs spéciaux
411
		sortie += getUrl();
459
		sortie += getUrl();
412
		
460
		
413
		return sortie;
461
		return sortie;
414
	}
462
	}
415
	
463
	
416
}
464
}