Subversion Repositories eFlore/Applications.coel

Rev

Rev 119 | Rev 166 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
60 jpm 1
package org.tela_botanica.client.modeles;
2
 
156 jp_milcent 3
import java.util.Date;
60 jpm 4
import java.util.Iterator;
5
import java.util.Set;
6
 
156 jp_milcent 7
import com.google.gwt.i18n.client.DateTimeFormat;
60 jpm 8
import com.google.gwt.json.client.JSONObject;
9
 
69 jpm 10
public class Structure extends aDonnee {
119 jpm 11
 
12
	public static final String PREFIXE = "cs";
13
 
60 jpm 14
	/**
15
	 * Constructeur vide
16
	 *
17
	 */
18
	public Structure() {
19
 
20
	}
21
 
22
	/**
23
	 * Constructeur avec un objet JSON
24
	 *
25
	 * @param image
26
	 */
27
	public Structure(JSONObject institution) {
28
		// l'objet JSON est une table de hachage
29
		Set<String> im = institution.keySet();
30
 
31
		// Parcourt pour chaque clé
32
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
33
			// Si elle est associée à une valeur, nous l'ajoutons
34
			String cle = it.next();
35
			// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
119 jpm 36
			String cleObjet = cle.replaceFirst("^"+Structure.PREFIXE+"_", "");
60 jpm 37
			if (institution.get(cle).isString() != null) {
38
				String valeur = institution.get(cle).isString().stringValue();
39
				this.set(cleObjet, valeur);
40
			} else {
41
				// Sinon, nous ajoutons la clé avec une valeur vide
42
				String valeur = " ";
43
				this.set(cleObjet, valeur);
44
			}
45
		}
46
	}
47
 
48
	public String getId() {
49
		return (String) renvoyerValeurCorrecte("id_structure");
50
	}
119 jpm 51
	public void setId(String idStructure) {
52
		this.set("id_structure", idStructure);
53
	}
60 jpm 54
 
119 jpm 55
	public String getIdProjet() {
56
		return (String) renvoyerValeurCorrecte("ce_projet");
57
	}
58
	public void setIdProjet(String idProjet) {
59
		this.set("ce_projet", idProjet);
60
	}
61
 
62
	public String getIdMere() {
63
		return (String) renvoyerValeurCorrecte("ce_mere");
64
	}
65
	public void setIdMere(String idMere) {
66
		this.set("ce_mere", idMere);
67
	}
68
 
69
	public String getGuid() {
70
		return (String) renvoyerValeurCorrecte("guid");
71
	}
72
	public void setGuid(String guid) {
73
		this.set("guid", guid);
74
	}
75
 
76
	public String getIdAlternatif() {
77
		return (String) renvoyerValeurCorrecte("truk_identifiant_alternatif");
78
	}
79
	public void setIdAlternatif(String idAlter) {
80
		this.set("truk_identifiant_alternatif", idAlter);
81
	}
82
 
60 jpm 83
	public String getNom() {
84
		return (String) renvoyerValeurCorrecte("nom");
85
	}
119 jpm 86
	public void setNom(String nom) {
87
		this.set("nom", nom);
88
	}
60 jpm 89
 
119 jpm 90
	public String getNomAlternatif() {
91
		return (String) renvoyerValeurCorrecte("truk_nom_alternatif");
92
	}
93
 
60 jpm 94
	public String getDescription() {
95
		return (String) renvoyerValeurCorrecte("description");
96
	}
97
 
119 jpm 98
	public String getType() {
99
		return (String) renvoyerValeurCorrecte("ce_type");
100
	}
101
	public void setType(String type) {
102
		this.set("ce_type", type);
103
	}
104
 
105
	public String getTypePrive() {
106
		return (String) renvoyerValeurCorrecte("ce_truk_type_prive");
107
	}
108
	public void setTypePrive(String typePrive) {
109
		this.set("ce_truk_type_prive", typePrive);
110
	}
111
 
112
	public String getTypePublic() {
113
		return (String) renvoyerValeurCorrecte("ce_truk_type_public");
114
	}
115
	public void setTypePublic(String typePublic) {
116
		this.set("ce_truk_type_public", typePublic);
117
	}
118
 
119
	public String getAdresse() {
60 jpm 120
		return (String) renvoyerValeurCorrecte("adresse_01");
121
	}
119 jpm 122
	public void setAdresse(String adr) {
123
		this.set("adresse_01", adr);
124
	}
125
 
126
	public String getAdresseComplement() {
127
		return (String) renvoyerValeurCorrecte("adresse_02");
128
	}
60 jpm 129
 
156 jp_milcent 130
	public Date getDateFondation() {
131
		return DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").parse((String) renvoyerValeurCorrecte("date_fondation"));
119 jpm 132
	}
156 jp_milcent 133
	public void setDateFondation(Date dateFondation) {
134
		if (dateFondation != null) {
135
			DateTimeFormat.getFormat("yyyy-MM-dd HH:mm:ss").format(dateFondation);
136
			this.set("date_fondation", dateFondation.toString());
137
		}
138
	}
119 jpm 139
	public void setDateFondation(String dateFondation) {
156 jp_milcent 140
		if (dateFondation != null) {
141
			this.set("date_fondation", dateFondation);
142
		}
119 jpm 143
	}
156 jp_milcent 144
 
60 jpm 145
	public String getCodePostal() {
146
		return (String) renvoyerValeurCorrecte("code_postal");
147
	}
119 jpm 148
	public void setCodePostal(String codePostal) {
149
		this.set("code_postal", codePostal);
150
	}
151
 
60 jpm 152
	public String getVille() {
153
		return (String) renvoyerValeurCorrecte("ville");
154
	}
119 jpm 155
	public void setVille(String ville) {
156
		this.set("ville", ville);
157
	}
158
 
60 jpm 159
	public String getRegion() {
160
		return (String) renvoyerValeurCorrecte("region");
161
	}
119 jpm 162
	public void setRegion(String region) {
163
		this.set("region", region);
164
	}
165
 
60 jpm 166
	public String getPays() {
167
		return (String) renvoyerValeurCorrecte("pays");
168
	}
119 jpm 169
	public void setPays(String pays) {
170
		this.set("pays", pays);
171
	}
60 jpm 172
 
119 jpm 173
	public String getLatitude() {
174
		return (String) renvoyerValeurCorrecte("latitude");
175
	}
176
 
177
	public String getLongitude() {
178
		return (String) renvoyerValeurCorrecte("longitude");
179
	}
180
 
60 jpm 181
	public String getTelephone() {
182
		return (String) renvoyerValeurCorrecte("telephone");
183
	}
119 jpm 184
	public void setTelephone(String tel) {
185
		this.set("telephone", tel);
186
	}
60 jpm 187
 
188
	public String getFax() {
189
		return (String) renvoyerValeurCorrecte("fax");
190
	}
119 jpm 191
	public void setFax(String fax) {
192
		this.set("fax", fax);
193
	}
60 jpm 194
 
195
	public String getCourriel() {
196
		return (String) renvoyerValeurCorrecte("courriel");
197
	}
119 jpm 198
	public void setCourriel(String courriel) {
199
		this.set("courriel", courriel);
200
	}
60 jpm 201
 
119 jpm 202
	public String getUrl() {
203
		return (String) renvoyerValeurCorrecte("truk_url");
204
	}
205
	public void setUrl(String url) {
206
		this.set("truk_url", url);
207
	}
208
 
209
	public String getNbrePersonne() {
210
		return (String) renvoyerValeurCorrecte("nbre_personne");
211
	}
212
	public void setNbrePersonne(String nbrePersonne) {
213
		this.set("nbre_personne", nbrePersonne);
214
	}
215
 
60 jpm 216
	public String getConditionAcces() {
217
		return (String) renvoyerValeurCorrecte("condition_acces");
218
	}
119 jpm 219
 
220
	public String getConditionUsage() {
221
		return (String) renvoyerValeurCorrecte("condition_usage");
222
	}
223
 
60 jpm 224
}