18,13 → 18,15 |
import com.google.gwt.json.client.JSONValue; |
|
public class StructureAsyncDao { |
|
public void selectionner(final Rafraichissable r, String idUtilisateur, final String projetId, final String idStr) { |
|
private static final String SERVICE_NOM = "CoelStructureListe"; |
|
public void selectionner(final Rafraichissable vue, String idUtilisateur, final String projetId, final String structureId) { |
// Ajout des paramètres et données à selectionner dans l'URL |
final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + |
"CoelStructureListe/" + |
SERVICE_NOM + "/" + |
(projetId == null ? "*" : projetId) + "/" + |
(idStr == null ? "" : idStr) + |
(structureId == null ? "*" : structureId) + "/" + |
""; |
|
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url); |
63,21 → 65,21 |
info.setDonnee(0, structure); |
info.setDonnee(1, structureConservation); |
info.setDonnee(2, structureValorisation); |
r.rafraichir(info); |
vue.rafraichir(info); |
} else if (responseValue.isArray() != null) { |
final JSONArray reponse = responseValue.isArray(); |
// Transformation du tableau JSON réponse en ListeInstitution |
StructureListe structures = new StructureListe(reponse); |
// et on met à jour le demandeur des données |
r.rafraichir(structures); |
vue.rafraichir(structures); |
} else { |
GWT.log(url+"\n\tLa réponse n'est pas un objet ou un talbeau JSON et vaut : "+responseValue.toString(), null); |
} |
} else { |
if (idStr == null) { |
if (structureId == null) { |
// Dans le cas, où nous demandons toutes les institutions et qu'il n'y en a pas, nous retournons un objet vide |
StructureListe structures = new StructureListe(0); |
r.rafraichir(structures); |
vue.rafraichir(structures); |
} else { |
GWT.log(url, null); |
if (response.getText().length() == 0) { |
98,31 → 100,32 |
|
public void ajouter(final Rafraichissable r, String utilisateurId, final Structure str) { |
final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + |
"CoelStructureListe/"; |
SERVICE_NOM + "/" + |
""; |
|
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url); |
|
String postDonnees = "cmhl_ce_modifier_par=" + utilisateurId + |
"&cs_ce_projet =" + URL.encodeComponent(str.getIdProjet()) + |
"&cs_ce_mere =" + URL.encodeComponent(str.getIdMere()) + |
"&cs_guid =" + URL.encodeComponent(str.getGuid()) + |
"&cs_truk_identifiant_alternatif =" + URL.encodeComponent(str.getIdAlternatif()) + |
"&cs_ce_projet=" + URL.encodeComponent(str.getIdProjet()) + |
"&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) + |
"&cs_guid=" + URL.encodeComponent(str.getGuid()) + |
"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) + |
"&cs_nom=" + URL.encodeComponent(str.getNom()) + |
"&cs_truk_nom_alternatif =" + URL.encodeComponent(str.getNomAlternatif()) + |
"&cs_ce_type =" + URL.encodeComponent(str.getType()) + |
"&cs_ce_truk_type_prive =" + URL.encodeComponent(str.getTypePrive()) + |
"&cs_ce_truk_type_public =" + URL.encodeComponent(str.getTypePublic()) + |
"&cs_adresse_01 =" + URL.encodeComponent(str.getAdresse()) + |
"&cs_adresse_02 =" + URL.encodeComponent(str.getAdresseComplement()) + |
"&cs_date_fondation =" + URL.encodeComponent(str.getDateFondationFormatMysql()) + |
"&cs_code_postal =" + URL.encodeComponent(str.getCodePostal()) + |
"&cs_ville =" + URL.encodeComponent(str.getVille()) + |
"&cs_region =" + URL.encodeComponent(str.getRegion()) + |
"&cs_pays =" + URL.encodeComponent(str.getPays()) + |
"&cs_telephone =" + URL.encodeComponent(str.getTelephone()) + |
"&cs_fax =" + URL.encodeComponent(str.getFax()) + |
"&cs_truk_url =" + URL.encodeComponent(str.getUrl()) + |
"&cs_nbre_personne =" + URL.encodeComponent(Integer.toString(str.getNbrePersonne())) + |
"&cs_truk_nom_alternatif=" + URL.encodeComponent(str.getNomAlternatif()) + |
"&cs_ce_type=" + URL.encodeComponent(str.getType()) + |
"&cs_ce_truk_type_prive=" + URL.encodeComponent(str.getTypePrive()) + |
"&cs_ce_truk_type_public=" + URL.encodeComponent(str.getTypePublic()) + |
"&cs_adresse_01=" + URL.encodeComponent(str.getAdresse()) + |
"&cs_adresse_02=" + URL.encodeComponent(str.getAdresseComplement()) + |
"&cs_date_fondation=" + URL.encodeComponent(str.getDateFondationFormatMysql()) + |
"&cs_code_postal=" + URL.encodeComponent(str.getCodePostal()) + |
"&cs_ville=" + URL.encodeComponent(str.getVille()) + |
"&cs_region=" + URL.encodeComponent(str.getRegion()) + |
"&cs_pays=" + URL.encodeComponent(str.getPays()) + |
"&cs_telephone=" + URL.encodeComponent(str.getTelephone()) + |
"&cs_fax=" + URL.encodeComponent(str.getFax()) + |
"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) + |
"&cs_nbre_personne=" + URL.encodeComponent(Integer.toString(str.getNbrePersonne())) + |
""; |
|
try { |
176,12 → 179,12 |
} |
} |
|
public void supprimer(final Rafraichissable r, String idUtilisateur, String idStr) { |
public void supprimer(final Rafraichissable r, String utilisateurId, String structureId) { |
// Ajout des paramètres et données à supprimer dans l'URL |
final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + |
"CoelStructureListe/" + |
idUtilisateur + "/" + |
idStr + |
SERVICE_NOM + "/" + |
utilisateurId + "/" + |
structureId + |
""; |
|
// DELETE n'étant pas disponible comme méthode HTTP, nous utilisons POST avec le paramètre action=DELETE |
241,7 → 244,7 |
|
public void modifier(final Rafraichissable r, String utilisateurId, Structure str, StructureConservation conservation, StructureValorisation valorisation) { |
final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + |
"CoelStructureListe/" + |
SERVICE_NOM + "/" + |
str.getId() |
; |
|
248,60 → 251,60 |
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url); |
|
String postDonnees = "cmhl_ce_modifier_par=" + utilisateurId + |
"&cs_ce_projet =" + URL.encodeComponent(str.getIdProjet()) + |
"&cs_ce_mere =" + URL.encodeComponent(str.getIdMere()) + |
"&cs_guid =" + URL.encodeComponent(str.getGuid()) + |
"&cs_truk_identifiant_alternatif =" + URL.encodeComponent(str.getIdAlternatif()) + |
"&cs_ce_projet=" + URL.encodeComponent(str.getIdProjet()) + |
"&cs_ce_mere=" + URL.encodeComponent(str.getIdMere()) + |
"&cs_guid=" + URL.encodeComponent(str.getGuid()) + |
"&cs_truk_identifiant_alternatif=" + URL.encodeComponent(str.getIdAlternatif()) + |
"&cs_nom=" + URL.encodeComponent(str.getNom()) + |
"&cs_truk_nom_alternatif =" + URL.encodeComponent(str.getNomAlternatif()) + |
"&cs_ce_type =" + URL.encodeComponent(str.getType()) + |
"&cs_ce_truk_type_prive =" + URL.encodeComponent(str.getTypePrive()) + |
"&cs_ce_truk_type_public =" + URL.encodeComponent(str.getTypePublic()) + |
"&cs_adresse_01 =" + URL.encodeComponent(str.getAdresse()) + |
"&cs_adresse_02 =" + URL.encodeComponent(str.getAdresseComplement()) + |
"&cs_date_fondation =" + URL.encodeComponent(str.getDateFondationFormatMysql()) + |
"&cs_code_postal =" + URL.encodeComponent(str.getCodePostal()) + |
"&cs_ville =" + URL.encodeComponent(str.getVille()) + |
"&cs_region =" + URL.encodeComponent(str.getRegion()) + |
"&cs_pays =" + URL.encodeComponent(str.getPays()) + |
"&cs_telephone =" + URL.encodeComponent(str.getTelephone()) + |
"&cs_fax =" + URL.encodeComponent(str.getFax()) + |
"&cs_courriel =" + URL.encodeComponent(str.getCourriel()) + |
"&cs_truk_url =" + URL.encodeComponent(str.getUrl()) + |
"&cs_nbre_personne =" + URL.encodeComponent(Integer.toString(str.getNbrePersonne())) + |
"&csc_mark_formation =" + URL.encodeComponent(conservation.getFormation()) + |
"&csc_formation =" + URL.encodeComponent(conservation.getFormationInfo()) + |
"&csc_mark_formation_interet =" + URL.encodeComponent(conservation.getFormationInteret()) + |
"&csc_truk_stockage_local =" + URL.encodeComponent(conservation.getStockageLocal()) + |
"&csc_truk_stockage_meuble =" + URL.encodeComponent(conservation.getStockageMeuble()) + |
"&csc_truk_stockage_parametre =" + URL.encodeComponent(conservation.getStockageParametre()) + |
"&csc_mark_collection_commune =" + URL.encodeComponent(conservation.getCollectionCommune()) + |
"&csc_truk_collection_autre =" + URL.encodeComponent(conservation.getCollectionAutre()) + |
"&csc_mark_acces_controle =" + URL.encodeComponent(conservation.getAccesControle()) + |
"&csc_mark_restauration =" + URL.encodeComponent(conservation.getRestauration()) + |
"&csc_truk_restauration_operation =" + URL.encodeComponent(conservation.getRestaurationOperation()) + |
"&csc_ce_materiel_conservation =" + URL.encodeComponent(conservation.getMaterielConservation()) + |
"&csc_truk_materiel_autre =" + URL.encodeComponent(conservation.getMaterielAutre()) + |
"&csc_mark_traitement =" + URL.encodeComponent(conservation.getTraitement()) + |
"&csc_truk_traitement =" + URL.encodeComponent(conservation.getTraitements()) + |
"&csc_mark_acquisition_collection =" + URL.encodeComponent(conservation.getAcquisitionCollection()) + |
"&csc_mark_acquisition_echantillon =" + URL.encodeComponent(conservation.getAcquisitionEchantillon()) + |
"&csc_mark_acquisition_traitement =" + URL.encodeComponent(conservation.getAcquisitionTraitement()) + |
"&csc_truk_acquisition_traitement_poison =" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) + |
"&csc_truk_acquisition_traitement_insecte =" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte()) + |
"&csv_mark_action =" + URL.encodeComponent(valorisation.getAction()) + |
"&csv_truk_action =" + URL.encodeComponent(valorisation.getActionInfo()) + |
"&csv_publication =" + URL.encodeComponent(valorisation.getPublication()) + |
"&csv_collection_autre =" + URL.encodeComponent(valorisation.getCollectionAutre()) + |
"&csv_mark_action_future =" + URL.encodeComponent(valorisation.getActionFuture()) + |
"&csv_action_future =" + URL.encodeComponent(valorisation.getActionFutureInfo()) + |
"&csv_mark_recherche =" + URL.encodeComponent(valorisation.getRecherche()) + |
"&csv_truk_recherche_provenance =" + URL.encodeComponent(valorisation.getRechercheProvenance()) + |
"&csv_truk_recherche_type =" + URL.encodeComponent(valorisation.getRechercheType()) + |
"&csv_mark_acces_ss_motif =" + URL.encodeComponent(valorisation.getAccesSansMotif()) + |
"&csv_acces_ss_motif =" + URL.encodeComponent(valorisation.getAccesSansMotifInfo()) + |
"&csv_mark_visite_avec_motif =" + URL.encodeComponent(valorisation.getVisiteAvecMotif()) + |
"&csv_visite_avec_motif =" + URL.encodeComponent(valorisation.getVisiteAvecMotifInfo()) + |
"&cs_truk_nom_alternatif=" + URL.encodeComponent(str.getNomAlternatif()) + |
"&cs_ce_type=" + URL.encodeComponent(str.getType()) + |
"&cs_ce_truk_type_prive=" + URL.encodeComponent(str.getTypePrive()) + |
"&cs_ce_truk_type_public=" + URL.encodeComponent(str.getTypePublic()) + |
"&cs_adresse_01=" + URL.encodeComponent(str.getAdresse()) + |
"&cs_adresse_02=" + URL.encodeComponent(str.getAdresseComplement()) + |
"&cs_date_fondation=" + URL.encodeComponent(str.getDateFondationFormatMysql()) + |
"&cs_code_postal=" + URL.encodeComponent(str.getCodePostal()) + |
"&cs_ville=" + URL.encodeComponent(str.getVille()) + |
"&cs_region=" + URL.encodeComponent(str.getRegion()) + |
"&cs_pays=" + URL.encodeComponent(str.getPays()) + |
"&cs_telephone=" + URL.encodeComponent(str.getTelephone()) + |
"&cs_fax=" + URL.encodeComponent(str.getFax()) + |
"&cs_courriel=" + URL.encodeComponent(str.getCourriel()) + |
"&cs_truk_url=" + URL.encodeComponent(str.getUrl()) + |
"&cs_nbre_personne=" + URL.encodeComponent(Integer.toString(str.getNbrePersonne())) + |
"&csc_mark_formation=" + URL.encodeComponent(conservation.getFormation()) + |
"&csc_formation=" + URL.encodeComponent(conservation.getFormationInfo()) + |
"&csc_mark_formation_interet=" + URL.encodeComponent(conservation.getFormationInteret()) + |
"&csc_truk_stockage_local=" + URL.encodeComponent(conservation.getStockageLocal()) + |
"&csc_truk_stockage_meuble=" + URL.encodeComponent(conservation.getStockageMeuble()) + |
"&csc_truk_stockage_parametre=" + URL.encodeComponent(conservation.getStockageParametre()) + |
"&csc_mark_collection_commune=" + URL.encodeComponent(conservation.getCollectionCommune()) + |
"&csc_truk_collection_autre=" + URL.encodeComponent(conservation.getCollectionAutre()) + |
"&csc_mark_acces_controle=" + URL.encodeComponent(conservation.getAccesControle()) + |
"&csc_mark_restauration=" + URL.encodeComponent(conservation.getRestauration()) + |
"&csc_truk_restauration_operation=" + URL.encodeComponent(conservation.getRestaurationOperation()) + |
"&csc_ce_materiel_conservation=" + URL.encodeComponent(conservation.getMaterielConservation()) + |
"&csc_truk_materiel_autre=" + URL.encodeComponent(conservation.getMaterielAutre()) + |
"&csc_mark_traitement=" + URL.encodeComponent(conservation.getTraitement()) + |
"&csc_truk_traitement=" + URL.encodeComponent(conservation.getTraitements()) + |
"&csc_mark_acquisition_collection=" + URL.encodeComponent(conservation.getAcquisitionCollection()) + |
"&csc_mark_acquisition_echantillon=" + URL.encodeComponent(conservation.getAcquisitionEchantillon()) + |
"&csc_mark_acquisition_traitement=" + URL.encodeComponent(conservation.getAcquisitionTraitement()) + |
"&csc_truk_acquisition_traitement_poison=" + URL.encodeComponent(conservation.getAcquisitionTraitementPoison()) + |
"&csc_truk_acquisition_traitement_insecte=" + URL.encodeComponent(conservation.getAcquisitionTraitementInsecte()) + |
"&csv_mark_action=" + URL.encodeComponent(valorisation.getAction()) + |
"&csv_truk_action=" + URL.encodeComponent(valorisation.getActionInfo()) + |
"&csv_publication=" + URL.encodeComponent(valorisation.getPublication()) + |
"&csv_collection_autre=" + URL.encodeComponent(valorisation.getCollectionAutre()) + |
"&csv_mark_action_future=" + URL.encodeComponent(valorisation.getActionFuture()) + |
"&csv_action_future=" + URL.encodeComponent(valorisation.getActionFutureInfo()) + |
"&csv_mark_recherche=" + URL.encodeComponent(valorisation.getRecherche()) + |
"&csv_truk_recherche_provenance=" + URL.encodeComponent(valorisation.getRechercheProvenance()) + |
"&csv_truk_recherche_type=" + URL.encodeComponent(valorisation.getRechercheType()) + |
"&csv_mark_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotif()) + |
"&csv_acces_ss_motif=" + URL.encodeComponent(valorisation.getAccesSansMotifInfo()) + |
"&csv_mark_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotif()) + |
"&csv_visite_avec_motif=" + URL.encodeComponent(valorisation.getVisiteAvecMotifInfo()) + |
""; |
|
try { |