Subversion Repositories eFlore/Applications.coel

Rev

Rev 935 | Rev 1369 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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