Subversion Repositories eFlore/Applications.cel

Rev

Rev 1293 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1293 Rev 1488
Line 82... Line 82...
82
		try {
82
		try {
83
			rb.sendRequest(null, new RequestCallback() {
83
			rb.sendRequest(null, new RequestCallback() {
Line 84... Line 84...
84
 
84
 
85
				@Override
85
				@Override
86
				public void onError(final Request request, final Throwable exception) {
86
				public void onError(final Request request, final Throwable exception) {
87
					// TODO Auto-generated method stub
-
 
88
					
87
					// TODO Auto-generated method stub	
Line 89... Line 88...
89
				}
88
				}
90
 
89
 
91
				@Override
90
				@Override
Line 111... Line 110...
111
								
110
								
112
								Observation obs = new Observation(observation);
111
								Observation obs = new Observation(observation);
113
								observationData.put(obs.getNumeroOrdre(),obs);
112
								observationData.put(obs.getNumeroOrdre(),obs);
114
							}
113
							}
115
						}
114
						}
116
					} else {
-
 
117
						
115
					} else {		
118
						observationData = new ListeObservation(0) ;
116
						observationData = new ListeObservation(0) ;
Line 119... Line 117...
119
					}
117
					}
120
										
118
										
Line 133... Line 131...
133
	}
131
	}
Line 134... Line 132...
134
	
132
	
135
	public void modifierEnMasse(final Rafraichissable r, String identifiant,
133
	public void modifierEnMasse(final Rafraichissable r, String identifiant,
Line 136... Line 134...
136
			final Observation obs) {
134
			final Observation obs) {
137
 
135
 
138
				RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,Configuration.getServiceBaseUrl()+ "/InventoryObservationList/" + identifiant + "/" + obs.getNumeroOrdre()+ "/") ;
136
			RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,Configuration.getServiceBaseUrl()+ "/InventoryObservationList/" + identifiant + "/" + obs.getNumeroOrdre()+ "/") ;
139
				
137
			
140
				String postData = "ce_utilisateur="
138
			String postData = "ce_utilisateur="
141
					+ identifiant ;
139
				+ identifiant ;
142
				if(obs.getNomSaisi() != null) {
140
			if(obs.getNomSaisi() != null) {
143
					postData += "&nom_sel=" + URL.encodeComponent(obs.getNomSaisi());
141
				postData += "&nom_sel=" + URL.encodeComponent(obs.getNomSaisi());
144
				}
142
			}
145
				if(obs.getNumeroNomenclaturalSaisi() != null) {
143
			if(obs.getNumeroNomenclaturalSaisi() != null) {
146
					postData += "&nom_sel_nn=" + obs.getNumeroNomenclaturalSaisi();
144
				postData += "&nom_sel_nn=" + obs.getNumeroNomenclaturalSaisi();
147
				}
145
			}
148
				
146
			
149
				if(obs.getIdentifiantLocalite() != null) {
147
			if(obs.getIdentifiantLocalite() != null) {
150
					postData += "&ce_zone_geo=" + obs.getIdentifiantLocalite();
148
				postData += "&ce_zone_geo=" + obs.getIdentifiantLocalite();
151
				}
149
			}
152
				
150
			
153
				if(obs.getLocalite() != null) {
151
			if(obs.getLocalite() != null) {
154
					postData += "&zone_geo=" + URL.encodeComponent(obs.getLocalite()); 
152
				postData += "&zone_geo=" + URL.encodeComponent(obs.getLocalite()); 
155
				}
153
			}
156
				
154
			
157
				if(obs.getDate() != null) {
155
			if(obs.getDate() != null) {
158
					postData += "&date_observation=" +  obs.getDate();
156
				postData += "&date_observation=" +  obs.getDate();
159
				}
157
			}
160
				
158
			
161
				if(obs.getLieudit() != null) {
159
			if(obs.getLieudit() != null) {
162
					postData += "&lieudit="+ URL.encodeComponent(obs.getLieudit()); 
160
				postData += "&lieudit="+ URL.encodeComponent(obs.getLieudit()); 
163
				}
161
			}
164
				
162
			
165
				if(obs.getStation() != null) {
163
			if(obs.getStation() != null) {
166
					postData += "&station="+ URL.encodeComponent(obs.getStation());
164
				postData += "&station="+ URL.encodeComponent(obs.getStation());
167
				}
165
			}
168
				
166
			
169
				if(obs.getMilieu() != null) {
167
			if(obs.getMilieu() != null) {
170
					postData += "&milieu="+ URL.encodeComponent(obs.getMilieu());
168
				postData += "&milieu="+ URL.encodeComponent(obs.getMilieu());
171
				}
169
			}
172
				
170
			
173
				if(obs.getCommentaire() != null) {
171
			if(obs.getCommentaire() != null) {
174
					postData += "&commentaire="+obs.getCommentaire();
172
				postData += "&commentaire="+obs.getCommentaire();
175
				}
173
			}
176
				
174
			
177
				if(obs.getLatitude() != null ) {
175
			if(obs.getLatitude() != null ) {
178
					postData += "&latitude="+URL.encodeComponent(""+obs.getLatitude());
176
				postData += "&latitude="+URL.encodeComponent(""+obs.getLatitude());
179
				}
177
			}
180
				
178
			
-
 
179
			if(obs.getLongitude() != null) {
-
 
180
				postData += "&longitude="+URL.encodeComponent(""+obs.getLongitude());
-
 
181
			}
-
 
182
			
-
 
183
			if(obs.getAbondance() != null) {
-
 
184
				postData += "&abondance="+URL.encodeComponent(""+obs.getAbondance());
-
 
185
			}
-
 
186
			
181
				if(obs.getLongitude() != null) {
187
			if(obs.getCertitude() != null) {
Line 182... Line 188...
182
					postData += "&longitude="+URL.encodeComponent(""+obs.getLongitude());
188
				postData += "&certitude="+URL.encodeComponent(""+obs.getCertitude());
183
				}
-
 
184
 
189
			}
Line 185... Line 190...
185
				try {
190
 
186
					
191
			try {
187
					rb.sendRequest(postData, new RequestCallback() {
192
				rb.sendRequest(postData, new RequestCallback() {
188
 
193
 
189
						@Override
194
					@Override
Line 190... Line 195...
190
						public void onError(Request request, Throwable exception) {
195
					public void onError(Request request, Throwable exception) {
191
							// TODO Auto-generated method stub
196
						// TODO Auto-generated method stub
192
							
197
						
193
						}
198
					}
194
 
199
 
195
						@Override
-
 
196
						public void onResponseReceived(Request request,
200
					@Override
197
								Response response) {
-
 
198
							if(observationModele != null) {
201
					public void onResponseReceived(Request request,
199
								observationModele.obtenirListeObservation(r);
202
							Response response) {
200
							}
-
 
201
						}
203
						if(observationModele != null) {
202
						
-
 
203
						
204
							observationModele.obtenirListeObservation(r);
204
					}) ;
-
 
205
					
205
						}
Line 206... Line 206...
206
				} catch (RequestException e) {
206
					}	
207
					
207
				}) ;			
208
			}
208
			} catch (RequestException e) {				
Line 225... Line 225...
225
				Configuration.getServiceBaseUrl()
225
				Configuration.getServiceBaseUrl()
226
				+ "/inventoryObservationList/"
226
				+ "/inventoryObservationList/"
227
				+ identifiant
227
				+ identifiant
228
				+ "/"
228
				+ "/"
229
				+ numerosOrdre);
229
				+ numerosOrdre);
230
 
-
 
231
		try {
230
		try {
232
			rb.sendRequest(postData, new RequestCallback() {
231
			rb.sendRequest(postData, new RequestCallback() {
Line 233... Line 232...
233
 
232
 
234
				@Override
233
				@Override
Line 248... Line 247...
248
						com.google.gwt.user.client.Window
247
						com.google.gwt.user.client.Window
249
								.alert("Problème lors de la mise à jour des données");
248
								.alert("Problème lors de la mise à jour des données");
250
						return ;
249
						return ;
251
					}
250
					}
252
				}
251
				}
253
 
-
 
254
			});
252
			});
255
			
-
 
256
			r.rafraichir("OK", true) ;
253
			r.rafraichir("OK", true) ;
Line 257... Line 254...
257
 
254
 
258
		} catch (RequestException e) {
255
		} catch (RequestException e) {
259
			// TODO Auto-generated catch block
256
			// TODO Auto-generated catch block
260
			e.printStackTrace();
257
			e.printStackTrace();
261
		}
-
 
262
		
258
		}
Line 263... Line 259...
263
	}
259
	}