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