Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 412 Rev 602
Line 107... Line 107...
107
			SERVICE_NOM + "/" +
107
			SERVICE_NOM + "/" +
108
			"";
108
			"";
Line 109... Line 109...
109
		
109
		
Line 110... Line -...
110
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
-
 
111
		
-
 
112
		String postDonnees = 	"cmhl_ce_modifier_par=" + utilisateurId +
-
 
113
			"&cs_ce_projet=" + str.getIdProjet() +
-
 
114
			"&cs_ce_mere=" + str.getIdMere() +
-
 
115
			"&cs_guid=" + str.getGuid() +
-
 
116
			"&cs_truk_identifiant_alternatif=" + str.getIdAlternatif() +
-
 
117
			"&cs_nom=" + str.getNom() +
-
 
118
			"&cs_truk_nom_alternatif=" + str.getNomAlternatif() +
-
 
119
			"&cs_ce_type=" + str.getType() +
-
 
120
			"&cs_ce_truk_type_prive=" + str.getTypePrive() +
-
 
121
			"&cs_ce_truk_type_public=" + str.getTypePublic() +
-
 
122
			"&cs_adresse_01=" + str.getAdresse() +
-
 
123
			"&cs_adresse_02=" + str.getAdresseComplement() +
-
 
124
			"&cs_date_fondation=" + str.getDateFondationFormatMysql() +
-
 
125
			"&cs_code_postal=" + str.getCodePostal() +
-
 
126
			"&cs_ville=" + str.getVille() +
-
 
127
			"&cs_region=" + str.getRegion() +
-
 
128
			"&cs_pays=" + str.getPays() +
-
 
129
			"&cs_telephone=" + str.getTelephone() +
-
 
130
			"&cs_fax=" + str.getFax() +
-
 
131
			"&cs_truk_url=" + str.getUrl() +
-
 
132
			"&cs_nbre_personne=" + Integer.toString(str.getNbrePersonne());
110
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
133
		if (conservation != null) {
-
 
134
			postDonnees += "&csc_mark_formation=" + conservation.getFormation() +
-
 
135
				"&csc_formation=" + conservation.getFormationInfo() +
-
 
136
				"&csc_mark_formation_interet=" + conservation.getFormationInteret() +
-
 
137
				"&csc_truk_stockage_local=" + conservation.getStockageLocal() +
-
 
138
				"&csc_truk_stockage_meuble=" + conservation.getStockageMeuble() +
-
 
139
				"&csc_truk_stockage_parametre=" + conservation.getStockageParametre() +
-
 
140
				"&csc_mark_collection_commune=" + conservation.getCollectionCommune() +
-
 
141
				"&csc_truk_collection_autre=" + conservation.getCollectionAutre() +
-
 
142
				"&csc_mark_acces_controle=" + conservation.getAccesControle() +
-
 
143
				"&csc_mark_restauration=" + conservation.getRestauration() +
-
 
144
				"&csc_truk_restauration_operation=" + conservation.getRestaurationOperation() +
-
 
145
				"&csc_ce_materiel_conservation=" + conservation.getMaterielConservation() +
-
 
146
				"&csc_truk_materiel_autre=" + conservation.getMaterielAutre() +
-
 
147
				"&csc_mark_traitement=" + conservation.getTraitement() +
-
 
148
				"&csc_truk_traitement=" + conservation.getTraitements() +
-
 
149
				"&csc_mark_acquisition_collection=" + conservation.getAcquisitionCollection() +
-
 
150
				"&csc_mark_acquisition_echantillon=" + conservation.getAcquisitionEchantillon() +
-
 
151
				"&csc_mark_acquisition_traitement=" + conservation.getAcquisitionTraitement() +
-
 
152
				"&csc_truk_acquisition_traitement_poison=" + conservation.getAcquisitionTraitementPoison() +
-
 
153
				"&csc_truk_acquisition_traitement_insecte=" + conservation.getAcquisitionTraitementInsecte();
-
 
154
		}
-
 
155
		if (valorisation != null) {
-
 
156
			postDonnees += "&csv_mark_action=" + valorisation.getAction() +
-
 
157
				"&csv_truk_action=" + valorisation.getActionInfo() +
-
 
158
				"&csv_publication=" + valorisation.getPublication() +
-
 
159
				"&csv_collection_autre=" + valorisation.getCollectionAutre() +
-
 
160
				"&csv_mark_action_future=" + valorisation.getActionFuture() +
-
 
161
				"&csv_action_future=" + valorisation.getActionFutureInfo() +
-
 
162
				"&csv_mark_recherche=" + valorisation.getRecherche() +
-
 
163
				"&csv_truk_recherche_provenance=" + valorisation.getRechercheProvenance() +
-
 
164
				"&csv_truk_recherche_type=" + valorisation.getRechercheType() +
-
 
165
				"&csv_mark_acces_ss_motif=" + valorisation.getAccesSansMotif() +
-
 
166
				"&csv_acces_ss_motif=" + valorisation.getAccesSansMotifInfo() +
-
 
167
				"&csv_mark_visite_avec_motif=" + valorisation.getVisiteAvecMotif() +
-
 
168
				"&csv_visite_avec_motif=" + valorisation.getVisiteAvecMotifInfo();
-
 
169
		}
-
 
Line 170... Line 111...
170
		
111
		
171
		String postDonneesEncodees = URL.encode(postDonnees);
112
		String postDonneesEncodees = construirePost(utilisateurId, str, conservation, valorisation);
Line 172... Line 113...
172
		
113
		
Line 303... Line 244...
303
		final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + 
244
		final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + 
304
			SERVICE_NOM + "/" + structureId;
245
			SERVICE_NOM + "/" + structureId;
Line 305... Line 246...
305
	
246
	
Line 306... Line -...
306
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
-
 
307
		
-
 
308
		String postDonnees = "cmhl_ce_modifier_par=" + utilisateurId;
-
 
309
		if (str != null) {
-
 
310
			postDonnees += "&cs_ce_projet=" + str.getIdProjet() +
-
 
311
			"&cs_ce_mere=" + str.getIdMere() +
-
 
312
			"&cs_guid=" + str.getGuid() +
-
 
313
			"&cs_truk_identifiant_alternatif=" + str.getIdAlternatif() +
-
 
314
			"&cs_nom=" + str.getNom() +
-
 
315
			"&cs_truk_nom_alternatif=" + str.getNomAlternatif() +
-
 
316
			"&cs_ce_type=" + str.getType() +
-
 
317
			"&cs_ce_truk_type_prive=" + str.getTypePrive() +
-
 
318
			"&cs_ce_truk_type_public=" + str.getTypePublic() +
-
 
319
			"&cs_adresse_01=" + str.getAdresse() +
-
 
320
			"&cs_adresse_02=" + str.getAdresseComplement() +
-
 
321
			"&cs_date_fondation=" + str.getDateFondationFormatMysql() +
-
 
322
			"&cs_code_postal=" + str.getCodePostal() +
-
 
323
			"&cs_ville=" + str.getVille() +
-
 
324
			"&cs_region=" + str.getRegion() +
-
 
325
			"&cs_pays=" + str.getPays() +
-
 
326
			"&cs_telephone=" + str.getTelephone() +
-
 
327
			"&cs_fax=" + str.getFax() +
-
 
328
			"&cs_courriel=" + str.getCourriel() +
-
 
329
			"&cs_truk_url=" + str.getUrl() +
-
 
330
			"&cs_nbre_personne=" + Integer.toString(str.getNbrePersonne());
-
 
331
		}
247
		RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url);
332
		if (conservation != null) {
-
 
333
			postDonnees += "&csc_mark_formation=" + conservation.getFormation() +
-
 
334
			"&csc_formation=" + conservation.getFormationInfo() +
-
 
335
			"&csc_mark_formation_interet=" + conservation.getFormationInteret() +
-
 
336
			"&csc_truk_stockage_local=" + conservation.getStockageLocal() +
-
 
337
			"&csc_truk_stockage_meuble=" + conservation.getStockageMeuble() +
-
 
338
			"&csc_truk_stockage_parametre=" + conservation.getStockageParametre() +
-
 
339
			"&csc_mark_collection_commune=" + conservation.getCollectionCommune() +
-
 
340
			"&csc_truk_collection_autre=" + conservation.getCollectionAutre() +
-
 
341
			"&csc_mark_acces_controle=" + conservation.getAccesControle() +
-
 
342
			"&csc_mark_restauration=" + conservation.getRestauration() +
-
 
343
			"&csc_truk_restauration_operation=" + conservation.getRestaurationOperation() +
-
 
344
			"&csc_ce_materiel_conservation=" + conservation.getMaterielConservation() +
-
 
345
			"&csc_truk_materiel_autre=" + conservation.getMaterielAutre() +
-
 
346
			"&csc_mark_traitement=" + conservation.getTraitement() +
-
 
347
			"&csc_truk_traitement=" + conservation.getTraitements() +
-
 
348
			"&csc_mark_acquisition_collection=" + conservation.getAcquisitionCollection() +
-
 
349
			"&csc_mark_acquisition_echantillon=" + conservation.getAcquisitionEchantillon() +
-
 
350
			"&csc_mark_acquisition_traitement=" + conservation.getAcquisitionTraitement() +
-
 
351
			"&csc_truk_acquisition_traitement_poison=" + conservation.getAcquisitionTraitementPoison() +
-
 
352
			"&csc_truk_acquisition_traitement_insecte=" + conservation.getAcquisitionTraitementInsecte();
-
 
353
		}
-
 
354
		if (valorisation != null) {
-
 
355
			postDonnees += "&csv_mark_action=" + valorisation.getAction() +
-
 
356
			"&csv_truk_action=" + valorisation.getActionInfo() +
-
 
357
			"&csv_publication=" + valorisation.getPublication() +
-
 
358
			"&csv_collection_autre=" + valorisation.getCollectionAutre() +
-
 
359
			"&csv_mark_action_future=" + valorisation.getActionFuture() +
-
 
360
			"&csv_action_future=" + valorisation.getActionFutureInfo() +
-
 
361
			"&csv_mark_recherche=" + valorisation.getRecherche() +
-
 
362
			"&csv_truk_recherche_provenance=" + valorisation.getRechercheProvenance() +
-
 
363
			"&csv_truk_recherche_type=" + valorisation.getRechercheType() +
-
 
364
			"&csv_mark_acces_ss_motif=" + valorisation.getAccesSansMotif() +
-
 
365
			"&csv_acces_ss_motif=" + valorisation.getAccesSansMotifInfo() +
-
 
366
			"&csv_mark_visite_avec_motif=" + valorisation.getVisiteAvecMotif() +
-
 
367
			"&csv_visite_avec_motif=" + valorisation.getVisiteAvecMotifInfo();
-
 
368
		}
-
 
369
		
248
		
370
		String postDonneesEncodees = URL.encode(postDonnees);
249
		String postDonneesEncodees = construirePost(utilisateurId, str, conservation, valorisation);
371
		GWT.log(postDonnees, null);
250
		GWT.log(postDonneesEncodees, null);
Line 372... Line 251...
372
		try {
251
		try {
373
			rb.sendRequest(postDonneesEncodees, new RequestCallback() {
252
			rb.sendRequest(postDonneesEncodees, new RequestCallback() {
Line 423... Line 302...
423
			// Gestion des exceptions déclenchées par la création de la requête (url non-valide ?)
302
			// Gestion des exceptions déclenchées par la création de la requête (url non-valide ?)
424
			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);
425
			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.");
426
		}	
305
		}	
427
	}
306
	}
-
 
307
	
-
 
308
	private String construirePost(String utilisateurId, Structure str, StructureConservation conservation, StructureValorisation valorisation) {
-
 
309
		String postDonnees = "cmhl_ce_modifier_par=" + URL.encodeComponent(utilisateurId);
-
 
310
		if (str != null) {
-
 
311
			postDonnees += "&cs_ce_projet=" + URL.encodeComponent(str.getIdProjet()) +
-
 
312
				"&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) +
-
 
313
				"&cs_guid=" + URL.encodeComponent(str.getGuid()) +
-
 
314
				"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) +
-
 
315
				"&cs_nom=" + URL.encodeComponent(str.getNom()) +
-
 
316
				"&cs_truk_nom_alternatif=" + URL.encodeComponent(str.getNomAlternatif()) +
-
 
317
				"&cs_ce_type=" + URL.encodeComponent(str.getType()) +
-
 
318
				"&cs_ce_truk_type_prive=" + URL.encodeComponent(str.getTypePrive()) +
-
 
319
				"&cs_ce_truk_type_public=" + URL.encodeComponent(str.getTypePublic()) +
-
 
320
				"&cs_adresse_01=" + URL.encodeComponent(str.getAdresse()) +
-
 
321
				"&cs_adresse_02=" + URL.encodeComponent(str.getAdresseComplement()) +
-
 
322
				"&cs_date_fondation=" + URL.encodeComponent(str.getDateFondationFormatMysql()) +
-
 
323
				"&cs_code_postal=" + URL.encodeComponent(str.getCodePostal()) +
-
 
324
				"&cs_ville=" + URL.encodeComponent(str.getVille()) +
-
 
325
				"&cs_ce_truk_region=" + URL.encodeComponent(str.getRegion()) +
-
 
326
				"&cs_ce_truk_pays=" + URL.encodeComponent(str.getPays()) +
-
 
327
				"&cs_truk_telephone=" + URL.encodeComponent(str.getTelephone()) +
-
 
328
				"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) +
-
 
329
				"&cs_nbre_personne=" + URL.encodeComponent(Integer.toString(str.getNbrePersonne()));
-
 
330
		}
-
 
331
		if (conservation != null) {
-
 
332
			postDonnees += "&csc_mark_formation=" + URL.encodeComponent(conservation.getFormation()) +
-
 
333
				"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) +
-
 
334
				"&csc_mark_formation_interet=" + URL.encodeComponent(conservation.getFormationInteret()) +
-
 
335
				"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) +
-
 
336
				"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) +
-
 
337
				"&csc_truk_stockage_parametre=" + URL.encodeComponent(conservation.getStockageParametre()) +
-
 
338
				"&csc_mark_collection_commune=" + URL.encodeComponent(conservation.getCollectionCommune()) +
-
 
339
				"&csc_truk_collection_autre=" + URL.encodeComponent(conservation.getCollectionAutre()) +
-
 
340
				"&csc_mark_acces_controle=" + URL.encodeComponent(conservation.getAccesControle()) +
-
 
341
				"&csc_mark_restauration=" + URL.encodeComponent(conservation.getRestauration()) +
-
 
342
				"&csc_truk_restauration_operation=" + URL.encodeComponent(conservation.getRestaurationOperation()) +
-
 
343
				"&csc_ce_materiel_conservation=" + URL.encodeComponent(conservation.getMaterielConservation()) +
-
 
344
				"&csc_truk_materiel_autre=" + URL.encodeComponent(conservation.getMaterielAutre()) +
-
 
345
				"&csc_mark_traitement=" + URL.encodeComponent(conservation.getTraitement()) +
-
 
346
				"&csc_truk_traitement=" + URL.encodeComponent(conservation.getTraitements()) +
-
 
347
				"&csc_mark_acquisition_collection=" + URL.encodeComponent(conservation.getAcquisitionCollection()) +
-
 
348
				"&csc_mark_acquisition_echantillon=" + URL.encodeComponent(conservation.getAcquisitionEchantillon()) +
-
 
349
				"&csc_mark_acquisition_traitement=" + URL.encodeComponent(conservation.getAcquisitionTraitement()) +
-
 
350
				"&csc_truk_acquisition_traitement_poison=" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) +
-
 
351
				"&csc_truk_acquisition_traitement_insecte=" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte());
-
 
352
		}
-
 
353
		if (valorisation != null) {
-
 
354
			postDonnees += "&csv_mark_action=" + URL.encodeComponent(valorisation.getAction()) +
-
 
355
				"&csv_truk_action=" + URL.encodeComponent(valorisation.getActionInfo()) +
-
 
356
				"&csv_publication=" + URL.encodeComponent(valorisation.getPublication()) +
-
 
357
				"&csv_collection_autre=" + URL.encodeComponent(valorisation.getCollectionAutre()) +
-
 
358
				"&csv_mark_action_future=" + URL.encodeComponent(valorisation.getActionFuture()) +
-
 
359
				"&csv_action_future=" + URL.encodeComponent(valorisation.getActionFutureInfo()) +
-
 
360
				"&csv_mark_recherche=" + URL.encodeComponent(valorisation.getRecherche()) +
-
 
361
				"&csv_truk_recherche_provenance=" + URL.encodeComponent(valorisation.getRechercheProvenance()) +
-
 
362
				"&csv_truk_recherche_type=" + URL.encodeComponent(valorisation.getRechercheType()) +
-
 
363
				"&csv_mark_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotif()) +
-
 
364
				"&csv_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotifInfo()) +
-
 
365
				"&csv_mark_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotif()) +
-
 
366
				"&csv_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotifInfo());
-
 
367
		}
-
 
368
		return postDonnees;
-
 
369
	}
428
}
370
}
429
371