Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 989 Rev 1286
1
package org.tela_botanica.client.modeles.objets;
1
package org.tela_botanica.client.modeles.objets;
2
 
2
 
3
import org.tela_botanica.client.util.Util;
3
import org.tela_botanica.client.util.Util;
4
 
4
 
5
import com.google.gwt.json.client.JSONObject;
5
import com.google.gwt.json.client.JSONObject;
6
import com.google.gwt.json.client.JSONString;
-
 
7
 
6
 
8
 
7
 
9
public class Observation {
8
public class Observation {
10
 
9
 
11
	private String id=null;
10
	private String id=null;
12
	private String transmis=null;
11
	private String transmis=null;
13
	private String nomSaisi=null;
12
	private String nomSaisi=null;
14
	private String nomRetenu=null;
13
	private String nomRetenu=null;
15
	private String numeroNomenclaturalSaisi=null;
14
	private String numeroNomenclaturalSaisi=null;
16
	private String numeroNomenclaturalRetenu=null;
15
	private String numeroNomenclaturalRetenu=null;
17
	private String numeroTaxonomique=null;
16
	private String numeroTaxonomique=null;
18
	private String famille=null;
17
	private String famille=null;
19
	private String localite=null;
18
	private String localite=null;
20
	private String identifiantLocalite=null;
19
	private String identifiantLocalite=null;
21
	private String lieudit=null;
20
	private String lieudit=null;
22
	private String station=null;
21
	private String station=null;
23
	private String milieu=null;
22
	private String milieu=null;
24
	private String commentaire=null;
23
	private String commentaire=null;
25
	private String date=null;
24
	private String date=null;
26
	private String numeroOrdre=null;
25
	private String numeroOrdre=null;
27
	private String motsCles=null;
26
	private String motsCles=null;
28
	private String latitude=null;
27
	private String latitude=null;
29
	private String longitude=null;
28
	private String longitude=null;
30
	private String referentielGeo=null;
29
	private String referentielGeo=null;
31
 
30
 
32
	public Observation() {
31
	public Observation() {
33
	}
32
	}
34
 
33
 
35
	
34
	
36
	/**
35
	/**
37
	 * Une observation telle que stockee dans la base de donnee
36
	 * Une observation telle que stockee dans la base de donnee
38
	 * 
37
	 * 
39
	 * @param transmis
38
	 * @param transmis
40
	 * @param nomSaisi
39
	 * @param nomSaisi
41
	 * @param nomRetenu
40
	 * @param nomRetenu
42
	 * @param numeroNomenclaturalSaisi
41
	 * @param numeroNomenclaturalSaisi
43
	 * @param numeroNomenclaturalRetenu
42
	 * @param numeroNomenclaturalRetenu
44
	 * @param numeroTaxonomique
43
	 * @param numeroTaxonomique
45
	 * @param famille
44
	 * @param famille
46
	 * @param localite
45
	 * @param localite
47
	 * @param IdentifiantLocalite
46
	 * @param IdentifiantLocalite
48
	 * @param lieudit
47
	 * @param lieudit
49
	 * @param station
48
	 * @param station
50
	 * @param milieu
49
	 * @param milieu
51
	 * @param commentaire
50
	 * @param commentaire
52
	 * @param date
51
	 * @param date
53
	 * @param numeroOrdre
52
	 * @param numeroOrdre
54
	 */
53
	 */
55
	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) {
54
	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) {
56
		
55
		
57
		this.transmis = transmis;
56
		this.transmis = transmis;
58
		this.nomSaisi = nomSaisi;
57
		this.nomSaisi = nomSaisi;
59
		this.nomRetenu = nomRetenu;
58
		this.nomRetenu = nomRetenu;
60
		this.numeroNomenclaturalSaisi = numeroNomenclaturalSaisi;
59
		this.numeroNomenclaturalSaisi = numeroNomenclaturalSaisi;
61
		this.numeroNomenclaturalRetenu = numeroNomenclaturalRetenu;
60
		this.numeroNomenclaturalRetenu = numeroNomenclaturalRetenu;
62
		this.numeroTaxonomique = numeroTaxonomique;
61
		this.numeroTaxonomique = numeroTaxonomique;
63
		this.famille = famille;
62
		this.famille = famille;
64
		
63
		
65
		this.identifiantLocalite = identifiantLocalite;		
64
		this.identifiantLocalite = identifiantLocalite;		
66
		this.lieudit = lieudit;
65
		this.lieudit = lieudit;
67
		this.station = station;
66
		this.station = station;
68
		this.milieu = milieu;
67
		this.milieu = milieu;
69
		this.commentaire = commentaire;
68
		this.commentaire = commentaire;
70
		this.date = date;
69
		this.date = date;
71
		this.numeroOrdre = numeroOrdre;
70
		this.numeroOrdre = numeroOrdre;
72
		
71
		
73
		 // Suppresion indication departementale (on pourrait faire mieux !!)
72
		 // Suppresion indication departementale (on pourrait faire mieux !!)
74
		if(localite != null) {
73
		if(localite != null) {
75
			int pos=localite.indexOf(" (" );
74
			int pos=localite.indexOf(" (" );
76
			if (pos>=0) {
75
			if (pos>=0) {
77
	    	this.localite=localite.substring(0,pos);
76
	    	this.localite=localite.substring(0,pos);
78
			}
77
			}
79
			else {
78
			else {
80
			 this.localite=localite;
79
			 this.localite=localite;
81
			}
80
			}
82
		}
81
		}
83
	    this.motsCles = "";	
82
	    this.motsCles = "";	
84
	}
83
	}
85
	
84
	
86
	public Observation(JSONObject observation) {
85
	public Observation(JSONObject observation) {
-
 
86
		this.transmis = Util.getValeurJsonOuVide(observation, "transmission");
-
 
87
		this.identifiantLocalite = Util.getValeurJsonOuVide(observation, "ce_zone_geo");
-
 
88
		this.nomSaisi = Util.getValeurJsonOuVide(observation, "nom_sel");
-
 
89
		this.nomRetenu = (Util.getValeurJsonOuVide(observation,"nom_ret"));
-
 
90
		this.numeroNomenclaturalSaisi = Util.getValeurJsonOuVide(observation,"nom_sel_nn");
-
 
91
		this.numeroNomenclaturalRetenu = Util.getValeurJsonOuVide(observation,"nom_ret_nn");
-
 
92
		this.numeroTaxonomique= Util.getValeurJsonOuVide(observation,"nt");
-
 
93
		this.famille = Util.getValeurJsonOuVide(observation,"famille");
-
 
94
		this.localite = Util.getValeurJsonOuVide(observation,"zone_geo");
-
 
95
		this.lieudit = Util.getValeurJsonOuVide(observation,"lieudit");
-
 
96
		this.station= Util.getValeurJsonOuVide(observation,"station");
-
 
97
		this.milieu = Util.getValeurJsonOuVide(observation,"milieu");
-
 
98
		this.commentaire = Util.getValeurJsonOuVide(observation,"commentaire");
-
 
99
		this.date = Util.getValeurJsonOuVide(observation,"date_observation");
-
 
100
		this.numeroOrdre = Util.getValeurJsonOuVide(observation,"ordre");
-
 
101
		this.id = Util.getValeurJsonOuVide(observation,"id_observation");
-
 
102
		this.latitude = Util.getValeurJsonOuVide(observation,"latitude");
-
 
103
		this.longitude = Util.getValeurJsonOuVide(observation,"longitude");
-
 
104
		this.motsCles = Util.getValeurJsonOuVide(observation,"mots_cles");
87
		
-
 
88
		this.transmis = getValeurJsonOuVide(observation, "transmission");
-
 
89
		this.identifiantLocalite = getValeurJsonOuVide(observation, "ce_zone_geo");
-
 
90
		this.nomSaisi = getValeurJsonOuVide(observation, "nom_sel");
-
 
91
		this.nomRetenu = (getValeurJsonOuVide(observation,"nom_ret"));
-
 
92
		this.numeroNomenclaturalSaisi = getValeurJsonOuVide(observation,"nom_sel_nn");
-
 
93
		this.numeroNomenclaturalRetenu = getValeurJsonOuVide(observation,"nom_ret_nn");
-
 
94
		this.numeroTaxonomique= getValeurJsonOuVide(observation,"nt");
-
 
95
		this.famille = getValeurJsonOuVide(observation,"famille");
-
 
96
		this.localite = getValeurJsonOuVide(observation,"zone_geo");
-
 
97
		this.lieudit = getValeurJsonOuVide(observation,"lieudit");
-
 
98
		this.station= getValeurJsonOuVide(observation,"station");
-
 
99
		this.milieu = getValeurJsonOuVide(observation,"milieu");
-
 
100
		this.commentaire = getValeurJsonOuVide(observation,"commentaire");
-
 
101
		this.date = getValeurJsonOuVide(observation,"date_observation");
-
 
102
		this.numeroOrdre = getValeurJsonOuVide(observation,"ordre");
-
 
103
		this.id = getValeurJsonOuVide(observation,"id_observation");
-
 
104
		this.latitude = getValeurJsonOuVide(observation,"latitude");
-
 
105
		this.longitude = getValeurJsonOuVide(observation,"longitude");
-
 
106
		this.motsCles = getValeurJsonOuVide(observation,"mots_cles");
-
 
107
		
-
 
108
	}
-
 
109
	
-
 
110
	private String getValeurJsonOuVide(JSONObject jo, String index) {
-
 
111
		return (jo.get(index) != null) ? ((JSONString)jo.get(index)).stringValue() : "";
105
		
112
	}
-
 
113
 
106
	}
114
	
107
	
115
	/**
108
	/**
116
	 * Une observation saisie ou modifiee
109
	 * Une observation saisie ou modifiee
117
	 * 
110
	 * 
118
	 * @param nomSaisi
111
	 * @param nomSaisi
119
	 * @param numeroNomenclaturalSaisi
112
	 * @param numeroNomenclaturalSaisi
120
	 * @param localite
113
	 * @param localite
121
	 * @param IdentifiantLocalite
114
	 * @param IdentifiantLocalite
122
	 * @param lieudit
115
	 * @param lieudit
123
	 * @param station
116
	 * @param station
124
	 * @param milieu
117
	 * @param milieu
125
	 * @param commentaire
118
	 * @param commentaire
126
	 * @param date
119
	 * @param date
127
	 * 
120
	 * 
128
	 */
121
	 */
129
	
122
	
130
	public Observation(String nomSaisi, String numeroNomenclaturalSaisi,   String localite, String identifiantLocalite, String lieudit, String station, String milieu, String commentaire, String date) {
123
	public Observation(String nomSaisi, String numeroNomenclaturalSaisi,   String localite, String identifiantLocalite, String lieudit, String station, String milieu, String commentaire, String date) {
131
		
124
		
132
		this.nomSaisi = nomSaisi;
125
		this.nomSaisi = nomSaisi;
133
		this.numeroNomenclaturalSaisi = numeroNomenclaturalSaisi;
126
		this.numeroNomenclaturalSaisi = numeroNomenclaturalSaisi;
134
		
127
		
135
		this.identifiantLocalite = identifiantLocalite;		
128
		this.identifiantLocalite = identifiantLocalite;		
136
		this.lieudit = lieudit;
129
		this.lieudit = lieudit;
137
		this.station = station;
130
		this.station = station;
138
		this.milieu = milieu;
131
		this.milieu = milieu;
139
		this.commentaire = commentaire;
132
		this.commentaire = commentaire;
140
		this.date = date;
133
		this.date = date;
141
		
134
		
142
		 // Suppresion indication departementale (on pourrait faire mieux !!)
135
		 // Suppresion indication departementale (on pourrait faire mieux !!)
143
		if(localite != null) {
136
		if(localite != null) {
144
			int pos=localite.indexOf(" (" );
137
			int pos=localite.indexOf(" (" );
145
		    if (pos>=0) {
138
		    if (pos>=0) {
146
		    	this.localite=localite.substring(0,pos);
139
		    	this.localite=localite.substring(0,pos);
147
		    }
140
		    }
148
			else {
141
			else {
149
				 this.localite=localite;
142
				 this.localite=localite;
150
			}
143
			}
151
		}
144
		}
152
	    
145
	    
153
	    this.motsCles = "" ;
146
	    this.motsCles = "" ;
154
		
147
		
155
	}
148
	}
156
 
149
 
157
 
150
 
158
	public String getNomSaisi() {
151
	public String getNomSaisi() {
159
		return nomSaisi;
152
		return nomSaisi;
160
	}
153
	}
161
 
154
 
162
 
155
 
163
	public String getNumeroOrdre() {
156
	public String getNumeroOrdre() {
164
		return numeroOrdre;
157
		return numeroOrdre;
165
	}
158
	}
166
 
159
 
167
 
160
 
168
	public String getCommentaire() {
161
	public String getCommentaire() {
169
		return commentaire;
162
		return commentaire;
170
	}
163
	}
171
 
164
 
172
 
165
 
173
	public String getDate() {
166
	public String getDate() {
174
		return date;
167
		return date;
175
	}
168
	}
176
 
169
 
177
 
170
 
178
	public String getFamille() {
171
	public String getFamille() {
179
		return famille;
172
		return famille;
180
	}
173
	}
181
 
174
 
182
 
175
 
183
	public String getLieudit() {
176
	public String getLieudit() {
184
		return lieudit;
177
		return lieudit;
185
	}
178
	}
186
 
179
 
187
 
180
 
188
	public String getLocalite() {
181
	public String getLocalite() {
189
		return localite;
182
		return localite;
190
	}
183
	}
191
 
184
 
192
 
185
 
193
	public String getIdentifiantLocalite() {
186
	public String getIdentifiantLocalite() {
194
		if(identifiantLocalite != null) {
187
		if(identifiantLocalite != null) {
195
			identifiantLocalite = identifiantLocalite.replaceAll("\"", "");
188
			identifiantLocalite = identifiantLocalite.replaceAll("\"", "");
196
		}
189
		}
197
		return identifiantLocalite; 
190
		return identifiantLocalite; 
198
	}
191
	}
199
 
192
 
200
	
193
	
201
	public String getMilieu() {
194
	public String getMilieu() {
202
		return milieu;
195
		return milieu;
203
	}
196
	}
204
 
197
 
205
 
198
 
206
	public String getNomRetenu() {
199
	public String getNomRetenu() {
207
		return nomRetenu;
200
		return nomRetenu;
208
	}
201
	}
209
 
202
 
210
 
203
 
211
	public String getNumeroNomenclaturalSaisi() {
204
	public String getNumeroNomenclaturalSaisi() {
212
		return numeroNomenclaturalSaisi;
205
		return numeroNomenclaturalSaisi;
213
	}
206
	}
214
 
207
 
215
 
208
 
216
	public String getNumeroNomenclaturalRetenu() {
209
	public String getNumeroNomenclaturalRetenu() {
217
		return numeroNomenclaturalRetenu;
210
		return numeroNomenclaturalRetenu;
218
	}
211
	}
219
 
212
 
220
 
213
 
221
	public String getNumeroTaxonomique() {
214
	public String getNumeroTaxonomique() {
222
		return numeroTaxonomique;
215
		return numeroTaxonomique;
223
	}
216
	}
224
 
217
 
225
 
218
 
226
	public String getStation() {
219
	public String getStation() {
227
		return station;
220
		return station;
228
	}
221
	}
229
 
222
 
230
 
223
 
231
	public String getTransmis() {
224
	public String getTransmis() {
232
		return transmis;
225
		return transmis;
233
	}
226
	}
234
	
227
	
235
	public String getMotsCles() {
228
	public String getMotsCles() {
236
		return motsCles;
229
		return motsCles;
237
	}
230
	}
238
	
231
	
239
	public String getLatitude() {
232
	public String getLatitude() {
240
		return this.latitude ;
233
		return this.latitude ;
241
	}
234
	}
242
	
235
	
243
	public String getLongitude() {
236
	public String getLongitude() {
244
		return this.longitude ;
237
		return this.longitude ;
245
	}
238
	}
246
	
239
	
247
	public String getReferentielGeo() {
240
	public String getReferentielGeo() {
248
		return this.referentielGeo ;
241
		return this.referentielGeo ;
249
	}
242
	}
250
	
243
	
251
	public String getId() {
244
	public String getId() {
252
		return this.id;
245
		return this.id;
253
	}
246
	}
254
	
247
	
255
	public void setMotsCles(String motsCles) {
248
	public void setMotsCles(String motsCles) {
256
		this.motsCles = motsCles;
249
		this.motsCles = motsCles;
257
	}
250
	}
258
	
251
	
259
	public void setNumeroOrdre(String numeroOrdre) {
252
	public void setNumeroOrdre(String numeroOrdre) {
260
		this.numeroOrdre = numeroOrdre;
253
		this.numeroOrdre = numeroOrdre;
261
	}
254
	}
262
	
255
	
263
	public void setLatitude(String latitude) {
256
	public void setLatitude(String latitude) {
264
		this.latitude = latitude;
257
		this.latitude = latitude;
265
	}
258
	}
266
	
259
	
267
	public void setLongitude(String longitude) {
260
	public void setLongitude(String longitude) {
268
		this.longitude = longitude;
261
		this.longitude = longitude;
269
	}
262
	}
270
	
263
	
271
	public void setReferentielGeo(String refGeo) {
264
	public void setReferentielGeo(String refGeo) {
272
		this.referentielGeo = refGeo;
265
		this.referentielGeo = refGeo;
273
	}
266
	}
274
 
267
 
275
 
268
 
276
	public void setId(String id) {
269
	public void setId(String id) {
277
		this.id = id;
270
		this.id = id;
278
	}
271
	}
279
 
272
 
280
 
273
 
281
}
274
}