Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 295 Rev 306
Line 104... Line 104...
104
			"";
104
			"";
Line 105... Line 105...
105
		
105
		
Line 106... Line 106...
106
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
106
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
107
		
107
		
108
		String postDonnees = 	"cmhl_ce_modifier_par=" + utilisateurId +
108
		String postDonnees = 	"cmhl_ce_modifier_par=" + utilisateurId +
109
			"&cs_ce_projet=" + URL.encodeComponent(str.getIdProjet()) +
109
			"&cs_ce_projet=" + str.getIdProjet() +
110
			"&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) +
110
			"&cs_ce_mere=" + str.getIdMere() +
111
			"&cs_guid=" + URL.encodeComponent(str.getGuid()) +
111
			"&cs_guid=" + str.getGuid() +
112
			"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) +
112
			"&cs_truk_identifiant_alternatif=" + str.getIdAlternatif() +
113
			"&cs_nom=" + URL.encodeComponent(str.getNom()) +
113
			"&cs_nom=" + str.getNom() +
114
			"&cs_truk_nom_alternatif=" + URL.encodeComponent(str.getNomAlternatif()) +
114
			"&cs_truk_nom_alternatif=" + str.getNomAlternatif() +
115
			"&cs_ce_type=" + URL.encodeComponent(str.getType()) +
115
			"&cs_ce_type=" + str.getType() +
116
			"&cs_ce_truk_type_prive=" + URL.encodeComponent(str.getTypePrive()) +
116
			"&cs_ce_truk_type_prive=" + str.getTypePrive() +
117
			"&cs_ce_truk_type_public=" + URL.encodeComponent(str.getTypePublic()) +
117
			"&cs_ce_truk_type_public=" + str.getTypePublic() +
118
			"&cs_adresse_01=" + URL.encodeComponent(str.getAdresse()) +
118
			"&cs_adresse_01=" + str.getAdresse() +
119
			"&cs_adresse_02=" + URL.encodeComponent(str.getAdresseComplement()) +
119
			"&cs_adresse_02=" + str.getAdresseComplement() +
120
			"&cs_date_fondation=" + URL.encodeComponent(str.getDateFondationFormatMysql()) +
120
			"&cs_date_fondation=" + str.getDateFondationFormatMysql() +
121
			"&cs_code_postal=" + URL.encodeComponent(str.getCodePostal()) +
121
			"&cs_code_postal=" + str.getCodePostal() +
122
			"&cs_ville=" + URL.encodeComponent(str.getVille()) +
122
			"&cs_ville=" + str.getVille() +
123
			"&cs_region=" + URL.encodeComponent(str.getRegion()) +
123
			"&cs_region=" + str.getRegion() +
124
			"&cs_pays=" + URL.encodeComponent(str.getPays()) +
124
			"&cs_pays=" + str.getPays() +
125
			"&cs_telephone=" + URL.encodeComponent(str.getTelephone()) +
125
			"&cs_telephone=" + str.getTelephone() +
126
			"&cs_fax=" + URL.encodeComponent(str.getFax()) +
126
			"&cs_fax=" + str.getFax() +
127
			"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) +
127
			"&cs_truk_url=" + str.getUrl() +
128
			"&cs_nbre_personne=" + URL.encodeComponent(Integer.toString(str.getNbrePersonne()));
128
			"&cs_nbre_personne=" + Integer.toString(str.getNbrePersonne());
129
		if (conservation != null) {
129
		if (conservation != null) {
130
			postDonnees += "&csc_mark_formation=" + URL.encodeComponent(conservation.getFormation()) +
130
			postDonnees += "&csc_mark_formation=" + conservation.getFormation() +
131
				"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) +
131
				"&csc_formation=" + conservation.getFormationInfo() +
132
				"&csc_mark_formation_interet=" + URL.encodeComponent(conservation.getFormationInteret()) +
132
				"&csc_mark_formation_interet=" + conservation.getFormationInteret() +
133
				"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) +
133
				"&csc_truk_stockage_local=" + conservation.getStockageLocal() +
134
				"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) +
134
				"&csc_truk_stockage_meuble=" + conservation.getStockageMeuble() +
135
				"&csc_truk_stockage_parametre=" + URL.encodeComponent(conservation.getStockageParametre()) +
135
				"&csc_truk_stockage_parametre=" + conservation.getStockageParametre() +
136
				"&csc_mark_collection_commune=" + URL.encodeComponent(conservation.getCollectionCommune()) +
136
				"&csc_mark_collection_commune=" + conservation.getCollectionCommune() +
137
				"&csc_truk_collection_autre=" + URL.encodeComponent(conservation.getCollectionAutre()) +
137
				"&csc_truk_collection_autre=" + conservation.getCollectionAutre() +
138
				"&csc_mark_acces_controle=" + URL.encodeComponent(conservation.getAccesControle()) +
138
				"&csc_mark_acces_controle=" + conservation.getAccesControle() +
139
				"&csc_mark_restauration=" + URL.encodeComponent(conservation.getRestauration()) +
139
				"&csc_mark_restauration=" + conservation.getRestauration() +
140
				"&csc_truk_restauration_operation=" + URL.encodeComponent(conservation.getRestaurationOperation()) +
140
				"&csc_truk_restauration_operation=" + conservation.getRestaurationOperation() +
141
				"&csc_ce_materiel_conservation=" + URL.encodeComponent(conservation.getMaterielConservation()) +
141
				"&csc_ce_materiel_conservation=" + conservation.getMaterielConservation() +
142
				"&csc_truk_materiel_autre=" + URL.encodeComponent(conservation.getMaterielAutre()) +
142
				"&csc_truk_materiel_autre=" + conservation.getMaterielAutre() +
143
				"&csc_mark_traitement=" + URL.encodeComponent(conservation.getTraitement()) +
143
				"&csc_mark_traitement=" + conservation.getTraitement() +
144
				"&csc_truk_traitement=" + URL.encodeComponent(conservation.getTraitements()) +
144
				"&csc_truk_traitement=" + conservation.getTraitements() +
145
				"&csc_mark_acquisition_collection=" + URL.encodeComponent(conservation.getAcquisitionCollection()) +
145
				"&csc_mark_acquisition_collection=" + conservation.getAcquisitionCollection() +
146
				"&csc_mark_acquisition_echantillon=" + URL.encodeComponent(conservation.getAcquisitionEchantillon()) +
146
				"&csc_mark_acquisition_echantillon=" + conservation.getAcquisitionEchantillon() +
147
				"&csc_mark_acquisition_traitement=" + URL.encodeComponent(conservation.getAcquisitionTraitement()) +
147
				"&csc_mark_acquisition_traitement=" + conservation.getAcquisitionTraitement() +
148
				"&csc_truk_acquisition_traitement_poison=" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) +
148
				"&csc_truk_acquisition_traitement_poison=" + conservation.getAcquisitionTraitementPoison() +
149
				"&csc_truk_acquisition_traitement_insecte=" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte());
149
				"&csc_truk_acquisition_traitement_insecte=" + conservation.getAcquisitionTraitementInsecte();
150
		}
150
		}
151
		if (valorisation != null) {
151
		if (valorisation != null) {
152
			postDonnees += "&csv_mark_action=" + URL.encodeComponent(valorisation.getAction()) +
152
			postDonnees += "&csv_mark_action=" + valorisation.getAction() +
153
				"&csv_truk_action=" + URL.encodeComponent(valorisation.getActionInfo()) +
153
				"&csv_truk_action=" + valorisation.getActionInfo() +
154
				"&csv_publication=" + URL.encodeComponent(valorisation.getPublication()) +
154
				"&csv_publication=" + valorisation.getPublication() +
155
				"&csv_collection_autre=" + URL.encodeComponent(valorisation.getCollectionAutre()) +
155
				"&csv_collection_autre=" + valorisation.getCollectionAutre() +
156
				"&csv_mark_action_future=" + URL.encodeComponent(valorisation.getActionFuture()) +
156
				"&csv_mark_action_future=" + valorisation.getActionFuture() +
157
				"&csv_action_future=" + URL.encodeComponent(valorisation.getActionFutureInfo()) +
157
				"&csv_action_future=" + valorisation.getActionFutureInfo() +
158
				"&csv_mark_recherche=" + URL.encodeComponent(valorisation.getRecherche()) +
158
				"&csv_mark_recherche=" + valorisation.getRecherche() +
159
				"&csv_truk_recherche_provenance=" + URL.encodeComponent(valorisation.getRechercheProvenance()) +
159
				"&csv_truk_recherche_provenance=" + valorisation.getRechercheProvenance() +
160
				"&csv_truk_recherche_type=" + URL.encodeComponent(valorisation.getRechercheType()) +
160
				"&csv_truk_recherche_type=" + valorisation.getRechercheType() +
161
				"&csv_mark_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotif()) +
161
				"&csv_mark_acces_ss_motif=" + valorisation.getAccesSansMotif() +
162
				"&csv_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotifInfo()) +
162
				"&csv_acces_ss_motif=" + valorisation.getAccesSansMotifInfo() +
163
				"&csv_mark_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotif()) +
163
				"&csv_mark_visite_avec_motif=" + valorisation.getVisiteAvecMotif() +
164
				"&csv_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotifInfo());
164
				"&csv_visite_avec_motif=" + valorisation.getVisiteAvecMotifInfo();
-
 
165
		}
-
 
166
		
165
		}
167
		String postDonneesEncodees = URL.encode(postDonnees);
166
 
168
		
Line 167... Line 169...
167
		try {
169
		try {
168
			rb.sendRequest(postDonnees, new RequestCallback() {
170
			rb.sendRequest(postDonneesEncodees, new RequestCallback() {
169
 
171
 
170
				public void onError(Request request, Throwable exception) {
172
				public void onError(Request request, Throwable exception) {
Line 183... Line 185...
183
				public void onResponseReceived(Request request, Response response) {
185
				public void onResponseReceived(Request request, Response response) {
184
					// Si le code de réponse HTTP ne vaut pas 200 OK, on lance le mécanise d'erreur HTTP
186
					// Si le code de réponse HTTP ne vaut pas 200 OK, on lance le mécanise d'erreur HTTP
185
					if (response.getStatusCode() != 200) {
187
					if (response.getStatusCode() != 200) {
186
						onErrorHTTP(request, response);
188
						onErrorHTTP(request, response);
187
					} else {
189
					} else {
-
 
190
						Information info = new Information("ajout_structure");
-
 
191
						if (response.getHeader("X-DebugJrest-Data").length() != 0) {
-
 
192
							final JSONValue reponseEnteteDeboguage = JSONParser.parse(response.getHeader("X-DebugJrest-Data"));
-
 
193
							if (reponseEnteteDeboguage.isArray() != null) {
-
 
194
								info.setDeboguages(reponseEnteteDeboguage.isArray());
-
 
195
							}
-
 
196
						}
188
						if (response.getText().length() != 0 && response.getText() != null) {
197
						if (response.getText().length() != 0 && response.getText() != null) {
189
							final JSONValue responseValue = JSONParser.parse(response.getText());
198
							final JSONValue responseValue = JSONParser.parse(response.getText());
Line 190... Line 199...
190
							
199
							
191
							// Si la requête est un succès, reception d'une chaine
200
							// Si la requête est un succès, reception d'une chaine
192
							if (responseValue.isString() != null) {
201
							if (responseValue.isString() != null) {
193
								Information info = new Information("ajout_structure", responseValue.isString().stringValue());
-
 
194
								r.rafraichir(info);
202
								info.setMessage(responseValue.isString().stringValue());
195
							} else {
203
							} else {
196
								GWT.log(url+"\n\tLa réponse n'est pas une chaine JSON.", null);
204
								info.setDeboguage("La réponse n'est pas une chaine JSON.");
197
							}
205
							}
198
						} else {
-
 
199
							GWT.log(url, null);
-
 
200
							if (response.getText().length() == 0) {
-
 
201
								GWT.log("\tLa réponse a une taille de 0", null);
-
 
202
							}
206
						} else {
203
							if (response.getText() == null) {
207
							if (response.getText() == null) {
-
 
208
								info.setDeboguage("tLa réponse vaut null");
-
 
209
							} else if (response.getText().length() == 0) {
204
								GWT.log("\tLa réponse vaut null", null);
210
								info.setDeboguage("tLa réponse a une taille de 0");
205
							}
211
							}
-
 
212
						}
-
 
213
						r.rafraichir(info);
206
						}
214
						
207
					}
215
					}
Line 208... Line 216...
208
				}
216
				}
209
				
217
				
Line 276... Line 284...
276
			GWT.log("Erreur à la création du service "+SERVICE_NOM+" (suppression)", e);
284
			GWT.log("Erreur à la création du service "+SERVICE_NOM+" (suppression)", e);
277
			Info.display("Erreur de Requête", "Une erreur s'est produite lors de la création de la requête.");
285
			Info.display("Erreur de Requête", "Une erreur s'est produite lors de la création de la requête.");
278
		}
286
		}
279
	}
287
	}
Line 280... Line 288...
280
 
288
 
281
	public void modifier(final Rafraichissable vues, String utilisateurId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
289
	public void modifier(final Rafraichissable vues, String utilisateurId, String structureId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
282
		final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + 
290
		final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + 
283
		SERVICE_NOM + "/" +
-
 
284
		str.getId()
-
 
Line 285... Line 291...
285
		;
291
			SERVICE_NOM + "/" + structureId;
Line 286... Line 292...
286
	
292
	
-
 
293
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
287
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
294
		
288
		
295
		String postDonnees = "cmhl_ce_modifier_par=" + utilisateurId;
289
		String postDonnees = 	"cmhl_ce_modifier_par=" + utilisateurId +
296
		if (str != null) {
290
			"&cs_ce_projet=" + URL.encodeComponent(str.getIdProjet()) +
297
			postDonnees += "&cs_ce_projet=" + str.getIdProjet() +
291
			"&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) +
298
			"&cs_ce_mere=" + str.getIdMere() +
292
			"&cs_guid=" + URL.encodeComponent(str.getGuid()) +
299
			"&cs_guid=" + str.getGuid() +
293
			"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) +
300
			"&cs_truk_identifiant_alternatif=" + str.getIdAlternatif() +
294
			"&cs_nom=" + URL.encodeComponent(str.getNom()) +
301
			"&cs_nom=" + str.getNom() +
295
			"&cs_truk_nom_alternatif=" + URL.encodeComponent(str.getNomAlternatif()) +
302
			"&cs_truk_nom_alternatif=" + str.getNomAlternatif() +
296
			"&cs_ce_type=" + URL.encodeComponent(str.getType()) +
303
			"&cs_ce_type=" + str.getType() +
297
			"&cs_ce_truk_type_prive=" + URL.encodeComponent(str.getTypePrive()) +
304
			"&cs_ce_truk_type_prive=" + str.getTypePrive() +
298
			"&cs_ce_truk_type_public=" + URL.encodeComponent(str.getTypePublic()) +
305
			"&cs_ce_truk_type_public=" + str.getTypePublic() +
299
			"&cs_adresse_01=" + URL.encodeComponent(str.getAdresse()) +
306
			"&cs_adresse_01=" + str.getAdresse() +
300
			"&cs_adresse_02=" + URL.encodeComponent(str.getAdresseComplement()) +
307
			"&cs_adresse_02=" + str.getAdresseComplement() +
301
			"&cs_date_fondation=" + URL.encodeComponent(str.getDateFondationFormatMysql()) +
308
			"&cs_date_fondation=" + str.getDateFondationFormatMysql() +
302
			"&cs_code_postal=" + URL.encodeComponent(str.getCodePostal()) +
309
			"&cs_code_postal=" + str.getCodePostal() +
303
			"&cs_ville=" + URL.encodeComponent(str.getVille()) +
310
			"&cs_ville=" + str.getVille() +
304
			"&cs_region=" + URL.encodeComponent(str.getRegion()) +
311
			"&cs_region=" + str.getRegion() +
305
			"&cs_pays=" + URL.encodeComponent(str.getPays()) +
312
			"&cs_pays=" + str.getPays() +
306
			"&cs_telephone=" + URL.encodeComponent(str.getTelephone()) +
313
			"&cs_telephone=" + str.getTelephone() +
307
			"&cs_fax=" + URL.encodeComponent(str.getFax()) +
314
			"&cs_fax=" + str.getFax() +
-
 
315
			"&cs_courriel=" + str.getCourriel() +
-
 
316
			"&cs_truk_url=" + str.getUrl() +
308
			"&cs_courriel=" + URL.encodeComponent(str.getCourriel()) +
317
			"&cs_nbre_personne=" + Integer.toString(str.getNbrePersonne());
309
			"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) +
318
		}
310
			"&cs_nbre_personne=" + URL.encodeComponent(Integer.toString(str.getNbrePersonne())) +
319
		if (conservation != null) {
311
			"&csc_mark_formation=" + URL.encodeComponent(conservation.getFormation()) +
320
			postDonnees += "&csc_mark_formation=" + conservation.getFormation() +
312
			"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) +
321
			"&csc_formation=" + conservation.getFormationInfo() +
313
			"&csc_mark_formation_interet=" + URL.encodeComponent(conservation.getFormationInteret()) +
322
			"&csc_mark_formation_interet=" + conservation.getFormationInteret() +
314
			"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) +
323
			"&csc_truk_stockage_local=" + conservation.getStockageLocal() +
315
			"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) +
324
			"&csc_truk_stockage_meuble=" + conservation.getStockageMeuble() +
316
			"&csc_truk_stockage_parametre=" + URL.encodeComponent(conservation.getStockageParametre()) +
325
			"&csc_truk_stockage_parametre=" + conservation.getStockageParametre() +
317
			"&csc_mark_collection_commune=" + URL.encodeComponent(conservation.getCollectionCommune()) +
326
			"&csc_mark_collection_commune=" + conservation.getCollectionCommune() +
318
			"&csc_truk_collection_autre=" + URL.encodeComponent(conservation.getCollectionAutre()) +
327
			"&csc_truk_collection_autre=" + conservation.getCollectionAutre() +
319
			"&csc_mark_acces_controle=" + URL.encodeComponent(conservation.getAccesControle()) +
328
			"&csc_mark_acces_controle=" + conservation.getAccesControle() +
320
			"&csc_mark_restauration=" + URL.encodeComponent(conservation.getRestauration()) +
329
			"&csc_mark_restauration=" + conservation.getRestauration() +
321
			"&csc_truk_restauration_operation=" + URL.encodeComponent(conservation.getRestaurationOperation()) +
330
			"&csc_truk_restauration_operation=" + conservation.getRestaurationOperation() +
322
			"&csc_ce_materiel_conservation=" + URL.encodeComponent(conservation.getMaterielConservation()) +
331
			"&csc_ce_materiel_conservation=" + conservation.getMaterielConservation() +
323
			"&csc_truk_materiel_autre=" + URL.encodeComponent(conservation.getMaterielAutre()) +
332
			"&csc_truk_materiel_autre=" + conservation.getMaterielAutre() +
324
			"&csc_mark_traitement=" + URL.encodeComponent(conservation.getTraitement()) +
333
			"&csc_mark_traitement=" + conservation.getTraitement() +
325
			"&csc_truk_traitement=" + URL.encodeComponent(conservation.getTraitements()) +
334
			"&csc_truk_traitement=" + conservation.getTraitements() +
326
			"&csc_mark_acquisition_collection=" + URL.encodeComponent(conservation.getAcquisitionCollection()) +
335
			"&csc_mark_acquisition_collection=" + conservation.getAcquisitionCollection() +
327
			"&csc_mark_acquisition_echantillon=" + URL.encodeComponent(conservation.getAcquisitionEchantillon()) +
336
			"&csc_mark_acquisition_echantillon=" + conservation.getAcquisitionEchantillon() +
-
 
337
			"&csc_mark_acquisition_traitement=" + conservation.getAcquisitionTraitement() +
-
 
338
			"&csc_truk_acquisition_traitement_poison=" + conservation.getAcquisitionTraitementPoison() +
328
			"&csc_mark_acquisition_traitement=" + URL.encodeComponent(conservation.getAcquisitionTraitement()) +
339
			"&csc_truk_acquisition_traitement_insecte=" + conservation.getAcquisitionTraitementInsecte();
329
			"&csc_truk_acquisition_traitement_poison=" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) +
340
		}
330
			"&csc_truk_acquisition_traitement_insecte=" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte()) +
341
		if (valorisation != null) {
331
			"&csv_mark_action=" + URL.encodeComponent(valorisation.getAction()) +
342
			postDonnees += "&csv_mark_action=" + valorisation.getAction() +
332
			"&csv_truk_action=" + URL.encodeComponent(valorisation.getActionInfo()) +
343
			"&csv_truk_action=" + valorisation.getActionInfo() +
333
			"&csv_publication=" + URL.encodeComponent(valorisation.getPublication()) +
344
			"&csv_publication=" + valorisation.getPublication() +
334
			"&csv_collection_autre=" + URL.encodeComponent(valorisation.getCollectionAutre()) +
345
			"&csv_collection_autre=" + valorisation.getCollectionAutre() +
335
			"&csv_mark_action_future=" + URL.encodeComponent(valorisation.getActionFuture()) +
346
			"&csv_mark_action_future=" + valorisation.getActionFuture() +
336
			"&csv_action_future=" + URL.encodeComponent(valorisation.getActionFutureInfo()) +
347
			"&csv_action_future=" + valorisation.getActionFutureInfo() +
337
			"&csv_mark_recherche=" + URL.encodeComponent(valorisation.getRecherche()) +
348
			"&csv_mark_recherche=" + valorisation.getRecherche() +
338
			"&csv_truk_recherche_provenance=" + URL.encodeComponent(valorisation.getRechercheProvenance()) +
349
			"&csv_truk_recherche_provenance=" + valorisation.getRechercheProvenance() +
339
			"&csv_truk_recherche_type=" + URL.encodeComponent(valorisation.getRechercheType()) +
350
			"&csv_truk_recherche_type=" + valorisation.getRechercheType() +
340
			"&csv_mark_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotif()) +
351
			"&csv_mark_acces_ss_motif=" + valorisation.getAccesSansMotif() +
341
			"&csv_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotifInfo()) +
352
			"&csv_acces_ss_motif=" + valorisation.getAccesSansMotifInfo() +
342
			"&csv_mark_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotif()) +
353
			"&csv_mark_visite_avec_motif=" + valorisation.getVisiteAvecMotif() +
-
 
354
			"&csv_visite_avec_motif=" + valorisation.getVisiteAvecMotifInfo();
-
 
355
		}
343
			"&csv_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotifInfo()) +
356
		
344
			"";
357
		String postDonneesEncodees = URL.encode(postDonnees);
Line 345... Line 358...
345
	
358
		GWT.log(postDonnees, null);
346
		try {
359
		try {
347
			rb.sendRequest(postDonnees, new RequestCallback() {
360
			rb.sendRequest(postDonneesEncodees, new RequestCallback() {
348
	
361
	
Line 362... Line 375...
362
				public void onResponseReceived(Request request, Response response) {
375
				public void onResponseReceived(Request request, Response response) {
363
					// Si le code de réponse HTTP ne vaut pas 200 OK, on lance le mécanise d'erreur HTTP
376
					// Si le code de réponse HTTP ne vaut pas 200 OK, on lance le mécanise d'erreur HTTP
364
					if (response.getStatusCode() != 200) {
377
					if (response.getStatusCode() != 200) {
365
						onErrorHTTP(request, response);
378
						onErrorHTTP(request, response);
366
					} else {
379
					} else {
-
 
380
						Information info = new Information("modif_structure");
-
 
381
						if (response.getHeader("X-DebugJrest-Data").length() != 0) {
-
 
382
							final JSONValue reponseEnteteDeboguage = JSONParser.parse(response.getHeader("X-DebugJrest-Data"));
-
 
383
							if (reponseEnteteDeboguage.isArray() != null) {
-
 
384
								info.setDeboguages(reponseEnteteDeboguage.isArray());
-
 
385
							}
-
 
386
						}
367
						if (response.getText().length() != 0 && response.getText() != null) {
387
						if (response.getText() != null && response.getText().length() != 0) {
368
							final JSONValue responseValue = JSONParser.parse(response.getText());
388
							final JSONValue responseValue = JSONParser.parse(response.getText());
Line 369... Line 389...
369
							
389
							
370
							// Si la requête est un succès, reception d'une chaine
390
							// Si la requête est un succès, reception d'une chaine
371
							if (responseValue.isString() != null) {
391
							if (responseValue.isString() != null) {
372
								Information info = new Information("modif_structure", responseValue.isString().stringValue());
-
 
373
								vues.rafraichir(info);
392
								info.setMessage(responseValue.isString().stringValue());
374
							} else {
393
							} else {
375
								GWT.log(url+"\n\tLa réponse n'est pas une chaine JSON.", null);
394
								info.setDeboguage("La réponse n'est pas une chaine JSON.");
376
							}
395
							}
377
						} else {
-
 
378
							GWT.log(url, null);
-
 
379
							if (response.getText().length() == 0) {
-
 
380
								GWT.log("\tLa réponse a une taille de 0", null);
-
 
381
							}
396
						} else {
382
							if (response.getText() == null) {
397
							if (response.getText() == null) {
-
 
398
								info.setDeboguage("La réponse vaul null");
-
 
399
							} else if (response.getText().length() == 0) {
383
								GWT.log("\tLa réponse vaul null", null);
400
								info.setDeboguage("La réponse a une taille de 0");
384
							}
401
							}
-
 
402
						}
385
						}
403
						vues.rafraichir(info);
386
					}
404
					}
Line 387... Line 405...
387
				}
405
				}
388
				
406