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