Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 609 Rev 612
Line 107... Line 107...
107
			SERVICE_NOM + "/" +
107
			SERVICE_NOM + "/" +
108
			"";
108
			"";
Line 109... Line 109...
109
		
109
		
Line 110... Line 110...
110
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
110
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
Line 111... Line 111...
111
		
111
		
112
		String postDonneesEncodees = construirePost(utilisateurId, str, conservation, valorisation);
112
		String postDonneesEncodees = construirePost(utilisateurId, null, str, conservation, valorisation);
Line 113... Line 113...
113
 
113
 
Line 244... Line 244...
244
		final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + 
244
		final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + 
245
			SERVICE_NOM + "/" + structureId;
245
			SERVICE_NOM + "/" + structureId;
Line 246... Line 246...
246
	
246
	
Line 247... Line 247...
247
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
247
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
248
		
-
 
-
 
248
		
249
		String postDonneesEncodees = construirePost(utilisateurId, str, conservation, valorisation);
249
		String postDonneesEncodees = construirePost(utilisateurId, structureId, str, conservation, valorisation);
250
		GWT.log(postDonneesEncodees, null);
250
		
Line 251... Line 251...
251
		try {
251
		try {
252
			rb.sendRequest(postDonneesEncodees, new RequestCallback() {
252
			rb.sendRequest(postDonneesEncodees, new RequestCallback() {
Line 303... Line 303...
303
			GWT.log("Erreur à la création du service "+SERVICE_NOM+" (modif)", e);
303
			GWT.log("Erreur à la création du service "+SERVICE_NOM+" (modif)", e);
304
			Info.display("Erreur de Requête", "Une erreur s'est produite lors de la création de la requête.");
304
			Info.display("Erreur de Requête", "Une erreur s'est produite lors de la création de la requête.");
305
		}	
305
		}	
306
	}
306
	}
Line 307... Line 307...
307
	
307
	
308
	private String construirePost(String utilisateurId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
308
	private String construirePost(String utilisateurId, String structureId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
309
		String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId);
309
		String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId);
-
 
310
		if (str != null) {
-
 
311
			if (structureId != null) {
-
 
312
				postDonnees += "&cs_id_structure=" + URL.encodeComponent(structureId);
310
		if (str != null) {
313
			}
311
			postDonnees += "&cs_ce_projet=" + URL.encodeComponent(str.getIdProjet()) +
314
			postDonnees += "&cs_ce_projet=" + URL.encodeComponent(str.getIdProjet()) +
312
				"&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) +
315
				"&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) +
313
				"&cs_guid=" + URL.encodeComponent(str.getGuid()) +
316
				"&cs_guid=" + URL.encodeComponent(str.getGuid()) +
314
				"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) +
317
				"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) +
Line 327... Line 330...
327
				"&cs_truk_telephone=" + URL.encodeComponent(str.getTelephone()) +
330
				"&cs_truk_telephone=" + URL.encodeComponent(str.getTelephone()) +
328
				"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) +
331
				"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) +
329
				"&cs_nbre_personne=" + URL.encodeComponent(Integer.toString(str.getNbrePersonne()));
332
				"&cs_nbre_personne=" + URL.encodeComponent(Integer.toString(str.getNbrePersonne()));
330
		}
333
		}
331
		if (conservation != null) {
334
		if (conservation != null) {
-
 
335
			if (structureId != null) {
-
 
336
				postDonnees += "&csc_id_structure=" + URL.encodeComponent(structureId);
-
 
337
			}
332
			postDonnees += "&csc_mark_formation=" + URL.encodeComponent(conservation.getFormation()) +
338
			postDonnees += "&csc_mark_formation=" + URL.encodeComponent(conservation.getFormation()) +
333
				"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) +
339
				"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) +
334
				"&csc_mark_formation_interet=" + URL.encodeComponent(conservation.getFormationInteret()) +
340
				"&csc_mark_formation_interet=" + URL.encodeComponent(conservation.getFormationInteret()) +
335
				"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) +
341
				"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) +
336
				"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) +
342
				"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) +
Line 349... Line 355...
349
				"&csc_mark_acquisition_traitement=" + URL.encodeComponent(conservation.getAcquisitionTraitement()) +
355
				"&csc_mark_acquisition_traitement=" + URL.encodeComponent(conservation.getAcquisitionTraitement()) +
350
				"&csc_truk_acquisition_traitement_poison=" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) +
356
				"&csc_truk_acquisition_traitement_poison=" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) +
351
				"&csc_truk_acquisition_traitement_insecte=" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte());
357
				"&csc_truk_acquisition_traitement_insecte=" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte());
352
		}
358
		}
353
		if (valorisation != null) {
359
		if (valorisation != null) {
-
 
360
			if (structureId != null) {
-
 
361
				postDonnees += "&csc_id_structure=" + URL.encodeComponent(structureId);
-
 
362
			}
354
			postDonnees += "&csv_mark_action=" + URL.encodeComponent(valorisation.getAction()) +
363
			postDonnees += "&csv_mark_action=" + URL.encodeComponent(valorisation.getAction()) +
355
				"&csv_truk_action=" + URL.encodeComponent(valorisation.getActionInfo()) +
364
				"&csv_truk_action=" + URL.encodeComponent(valorisation.getActionInfo()) +
356
				"&csv_publication=" + URL.encodeComponent(valorisation.getPublication()) +
365
				"&csv_publication=" + URL.encodeComponent(valorisation.getPublication()) +
357
				"&csv_collection_autre=" + URL.encodeComponent(valorisation.getCollectionAutre()) +
366
				"&csv_collection_autre=" + URL.encodeComponent(valorisation.getCollectionAutre()) +
358
				"&csv_mark_action_future=" + URL.encodeComponent(valorisation.getActionFuture()) +
367
				"&csv_mark_action_future=" + URL.encodeComponent(valorisation.getActionFuture()) +