/trunk/src/org/tela_botanica/client/Mediateur.java |
---|
400,7 → 400,7 |
public void clicAjouterStructure() { |
panneauCentre.removeAll(); |
FormStructureVue formStructureVue = new FormStructureVue(); |
FormStructureVue formStructureVue = new FormStructureVue(FormStructureVue.MODE_AJOUTER); |
panneauCentre.add(formStructureVue); |
panneauCentre.setId(ComposantId.PANNEAU_STRUCTURE_FORM); |
panneauCentre.layout(); |
413,7 → 413,7 |
Info.display("Information", "Veuillez sélectionner une seule structure à la fois."); |
} else if(structureSelection.size() == 1) { |
panneauCentre.removeAll(); |
FormStructureVue formStructureVue = new FormStructureVue(); |
FormStructureVue formStructureVue = new FormStructureVue(FormStructureVue.MODE_MODIFIER); |
panneauCentre.add(formStructureVue); |
panneauCentre.setId(ComposantId.PANNEAU_STRUCTURE_FORM); |
461,8 → 461,8 |
modele.ajouterStructure(vue, getUtilisateurId(), structure, conservation, valorisation); |
} |
public void modifierStructure(Rafraichissable vue, Structure structure, StructureConservation conservation, StructureValorisation valorisation) { |
modele.modifierStructure(vue, getUtilisateurId(), structure, conservation, valorisation); |
public void modifierStructure(Rafraichissable vue, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) { |
modele.modifierStructure(vue, getUtilisateurId(), structureId, structure, conservation, valorisation); |
} |
//+----------------------------------------------------------------------------------------------------------------+ |
/trunk/src/org/tela_botanica/client/vues/FormStructureVue.java |
---|
91,14 → 91,14 |
public class FormStructureVue extends LayoutContainer implements Rafraichissable { |
private static final String MODE_AJOUTER = "AJOUT"; |
private static final String MODE_MODIFIER = "MODIF"; |
public static final String MODE_AJOUTER = "AJOUT"; |
public static final String MODE_MODIFIER = "MODIF"; |
private Constantes i18nC = null; |
private Mediateur mediateur = null; |
private Modele modele = null ; |
private String mode = "AJOUT"; |
private String mode = null; |
private int tabIndex = 100; |
private FormPanel structureFormPanneau = null; |
private TabPanel onglets = null; |
221,9 → 221,10 |
private List<Valeur> fonctionsListe; |
public FormStructureVue() { |
public FormStructureVue(String modeDeCreation) { |
//+-----------------------------------------------------------------------------------------------------------+ |
// Initialisation de variables |
mode = modeDeCreation; |
i18nC = GWT.create(Constantes.class); |
setLayout(new FitLayout()); |
modele = Registry.get(RegistreId.MODELE); |
265,7 → 266,7 |
// Gestion du FORMULAIRE GÉNÉRAL |
// Sélection de l'onglet par défaut |
onglets.setSelection(personnelOnglet); |
//onglets.setSelection(personnelOnglet); |
// Ajout des onglets au formulaire général |
structureFormPanneau.add(onglets); |
293,7 → 294,7 |
structureFormPanneau.addButton(validerBtn); |
// Ajout du panneau Formulaire à la disposition générale |
add(structureFormPanneau); |
add(structureFormPanneau); |
} |
private void soumettreFormulaire() { |
313,18 → 314,28 |
// Voir la méthode rafraichir(). |
} else if (mode.equals("MODIF")) { |
// Modification des informations sur la Structure |
mediateur.modifierStructure(this, structure, conservation, valorisation); |
// Modification des relations StructureAPersonne |
GWT.log("Personnel modifié :"+personnelModifie.size(), null); |
mediateur.modifierStructureAPersonne(this, personnelModifie); |
// Ajout des relations StructureAPersonne |
GWT.log("Personnel ajouté :"+personnelAjoute.size(), null); |
mediateur.ajouterStructureAPersonne(this, identification.getId(), personnelAjoute); |
// Suppression des relations StructureAPersonne |
GWT.log("Personnel supprimé :"+personnelSupprime.size(), null); |
mediateur.supprimerStructureAPersonne(this, personnelSupprime); |
// Nous rechargeons la liste du Personnel |
rafraichirPersonnel(); |
if (structure == null && conservation == null && valorisation == null) { |
Info.display("Modification d'une institution", "Rien n'a été enregistré car le formulaire n'a pas été modifié."); |
} else { |
mediateur.modifierStructure(this, identification.getId(), structure, conservation, valorisation); |
} |
if (personnelModifie.size() == 0 && personnelAjoute.size() == 0 && personnelSupprime.size() == 0) { |
Info.display("Modification du personnel", "Rien n'a été enregistré car le formulaire n'a pas été modifié."); |
} else { |
if (personnelModifie.size() != 0) { |
mediateur.modifierStructureAPersonne(this, personnelModifie); |
} |
// Ajout des relations StructureAPersonne |
if (personnelAjoute.size() != 0) { |
mediateur.ajouterStructureAPersonne(this, identification.getId(), personnelAjoute); |
} |
// Suppression des relations StructureAPersonne |
if (personnelSupprime.size() != 0) { |
mediateur.supprimerStructureAPersonne(this, personnelSupprime); |
} |
// Nous rechargeons la liste du Personnel |
rafraichirPersonnel(); |
} |
} |
} |
} |
372,64 → 383,67 |
} |
private StructureValorisation collecterStructureValorisation() { |
if (valorisationOnglet.getData("acces").equals(false)) { |
return valorisation; |
} else { |
StructureValorisation valorisationARetourner = null; |
if (valorisationOnglet.getData("acces").equals(true)) { |
// Création de l'objet |
StructureValorisation valorisationModifie = new StructureValorisation(); |
StructureValorisation valorisationCollectee = (StructureValorisation) valorisation.cloner(new StructureValorisation()); |
// ACTION |
if (actionMarkRGrpChp.getValue() != null) { |
valorisationModifie.setAction(actionMarkRGrpChp.getValue().getValueAttribute()); |
valorisationCollectee.setAction(actionMarkRGrpChp.getValue().getValueAttribute()); |
} |
// ACTION INFO |
valorisationModifie.setActionInfo(creerChaineDenormalisee(actionTrukCacGrpChp.getValues())); |
valorisationModifie.setActionInfo("AUTRE", actionAutreChp.getValue()); |
valorisationCollectee.setActionInfo(creerChaineDenormalisee(actionTrukCacGrpChp.getValues())); |
valorisationCollectee.setActionInfo("AUTRE", actionAutreChp.getValue()); |
// PUBLICATION |
valorisationModifie.setPublication(publicationChp.getValue()); |
valorisationCollectee.setPublication(publicationChp.getValue()); |
// COLLECTION AUTRE |
valorisationModifie.setCollectionAutre(creerChaineDenormalisee(autreCollectionTrukCacGrpChp.getValues())); |
valorisationModifie.setCollectionAutre("AUTRE", autreCollectionAutreChp.getValue()); |
valorisationCollectee.setCollectionAutre(creerChaineDenormalisee(autreCollectionTrukCacGrpChp.getValues())); |
valorisationCollectee.setCollectionAutre("AUTRE", autreCollectionAutreChp.getValue()); |
// ACTION FUTURE |
if (futureActionMarkRGrpChp.getValue() != null) { |
valorisationModifie.setActionFuture(futureActionMarkRGrpChp.getValue().getValueAttribute()); |
valorisationCollectee.setActionFuture(futureActionMarkRGrpChp.getValue().getValueAttribute()); |
} |
// ACTION FUTURE INFO |
valorisationModifie.setActionFutureInfo(futureActionChp.getValue()); |
valorisationCollectee.setActionFutureInfo(futureActionChp.getValue()); |
// RECHERCHE |
if (rechercheMarkRGrpChp.getValue() != null) { |
valorisationModifie.setRecherche(rechercheMarkRGrpChp.getValue().getValueAttribute()); |
valorisationCollectee.setRecherche(rechercheMarkRGrpChp.getValue().getValueAttribute()); |
} |
// RECHERCHE PROVENANCE |
valorisationModifie.setRechercheProvenance(creerChaineDenormalisee(provenanceRechercheTrukCacGrpChp.getValues())); |
valorisationModifie.setRechercheProvenance("AUTRE", provenanceRechercheAutreChp.getValue()); |
valorisationCollectee.setRechercheProvenance(creerChaineDenormalisee(provenanceRechercheTrukCacGrpChp.getValues())); |
valorisationCollectee.setRechercheProvenance("AUTRE", provenanceRechercheAutreChp.getValue()); |
// RECHERCHE TYPE |
valorisationModifie.setRechercheType(creerChaineDenormalisee(typeRechercheTrukCacGrpChp.getValues())); |
valorisationModifie.setRechercheType("AUTRE", typeRechercheAutreChp.getValue()); |
valorisationCollectee.setRechercheType(creerChaineDenormalisee(typeRechercheTrukCacGrpChp.getValues())); |
valorisationCollectee.setRechercheType("AUTRE", typeRechercheAutreChp.getValue()); |
// ACCÈS SANS MOTIF |
if (sansMotifAccesMarkRGrpChp.getValue() != null) { |
valorisationModifie.setAccesSansMotif(sansMotifAccesMarkRGrpChp.getValue().getValueAttribute()); |
valorisationCollectee.setAccesSansMotif(sansMotifAccesMarkRGrpChp.getValue().getValueAttribute()); |
} |
// ACCÈS SANS MOTIF INFO |
valorisationModifie.setAccesSansMotifInfo(sansMotifAccesChp.getValue()); |
valorisationCollectee.setAccesSansMotifInfo(sansMotifAccesChp.getValue()); |
// VISITE AVEC MOTIF |
if (avecMotifAccesMarkRGrpChp.getValue() != null) { |
valorisationModifie.setVisiteAvecMotif(avecMotifAccesMarkRGrpChp.getValue().getValueAttribute()); |
valorisationCollectee.setVisiteAvecMotif(avecMotifAccesMarkRGrpChp.getValue().getValueAttribute()); |
} |
// VISITE AVEC MOTIF INFO |
valorisationModifie.setVisiteAvecMotifInfo(avecMotifAccesChp.getValue()); |
valorisationCollectee.setVisiteAvecMotifInfo(avecMotifAccesChp.getValue()); |
return valorisationModifie; |
// Retour de l'objet |
if (!valorisationCollectee.comparer(valorisation)) { |
valorisationARetourner = valorisation = valorisationCollectee; |
} |
} |
return valorisationARetourner; |
} |
private void peuplerStructureValorisation() { |
475,98 → 489,99 |
} |
private StructureConservation collecterStructureConservation() { |
if (conservationOnglet.getData("acces").equals(false)) { |
return conservation; |
} else { |
StructureConservation conservationARetourner = null; |
if (conservationOnglet.getData("acces").equals(true)) { |
// Création de l'objet |
StructureConservation conservationModifie = new StructureConservation(); |
StructureConservation conservationCollectee = (StructureConservation) conservation.cloner(new StructureConservation()); |
// FORMATION |
if (formationMarkRGrpChp.getValue() != null) { |
conservationModifie.setFormation(formationMarkRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setFormation(formationMarkRGrpChp.getValue().getValueAttribute()); |
} |
// FORMATION INFO |
conservationModifie.setFormationInfo(formationChp.getValue()); |
conservationCollectee.setFormationInfo(formationChp.getValue()); |
// FORMATION INTERET |
if (interetFormationMarkRGrpChp.getValue() != null) { |
conservationModifie.setFormationInteret(interetFormationMarkRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setFormationInteret(interetFormationMarkRGrpChp.getValue().getValueAttribute()); |
} |
// STOCKAGE LOCAL |
conservationModifie.setStockageLocal(creerChaineDenormalisee(localStockageTrukCacGrpChp.getValues())); |
conservationModifie.setStockageLocal("AUTRE", localStockageAutreChp.getValue()); |
conservationCollectee.setStockageLocal(creerChaineDenormalisee(localStockageTrukCacGrpChp.getValues())); |
conservationCollectee.setStockageLocal("AUTRE", localStockageAutreChp.getValue()); |
// STOCKAGE MEUBLE |
conservationModifie.setStockageMeuble(creerChaineDenormalisee(meubleStockageTrukCacGrpChp.getValues())); |
conservationModifie.setStockageMeuble("AUTRE", meubleStockageAutreChp.getValue()); |
conservationCollectee.setStockageMeuble(creerChaineDenormalisee(meubleStockageTrukCacGrpChp.getValues())); |
conservationCollectee.setStockageMeuble("AUTRE", meubleStockageAutreChp.getValue()); |
// STOCKAGE PAREMETRE |
conservationModifie.setStockageParametre(creerChaineDenormalisee(parametreStockageTrukCacGrpChp.getValues())); |
conservationModifie.setStockageParametre("AUTRE", parametreStockageAutreChp.getValue()); |
conservationCollectee.setStockageParametre(creerChaineDenormalisee(parametreStockageTrukCacGrpChp.getValues())); |
conservationCollectee.setStockageParametre("AUTRE", parametreStockageAutreChp.getValue()); |
// COLLECTION COMMUNE |
if (collectionCommuneMarkRGrpChp.getValue() != null) { |
conservationModifie.setCollectionCommune(collectionCommuneMarkRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setCollectionCommune(collectionCommuneMarkRGrpChp.getValue().getValueAttribute()); |
} |
// COLLECTION AUTRE |
conservationModifie.setCollectionAutre(creerChaineDenormalisee(collectionAutreTrukCacGrpChp.getValues())); |
conservationModifie.setCollectionAutre("AUTRE", collectionAutreAutreChp.getValue()); |
conservationCollectee.setCollectionAutre(creerChaineDenormalisee(collectionAutreTrukCacGrpChp.getValues())); |
conservationCollectee.setCollectionAutre("AUTRE", collectionAutreAutreChp.getValue()); |
// ACCÈS CONTROLÉ |
if (accesControleMarkRGrpChp.getValue() != null) { |
conservationModifie.setAccesControle(accesControleMarkRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setAccesControle(accesControleMarkRGrpChp.getValue().getValueAttribute()); |
} |
// RESTAURATION |
if (restaurationMarkRGrpChp.getValue() != null) { |
conservationModifie.setRestauration(restaurationMarkRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setRestauration(restaurationMarkRGrpChp.getValue().getValueAttribute()); |
} |
// RESTAURATION OPÉRATION |
conservationModifie.setRestaurationOperation(creerChaineDenormalisee(opRestauTrukCacGrpChp.getValues())); |
conservationModifie.setRestaurationOperation("AUTRE", opRestauAutreChp.getValue()); |
conservationCollectee.setRestaurationOperation(creerChaineDenormalisee(opRestauTrukCacGrpChp.getValues())); |
conservationCollectee.setRestaurationOperation("AUTRE", opRestauAutreChp.getValue()); |
// MATERIEL CONSERVATION |
if (materielConservationCeRGrpChp.getValue() != null) { |
conservationModifie.setMaterielConservation(materielConservationCeRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setMaterielConservation(materielConservationCeRGrpChp.getValue().getValueAttribute()); |
} |
// MATERIEL AUTRE |
conservationModifie.setMaterielAutre(creerChaineDenormalisee(autreMaterielTrukCacGrpChp.getValues())); |
conservationModifie.setMaterielAutre("AUTRE", autreMaterielAutreChp.getValue()); |
conservationCollectee.setMaterielAutre(creerChaineDenormalisee(autreMaterielTrukCacGrpChp.getValues())); |
conservationCollectee.setMaterielAutre("AUTRE", autreMaterielAutreChp.getValue()); |
// TRAITEMENT |
if (traitementMarkRGrpChp.getValue() != null) { |
conservationModifie.setTraitement(traitementMarkRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setTraitement(traitementMarkRGrpChp.getValue().getValueAttribute()); |
} |
// TRAIEMENTS |
conservationModifie.setTraitements(creerChaineDenormalisee(traitementTrukCacGrpChp.getValues())); |
conservationModifie.setTraitements("AUTRE", traitementAutreChp.getValue()); |
conservationCollectee.setTraitements(creerChaineDenormalisee(traitementTrukCacGrpChp.getValues())); |
conservationCollectee.setTraitements("AUTRE", traitementAutreChp.getValue()); |
// ACQUISITION COLLECTION |
if (collectionAcquisitionMarkRGrpChp.getValue() != null) { |
conservationModifie.setAcquisitionCollection(collectionAcquisitionMarkRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setAcquisitionCollection(collectionAcquisitionMarkRGrpChp.getValue().getValueAttribute()); |
} |
// ACQUISITION ECHANTILLON |
if (echantillonAcquisitionMarkRGrpChp.getValue() != null) { |
conservationModifie.setAcquisitionEchantillon(echantillonAcquisitionMarkRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setAcquisitionEchantillon(echantillonAcquisitionMarkRGrpChp.getValue().getValueAttribute()); |
} |
// ACQUISITION TRAITEMENT |
if (traitementAcquisitionMarkRGrpChp.getValue() != null) { |
conservationModifie.setAcquisitionTraitement(traitementAcquisitionMarkRGrpChp.getValue().getValueAttribute()); |
conservationCollectee.setAcquisitionTraitement(traitementAcquisitionMarkRGrpChp.getValue().getValueAttribute()); |
} |
// ACQUISITION TRAITEMENT POISON |
conservationModifie.setAcquisitionTraitementPoison(creerChaineDenormalisee(poisonTraitementTrukCacGrpChp.getValues())); |
conservationModifie.setAcquisitionTraitementPoison("AUTRE", poisonTraitementAutreChp.getValue()); |
conservationCollectee.setAcquisitionTraitementPoison(creerChaineDenormalisee(poisonTraitementTrukCacGrpChp.getValues())); |
conservationCollectee.setAcquisitionTraitementPoison("AUTRE", poisonTraitementAutreChp.getValue()); |
// ACQUISITION TRAITEMENT INSECTE |
conservationModifie.setAcquisitionTraitementInsecte(creerChaineDenormalisee(insecteTraitementTrukCacGrpChp.getValues())); |
conservationModifie.setAcquisitionTraitementInsecte("AUTRE", insecteTraitementAutreChp.getValue()); |
conservationCollectee.setAcquisitionTraitementInsecte(creerChaineDenormalisee(insecteTraitementTrukCacGrpChp.getValues())); |
conservationCollectee.setAcquisitionTraitementInsecte("AUTRE", insecteTraitementAutreChp.getValue()); |
// Retour de l'objet |
//GWT.log(conservationLocal.toString(), null); |
return conservationModifie; |
if (!conservationCollectee.comparer(conservation)) { |
conservationARetourner = conservation = conservationCollectee; |
} |
} |
return conservationARetourner; |
} |
private void peuplerStructureConservation() { |
632,61 → 647,66 |
} |
private Structure collecterStructureIdentification() { |
if (identificationOnglet.getData("acces").equals(false)) { |
return identification; |
} else { |
Structure structure = new Structure(); |
structure.setId(idStructureChp.getValue()); |
structure.setNom(nomStructureChp.getValue()); |
Structure structureARetourner = null; |
if (identificationOnglet.getData("acces").equals(true)) { |
Structure structureCollectee = (Structure) identification.cloner(new Structure()); |
structureCollectee.setId(idStructureChp.getValue()); |
structureCollectee.setNom(nomStructureChp.getValue()); |
// Récupération de l'identifiant du projet |
if (projetsCombo.getValue() != null) { |
structure.setIdProjet(projetsCombo.getValue().getId()); |
structureCollectee.setIdProjet(projetsCombo.getValue().getId()); |
} |
// Récupération de l'acronyme (= identifiant alternatif) |
structure.setIdAlternatif(null); |
structureCollectee.setIdAlternatif(null); |
if (comboAcronyme.getValue() != null) { |
String typeAcronyme = comboAcronyme.getValue().getAbr(); |
if (typeAcronyme == "IH") { |
structure.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue()); |
structureCollectee.setIdAlternatif(typeAcronyme+"##"+ihChp.getValue()); |
} else if (typeAcronyme == "MNHN") { |
structure.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue()); |
structureCollectee.setIdAlternatif(typeAcronyme+"##"+mnhnChp.getValue()); |
} |
} |
// Récupération statut de la structure |
structure.setTypePublic(null); |
structure.setTypePrive(null); |
structureCollectee.setTypePublic(null); |
structureCollectee.setTypePrive(null); |
if (comboTypeStructure.getValue() != null) { |
String typeStructure = comboTypeStructure.getValue().getAbr(); |
if (typeStructure == "stpu" && comboLstpu.getValue() != null) { |
structure.setTypePublic(comboLstpu.getValue().getId()); |
structureCollectee.setTypePublic(comboLstpu.getValue().getId()); |
} else if (typeStructure == "stpr" && comboLstpr.getValue() != null) { |
structure.setTypePrive(comboLstpr.getValue().getId()); |
structureCollectee.setTypePrive(comboLstpr.getValue().getId()); |
} |
} |
structure.setDateFondation(dateFondationChp.getValue()); |
structureCollectee.setDateFondation(dateFondationChp.getValue()); |
structure.setAdresse(adrChp.getValue()); |
structure.setCodePostal(cpChp.getValue()); |
structure.setVille(villeChp.getValue()); |
structure.setRegion(regionChp.getValue()); |
structure.setPays(null); |
structureCollectee.setAdresse(adrChp.getValue()); |
structureCollectee.setCodePostal(cpChp.getValue()); |
structureCollectee.setVille(villeChp.getValue()); |
structureCollectee.setRegion(regionChp.getValue()); |
structureCollectee.setPays(null); |
if (comboPays.getValue() != null) { |
structure.setPays(comboPays.getValue().getAbreviation()); |
structureCollectee.setPays(comboPays.getValue().getAbreviation()); |
} else if (comboPays.getRawValue() != "") { |
structure.setPays(comboPays.getRawValue()); |
structureCollectee.setPays(comboPays.getRawValue()); |
} |
structure.setTelephone(telChp.getValue()); |
structure.setFax(faxChp.getValue()); |
structure.setCourriel(emailChp.getValue()); |
structure.setUrl(Structure.URL_SITE, urlChp.getValue()); |
structureCollectee.setTelephone(telChp.getValue()); |
structureCollectee.setFax(faxChp.getValue()); |
structureCollectee.setCourriel(emailChp.getValue()); |
structureCollectee.setUrl(Structure.URL_SITE, urlChp.getValue()); |
if (nbreTotalPersonneStructureChp.getValue() != null) { |
structure.setNbrePersonne(nbreTotalPersonneStructureChp.getValue().intValue()); |
structureCollectee.setNbrePersonne(nbreTotalPersonneStructureChp.getValue().intValue()); |
} |
return structure; |
if (!structureCollectee.comparer(identification)) { |
structureARetourner = identification = structureCollectee; |
} |
} |
return structureARetourner; |
} |
private void peuplerStructureIdentification() { |
693,6 → 713,8 |
if (mode.equals(MODE_AJOUTER)) { |
// Indique que l'ongleta pu être modifié pour la méthode collecter... |
identificationOnglet.setData("acces", true); |
// Initialisation de l'objet Structure |
identification = new Structure(); |
// Indication du projet sélectionné par défaut |
String projetCourantId = ((Mediateur) Registry.get(RegistreId.MEDIATEUR)).getProjetId(); |
if (projetCourantId != null && !projetCourantId.equals("0")) { |
790,6 → 812,13 |
futureActionChp = new TextArea(); |
futureActionChp.setFieldLabel("Si oui, lesquelles ?"); |
futureActionChp.hide(); |
futureActionChp.addListener(Events.Hide, new Listener<BaseEvent>() { |
public void handleEvent(BaseEvent be) { |
((TextArea) be.source).setValue(""); |
} |
}); |
valorisationOnglet.add(futureActionChp, new FormData(550, 0)); |
rechercheMarkRGrpChp = creerChoixUniqueRadioGroupe("recherche_mark", "ouiNon"); |
814,6 → 843,13 |
valorisationOnglet.add(sansMotifAccesChp = new TextArea(), new FormData(550, 0)); |
sansMotifAccesChp.hide(); |
sansMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() { |
public void handleEvent(BaseEvent be) { |
((TextArea) be.source).setValue(""); |
} |
}); |
sansMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les consulter ?"); |
avecMotifAccesMarkRGrpChp = creerChoixUniqueRadioGroupe("avec_motif_acces_mark", "ouiNon"); |
822,6 → 858,13 |
valorisationOnglet.add(avecMotifAccesChp = new TextArea(), new FormData(550, 0)); |
avecMotifAccesChp.hide(); |
avecMotifAccesChp.addListener(Events.Hide, new Listener<BaseEvent>() { |
public void handleEvent(BaseEvent be) { |
((TextArea) be.source).setValue(""); |
} |
}); |
avecMotifAccesChp.setFieldLabel("Si oui, quelles démarches doit-on faire pour les visiter ?"); |
return valorisationOnglet; |
846,6 → 889,13 |
formationChp = new TextField<String>(); |
formationChp.hide(); |
formationChp.addListener(Events.Hide, new Listener<BaseEvent>() { |
public void handleEvent(BaseEvent be) { |
((TextField<String>) be.source).setValue(""); |
} |
}); |
formationChp.setFieldLabel("Si oui, lesquelles ?"); |
conservationOnglet.add(formationChp); |
1078,6 → 1128,11 |
} |
private TabItem creerOngletPersonnel() { |
// Création des objets contenant les manipulations de la grille |
personnelModifie = new StructureAPersonneListe(); |
personnelAjoute = new StructureAPersonneListe(); |
personnelSupprime = new StructureAPersonneListe(); |
personnelOnglet = new TabItem(); |
personnelOnglet.setText("Personnel"); |
personnelOnglet.setScrollMode(Scroll.AUTO); |
1087,6 → 1142,9 |
public void handleEvent(ComponentEvent be) { |
// Indique que l'onglet a été rempli et a pu être modifié pour la méthode collecter... |
personnelOnglet.setData("acces", true); |
// Rafraichissement du contenu de la grille du personnel$ |
rafraichirPersonnel(); |
// Peuplement du formulaire |
peuplerStructurePersonnel(); |
1384,10 → 1442,9 |
} |
}); |
cp.add(grillePersonnel); |
personnelOnglet.add(cp); |
return personnelOnglet; |
} |
1727,14 → 1784,17 |
private String creerChaineDenormalisee(List<CheckBox> liste) { |
String identifiants = ""; |
int taille = liste.size(); |
for (int i = 0; i < taille; i++) { |
CheckBox cac = liste.get(i); |
if (cac.isEnabled()) { |
identifiants = identifiants.concat(";;"+cac.getData("id")); |
if (liste != null) { |
int taille = liste.size(); |
for (int i = 0; i < taille; i++) { |
CheckBox cac = liste.get(i); |
if (cac.isEnabled()) { |
identifiants = identifiants.concat(";;"+cac.getData("id")); |
} |
} |
identifiants.replaceFirst("^;;", ""); |
} |
return identifiants.replaceFirst("^;;", ""); |
return identifiants; |
} |
/** Méthode simplifiant la création de FormLayout. |
1856,9 → 1916,6 |
((Component) composants.get(i)).show(); |
} else { |
((Component) composants.get(i)).hide(); |
} |
} |
// Si on a à faire à un ContentPanel, on l'actualise pour déclencher l'affichage |
1894,21 → 1951,12 |
* @param boolAutreChp booléen indiquant si oui ou non le champ autre doit apparaître |
* @return |
*/ |
private void creerChoixMultipleCac(ContentPanel cp, CheckBoxGroup cacGroupe, ValeurListe listeValeurs, Field<String> autreChp) { |
private void creerChoixMultipleCac(ContentPanel cp, final CheckBoxGroup cacGroupe, ValeurListe listeValeurs, final Field<String> autreChp) { |
cp.addListener(Events.Hide, new Listener<BaseEvent>() { |
public void handleEvent(BaseEvent be) { |
ContentPanel cp = (ContentPanel) be.source; |
List<Component> composants = cp.getItems(); |
for (Iterator<Component> it = composants.iterator(); it.hasNext();) { |
Object composant = it.next(); |
if (composant instanceof CheckBoxGroup) { |
GWT.log("Classe : groupedecac", null); |
CheckBoxGroup caseACocherGroupe = (CheckBoxGroup) composant; |
caseACocherGroupe.reset(); |
} |
} |
cacGroupe.reset(); |
autreChp.setValue(""); |
} |
}); |
1947,12 → 1995,16 |
if (nouvelleDonnees instanceof Information) { |
Information info = (Information) nouvelleDonnees; |
if (info.getMessages() != null && !info.getMessages().toString().equals("[]")) { |
GWT.log(info.getMessages().toString(), null); |
GWT.log("MESSAGES:\n"+info.getMessages().toString(), null); |
} |
if (info.getDeboguages() != null && !info.getDeboguages().toString().equals("[]")) { |
GWT.log("DEBOGUAGE:\n"+info.getDeboguages().toString(), null); |
} |
if (info.getType().equals("modif_structure")) { |
Info.display("Modification d'une institution", info.toString()); |
} else if (info.getType().equals("ajout_structure")) { |
if (info.toString().matches("^[0-9]+$")) { |
if (info.getMessage(0) != null && info.getMessage(0).matches("^[0-9]+$")) { |
Info.display("Ajout d'une Institution", "L'intitution a bien été ajoutée"); |
// Suite à la récupération de l'id de l'institution nouvellement ajoutée nous ajoutons le personnel |
mediateur.ajouterStructureAPersonne(this, info.toString(), personnelAjoute); |
1967,7 → 2019,6 |
Info.display("Ajout du Personnel", info.toString()); |
} else if (info.getType().equals("selection_structure")) { |
Info.display("Modification d'une institution", info.toString()); |
mode = "MODIF"; |
GWT.log("Mode du formulaire : "+mode, null); |
String titre = i18nC.titreModifFormStructurePanneau(); |
if (info.getDonnee(0) != null) { |
1997,11 → 2048,6 |
if (info.getDonnee(0) != null) { |
personnel = (StructureAPersonneListe) info.getDonnee(0); |
// Création des objets contenant les manipulations de la grille |
personnelModifie = new StructureAPersonneListe(); |
personnelAjoute = new StructureAPersonneListe(); |
personnelSupprime = new StructureAPersonneListe(); |
//GWT.log(personnel.toString(), null); |
if (onglets.getSelectedItem().equals(personnelOnglet)) { |
peuplerStructurePersonnel(); |
2059,7 → 2105,6 |
fonctionsMagazin.removeAll(); |
fonctionsMagazin.add(liste); |
fonctionsCombo.setStore(fonctionsMagazin); |
rafraichirPersonnel(); |
} |
if (listeValeurs.getId().equals(config.getListeId("pays"))) { |
magazinPays.removeAll(); |
2167,7 → 2212,7 |
private void ajouterMembreAGrillePersonnel(StructureAPersonne personnel) { |
grillePersonnel.stopEditing(); |
personnelGrilleMagazin.insert(new StructureAPersonne(), 0); |
personnelGrilleMagazin.insert(personnel, 0); |
// Nous modifions l'enregistrement pour que le modèle soit pris en compte lors de la collecte. |
Record record = personnelGrilleMagazin.getRecord(personnelGrilleMagazin.getAt(0)); |
/trunk/src/org/tela_botanica/client/Modele.java |
---|
93,9 → 93,9 |
structureDao.supprimer(vue, idUtilisateur, idStr); |
} |
public void modifierStructure(Rafraichissable vue, String utilisateurId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) { |
public void modifierStructure(Rafraichissable vue, String utilisateurId, String structureId, Structure structure, StructureConservation conservation, StructureValorisation valorisation) { |
StructureAsyncDao structureDao = new StructureAsyncDao(); |
structureDao.modifier(vue, utilisateurId, structure, conservation, valorisation); |
structureDao.modifier(vue, utilisateurId, structureId, structure, conservation, valorisation); |
} |
//+----------------------------------------------------------------------------------------------------------------+ |
/trunk/src/org/tela_botanica/client/modeles/aDonnee.java |
---|
1,10 → 1,14 |
package org.tela_botanica.client.modeles; |
import java.io.Serializable; |
import java.util.Collections; |
import java.util.HashMap; |
import java.util.Iterator; |
import java.util.LinkedList; |
import java.util.List; |
import java.util.Map; |
import java.util.Set; |
import java.util.TreeSet; |
import org.tela_botanica.client.util.UtilArray; |
66,6 → 70,26 |
} |
} |
protected void supprimerTypeDansChaineDenormalise(String champ, String type) { |
String chaineExistante = renvoyerValeurCorrecte(champ); |
if (!chaineExistante.equals("")) { |
// Si la valeur à ajouter n'est pas déjà présente, nous l'ajoutons |
if (chaineExistante.matches("(^|;;)"+type+"##")) { |
chaineExistante = chaineExistante.replaceFirst(type+"##", ""); |
chaineExistante = chaineExistante.replaceAll(";;;;", ";;"); |
chaineExistante = chaineExistante.replaceAll("(^;;|;;$)", ""); |
this.set(champ, chaineExistante); |
} |
} |
} |
protected void remplacerTypeDansChaineDenormalise(String champ, String type, Object valeur) { |
if (valeur != null && !valeur.equals("")) { |
ajouterChaineDenormaliseAvecType(champ, type, valeur); |
} else { |
supprimerTypeDansChaineDenormalise(champ, type); |
} |
} |
/** |
* Ajoute un nouvel élément sans type à une chaine dénormalisée. |
* Champ de type "truk" contenant seulement des valeurs séparées par ";;". |
282,9 → 306,10 |
// Champs du BaseModelData |
Set<String> proprietes = this.getProperties().keySet(); |
for (Iterator<String> it = proprietes.iterator(); it.hasNext();) { |
TreeSet<String> proprietesTriees = new TreeSet<String>(proprietes); |
for (Iterator<String> it = proprietesTriees.iterator(); it.hasNext();) { |
String cle = it.next(); |
if (!this.get(cle).equals("")) { |
if (this.get(cle) != null && !this.get(cle).equals("")) { |
sortie += cle+" : "+this.get(cle)+"\n"; |
} |
} |
291,4 → 316,36 |
return sortie; |
} |
public Boolean comparer(BaseModelData objetAComparer) { |
Boolean retour = true; |
Map<String, Object> a = this.getProperties(); |
Map<String, Object> b = objetAComparer.getProperties(); |
if (a.size() != b.size()) { |
retour = false; |
} else { |
Set<String> cles = a.keySet(); |
Iterator<String> it = cles.iterator(); |
while (it.hasNext()) { |
String cle = it.next(); |
if (a.get(cle) != null && !a.get(cle).equals(b.get(cle))) { |
retour = false; |
break; |
} |
} |
} |
return retour; |
} |
public Object cloner(BaseModelData nouvelleInstance) { |
Map<String, Object> proprietes = this.getProperties(); |
Set<String> cles = proprietes.keySet(); |
for (Iterator<String> it = cles.iterator(); it.hasNext();) { |
String cle = it.next(); |
nouvelleInstance.set(cle, this.get(cle)); |
} |
return nouvelleInstance; |
} |
} |
/trunk/src/org/tela_botanica/client/modeles/StructureAsyncDao.java |
---|
106,66 → 106,68 |
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_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_ce_projet=" + str.getIdProjet() + |
"&cs_ce_mere=" + str.getIdMere() + |
"&cs_guid=" + str.getGuid() + |
"&cs_truk_identifiant_alternatif=" + str.getIdAlternatif() + |
"&cs_nom=" + str.getNom() + |
"&cs_truk_nom_alternatif=" + str.getNomAlternatif() + |
"&cs_ce_type=" + str.getType() + |
"&cs_ce_truk_type_prive=" + str.getTypePrive() + |
"&cs_ce_truk_type_public=" + str.getTypePublic() + |
"&cs_adresse_01=" + str.getAdresse() + |
"&cs_adresse_02=" + str.getAdresseComplement() + |
"&cs_date_fondation=" + str.getDateFondationFormatMysql() + |
"&cs_code_postal=" + str.getCodePostal() + |
"&cs_ville=" + str.getVille() + |
"&cs_region=" + str.getRegion() + |
"&cs_pays=" + str.getPays() + |
"&cs_telephone=" + str.getTelephone() + |
"&cs_fax=" + str.getFax() + |
"&cs_truk_url=" + str.getUrl() + |
"&cs_nbre_personne=" + Integer.toString(str.getNbrePersonne()); |
if (conservation != null) { |
postDonnees += "&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()); |
postDonnees += "&csc_mark_formation=" + conservation.getFormation() + |
"&csc_formation=" + conservation.getFormationInfo() + |
"&csc_mark_formation_interet=" + conservation.getFormationInteret() + |
"&csc_truk_stockage_local=" + conservation.getStockageLocal() + |
"&csc_truk_stockage_meuble=" + conservation.getStockageMeuble() + |
"&csc_truk_stockage_parametre=" + conservation.getStockageParametre() + |
"&csc_mark_collection_commune=" + conservation.getCollectionCommune() + |
"&csc_truk_collection_autre=" + conservation.getCollectionAutre() + |
"&csc_mark_acces_controle=" + conservation.getAccesControle() + |
"&csc_mark_restauration=" + conservation.getRestauration() + |
"&csc_truk_restauration_operation=" + conservation.getRestaurationOperation() + |
"&csc_ce_materiel_conservation=" + conservation.getMaterielConservation() + |
"&csc_truk_materiel_autre=" + conservation.getMaterielAutre() + |
"&csc_mark_traitement=" + conservation.getTraitement() + |
"&csc_truk_traitement=" + conservation.getTraitements() + |
"&csc_mark_acquisition_collection=" + conservation.getAcquisitionCollection() + |
"&csc_mark_acquisition_echantillon=" + conservation.getAcquisitionEchantillon() + |
"&csc_mark_acquisition_traitement=" + conservation.getAcquisitionTraitement() + |
"&csc_truk_acquisition_traitement_poison=" + conservation.getAcquisitionTraitementPoison() + |
"&csc_truk_acquisition_traitement_insecte=" + conservation.getAcquisitionTraitementInsecte(); |
} |
if (valorisation != null) { |
postDonnees += "&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()); |
postDonnees += "&csv_mark_action=" + valorisation.getAction() + |
"&csv_truk_action=" + valorisation.getActionInfo() + |
"&csv_publication=" + valorisation.getPublication() + |
"&csv_collection_autre=" + valorisation.getCollectionAutre() + |
"&csv_mark_action_future=" + valorisation.getActionFuture() + |
"&csv_action_future=" + valorisation.getActionFutureInfo() + |
"&csv_mark_recherche=" + valorisation.getRecherche() + |
"&csv_truk_recherche_provenance=" + valorisation.getRechercheProvenance() + |
"&csv_truk_recherche_type=" + valorisation.getRechercheType() + |
"&csv_mark_acces_ss_motif=" + valorisation.getAccesSansMotif() + |
"&csv_acces_ss_motif=" + valorisation.getAccesSansMotifInfo() + |
"&csv_mark_visite_avec_motif=" + valorisation.getVisiteAvecMotif() + |
"&csv_visite_avec_motif=" + valorisation.getVisiteAvecMotifInfo(); |
} |
String postDonneesEncodees = URL.encode(postDonnees); |
try { |
rb.sendRequest(postDonnees, new RequestCallback() { |
rb.sendRequest(postDonneesEncodees, new RequestCallback() { |
public void onError(Request request, Throwable exception) { |
// Gestion des exceptions déclenchées par l'exécution de la requête |
185,25 → 187,31 |
if (response.getStatusCode() != 200) { |
onErrorHTTP(request, response); |
} else { |
Information info = new Information("ajout_structure"); |
if (response.getHeader("X-DebugJrest-Data").length() != 0) { |
final JSONValue reponseEnteteDeboguage = JSONParser.parse(response.getHeader("X-DebugJrest-Data")); |
if (reponseEnteteDeboguage.isArray() != null) { |
info.setDeboguages(reponseEnteteDeboguage.isArray()); |
} |
} |
if (response.getText().length() != 0 && response.getText() != null) { |
final JSONValue responseValue = JSONParser.parse(response.getText()); |
// Si la requête est un succès, reception d'une chaine |
if (responseValue.isString() != null) { |
Information info = new Information("ajout_structure", responseValue.isString().stringValue()); |
r.rafraichir(info); |
info.setMessage(responseValue.isString().stringValue()); |
} else { |
GWT.log(url+"\n\tLa réponse n'est pas une chaine JSON.", null); |
info.setDeboguage("La réponse n'est pas une chaine JSON."); |
} |
} else { |
GWT.log(url, null); |
if (response.getText().length() == 0) { |
GWT.log("\tLa réponse a une taille de 0", null); |
} |
if (response.getText() == null) { |
GWT.log("\tLa réponse vaut null", null); |
info.setDeboguage("tLa réponse vaut null"); |
} else if (response.getText().length() == 0) { |
info.setDeboguage("tLa réponse a une taille de 0"); |
} |
} |
r.rafraichir(info); |
} |
} |
278,73 → 286,78 |
} |
} |
public void modifier(final Rafraichissable vues, String utilisateurId, Structure str, StructureConservation conservation, StructureValorisation valorisation) { |
public void modifier(final Rafraichissable vues, String utilisateurId, String structureId, Structure str, StructureConservation conservation, StructureValorisation valorisation) { |
final String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl() + |
SERVICE_NOM + "/" + |
str.getId() |
; |
SERVICE_NOM + "/" + structureId; |
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_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()) + |
""; |
String postDonnees = "cmhl_ce_modifier_par=" + utilisateurId; |
if (str != null) { |
postDonnees += "&cs_ce_projet=" + str.getIdProjet() + |
"&cs_ce_mere=" + str.getIdMere() + |
"&cs_guid=" + str.getGuid() + |
"&cs_truk_identifiant_alternatif=" + str.getIdAlternatif() + |
"&cs_nom=" + str.getNom() + |
"&cs_truk_nom_alternatif=" + str.getNomAlternatif() + |
"&cs_ce_type=" + str.getType() + |
"&cs_ce_truk_type_prive=" + str.getTypePrive() + |
"&cs_ce_truk_type_public=" + str.getTypePublic() + |
"&cs_adresse_01=" + str.getAdresse() + |
"&cs_adresse_02=" + str.getAdresseComplement() + |
"&cs_date_fondation=" + str.getDateFondationFormatMysql() + |
"&cs_code_postal=" + str.getCodePostal() + |
"&cs_ville=" + str.getVille() + |
"&cs_region=" + str.getRegion() + |
"&cs_pays=" + str.getPays() + |
"&cs_telephone=" + str.getTelephone() + |
"&cs_fax=" + str.getFax() + |
"&cs_courriel=" + str.getCourriel() + |
"&cs_truk_url=" + str.getUrl() + |
"&cs_nbre_personne=" + Integer.toString(str.getNbrePersonne()); |
} |
if (conservation != null) { |
postDonnees += "&csc_mark_formation=" + conservation.getFormation() + |
"&csc_formation=" + conservation.getFormationInfo() + |
"&csc_mark_formation_interet=" + conservation.getFormationInteret() + |
"&csc_truk_stockage_local=" + conservation.getStockageLocal() + |
"&csc_truk_stockage_meuble=" + conservation.getStockageMeuble() + |
"&csc_truk_stockage_parametre=" + conservation.getStockageParametre() + |
"&csc_mark_collection_commune=" + conservation.getCollectionCommune() + |
"&csc_truk_collection_autre=" + conservation.getCollectionAutre() + |
"&csc_mark_acces_controle=" + conservation.getAccesControle() + |
"&csc_mark_restauration=" + conservation.getRestauration() + |
"&csc_truk_restauration_operation=" + conservation.getRestaurationOperation() + |
"&csc_ce_materiel_conservation=" + conservation.getMaterielConservation() + |
"&csc_truk_materiel_autre=" + conservation.getMaterielAutre() + |
"&csc_mark_traitement=" + conservation.getTraitement() + |
"&csc_truk_traitement=" + conservation.getTraitements() + |
"&csc_mark_acquisition_collection=" + conservation.getAcquisitionCollection() + |
"&csc_mark_acquisition_echantillon=" + conservation.getAcquisitionEchantillon() + |
"&csc_mark_acquisition_traitement=" + conservation.getAcquisitionTraitement() + |
"&csc_truk_acquisition_traitement_poison=" + conservation.getAcquisitionTraitementPoison() + |
"&csc_truk_acquisition_traitement_insecte=" + conservation.getAcquisitionTraitementInsecte(); |
} |
if (valorisation != null) { |
postDonnees += "&csv_mark_action=" + valorisation.getAction() + |
"&csv_truk_action=" + valorisation.getActionInfo() + |
"&csv_publication=" + valorisation.getPublication() + |
"&csv_collection_autre=" + valorisation.getCollectionAutre() + |
"&csv_mark_action_future=" + valorisation.getActionFuture() + |
"&csv_action_future=" + valorisation.getActionFutureInfo() + |
"&csv_mark_recherche=" + valorisation.getRecherche() + |
"&csv_truk_recherche_provenance=" + valorisation.getRechercheProvenance() + |
"&csv_truk_recherche_type=" + valorisation.getRechercheType() + |
"&csv_mark_acces_ss_motif=" + valorisation.getAccesSansMotif() + |
"&csv_acces_ss_motif=" + valorisation.getAccesSansMotifInfo() + |
"&csv_mark_visite_avec_motif=" + valorisation.getVisiteAvecMotif() + |
"&csv_visite_avec_motif=" + valorisation.getVisiteAvecMotifInfo(); |
} |
String postDonneesEncodees = URL.encode(postDonnees); |
GWT.log(postDonnees, null); |
try { |
rb.sendRequest(postDonnees, new RequestCallback() { |
rb.sendRequest(postDonneesEncodees, new RequestCallback() { |
public void onError(Request request, Throwable exception) { |
// Gestion des exceptions déclenchées par l'exécution de la requête |
364,25 → 377,30 |
if (response.getStatusCode() != 200) { |
onErrorHTTP(request, response); |
} else { |
if (response.getText().length() != 0 && response.getText() != null) { |
Information info = new Information("modif_structure"); |
if (response.getHeader("X-DebugJrest-Data").length() != 0) { |
final JSONValue reponseEnteteDeboguage = JSONParser.parse(response.getHeader("X-DebugJrest-Data")); |
if (reponseEnteteDeboguage.isArray() != null) { |
info.setDeboguages(reponseEnteteDeboguage.isArray()); |
} |
} |
if (response.getText() != null && response.getText().length() != 0) { |
final JSONValue responseValue = JSONParser.parse(response.getText()); |
// Si la requête est un succès, reception d'une chaine |
if (responseValue.isString() != null) { |
Information info = new Information("modif_structure", responseValue.isString().stringValue()); |
vues.rafraichir(info); |
info.setMessage(responseValue.isString().stringValue()); |
} else { |
GWT.log(url+"\n\tLa réponse n'est pas une chaine JSON.", null); |
info.setDeboguage("La réponse n'est pas une chaine JSON."); |
} |
} else { |
GWT.log(url, null); |
if (response.getText().length() == 0) { |
GWT.log("\tLa réponse a une taille de 0", null); |
} |
if (response.getText() == null) { |
GWT.log("\tLa réponse vaul null", null); |
info.setDeboguage("La réponse vaul null"); |
} else if (response.getText().length() == 0) { |
info.setDeboguage("La réponse a une taille de 0"); |
} |
} |
vues.rafraichir(info); |
} |
} |
/trunk/src/org/tela_botanica/client/modeles/Information.java |
---|
8,16 → 8,19 |
private String type = null; |
private ArrayList<String> messages = null; |
private ArrayList<String> deboguages = null; |
private ArrayList<Object> donnees = null; |
public Information() { |
donnees = new ArrayList<Object>(); |
messages = new ArrayList<String>(); |
donnees = new ArrayList<Object>(); |
deboguages = new ArrayList<String>(); |
} |
public Information(String t) { |
donnees = new ArrayList<Object>(); |
messages = new ArrayList<String>(); |
deboguages = new ArrayList<String>(); |
type = t; |
} |
25,6 → 28,7 |
donnees = new ArrayList<Object>(); |
messages = new ArrayList<String>(); |
messages.add(m); |
deboguages = new ArrayList<String>(); |
type = t; |
} |
36,13 → 40,15 |
messages.add(jsonArray.get(i).isString().stringValue()); |
} |
} |
deboguages = new ArrayList<String>(); |
type = t; |
} |
public Information(String t, Object o) { |
messages = new ArrayList<String>(); |
donnees = new ArrayList<Object>(); |
donnees.add(o); |
messages = new ArrayList<String>(); |
deboguages = new ArrayList<String>(); |
type = t; |
} |
60,11 → 66,27 |
public String getMessage(int index) { |
return messages.get(index); |
} |
public ArrayList<String> getMessages() { |
return messages; |
} |
public void setDeboguage(String messageDeboguage) { |
deboguages.add(messageDeboguage); |
} |
public void setDeboguages(JSONArray jsonArray) { |
for(int i = 0 ; i < jsonArray.size() ; i++) { |
if (jsonArray.get(i).isString() != null) { |
deboguages.add(jsonArray.get(i).isString().stringValue()); |
} |
} |
} |
public String getDeboguage(int index) { |
return deboguages.get(index); |
} |
public ArrayList<String> getDeboguages() { |
return deboguages; |
} |
public void setDonnee(Object objet) { |
donnees.add(objet); |
} |
80,7 → 102,6 |
return null; |
} |
} |
public ArrayList<Object> getDonnees() { |
return donnees; |
} |
/trunk/src/org/tela_botanica/client/modeles/StructureValorisation.java |
---|
60,7 → 60,7 |
this.set("truk_action", a); |
} |
public void setActionInfo(String type, Object valeur) { |
ajouterChaineDenormaliseAvecType("truk_action", type, valeur); |
remplacerTypeDansChaineDenormalise("truk_action", type, valeur); |
} |
// PUBLICATION |
79,7 → 79,7 |
this.set("collection_autre", ca); |
} |
public void setCollectionAutre(String type, Object valeur) { |
ajouterChaineDenormaliseAvecType("collection_autre", type, valeur); |
remplacerTypeDansChaineDenormalise("collection_autre", type, valeur); |
} |
// ACTION FUTURE |
115,7 → 115,7 |
this.set("truk_recherche_provenance", rp); |
} |
public void setRechercheProvenance(String type, Object valeur) { |
ajouterChaineDenormaliseAvecType("truk_recherche_provenance", type, valeur); |
remplacerTypeDansChaineDenormalise("truk_recherche_provenance", type, valeur); |
} |
// RECHERCHE TYPE |
126,7 → 126,7 |
this.set("truk_recherche_type", rt); |
} |
public void setRechercheType(String type, Object valeur) { |
ajouterChaineDenormaliseAvecType("truk_recherche_type", type, valeur); |
remplacerTypeDansChaineDenormalise("truk_recherche_type", type, valeur); |
} |
// ACCES SANS MOTIF |
/trunk/src/org/tela_botanica/client/modeles/StructureConservation.java |
---|
75,7 → 75,7 |
this.set("truk_stockage_local", sl); |
} |
public void setStockageLocal(String type, Object valeur) { |
ajouterChaineDenormaliseAvecType("truk_stockage_local", type, valeur); |
remplacerTypeDansChaineDenormalise("truk_stockage_local", type, valeur); |
} |
// STOCKAGE MEUBLE |
86,7 → 86,7 |
this.set("truk_stockage_meuble", sm); |
} |
public void setStockageMeuble(String type, Object valeur) { |
ajouterChaineDenormaliseAvecType("truk_stockage_meuble", type, valeur); |
remplacerTypeDansChaineDenormalise("truk_stockage_meuble", type, valeur); |
} |
// STOCKAGE PARAMÊTRE |
97,7 → 97,7 |
this.set("truk_stockage_parametre", sl); |
} |
public void setStockageParametre(String type, Object valeur) { |
ajouterChaineDenormaliseAvecType("truk_stockage_parametre", type, valeur); |
remplacerTypeDansChaineDenormalise("truk_stockage_parametre", type, valeur); |
} |
// COLLECTION COMMUNE |
116,7 → 116,7 |
this.set("truk_collection_autre", ca); |
} |
public void setCollectionAutre(String type, Object valeur) { |
ajouterChaineDenormaliseAvecType("truk_collection_autre", type, valeur); |
remplacerTypeDansChaineDenormalise("truk_collection_autre", type, valeur); |
} |
// ACCÈS CONTROLÉ |