Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 477 Rev 628
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
 
38
 
39
	// BOTANIQUE
39
	// BOTANIQUE
40
	public CollectionBotanique getBotanique() {
40
	public CollectionBotanique getBotanique() {
41
		return botanique;
41
		return botanique;
42
	}
42
	}
43
	public void setBotanique(CollectionBotanique botaniqueAStocker) {
43
	public void setBotanique(CollectionBotanique botaniqueAStocker) {
44
		botanique = botaniqueAStocker;
44
		botanique = botaniqueAStocker;
45
	}
45
	}
46
	
46
	
47
	// ID
47
	// ID
48
	public String getId() {
48
	public String getId() {
49
		return renvoyerValeurCorrecte("id_collection");
49
		return renvoyerValeurCorrecte("id_collection");
50
	}
50
	}
51
	public void setId(String idCollection) {
51
	public void setId(String idCollection) {
52
		this.set("id_collection", idCollection);
52
		this.set("id_collection", idCollection);
53
	}
53
	}
54
	
54
	
55
	// CE PROJET
55
	// CE PROJET
56
	public String getIdProjet() {
56
	public String getIdProjet() {
57
		return renvoyerValeurCorrecte("ce_projet");
57
		return renvoyerValeurCorrecte("ce_projet");
58
	}
58
	}
59
	public void setIdProjet(String idProjet) {
59
	public void setIdProjet(String idProjet) {
60
		this.set("ce_projet", idProjet);
60
		this.set("ce_projet", idProjet);
61
	}
61
	}
-
 
62
	
-
 
63
	// COLLECTION MERE NOM
-
 
64
	public String getCollectionMereNom() {
-
 
65
		return renvoyerValeurCorrecte("collection_mere_nom");
-
 
66
	}
-
 
67
	public void setCollectionMereNom(String collectionMereNom) {
-
 
68
		this.set("collection_mere_nom", collectionMereNom);
-
 
69
	}
62
	
70
	
63
	// CE STRUCTURE
71
	// CE STRUCTURE
64
	public String getIdStructure() {
72
	public String getIdStructure() {
65
		return renvoyerValeurCorrecte("ce_structure");
73
		return renvoyerValeurCorrecte("ce_structure");
66
	}
74
	}
67
	public void setIdStructure(String idStructure) {
75
	public void setIdStructure(String idStructure) {
68
		this.set("ce_structure", idStructure);
76
		this.set("ce_structure", idStructure);
69
	}
77
	}
70
 
78
 
71
	// GUID
79
	// GUID
72
	public String getGuid() {
80
	public String getGuid() {
73
		return renvoyerValeurCorrecte("guid");
81
		return renvoyerValeurCorrecte("guid");
74
	}
82
	}
75
	public void setGuid(String guid) {
83
	public void setGuid(String guid) {
76
		this.set("guid", guid);
84
		this.set("guid", guid);
77
	}
85
	}
-
 
86
 
-
 
87
	// IDENTIFIANT ALTERNATIF
-
 
88
	public String getIdAlternatif() {
-
 
89
		return renvoyerValeurCorrecte("truk_identifiant_alternatif");
-
 
90
	}
-
 
91
	public void setIdAlternatif(String idAlter) {
-
 
92
		this.set("truk_identifiant_alternatif", idAlter);
-
 
93
	}
78
	
94
	
79
	// CODE
95
	// CODE
80
	public String getCode() {
96
	public String getCode() {
81
		return renvoyerValeurCorrecte("code");
97
		return renvoyerValeurCorrecte("truk_code");
82
	}
98
	}
83
	public void setCode(String code) {
99
	public void setCode(String code) {
-
 
100
		this.set("truk_code", code);
-
 
101
	}
-
 
102
	
-
 
103
	// COTE
-
 
104
	public String getCote() {
-
 
105
		return renvoyerValeurCorrecte("cote");
-
 
106
	}
-
 
107
	public void setCote(String cote) {
84
		this.set("code", code);
108
		this.set("cote", cote);
85
	}
109
	}
86
	
110
	
87
	// NOM
111
	// NOM
88
	public String getNom() {
112
	public String getNom() {
89
		return renvoyerValeurCorrecte("nom");
113
		return renvoyerValeurCorrecte("nom");
90
	}
114
	}
91
	public void setNom(String nom) {
115
	public void setNom(String nom) {
92
		this.set("nom", nom);
116
		this.set("nom", nom);
93
	}
117
	}
94
 
118
	
95
	// TRUK IDENTIFIANT ALTERNATIF
119
	// NOM ALTERNATIF
96
	public String getIdAlternatif() {
120
	public String getNomAlternatif() {
97
		return renvoyerValeurCorrecte("truk_identifiant_alternatif");
121
		return renvoyerValeurCorrecte("truk_nom_alternatif");
98
	}
122
	}
99
	public void setIdAlternatif(String idAlter) {
123
	public void setNomAlternatif(String nomAlter) {
100
		this.set("truk_identifiant_alternatif", idAlter);
124
		this.set("truk_nom_alternatif", nomAlter);
101
	}
125
	}
102
	
126
	
103
	// DESCRIPTION
127
	// DESCRIPTION
104
	public String getDescription() {
128
	public String getDescription() {
105
		return renvoyerValeurCorrecte("description");
129
		return renvoyerValeurCorrecte("description");
106
	}
130
	}
107
	public void setDescription(String description) {
131
	public void setDescription(String description) {
108
		this.set("description", description);
132
		this.set("description", description);
109
	}
133
	}
110
	
134
	
111
	// DESCRIPTION SPECIALISTE
135
	// DESCRIPTION SPECIALISTE
112
	public String getDescriptionSpecialiste() {
136
	public String getDescriptionSpecialiste() {
113
		return renvoyerValeurCorrecte("description_specialiste");
137
		return renvoyerValeurCorrecte("description_specialiste");
114
	}
138
	}
115
	public void setDescriptionSpecialiste(String descriptionSepcialiste) {
139
	public void setDescriptionSpecialiste(String descriptionSepcialiste) {
116
		this.set("description_specialiste", descriptionSepcialiste);
140
		this.set("description_specialiste", descriptionSepcialiste);
117
	}
141
	}
-
 
142
	
-
 
143
	// HISTORIQUE
-
 
144
	public String getHistorique() {
-
 
145
		return renvoyerValeurCorrecte("historique");
-
 
146
	}
-
 
147
	public void setHistorique(String historique) {
-
 
148
		this.set("historique", historique);
-
 
149
	}
-
 
150
 
-
 
151
	// URL
-
 
152
	public String getUrls() {
-
 
153
		return renvoyerValeurCorrecte("truk_url");
-
 
154
	}
-
 
155
	public void setUrls(String urls) {
-
 
156
		this.set("truk_url", urls);
-
 
157
	}
-
 
158
	
-
 
159
	// GROUPEMENT PRINCIPE
-
 
160
	public String getGroupementPrincipe() {
-
 
161
		return renvoyerValeurCorrecte("truk_groupement_principe");
-
 
162
	}
-
 
163
	public void setGroupementPrincipe(String groupementPrincipe) {
-
 
164
		this.set("truk_groupement_principe", groupementPrincipe);
-
 
165
	}
-
 
166
	
-
 
167
	// GROUPEMENT BUT
-
 
168
	public String getGroupementBut() {
-
 
169
		return renvoyerValeurCorrecte("truk_groupement_but");
-
 
170
	}
-
 
171
	public void setGroupementBut(String groupementBut) {
-
 
172
		this.set("truk_groupement_but", groupementBut);
-
 
173
	}
-
 
174
	
-
 
175
	// TYPE NCD
-
 
176
	public String getTypeNcd() {
-
 
177
		return renvoyerValeurCorrecte("ce_type");
-
 
178
	}
-
 
179
	public void setTypeNcd(String typeNcd) {
-
 
180
		this.set("ce_type", typeNcd);
-
 
181
	}
-
 
182
	
-
 
183
	// TYPE DEPOT
-
 
184
	public String getTypeDepot() {
-
 
185
		return renvoyerValeurCorrecte("ce_type_depot");
-
 
186
	}
-
 
187
	public void setTypeDepot(String typeDepot) {
-
 
188
		this.set("ce_type_depot", typeDepot);
-
 
189
	}
118
 
190
	
119
	// +--------------------------------------------------------------------------------------------------------------+
191
	// +--------------------------------------------------------------------------------------------------------------+
120
	// STRUCTURE NOM
192
	// STRUCTURE NOM
121
	public String getStructureNom() {
193
	public String getStructureNom() {
122
		return renvoyerValeurCorrecte("structure_nom");
194
		return renvoyerValeurCorrecte("structure_nom");
123
	}
195
	}
124
	
196
	
125
	// STRUCTURE VILLE
197
	// STRUCTURE VILLE
126
	public String getStructureVille() {
198
	public String getStructureVille() {
127
		return renvoyerValeurCorrecte("structure_ville");
199
		return renvoyerValeurCorrecte("structure_ville");
128
	}
200
	}
129
	
201
	
130
}
202
}