Subversion Repositories eFlore/Applications.coel

Rev

Rev 628 | Rev 775 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 628 Rev 748
1
package org.tela_botanica.client.modeles;
1
package org.tela_botanica.client.modeles;
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 com.google.gwt.json.client.JSONObject;
6
import com.google.gwt.json.client.JSONObject;
7
 
7
 
8
public class Collection extends aDonnee {
8
public class Collection extends aDonnee {
9
	
9
	
10
	private static final long serialVersionUID = 3295310312337145716L;
10
	private static final long serialVersionUID = 3295310312337145716L;
11
	
11
	
12
	public static final String PREFIXE = "cc";
12
	public static final String PREFIXE = "cc";
13
	private CollectionBotanique botanique = null;
13
	private CollectionBotanique botanique = null;
14
	
14
	
15
	public Collection() {
15
	public Collection() {
16
	}
16
	}
17
	
17
	
18
	public Collection(JSONObject collection) {
18
	public Collection(JSONObject collection) {
19
		// l'objet JSON est une table de hachage
19
		// l'objet JSON est une table de hachage
20
		Set<String> im = collection.keySet();
20
		Set<String> im = collection.keySet();
21
 
21
 
22
		// Parcourt pour chaque clé
22
		// Parcourt pour chaque clé
23
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
23
		for (Iterator<String> it = im.iterator(); it.hasNext();) {
24
			// Si elle est associée à une valeur, nous l'ajoutons
24
			// Si elle est associée à une valeur, nous l'ajoutons
25
			String cle = it.next();
25
			String cle = it.next();
26
			if (cle.startsWith(PREFIXE+"_")) {
26
			if (cle.startsWith(PREFIXE+"_")) {
27
				// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
27
				// Suppression de l'abréviation du champ. Inutile dans le contexte d'un objet
28
				String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
28
				String cleObjet = cle.replaceFirst("^"+PREFIXE+"_", "");
29
				// Sinon, nous ajoutons la clé avec une valeur vide
29
				// Sinon, nous ajoutons la clé avec une valeur vide
30
				String valeur = "";
30
				String valeur = "";
31
				if (collection.get(cle).isString() != null) {
31
				if (collection.get(cle).isString() != null) {
32
					valeur = collection.get(cle).isString().stringValue();
32
					valeur = collection.get(cle).isString().stringValue();
33
				}
33
				}
34
				this.set(cleObjet, valeur);
34
				this.set(cleObjet, valeur);
35
			}
35
			}
36
		}
36
		}
37
	}
37
	}
-
 
38
 
-
 
39
	@Override
-
 
40
	protected String getPrefixe() {
-
 
41
		return PREFIXE;
-
 
42
	}
38
 
43
	
39
	// BOTANIQUE
44
	// BOTANIQUE
40
	public CollectionBotanique getBotanique() {
45
	public CollectionBotanique getBotanique() {
41
		return botanique;
46
		return botanique;
42
	}
47
	}
43
	public void setBotanique(CollectionBotanique botaniqueAStocker) {
48
	public void setBotanique(CollectionBotanique botaniqueAStocker) {
44
		botanique = botaniqueAStocker;
49
		botanique = botaniqueAStocker;
45
	}
50
	}
46
	
51
	
47
	// ID
52
	// ID
48
	public String getId() {
53
	public String getId() {
49
		return renvoyerValeurCorrecte("id_collection");
54
		return renvoyerValeurCorrecte("id_collection");
50
	}
55
	}
51
	public void setId(String idCollection) {
56
	public void setId(String idCollection) {
52
		this.set("id_collection", idCollection);
57
		this.set("id_collection", idCollection);
53
	}
58
	}
54
	
59
	
55
	// CE PROJET
60
	// CE PROJET
56
	public String getIdProjet() {
61
	public String getIdProjet() {
57
		return renvoyerValeurCorrecte("ce_projet");
62
		return renvoyerValeurCorrecte("ce_projet");
58
	}
63
	}
59
	public void setIdProjet(String idProjet) {
64
	public void setIdProjet(String idProjet) {
60
		this.set("ce_projet", idProjet);
65
		this.set("ce_projet", idProjet);
61
	}
66
	}
62
	
67
	
63
	// COLLECTION MERE NOM
68
	// COLLECTION MERE NOM
64
	public String getCollectionMereNom() {
69
	public String getCollectionMereNom() {
65
		return renvoyerValeurCorrecte("collection_mere_nom");
70
		return renvoyerValeurCorrecte("collection_mere_nom");
66
	}
71
	}
67
	public void setCollectionMereNom(String collectionMereNom) {
72
	public void setCollectionMereNom(String collectionMereNom) {
68
		this.set("collection_mere_nom", collectionMereNom);
73
		this.set("collection_mere_nom", collectionMereNom);
69
	}
74
	}
70
	
75
	
71
	// CE STRUCTURE
76
	// CE STRUCTURE
72
	public String getIdStructure() {
77
	public String getIdStructure() {
73
		return renvoyerValeurCorrecte("ce_structure");
78
		return renvoyerValeurCorrecte("ce_structure");
74
	}
79
	}
75
	public void setIdStructure(String idStructure) {
80
	public void setIdStructure(String idStructure) {
76
		this.set("ce_structure", idStructure);
81
		this.set("ce_structure", idStructure);
77
	}
82
	}
78
 
83
 
79
	// GUID
84
	// GUID
80
	public String getGuid() {
85
	public String getGuid() {
81
		return renvoyerValeurCorrecte("guid");
86
		return renvoyerValeurCorrecte("guid");
82
	}
87
	}
83
	public void setGuid(String guid) {
88
	public void setGuid(String guid) {
84
		this.set("guid", guid);
89
		this.set("guid", guid);
85
	}
90
	}
86
 
91
 
87
	// IDENTIFIANT ALTERNATIF
92
	// IDENTIFIANT ALTERNATIF
88
	public String getIdAlternatif() {
93
	public String getIdAlternatif() {
89
		return renvoyerValeurCorrecte("truk_identifiant_alternatif");
94
		return renvoyerValeurCorrecte("truk_identifiant_alternatif");
90
	}
95
	}
91
	public void setIdAlternatif(String idAlter) {
96
	public void setIdAlternatif(String idAlter) {
92
		this.set("truk_identifiant_alternatif", idAlter);
97
		this.set("truk_identifiant_alternatif", idAlter);
93
	}
98
	}
94
	
99
	
95
	// CODE
100
	// CODE
96
	public String getCode() {
101
	public String getCode() {
97
		return renvoyerValeurCorrecte("truk_code");
102
		return renvoyerValeurCorrecte("truk_code");
98
	}
103
	}
99
	public void setCode(String code) {
104
	public void setCode(String code) {
100
		this.set("truk_code", code);
105
		this.set("truk_code", code);
101
	}
106
	}
102
	
107
	
103
	// COTE
108
	// COTE
104
	public String getCote() {
109
	public String getCote() {
105
		return renvoyerValeurCorrecte("cote");
110
		return renvoyerValeurCorrecte("cote");
106
	}
111
	}
107
	public void setCote(String cote) {
112
	public void setCote(String cote) {
108
		this.set("cote", cote);
113
		this.set("cote", cote);
109
	}
114
	}
110
	
115
	
111
	// NOM
116
	// NOM
112
	public String getNom() {
117
	public String getNom() {
113
		return renvoyerValeurCorrecte("nom");
118
		return renvoyerValeurCorrecte("nom");
114
	}
119
	}
115
	public void setNom(String nom) {
120
	public void setNom(String nom) {
116
		this.set("nom", nom);
121
		this.set("nom", nom);
117
	}
122
	}
118
	
123
	
119
	// NOM ALTERNATIF
124
	// NOM ALTERNATIF
120
	public String getNomAlternatif() {
125
	public String getNomAlternatif() {
121
		return renvoyerValeurCorrecte("truk_nom_alternatif");
126
		return renvoyerValeurCorrecte("truk_nom_alternatif");
122
	}
127
	}
123
	public void setNomAlternatif(String nomAlter) {
128
	public void setNomAlternatif(String nomAlter) {
124
		this.set("truk_nom_alternatif", nomAlter);
129
		this.set("truk_nom_alternatif", nomAlter);
125
	}
130
	}
126
	
131
	
127
	// DESCRIPTION
132
	// DESCRIPTION
128
	public String getDescription() {
133
	public String getDescription() {
129
		return renvoyerValeurCorrecte("description");
134
		return renvoyerValeurCorrecte("description");
130
	}
135
	}
131
	public void setDescription(String description) {
136
	public void setDescription(String description) {
132
		this.set("description", description);
137
		this.set("description", description);
133
	}
138
	}
134
	
139
	
135
	// DESCRIPTION SPECIALISTE
140
	// DESCRIPTION SPECIALISTE
136
	public String getDescriptionSpecialiste() {
141
	public String getDescriptionSpecialiste() {
137
		return renvoyerValeurCorrecte("description_specialiste");
142
		return renvoyerValeurCorrecte("description_specialiste");
138
	}
143
	}
139
	public void setDescriptionSpecialiste(String descriptionSepcialiste) {
144
	public void setDescriptionSpecialiste(String descriptionSepcialiste) {
140
		this.set("description_specialiste", descriptionSepcialiste);
145
		this.set("description_specialiste", descriptionSepcialiste);
141
	}
146
	}
142
	
147
	
143
	// HISTORIQUE
148
	// HISTORIQUE
144
	public String getHistorique() {
149
	public String getHistorique() {
145
		return renvoyerValeurCorrecte("historique");
150
		return renvoyerValeurCorrecte("historique");
146
	}
151
	}
147
	public void setHistorique(String historique) {
152
	public void setHistorique(String historique) {
148
		this.set("historique", historique);
153
		this.set("historique", historique);
149
	}
154
	}
150
 
155
 
151
	// URL
156
	// URL
152
	public String getUrls() {
157
	public String getUrls() {
153
		return renvoyerValeurCorrecte("truk_url");
158
		return renvoyerValeurCorrecte("truk_url");
154
	}
159
	}
155
	public void setUrls(String urls) {
160
	public void setUrls(String urls) {
156
		this.set("truk_url", urls);
161
		this.set("truk_url", urls);
157
	}
162
	}
158
	
163
	
159
	// GROUPEMENT PRINCIPE
164
	// GROUPEMENT PRINCIPE
160
	public String getGroupementPrincipe() {
165
	public String getGroupementPrincipe() {
161
		return renvoyerValeurCorrecte("truk_groupement_principe");
166
		return renvoyerValeurCorrecte("truk_groupement_principe");
162
	}
167
	}
163
	public void setGroupementPrincipe(String groupementPrincipe) {
168
	public void setGroupementPrincipe(String groupementPrincipe) {
164
		this.set("truk_groupement_principe", groupementPrincipe);
169
		this.set("truk_groupement_principe", groupementPrincipe);
165
	}
170
	}
166
	
171
	
167
	// GROUPEMENT BUT
172
	// GROUPEMENT BUT
168
	public String getGroupementBut() {
173
	public String getGroupementBut() {
169
		return renvoyerValeurCorrecte("truk_groupement_but");
174
		return renvoyerValeurCorrecte("truk_groupement_but");
170
	}
175
	}
171
	public void setGroupementBut(String groupementBut) {
176
	public void setGroupementBut(String groupementBut) {
172
		this.set("truk_groupement_but", groupementBut);
177
		this.set("truk_groupement_but", groupementBut);
173
	}
178
	}
174
	
179
	
175
	// TYPE NCD
180
	// TYPE NCD
176
	public String getTypeNcd() {
181
	public String getTypeNcd() {
177
		return renvoyerValeurCorrecte("ce_type");
182
		return renvoyerValeurCorrecte("ce_type");
178
	}
183
	}
179
	public void setTypeNcd(String typeNcd) {
184
	public void setTypeNcd(String typeNcd) {
180
		this.set("ce_type", typeNcd);
185
		this.set("ce_type", typeNcd);
181
	}
186
	}
182
	
187
	
183
	// TYPE DEPOT
188
	// TYPE DEPOT
184
	public String getTypeDepot() {
189
	public String getTypeDepot() {
185
		return renvoyerValeurCorrecte("ce_type_depot");
190
		return renvoyerValeurCorrecte("ce_type_depot");
186
	}
191
	}
187
	public void setTypeDepot(String typeDepot) {
192
	public void setTypeDepot(String typeDepot) {
188
		this.set("ce_type_depot", typeDepot);
193
		this.set("ce_type_depot", typeDepot);
189
	}
194
	}
190
	
195
	
191
	// +--------------------------------------------------------------------------------------------------------------+
196
	// +--------------------------------------------------------------------------------------------------------------+
192
	// STRUCTURE NOM
197
	// STRUCTURE NOM
193
	public String getStructureNom() {
198
	public String getStructureNom() {
194
		return renvoyerValeurCorrecte("structure_nom");
199
		return renvoyerValeurCorrecte("structure_nom");
195
	}
200
	}
196
	
201
	
197
	// STRUCTURE VILLE
202
	// STRUCTURE VILLE
198
	public String getStructureVille() {
203
	public String getStructureVille() {
199
		return renvoyerValeurCorrecte("structure_ville");
204
		return renvoyerValeurCorrecte("structure_ville");
200
	}
205
	}	
201
	
-
 
202
}
206
}