Subversion Repositories eFlore/Applications.coel

Compare Revisions

Ignore whitespace Rev 263 → Rev 264

/trunk/src/org/tela_botanica/client/modeles/PublicationListeAsyncDao.java
67,13 → 67,13
}
}
public void modifierPublication(final Rafraichissable r, String idUtilisateur, Publication pubAModifier) {
public void modifierPublication(final Rafraichissable r, String utilisateurId, Publication pubAModifier) {
// Demande de toutes les structures
String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url+"CoelPublicationListe/"+idUtilisateur);
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url+"CoelPublicationListe/"+pubAModifier.getId());
 
try {
rb.sendRequest(pubAModifier.toReqString(), new RequestCallback() {
rb.sendRequest(pubAModifier.toReqString()+"&cmhl_ce_modifier_par="+utilisateurId, new RequestCallback() {
 
public void onError(Request request, Throwable exception) {
// TODO Auto-generated method stub
107,13 → 107,12
}
}
 
public void ajouterPublication(Modele modele, String utilisateurId,
Publication pubAModifier) {
public void ajouterPublication(Modele modele, String utilisateurId, Publication pubAModifier) {
String url = ((Configuration) Registry.get(RegistreId.CONFIG)).getServiceBaseUrl();
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, url+"CoelPublicationListe/");
 
try {
rb.sendRequest(pubAModifier.toReqString()+"&id_utilisateur="+utilisateurId, new RequestCallback() {
rb.sendRequest(pubAModifier.toReqString()+"&cmhl_ce_modifier_par="+utilisateurId, new RequestCallback() {
 
public void onError(Request request, Throwable exception) {
// TODO Auto-generated method stub
/trunk/src/org/tela_botanica/client/modeles/StructureAPersonneAsyncDao.java
26,7 → 26,7
(idStructure == null ? "*" : idStructure) + "/" +
(idRole == null ? "*" : idRole) + "/" +
"";
GWT.log("StructureAPersonne : "+url, null);
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, url);
try {
rb.sendRequest(null, new RequestCallback() {
/trunk/src/org/tela_botanica/client/modeles/Valeur.java
7,9 → 7,6
 
public class Valeur extends aDonnee {
public static final String FONCTION_DIRECTEUR = "Directeur";
public static final String FONCTION_CONSERVATEUR = "Conservateur";
/**
* Constructeur avec un objet JSON
*
/trunk/src/org/tela_botanica/client/modeles/Publication.java
4,6 → 4,7
import java.util.Map;
import java.util.Set;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.user.client.Window;
14,7 → 15,7
* Préfixe à retirer pour construire les noms des clés
* et à rajouter lors de la transformation en requête
*/
private static String prefixe = "cpu_";
private static String prefixe = "cpu";
/**
* Constructeur vide
147,9 → 148,9
Map<String,Object> clesValeurs = getProperties() ;
for(Iterator<String> it = clesValeurs.keySet().iterator(); it.hasNext();) {
String cle = it.next();
reqString += "&"+prefixe+cle+"="+URL.encode((String)clesValeurs.get(cle));
reqString += "&"+prefixe+"_"+cle+"="+URL.encode((String)clesValeurs.get(cle));
}
Window.alert(reqString);
GWT.log(reqString, null);
return reqString;
}
}
/trunk/src/org/tela_botanica/client/modeles/StructureAPersonne.java
10,7 → 10,9
import com.google.gwt.json.client.JSONObject;
 
public class StructureAPersonne extends aDonnee {
 
public static final String FONCTION_DIRECTEUR = "2028";
public static final String FONCTION_CONSERVATEUR = "2029";
public static final String FONCTION_TECHNICIEN = "2030";
public static final String ROLE_ADMIN = "2026";
public static final String ROLE_EQUIPE = "2027";
public static final String PREFIXE = "csap";
/trunk/src/org/tela_botanica/client/modeles/StructureAsyncDao.java
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 {