| 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
|
|
|
114 |
public String getCollectionCommune() {
|
|
|
115 |
return renvoyerValeurCorrecte("mark_collection_commune");
|
|
|
116 |
}
|
| 179 |
jp_milcent |
117 |
public void setCollectionCommune(String ccm) {
|
|
|
118 |
this.set("mark_collection_commune", ccm);
|
|
|
119 |
}
|
|
|
120 |
|
| 191 |
jp_milcent |
121 |
// COLLECTION AUTRE
|
|
|
122 |
public String getCollectionAutre() {
|
|
|
123 |
return renvoyerValeurCorrecte("truk_collection_autre");
|
|
|
124 |
}
|
| 179 |
jp_milcent |
125 |
public void setCollectionAutre(String ca) {
|
|
|
126 |
this.set("truk_collection_autre", ca);
|
|
|
127 |
}
|
| 191 |
jp_milcent |
128 |
public void setCollectionAutre(String type, Object valeur) {
|
| 306 |
jp_milcent |
129 |
remplacerTypeDansChaineDenormalise("truk_collection_autre", type, valeur);
|
| 191 |
jp_milcent |
130 |
}
|
| 179 |
jp_milcent |
131 |
|
| 191 |
jp_milcent |
132 |
// ACCÈS CONTROLÉ
|
|
|
133 |
public String getAccesControle() {
|
|
|
134 |
return renvoyerValeurCorrecte("mark_acces_controle");
|
|
|
135 |
}
|
| 179 |
jp_milcent |
136 |
public void setAccesControle(String ac) {
|
|
|
137 |
this.set("mark_acces_controle", ac);
|
|
|
138 |
}
|
|
|
139 |
|
| 191 |
jp_milcent |
140 |
// RESTAURATION
|
|
|
141 |
public String getRestauration() {
|
|
|
142 |
return renvoyerValeurCorrecte("mark_restauration");
|
|
|
143 |
}
|
| 179 |
jp_milcent |
144 |
public void setRestauration(String ccm) {
|
|
|
145 |
this.set("mark_restauration", ccm);
|
|
|
146 |
}
|
|
|
147 |
|
| 191 |
jp_milcent |
148 |
// RESTAURATION OPÉRATION
|
|
|
149 |
public String getRestaurationOperation() {
|
|
|
150 |
return renvoyerValeurCorrecte("truk_restauration_operation");
|
|
|
151 |
}
|
| 179 |
jp_milcent |
152 |
public void setRestaurationOperation(String ro) {
|
|
|
153 |
this.set("truk_restauration_operation", ro);
|
|
|
154 |
}
|
| 191 |
jp_milcent |
155 |
public void setRestaurationOperation(String type, Object valeur) {
|
| 242 |
jp_milcent |
156 |
ajouterChaineDenormaliseAvecType("truk_restauration_operation", type, valeur);
|
| 191 |
jp_milcent |
157 |
}
|
| 179 |
jp_milcent |
158 |
|
| 191 |
jp_milcent |
159 |
// MATERIEL CONSERVATION
|
|
|
160 |
public String getMaterielConservation() {
|
|
|
161 |
return renvoyerValeurCorrecte("ce_materiel_conservation");
|
|
|
162 |
}
|
| 179 |
jp_milcent |
163 |
public void setMaterielConservation(String mc) {
|
|
|
164 |
this.set("ce_materiel_conservation", mc);
|
|
|
165 |
}
|
|
|
166 |
|
| 191 |
jp_milcent |
167 |
// MATERIEL AUTRE
|
|
|
168 |
public String getMaterielAutre() {
|
|
|
169 |
return renvoyerValeurCorrecte("truk_materiel_autre");
|
|
|
170 |
}
|
| 179 |
jp_milcent |
171 |
public void setMaterielAutre(String ma) {
|
|
|
172 |
this.set("truk_materiel_autre", ma);
|
|
|
173 |
}
|
| 191 |
jp_milcent |
174 |
public void setMaterielAutre(String type, Object valeur) {
|
| 242 |
jp_milcent |
175 |
ajouterChaineDenormaliseAvecType("truk_materiel_autre", type, valeur);
|
| 191 |
jp_milcent |
176 |
}
|
| 179 |
jp_milcent |
177 |
|
| 191 |
jp_milcent |
178 |
// TRAITEMENT
|
|
|
179 |
public String getTraitement() {
|
|
|
180 |
return renvoyerValeurCorrecte("mark_traitement");
|
|
|
181 |
}
|
| 179 |
jp_milcent |
182 |
public void setTraitement(String t) {
|
|
|
183 |
this.set("mark_traitement", t);
|
|
|
184 |
}
|
|
|
185 |
|
| 191 |
jp_milcent |
186 |
// TRAITEMENTS
|
|
|
187 |
public String getTraitements() {
|
|
|
188 |
return renvoyerValeurCorrecte("truk_traitement");
|
|
|
189 |
}
|
| 179 |
jp_milcent |
190 |
public void setTraitements(String t) {
|
|
|
191 |
this.set("truk_traitement", t);
|
|
|
192 |
}
|
| 191 |
jp_milcent |
193 |
public void setTraitements(String type, Object valeur) {
|
| 242 |
jp_milcent |
194 |
ajouterChaineDenormaliseAvecType("truk_traitement", type, valeur);
|
| 191 |
jp_milcent |
195 |
}
|
| 179 |
jp_milcent |
196 |
|
| 191 |
jp_milcent |
197 |
// ACQUISITION COLLECTION
|
|
|
198 |
public String getAcquisitionCollection() {
|
|
|
199 |
return renvoyerValeurCorrecte("mark_acquisition_collection");
|
|
|
200 |
}
|
| 179 |
jp_milcent |
201 |
public void setAcquisitionCollection(String ac) {
|
|
|
202 |
this.set("mark_acquisition_collection", ac);
|
|
|
203 |
}
|
|
|
204 |
|
| 191 |
jp_milcent |
205 |
// ACQUISITION ECHANTILLON
|
|
|
206 |
public String getAcquisitionEchantillon() {
|
|
|
207 |
return renvoyerValeurCorrecte("mark_acquisition_echantillon");
|
|
|
208 |
}
|
| 179 |
jp_milcent |
209 |
public void setAcquisitionEchantillon(String ae) {
|
|
|
210 |
this.set("mark_acquisition_echantillon", ae);
|
|
|
211 |
}
|
|
|
212 |
|
| 191 |
jp_milcent |
213 |
// ACQUISITION TRAITEMENT
|
|
|
214 |
public String getAcquisitionTraitement() {
|
|
|
215 |
return renvoyerValeurCorrecte("mark_acquisition_traitement");
|
|
|
216 |
}
|
| 179 |
jp_milcent |
217 |
public void setAcquisitionTraitement(String at) {
|
|
|
218 |
this.set("mark_acquisition_traitement", at);
|
|
|
219 |
}
|
|
|
220 |
|
| 191 |
jp_milcent |
221 |
// ACQUISITION TRAITEMENT POISON
|
|
|
222 |
public String getAcquisitionTraitementPoison() {
|
|
|
223 |
return renvoyerValeurCorrecte("truk_acquisition_traitement_poison");
|
|
|
224 |
}
|
| 179 |
jp_milcent |
225 |
public void setAcquisitionTraitementPoison(String atp) {
|
| 191 |
jp_milcent |
226 |
this.set("truk_acquisition_traitement_poison", atp);
|
| 179 |
jp_milcent |
227 |
}
|
| 191 |
jp_milcent |
228 |
public void setAcquisitionTraitementPoison(String type, Object valeur) {
|
| 242 |
jp_milcent |
229 |
ajouterChaineDenormaliseAvecType("truk_acquisition_traitement_poison", type, valeur);
|
| 191 |
jp_milcent |
230 |
}
|
| 179 |
jp_milcent |
231 |
|
| 191 |
jp_milcent |
232 |
// ACQUISITION TRAITEMENT INSECTE
|
|
|
233 |
public String getAcquisitionTraitementInsecte() {
|
|
|
234 |
return renvoyerValeurCorrecte("truk_acquisition_traitement_insecte");
|
|
|
235 |
}
|
| 179 |
jp_milcent |
236 |
public void setAcquisitionTraitementInsecte(String ati) {
|
| 191 |
jp_milcent |
237 |
this.set("truk_acquisition_traitement_insecte", ati);
|
| 179 |
jp_milcent |
238 |
}
|
| 191 |
jp_milcent |
239 |
public void setAcquisitionTraitementInsecte(String type, Object valeur) {
|
| 242 |
jp_milcent |
240 |
ajouterChaineDenormaliseAvecType("truk_acquisition_traitement_insecte", type, valeur);
|
| 179 |
jp_milcent |
241 |
}
|
| 1693 |
raphael |
242 |
}
|