Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1488 Rev 1542
1
package org.tela_botanica.client.modeles.objets;
1
package org.tela_botanica.client.modeles.objets;
-
 
2
 
-
 
3
import java.util.List;
-
 
4
import java.util.Map;
2
 
5
 
3
import org.tela_botanica.client.util.Util;
6
import org.tela_botanica.client.util.Util;
4
 
7
 
5
import com.google.gwt.json.client.JSONObject;
8
import com.google.gwt.json.client.JSONObject;
6
 
9
 
7
 
10
 
8
public class Observation {
11
public class Observation {
9
 
12
 
10
	private String id=null;
13
	private String id=null;
11
	private String transmis=null;
14
	private String transmis=null;
12
	private String nomSaisi=null;
15
	private String nomSaisi=null;
13
	private String nomRetenu=null;
16
	private String nomRetenu=null;
14
	private String numeroNomenclaturalSaisi=null;
17
	private String numeroNomenclaturalSaisi=null;
15
	private String numeroNomenclaturalRetenu=null;
18
	private String numeroNomenclaturalRetenu=null;
16
	private String numeroTaxonomique=null;
19
	private String numeroTaxonomique=null;
17
	private String famille=null;
20
	private String famille=null;
18
	private String localite=null;
21
	private String localite=null;
19
	private String identifiantLocalite=null;
22
	private String identifiantLocalite=null;
20
	private String lieudit=null;
23
	private String lieudit=null;
21
	private String station=null;
24
	private String station=null;
22
	private String milieu=null;
25
	private String milieu=null;
23
	private String commentaire=null;
26
	private String commentaire=null;
24
	private String date=null;
27
	private String date=null;
25
	private String numeroOrdre=null;
28
	private String numeroOrdre=null;
26
	private String motsCles=null;
29
	private String motsCles=null;
27
	private String latitude=null;
30
	private String latitude=null;
28
	private String longitude=null;
31
	private String longitude=null;
29
	private String referentielGeo=null;
32
	private String referentielGeo=null;
-
 
33
	private String referentielTaxo=null;
30
	private String abondance=null;
34
	private String abondance=null;
31
	private String certitude=null;
35
	private String certitude=null;
-
 
36
	private String phenologie=null;
-
 
37
	private String altitude=null;
-
 
38
	
-
 
39
	private Map<String, String> champsEtendus=null;
32
 
40
 
33
	public Observation() {
41
	public Observation() {
34
	}
42
	}
35
 
43
 
36
	
44
	
37
	/**
45
	/**
38
	 * Une observation telle que stockee dans la base de donnee
46
	 * Une observation telle que stockee dans la base de donnee
39
	 * 
47
	 * 
40
	 * @param transmis
48
	 * @param transmis
41
	 * @param nomSaisi
49
	 * @param nomSaisi
42
	 * @param nomRetenu
50
	 * @param nomRetenu
43
	 * @param numeroNomenclaturalSaisi
51
	 * @param numeroNomenclaturalSaisi
44
	 * @param numeroNomenclaturalRetenu
52
	 * @param numeroNomenclaturalRetenu
45
	 * @param numeroTaxonomique
53
	 * @param numeroTaxonomique
46
	 * @param famille
54
	 * @param famille
47
	 * @param localite
55
	 * @param localite
48
	 * @param IdentifiantLocalite
56
	 * @param IdentifiantLocalite
49
	 * @param lieudit
57
	 * @param lieudit
50
	 * @param station
58
	 * @param station
51
	 * @param milieu
59
	 * @param milieu
52
	 * @param commentaire
60
	 * @param commentaire
53
	 * @param date
61
	 * @param date
54
	 * @param numeroOrdre
62
	 * @param numeroOrdre
55
	 */
63
	 */
56
	public Observation(String transmis, String nomSaisi, String nomRetenu, String numeroNomenclaturalSaisi,  String numeroNomenclaturalRetenu, String numeroTaxonomique, String famille, String localite, String identifiantLocalite, String lieudit, String station, String milieu, String commentaire, String date, String numeroOrdre) {
64
	public Observation(String transmis, String nomSaisi, String nomRetenu, String numeroNomenclaturalSaisi,  String numeroNomenclaturalRetenu, String numeroTaxonomique, String famille, String localite, String identifiantLocalite, String lieudit, String station, String milieu, String commentaire, String date, String numeroOrdre) {
57
		
65
		
58
		this.transmis = transmis;
66
		this.transmis = transmis;
59
		this.nomSaisi = nomSaisi;
67
		this.nomSaisi = nomSaisi;
60
		this.nomRetenu = nomRetenu;
68
		this.nomRetenu = nomRetenu;
61
		this.numeroNomenclaturalSaisi = numeroNomenclaturalSaisi;
69
		this.numeroNomenclaturalSaisi = numeroNomenclaturalSaisi;
62
		this.numeroNomenclaturalRetenu = numeroNomenclaturalRetenu;
70
		this.numeroNomenclaturalRetenu = numeroNomenclaturalRetenu;
63
		this.numeroTaxonomique = numeroTaxonomique;
71
		this.numeroTaxonomique = numeroTaxonomique;
64
		this.famille = famille;
72
		this.famille = famille;
65
		
73
		
66
		this.identifiantLocalite = identifiantLocalite;		
74
		this.identifiantLocalite = identifiantLocalite;		
67
		this.lieudit = lieudit;
75
		this.lieudit = lieudit;
68
		this.station = station;
76
		this.station = station;
69
		this.milieu = milieu;
77
		this.milieu = milieu;
70
		this.commentaire = commentaire;
78
		this.commentaire = commentaire;
71
		this.date = date;
79
		this.date = date;
72
		this.numeroOrdre = numeroOrdre;
80
		this.numeroOrdre = numeroOrdre;
73
		
81
		
74
		 // Suppresion indication departementale (on pourrait faire mieux !!)
82
		 // Suppresion indication departementale (on pourrait faire mieux !!)
75
		if(localite != null) {
83
		if(localite != null) {
76
			int pos=localite.indexOf(" (" );
84
			int pos=localite.indexOf(" (" );
77
			if (pos>=0) {
85
			if (pos>=0) {
78
	    	this.localite=localite.substring(0,pos);
86
	    	this.localite=localite.substring(0,pos);
79
			}
87
			}
80
			else {
88
			else {
81
			 this.localite=localite;
89
			 this.localite=localite;
82
			}
90
			}
83
		}
91
		}
84
	    this.motsCles = "";	
92
	    this.motsCles = "";	
85
	}
93
	}
86
	
94
	
87
	public Observation(JSONObject observation) {
95
	public Observation(JSONObject observation) {
88
		this.transmis = Util.getValeurJsonOuVide(observation, "transmission");
96
		this.transmis = Util.getValeurJsonOuVide(observation, "transmission");
89
		this.identifiantLocalite = Util.getValeurJsonOuVide(observation, "ce_zone_geo");
97
		this.identifiantLocalite = Util.getValeurJsonOuVide(observation, "ce_zone_geo");
90
		this.nomSaisi = Util.getValeurJsonOuVide(observation, "nom_sel");
98
		this.nomSaisi = Util.getValeurJsonOuVide(observation, "nom_sel");
91
		this.nomRetenu = (Util.getValeurJsonOuVide(observation,"nom_ret"));
99
		this.nomRetenu = (Util.getValeurJsonOuVide(observation,"nom_ret"));
92
		this.numeroNomenclaturalSaisi = Util.getValeurJsonOuVide(observation,"nom_sel_nn");
100
		this.numeroNomenclaturalSaisi = Util.getValeurJsonOuVide(observation,"nom_sel_nn");
93
		this.numeroNomenclaturalRetenu = Util.getValeurJsonOuVide(observation,"nom_ret_nn");
101
		this.numeroNomenclaturalRetenu = Util.getValeurJsonOuVide(observation,"nom_ret_nn");
94
		this.numeroTaxonomique= Util.getValeurJsonOuVide(observation,"nt");
102
		this.numeroTaxonomique= Util.getValeurJsonOuVide(observation,"nt");
95
		this.famille = Util.getValeurJsonOuVide(observation,"famille");
103
		this.famille = Util.getValeurJsonOuVide(observation,"famille");
96
		this.localite = Util.getValeurJsonOuVide(observation,"zone_geo");
104
		this.localite = Util.getValeurJsonOuVide(observation,"zone_geo");
97
		this.lieudit = Util.getValeurJsonOuVide(observation,"lieudit");
105
		this.lieudit = Util.getValeurJsonOuVide(observation,"lieudit");
98
		this.station= Util.getValeurJsonOuVide(observation,"station");
106
		this.station= Util.getValeurJsonOuVide(observation,"station");
99
		this.milieu = Util.getValeurJsonOuVide(observation,"milieu");
107
		this.milieu = Util.getValeurJsonOuVide(observation,"milieu");
100
		this.commentaire = Util.getValeurJsonOuVide(observation,"commentaire");
108
		this.commentaire = Util.getValeurJsonOuVide(observation,"commentaire");
101
		this.date = Util.getValeurJsonOuVide(observation,"date_observation");
109
		this.date = Util.getValeurJsonOuVide(observation,"date_observation");
102
		this.numeroOrdre = Util.getValeurJsonOuVide(observation,"ordre");
110
		this.numeroOrdre = Util.getValeurJsonOuVide(observation,"ordre");
103
		this.id = Util.getValeurJsonOuVide(observation,"id_observation");
111
		this.id = Util.getValeurJsonOuVide(observation,"id_observation");
104
		this.latitude = Util.getValeurJsonOuVide(observation,"latitude");
112
		this.latitude = Util.getValeurJsonOuVide(observation,"latitude");
105
		this.longitude = Util.getValeurJsonOuVide(observation,"longitude");
113
		this.longitude = Util.getValeurJsonOuVide(observation,"longitude");
106
		this.motsCles = Util.getValeurJsonOuVide(observation,"mots_cles");
114
		this.motsCles = Util.getValeurJsonOuVide(observation,"mots_cles");
107
		this.abondance = Util.getValeurJsonOuVide(observation,"abondance");
115
		this.abondance = Util.getValeurJsonOuVide(observation,"abondance");
108
		this.certitude = Util.getValeurJsonOuVide(observation,"certitude");
116
		this.certitude = Util.getValeurJsonOuVide(observation,"certitude");
-
 
117
		this.phenologie = Util.getValeurJsonOuVide(observation,"phenologie");
-
 
118
		this.setReferentielTaxo(Util.getValeurJsonOuVide(observation,"nom_referentiel"));
109
	}
119
	}
110
	
120
	
111
	/**
121
	/**
112
	 * Une observation saisie ou modifiee
122
	 * Une observation saisie ou modifiee
113
	 * 
123
	 * 
114
	 * @param nomSaisi
124
	 * @param nomSaisi
115
	 * @param numeroNomenclaturalSaisi
125
	 * @param numeroNomenclaturalSaisi
116
	 * @param localite
126
	 * @param localite
117
	 * @param IdentifiantLocalite
127
	 * @param IdentifiantLocalite
118
	 * @param lieudit
128
	 * @param lieudit
119
	 * @param station
129
	 * @param station
120
	 * @param milieu
130
	 * @param milieu
121
	 * @param commentaire
131
	 * @param commentaire
122
	 * @param date
132
	 * @param date
123
	 * 
133
	 * 
124
	 */
134
	 */
125
	
135
	
126
	public Observation(String nomSaisi, String numeroNomenclaturalSaisi,   String localite, String identifiantLocalite, String lieudit, String station, String milieu, String commentaire, String date) {
136
	public Observation(String nomSaisi, String numeroNomenclaturalSaisi,   String localite, String identifiantLocalite, String lieudit, String station, String milieu, String commentaire, String date) {
127
		
137
		
128
		this.nomSaisi = nomSaisi;
138
		this.nomSaisi = nomSaisi;
129
		this.numeroNomenclaturalSaisi = numeroNomenclaturalSaisi;
139
		this.numeroNomenclaturalSaisi = numeroNomenclaturalSaisi;
130
		
140
		
131
		this.identifiantLocalite = identifiantLocalite;		
141
		this.identifiantLocalite = identifiantLocalite;		
132
		this.lieudit = lieudit;
142
		this.lieudit = lieudit;
133
		this.station = station;
143
		this.station = station;
134
		this.milieu = milieu;
144
		this.milieu = milieu;
135
		this.commentaire = commentaire;
145
		this.commentaire = commentaire;
136
		this.date = date;
146
		this.date = date;
137
		
147
		
138
		 // Suppresion indication departementale (on pourrait faire mieux !!)
148
		 // Suppresion indication departementale (on pourrait faire mieux !!)
139
		if(localite != null) {
149
		if(localite != null) {
140
			int pos=localite.indexOf(" (" );
150
			int pos=localite.indexOf(" (" );
141
		    if (pos>=0) {
151
		    if (pos>=0) {
142
		    	this.localite=localite.substring(0,pos);
152
		    	this.localite=localite.substring(0,pos);
143
		    }
153
		    }
144
			else {
154
			else {
145
				 this.localite=localite;
155
				 this.localite=localite;
146
			}
156
			}
147
		}
157
		}
148
	    
158
	    
149
	    this.motsCles = "" ;
159
	    this.motsCles = "" ;
150
		
160
		
151
	}
161
	}
152
 
162
 
153
 
163
 
154
	public String getNomSaisi() {
164
	public String getNomSaisi() {
155
		return nomSaisi;
165
		return nomSaisi;
156
	}
166
	}
157
 
167
 
158
 
168
 
159
	public String getNumeroOrdre() {
169
	public String getNumeroOrdre() {
160
		return numeroOrdre;
170
		return numeroOrdre;
161
	}
171
	}
162
 
172
 
163
 
173
 
164
	public String getCommentaire() {
174
	public String getCommentaire() {
165
		return commentaire;
175
		return commentaire;
166
	}
176
	}
167
 
177
 
168
 
178
 
169
	public String getDate() {
179
	public String getDate() {
170
		return date;
180
		return date;
171
	}
181
	}
172
 
182
 
173
 
183
 
174
	public String getFamille() {
184
	public String getFamille() {
175
		return famille;
185
		return famille;
176
	}
186
	}
177
 
187
 
178
 
188
 
179
	public String getLieudit() {
189
	public String getLieudit() {
180
		return lieudit;
190
		return lieudit;
181
	}
191
	}
182
 
192
 
183
 
193
 
184
	public String getLocalite() {
194
	public String getLocalite() {
185
		return localite;
195
		return localite;
186
	}
196
	}
187
 
197
 
188
 
198
 
189
	public String getIdentifiantLocalite() {
199
	public String getIdentifiantLocalite() {
190
		if(identifiantLocalite != null) {
200
		if(identifiantLocalite != null) {
191
			identifiantLocalite = identifiantLocalite.replaceAll("\"", "");
201
			identifiantLocalite = identifiantLocalite.replaceAll("\"", "");
192
		}
202
		}
193
		return identifiantLocalite; 
203
		return identifiantLocalite; 
194
	}
204
	}
195
 
205
 
196
	
206
	
197
	public String getMilieu() {
207
	public String getMilieu() {
198
		return milieu;
208
		return milieu;
199
	}
209
	}
200
 
210
 
201
 
211
 
202
	public String getNomRetenu() {
212
	public String getNomRetenu() {
203
		return nomRetenu;
213
		return nomRetenu;
204
	}
214
	}
205
 
215
 
206
 
216
 
207
	public String getNumeroNomenclaturalSaisi() {
217
	public String getNumeroNomenclaturalSaisi() {
208
		return numeroNomenclaturalSaisi;
218
		return numeroNomenclaturalSaisi;
209
	}
219
	}
210
 
220
 
211
 
221
 
212
	public String getNumeroNomenclaturalRetenu() {
222
	public String getNumeroNomenclaturalRetenu() {
213
		return numeroNomenclaturalRetenu;
223
		return numeroNomenclaturalRetenu;
214
	}
224
	}
215
 
225
 
216
 
226
 
217
	public String getNumeroTaxonomique() {
227
	public String getNumeroTaxonomique() {
218
		return numeroTaxonomique;
228
		return numeroTaxonomique;
219
	}
229
	}
220
 
230
 
221
 
231
 
222
	public String getStation() {
232
	public String getStation() {
223
		return station;
233
		return station;
224
	}
234
	}
225
 
235
 
226
 
236
 
227
	public String getTransmis() {
237
	public String getTransmis() {
228
		return transmis;
238
		return transmis;
229
	}
239
	}
230
	
240
	
231
	public String getMotsCles() {
241
	public String getMotsCles() {
232
		return motsCles;
242
		return motsCles;
233
	}
243
	}
234
	
244
	
235
	public String getLatitude() {
245
	public String getLatitude() {
236
		return this.latitude ;
246
		return this.latitude ;
237
	}
247
	}
238
	
248
	
239
	public String getLongitude() {
249
	public String getLongitude() {
240
		return this.longitude ;
250
		return this.longitude ;
241
	}
251
	}
242
	
252
	
243
	public String getReferentielGeo() {
253
	public String getReferentielGeo() {
244
		return this.referentielGeo ;
254
		return this.referentielGeo ;
245
	}
255
	}
246
	
256
	
247
	public String getId() {
257
	public String getId() {
248
		return this.id;
258
		return this.id;
249
	}
259
	}
250
	
260
	
251
	public String getAbondance() {
261
	public String getAbondance() {
252
		return this.abondance;
262
		return this.abondance;
253
	}
263
	}
254
	
264
	
255
	public String getCertitude() {
265
	public String getCertitude() {
256
		return this.certitude;
266
		return this.certitude;
257
	}
267
	}
258
	
268
	
259
	public void setMotsCles(String motsCles) {
269
	public void setMotsCles(String motsCles) {
260
		this.motsCles = motsCles;
270
		this.motsCles = motsCles;
261
	}
271
	}
262
	
272
	
263
	public void setNumeroOrdre(String numeroOrdre) {
273
	public void setNumeroOrdre(String numeroOrdre) {
264
		this.numeroOrdre = numeroOrdre;
274
		this.numeroOrdre = numeroOrdre;
265
	}
275
	}
266
	
276
	
267
	public void setLatitude(String latitude) {
277
	public void setLatitude(String latitude) {
268
		this.latitude = latitude;
278
		this.latitude = latitude;
269
	}
279
	}
270
	
280
	
271
	public void setLongitude(String longitude) {
281
	public void setLongitude(String longitude) {
272
		this.longitude = longitude;
282
		this.longitude = longitude;
273
	}
283
	}
274
	
284
	
275
	public void setReferentielGeo(String refGeo) {
285
	public void setReferentielGeo(String refGeo) {
276
		this.referentielGeo = refGeo;
286
		this.referentielGeo = refGeo;
277
	}
287
	}
278
 
288
 
279
	public void setId(String id) {
289
	public void setId(String id) {
280
		this.id = id;
290
		this.id = id;
281
	}
291
	}
282
	
292
	
283
	public void setAbondance(String abondance) {
293
	public void setAbondance(String abondance) {
284
		this.abondance = abondance;
294
		this.abondance = abondance;
285
	}
295
	}
286
	
296
	
287
	public void setCertitude(String certitude) {
297
	public void setCertitude(String certitude) {
288
		this.certitude = certitude;
298
		this.certitude = certitude;
289
	}
299
	}
-
 
300
 
-
 
301
	public String getReferentielTaxo() {
-
 
302
		return referentielTaxo;
-
 
303
	}
-
 
304
 
-
 
305
	public String getCodeCourtReferentielTaxo() {
-
 
306
		String codeRef = "";
-
 
307
		if(!getReferentielTaxo().equals("") && getReferentielTaxo().length() >= 5) {
-
 
308
			codeRef = referentielTaxo.substring(0, 5);
-
 
309
		}
-
 
310
		return codeRef;
-
 
311
	}
-
 
312
 
-
 
313
	public void setReferentielTaxo(String referentielTaxo) {
-
 
314
		this.referentielTaxo = referentielTaxo;
-
 
315
	}
-
 
316
	
-
 
317
	public String getPhenologie() {
-
 
318
		return phenologie;
-
 
319
	}
-
 
320
	
-
 
321
	public void setPhenologie(String phenologie) {
-
 
322
		this.phenologie = phenologie;
-
 
323
	}
-
 
324
 
-
 
325
	public String getAltitude() {
-
 
326
		return altitude;
-
 
327
	}
-
 
328
 
-
 
329
 
-
 
330
	public void setAltitude(String altitude) {
-
 
331
		this.altitude = altitude;
-
 
332
	}
-
 
333
 
-
 
334
 
-
 
335
	public void setValeurChampEtendu(String cle, String valeur) {
-
 
336
		champsEtendus.put(cle, valeur);
-
 
337
	}
-
 
338
 
-
 
339
	public String getValeurChampEtendu(String cle) {
-
 
340
		String valeur = "";
-
 
341
		if(champsEtendus.containsKey(cle)) {
-
 
342
			valeur = champsEtendus.get(cle);
-
 
343
		}
-
 
344
		
-
 
345
		return valeur;
-
 
346
	}
-
 
347
	
-
 
348
	public Map<String, String> getChampsEtendus() {
-
 
349
		return champsEtendus;
-
 
350
	}
-
 
351
 
-
 
352
 
-
 
353
	public void setChampsEtendus(Map<String, String> champsEtendus) {
-
 
354
		this.champsEtendus = champsEtendus;
-
 
355
	}
290
}
356
}