Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1693 Rev 1695
1
package org.tela_botanica.client.modeles.structure;
1
package org.tela_botanica.client.modeles.structure;
2
 
2
 
3
import java.util.Iterator;
3
import java.util.Iterator;
4
import java.util.Set;
4
import java.util.Set;
5
 
5
 
6
import org.tela_botanica.client.modeles.aDonnee;
6
import org.tela_botanica.client.modeles.aDonnee;
7
 
7
 
8
import com.google.gwt.json.client.JSONObject;
8
import com.google.gwt.json.client.JSONObject;
9
 
9
 
10
public class StructureConservation extends aDonnee {
10
public class StructureConservation extends aDonnee {
11
	
11
	
12
	private static final long serialVersionUID = -4556005804101933910L;
12
	private static final long serialVersionUID = -4556005804101933910L;
13
 
13
 
14
	public static final String PREFIXE = "csc";
14
	public static final String PREFIXE = "csc";
15
	public static String[] champsObligatoires = {"csc_id_structure"};
15
	public static String[] champsObligatoires = {"csc_id_structure"};
16
	
16
	
17
	public StructureConservation() {
17
	public StructureConservation() {
18
	}
18
	}
19
	
19
	
20
	public StructureConservation(JSONObject conservation) {
20
	public StructureConservation(JSONObject conservation) {
21
		// L'objet JSON est une table de hachage
21
		// L'objet JSON est une table de hachage
22
		Set<String> im = conservation.keySet();
22
		Set<String> im = conservation.keySet();
23
 
23
 
24
		// Parcourt pour chaque clé
24
		// Parcourt pour chaque clé
25
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
25
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
26
			// Si elle est associée à une valeur, nous l'ajoutons
26
			// Si elle est associée à une valeur, nous l'ajoutons
27
			String cle = it.next();
27
			String cle = it.next();
28
			if (cle.startsWith(PREFIXE+"_")) {
28
			if (cle.startsWith(PREFIXE+"_")) {
29
				// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
29
				// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
30
				String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
30
				String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
31
				// Sinon, nous ajoutons la clé avec une valeur vide
31
				// Sinon, nous ajoutons la clé avec une valeur vide
32
				String valeur = "";
32
				String valeur = "";
33
				if (conservation.get(cle).isString() != null) {
33
				if (conservation.get(cle).isString() != null) {
34
					valeur = conservation.get(cle).isString().stringValue();
34
					valeur = conservation.get(cle).isString().stringValue();
35
				}
35
				}
36
				this.set(cleObjet, valeur);
36
				this.set(cleObjet, valeur);
37
			}
37
			}
38
		}
38
		}
39
	}
39
	}
40
 
40
 
41
	@Override
41
	@Override
42
	protected String getPrefixe() {
42
	protected String getPrefixe() {
43
		return PREFIXE;
43
		return PREFIXE;
44
	}
44
	}
45
	
45
	
46
	protected String[] getChampsObligatoires()	{
46
	protected String[] getChampsObligatoires()	{
47
		return champsObligatoires;
47
		return champsObligatoires;
48
	}
48
	}
49
	
49
	
50
	// FORMATION
50
	// FORMATION
51
	public Integer getFormation() {
51
	public Integer getFormation() {
52
		if (renvoyerValeurCorrecte("mark_formation").equals("")) {
52
		if (renvoyerValeurCorrecte("mark_formation").equals("")) {
53
			return null;
53
			return null;
54
		}
54
		}
55
		return Integer.parseInt(renvoyerValeurCorrecte("mark_formation"));
55
		return Integer.parseInt(renvoyerValeurCorrecte("mark_formation"));
56
	}
56
	}
57
	public void setFormation(String f) {
57
	public void setFormation(String f) {
58
		this.set("mark_formation", f != null ? Integer.parseInt(f) : null);
58
		this.set("mark_formation", f != null ? Integer.parseInt(f) : null);
59
	}
59
	}
60
	
60
	
61
	// FORMATION INFO
61
	// FORMATION INFO
62
	public String getFormationInfo() {
62
	public String getFormationInfo() {
63
		return renvoyerValeurCorrecte("formation");
63
		return renvoyerValeurCorrecte("formation");
64
	}
64
	}
65
	public void setFormationInfo(String f) {
65
	public void setFormationInfo(String f) {
66
		this.set("formation", f);
66
		this.set("formation", f);
67
	}
67
	}
68
	
68
	
69
	// FORMATION INTÉRÊT
69
	// FORMATION INTÉRÊT
70
	public Integer getFormationInteret() {
70
	public Integer getFormationInteret() {
71
		if (renvoyerValeurCorrecte("mark_formation_interet").equals("")) {
71
		if (renvoyerValeurCorrecte("mark_formation_interet").equals("")) {
72
			return null;
72
			return null;
73
		}
73
		}
74
		return Integer.parseInt(renvoyerValeurCorrecte("mark_formation_interet"));
74
		return Integer.parseInt(renvoyerValeurCorrecte("mark_formation_interet"));
75
	}
75
	}
76
	public void setFormationInteret(String f) {
76
	public void setFormationInteret(String f) {
77
		this.set("mark_formation_interet", f != null ? Integer.parseInt(f) : null);
77
		this.set("mark_formation_interet", f != null ? Integer.parseInt(f) : null);
78
	}
78
	}
79
	
79
	
80
	// STOCKAGE LOCAL
80
	// STOCKAGE LOCAL
81
	public String getStockageLocal() {
81
	public String getStockageLocal() {
82
		return renvoyerValeurCorrecte("truk_stockage_local");
82
		return renvoyerValeurCorrecte("truk_stockage_local");
83
	}
83
	}
84
	public void setStockageLocal(String sl) {
84
	public void setStockageLocal(String sl) {
85
		this.set("truk_stockage_local", sl);
85
		this.set("truk_stockage_local", sl);
86
	}
86
	}
87
	public void setStockageLocal(String type, Object valeur) {
87
	public void setStockageLocal(String type, Object valeur) {
88
		remplacerTypeDansChaineDenormalise("truk_stockage_local", type, valeur);
88
		remplacerTypeDansChaineDenormalise("truk_stockage_local", type, valeur);
89
	}
89
	}
90
	
90
	
91
	// STOCKAGE MEUBLE
91
	// STOCKAGE MEUBLE
92
	public String getStockageMeuble() {
92
	public String getStockageMeuble() {
93
		return renvoyerValeurCorrecte("truk_stockage_meuble");
93
		return renvoyerValeurCorrecte("truk_stockage_meuble");
94
	}
94
	}
95
	public void setStockageMeuble(String sm) {
95
	public void setStockageMeuble(String sm) {
96
		this.set("truk_stockage_meuble", sm);
96
		this.set("truk_stockage_meuble", sm);
97
	}
97
	}
98
	public void setStockageMeuble(String type, Object valeur) {
98
	public void setStockageMeuble(String type, Object valeur) {
99
		remplacerTypeDansChaineDenormalise("truk_stockage_meuble", type, valeur);
99
		remplacerTypeDansChaineDenormalise("truk_stockage_meuble", type, valeur);
100
	}
100
	}
101
	
101
	
102
	// STOCKAGE PARAMÊTRE
102
	// STOCKAGE PARAMÊTRE
103
	public String getStockageParametre() {
103
	public String getStockageParametre() {
104
		return renvoyerValeurCorrecte("truk_stockage_parametre");
104
		return renvoyerValeurCorrecte("truk_stockage_parametre");
105
	}
105
	}
106
	public void setStockageParametre(String sl) {
106
	public void setStockageParametre(String sl) {
107
		this.set("truk_stockage_parametre", sl);
107
		this.set("truk_stockage_parametre", sl);
108
	}
108
	}
109
	public void setStockageParametre(String type, Object valeur) {
109
	public void setStockageParametre(String type, Object valeur) {
110
		remplacerTypeDansChaineDenormalise("truk_stockage_parametre", type, valeur);
110
		remplacerTypeDansChaineDenormalise("truk_stockage_parametre", type, valeur);
111
	}
111
	}
112
	
112
	
113
	// COLLECTION COMMUNE
113
	// COLLECTION COMMUNE
114
	public String getCollectionCommune() {
114
	public Integer getCollectionCommune() {
-
 
115
		if (renvoyerValeurCorrecte("mark_collection_commune").equals("")) {
-
 
116
			return null;
-
 
117
		}
115
		return renvoyerValeurCorrecte("mark_collection_commune");
118
		return Integer.parseInt(renvoyerValeurCorrecte("mark_collection_commune"));
116
	}
119
	}
117
	public void setCollectionCommune(String ccm) {
120
	public void setCollectionCommune(String ccm) {
118
		this.set("mark_collection_commune", ccm);
121
		this.set("mark_collection_commune", ccm != null ? Integer.parseInt(ccm) : null);
119
	}
122
	}
120
	
123
	
121
	// COLLECTION AUTRE
124
	// COLLECTION AUTRE
122
	public String getCollectionAutre() {
125
	public String getCollectionAutre() {
123
		return renvoyerValeurCorrecte("truk_collection_autre");
126
		return renvoyerValeurCorrecte("truk_collection_autre");
124
	}
127
	}
125
	public void setCollectionAutre(String ca) {
128
	public void setCollectionAutre(String ca) {
126
		this.set("truk_collection_autre", ca);
129
		this.set("truk_collection_autre", ca);
127
	}
130
	}
128
	public void setCollectionAutre(String type, Object valeur) {
131
	public void setCollectionAutre(String type, Object valeur) {
129
		remplacerTypeDansChaineDenormalise("truk_collection_autre", type, valeur);
132
		remplacerTypeDansChaineDenormalise("truk_collection_autre", type, valeur);
130
	}
133
	}
131
	
134
	
132
	// ACCÈS CONTROLÉ
135
	// ACCÈS CONTROLÉ
133
	public String getAccesControle() {
136
	public Integer getAccesControle() {
-
 
137
		if (renvoyerValeurCorrecte("mark_acces_controle").equals("")) {
-
 
138
			return null;
-
 
139
		}
134
		return renvoyerValeurCorrecte("mark_acces_controle");
140
		return Integer.parseInt(renvoyerValeurCorrecte("mark_acces_controle"));
135
	}
141
	}
136
	public void setAccesControle(String ac) {
142
	public void setAccesControle(String ac) {
137
		this.set("mark_acces_controle", ac);
143
		this.set("mark_acces_controle", ac != null ? Integer.parseInt(ac) : null);
138
	}
144
	}
139
	
145
	
140
	// RESTAURATION
146
	// RESTAURATION
141
	public String getRestauration() {
147
	public Integer getRestauration() {
-
 
148
		if (renvoyerValeurCorrecte("mark_restauration").equals("")) {
-
 
149
			return null;
-
 
150
		}
142
		return renvoyerValeurCorrecte("mark_restauration");
151
		return Integer.parseInt(renvoyerValeurCorrecte("mark_restauration"));
143
	}
152
	}
144
	public void setRestauration(String ccm) {
153
	public void setRestauration(String ccm) {
145
		this.set("mark_restauration", ccm);
154
		this.set("mark_restauration", ccm != null ? Integer.parseInt(ccm) : null);
146
	}
155
	}
147
	
156
	
148
	// RESTAURATION OPÉRATION
157
	// RESTAURATION OPÉRATION
149
	public String getRestaurationOperation() {
158
	public String getRestaurationOperation() {
150
		return renvoyerValeurCorrecte("truk_restauration_operation");
159
		return renvoyerValeurCorrecte("truk_restauration_operation");
151
	}
160
	}
152
	public void setRestaurationOperation(String ro) {
161
	public void setRestaurationOperation(String ro) {
153
		this.set("truk_restauration_operation", ro);
162
		this.set("truk_restauration_operation", ro);
154
	}
163
	}
155
	public void setRestaurationOperation(String type, Object valeur) {
164
	public void setRestaurationOperation(String type, Object valeur) {
156
		ajouterChaineDenormaliseAvecType("truk_restauration_operation", type, valeur);
165
		ajouterChaineDenormaliseAvecType("truk_restauration_operation", type, valeur);
157
	}
166
	}
158
	
167
	
159
	// MATERIEL CONSERVATION
168
	// MATERIEL CONSERVATION
160
	public String getMaterielConservation() {
169
	public String getMaterielConservation() {
161
		return renvoyerValeurCorrecte("ce_materiel_conservation");
170
		return renvoyerValeurCorrecte("ce_materiel_conservation");
162
	}
171
	}
163
	public void setMaterielConservation(String mc) {
172
	public void setMaterielConservation(String mc) {
164
		this.set("ce_materiel_conservation", mc);
173
		this.set("ce_materiel_conservation", mc);
165
	}
174
	}
166
	
175
	
167
	// MATERIEL AUTRE
176
	// MATERIEL AUTRE
168
	public String getMaterielAutre() {
177
	public String getMaterielAutre() {
169
		return renvoyerValeurCorrecte("truk_materiel_autre");
178
		return renvoyerValeurCorrecte("truk_materiel_autre");
170
	}
179
	}
171
	public void setMaterielAutre(String ma) {
180
	public void setMaterielAutre(String ma) {
172
		this.set("truk_materiel_autre", ma);
181
		this.set("truk_materiel_autre", ma);
173
	}
182
	}
174
	public void setMaterielAutre(String type, Object valeur) {
183
	public void setMaterielAutre(String type, Object valeur) {
175
		ajouterChaineDenormaliseAvecType("truk_materiel_autre", type, valeur);
184
		ajouterChaineDenormaliseAvecType("truk_materiel_autre", type, valeur);
176
	}
185
	}
177
	
186
	
178
	// TRAITEMENT
187
	// TRAITEMENT
179
	public String getTraitement() {
188
	public Integer getTraitement() {
-
 
189
		if (renvoyerValeurCorrecte("mark_traitement").equals("")) {
-
 
190
			return null;
-
 
191
		}
180
		return renvoyerValeurCorrecte("mark_traitement");
192
		return Integer.parseInt(renvoyerValeurCorrecte("mark_traitement"));
181
	}
193
	}
182
	public void setTraitement(String t) {
194
	public void setTraitement(String t) {
183
		this.set("mark_traitement", t);
195
		this.set("mark_traitement", t != null ? Integer.parseInt(t) : null);
184
	}
196
	}
185
	
197
	
186
	// TRAITEMENTS
198
	// TRAITEMENTS
187
	public String getTraitements() {
199
	public String getTraitements() {
188
		return renvoyerValeurCorrecte("truk_traitement");
200
		return renvoyerValeurCorrecte("truk_traitement");
189
	}
201
	}
190
	public void setTraitements(String t) {
202
	public void setTraitements(String t) {
191
		this.set("truk_traitement", t);
203
		this.set("truk_traitement", t);
192
	}
204
	}
193
	public void setTraitements(String type, Object valeur) {
205
	public void setTraitements(String type, Object valeur) {
194
		ajouterChaineDenormaliseAvecType("truk_traitement", type, valeur);
206
		ajouterChaineDenormaliseAvecType("truk_traitement", type, valeur);
195
	}
207
	}
196
	
208
	
197
	// ACQUISITION COLLECTION
209
	// ACQUISITION COLLECTION
198
	public String getAcquisitionCollection() {
210
	public Integer getAcquisitionCollection() {
-
 
211
		if (renvoyerValeurCorrecte("mark_acquisition_collection").equals("")) {
-
 
212
			return null;
-
 
213
		}
199
		return renvoyerValeurCorrecte("mark_acquisition_collection");
214
		return Integer.parseInt(renvoyerValeurCorrecte("mark_acquisition_collection"));
200
	}
215
	}
201
	public void setAcquisitionCollection(String ac) {
216
	public void setAcquisitionCollection(String ac) {
202
		this.set("mark_acquisition_collection", ac);
217
		this.set("mark_acquisition_collection", ac != null ? Integer.parseInt(ac) : null);
203
	}
218
	}
204
	
219
	
205
	// ACQUISITION ECHANTILLON
220
	// ACQUISITION ECHANTILLON
206
	public String getAcquisitionEchantillon() {
221
	public Integer getAcquisitionEchantillon() {
-
 
222
		if (renvoyerValeurCorrecte("mark_acquisition_echantillon").equals("")) {
-
 
223
			return null;
-
 
224
		}
207
		return renvoyerValeurCorrecte("mark_acquisition_echantillon");
225
		return Integer.parseInt(renvoyerValeurCorrecte("mark_acquisition_echantillon"));
208
	}
226
	}
209
	public void setAcquisitionEchantillon(String ae) {
227
	public void setAcquisitionEchantillon(String ae) {
210
		this.set("mark_acquisition_echantillon", ae);
228
		this.set("mark_acquisition_echantillon", ae != null ? Integer.parseInt(ae) : null);
211
	}
229
	}
212
	
230
	
213
	// ACQUISITION TRAITEMENT
231
	// ACQUISITION TRAITEMENT
214
	public String getAcquisitionTraitement() {
232
	public String getAcquisitionTraitement() {
215
		return renvoyerValeurCorrecte("mark_acquisition_traitement");
233
		return renvoyerValeurCorrecte("mark_acquisition_traitement");
216
	}
234
	}
217
	public void setAcquisitionTraitement(String at) {
235
	public void setAcquisitionTraitement(String at) {
218
		this.set("mark_acquisition_traitement", at);
236
		this.set("mark_acquisition_traitement", at);
219
	}
237
	}
220
	
238
	
221
	// ACQUISITION TRAITEMENT POISON
239
	// ACQUISITION TRAITEMENT POISON
222
	public String getAcquisitionTraitementPoison() {
240
	public String getAcquisitionTraitementPoison() {
223
		return renvoyerValeurCorrecte("truk_acquisition_traitement_poison");
241
		return renvoyerValeurCorrecte("truk_acquisition_traitement_poison");
224
	}
242
	}
225
	public void setAcquisitionTraitementPoison(String atp) {
243
	public void setAcquisitionTraitementPoison(String atp) {
226
		this.set("truk_acquisition_traitement_poison", atp);
244
		this.set("truk_acquisition_traitement_poison", atp);
227
	}
245
	}
228
	public void setAcquisitionTraitementPoison(String type, Object valeur) {
246
	public void setAcquisitionTraitementPoison(String type, Object valeur) {
229
		ajouterChaineDenormaliseAvecType("truk_acquisition_traitement_poison", type, valeur);
247
		ajouterChaineDenormaliseAvecType("truk_acquisition_traitement_poison", type, valeur);
230
	}
248
	}
231
	
249
	
232
	// ACQUISITION TRAITEMENT INSECTE
250
	// ACQUISITION TRAITEMENT INSECTE
233
	public String getAcquisitionTraitementInsecte() {
251
	public String getAcquisitionTraitementInsecte() {
234
		return renvoyerValeurCorrecte("truk_acquisition_traitement_insecte");
252
		return renvoyerValeurCorrecte("truk_acquisition_traitement_insecte");
235
	}
253
	}
236
	public void setAcquisitionTraitementInsecte(String ati) {
254
	public void setAcquisitionTraitementInsecte(String ati) {
237
		this.set("truk_acquisition_traitement_insecte", ati);
255
		this.set("truk_acquisition_traitement_insecte", ati);
238
	}
256
	}
239
	public void setAcquisitionTraitementInsecte(String type, Object valeur) {
257
	public void setAcquisitionTraitementInsecte(String type, Object valeur) {
240
		ajouterChaineDenormaliseAvecType("truk_acquisition_traitement_insecte", type, valeur);
258
		ajouterChaineDenormaliseAvecType("truk_acquisition_traitement_insecte", type, valeur);
241
	}
259
	}
242
}
260
}