Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 964 → Rev 965

/trunk/src/org/tela_botanica/client/image/ImageModele.java
156,15 → 156,15
 
int tailleFiltres = valeursFiltres.length;
 
String[][] criteres = new String[tailleFiltres + 1][2];
String[][] criteres = new String[tailleFiltres][2];
 
String[] utilisateur = { "ci_ce_utilisateur",
String[] utilisateur = {
"" + getIMediateur().getIdentifiant() };
criteres[0] = utilisateur;
 
 
for (int i = 0; i < valeursFiltres.length; i++) {
criteres[i + 1] = valeursFiltres[i];
criteres[i] = valeursFiltres[i];
}
 
// on les crée un DAO auquel on les transmet et qui demande le nombre
181,8 → 181,8
String[][] criteres2 = new String[tailleFiltres + 2][2];
String[] limite = { "ci_limite", "" + taillePage };
String[] taillePage = { "ci_numero_page", "" + pageEncours };
String[] limite = { "limite", "" + taillePage };
String[] taillePage = { "numero_page", "" + pageEncours };
criteres2[0] = limite;
criteres2[1] = taillePage;
484,11 → 484,11
if (reponse.get(j).isObject() != null) {
JSONObject noeud = (JSONObject) reponse.get(j);
 
String id_noeud = noeud.get("cmc_id_mot_cle_utilisateur")
String id_noeud = noeud.get("id_mot_cle_utilisateur")
.isString().stringValue();
String mot_cle = noeud.get("cmc_mot_cle").isString()
String mot_cle = noeud.get("mot_cle").isString()
.stringValue();
String parent = noeud.get("cmc_id_parent").isString()
String parent = noeud.get("ce_mot_cle_utilisateur_parent").isString()
.stringValue();
 
String[] usObj = { mot_cle, id_noeud };
/trunk/src/org/tela_botanica/client/vues/ArbreMotsClesFiltreVue.java
322,7 → 322,7
val = val.replaceFirst(";", "");
String[] valeursFiltres = {"ci_meta_mots_cles", val};
String[] valeursFiltres = {"id_mots_cles", val};
 
return valeursFiltres;
}
389,9 → 389,6
if (estInstancie) {
// on vide les mots clés en cours
motsClesEncours = "";
 
// on suppose que le filtre a change
filtreModifie = true;
}
/trunk/src/org/tela_botanica/client/vues/FenetreLicenceVue.java
23,6 → 23,8
private Button validerAcceptationLicence = new Button("Valider");
private Button annulerAcceptationLicence = new Button("Refuser");
// C'est moche mais ça évite de la transmettre du serveur ou de créer un fichier de config pour la licence
// Todo afficher un texte provenant d'une url
private String licence = "Le \"carnet en ligne\" (CEL) est un service proposé par Tela Botanica dans le but de vous aider à garder la trace de vos observations de terrain afin qu'elles ne restent plus prisonnière de votre \"petit carnet à spirale\"... La saisie des données est rapide, sure et précise et le CEL vous permet de les archiver et de les trier facilement. Si vous les publiez, ce que nous vous invitons vivement à faire, mais sans obligation, elles seront visibles sur les cartes de répartition des espèces du site de Tela Botanica. De même, vous pourrez faire partager vos meilleures photos de plantes avec les autres membres du réseau. Vous pourrez également exporter vos observations saisies dans le CEL dans une table Excel pour les traiter statistiquement ou les transférez à d'autres botanistes ou dans d'autres logiciels.<br>"
+"<br>"
+"Pour cela vous devez accepter les conditions suivantes :<br>"
/trunk/src/org/tela_botanica/client/vues/observation/ListeObservationVue.java
679,7 → 679,6
// Si on a effectué une suppression
if(nouvelleDonnees instanceof String)
{
String str = (String)nouvelleDonnees ;
observationMediateur.obtenirNombreObservation() ;
}
832,7 → 831,7
texteFiltresEnCours += "<span class=\"affichage_filtre\">"+
transformerNomFiltre(filtresEnCours[i][0])+": "+transformerValeurFiltre(filtresEnCours[i][0], filtresEnCours[i][1])+
" <input value=\"X\" type=\"button\" rel=\""+filtresEnCours[i][0]+"\" id=\"bouton_raz_filtres_obs"+filtresEnCours[i][0]+"\" />"+
" <input value=\"X\" type=\"button\" rel=\""+filtresEnCours[i][0]+"\" id=\"bouton_raz_filtres_obs_"+filtresEnCours[i][0]+"\" />"+
"</span>";
}
}
846,9 → 845,9
for(int i = 0; i < filtresEnCours.length; i++) {
if(Util.filtreValide(filtresEnCours[i])) {
if(Ext.get("bouton_raz_filtres_obs"+filtresEnCours[i][0]) != null) {
if(Ext.get("bouton_raz_filtres_obs_"+filtresEnCours[i][0]) != null) {
Ext.get("bouton_raz_filtres_obs"+filtresEnCours[i][0]).addListener("click", new EventCallback() {
Ext.get("bouton_raz_filtres_obs_"+filtresEnCours[i][0]).addListener("click", new EventCallback() {
public void execute(EventObject e) {
e.stopEvent();
863,11 → 862,11
private String transformerNomFiltre(String nomFiltre) {
if(nomFiltre.equals("id_location")) {
if(nomFiltre.equals("departement")) {
nomFiltre = "departement";
}
if(nomFiltre.equals("location")) {
if(nomFiltre.equals("commune")) {
nomFiltre = "commune";
}
875,7 → 874,7
nomFiltre = "recherche";
}
if(nomFiltre.equals("mots_cles")) {
if(nomFiltre.equals("id_mots_cles")) {
nomFiltre = "projets";
}
887,7 → 886,7
String valeurFiltreTransformee = valeurFiltre;
if(nomFiltre.equals("mots_cles")) {
if(nomFiltre.equals("id_mots_cles")) {
String[] tabMotsCles = valeurFiltre.split(";");
String[] tabMotsClesTexte = observationMediateur.obtenirTexteMotsCles(tabMotsCles);
/trunk/src/org/tela_botanica/client/vues/observation/PanneauFiltresObservationVues.java
159,7 → 159,7
public void viderFiltres(String nom) {
if(nom.equals("mots_cles")) {
if(nom.equals("id_mots_cles")) {
arbreMotsClesObservationVue.viderFiltre();
}
171,7 → 171,7
arbreDateObservationFiltreVue.viderFiltre(nom);
}
if(nom.equals("station") || nom.equals("lieudit") || nom.equals("id_location") || nom.equals("location")) {
if(nom.equals("station") || nom.equals("lieudit") || nom.equals("departement") || nom.equals("commune")) {
arbreEntiteGeographiqueObservationFiltreVue.viderFiltre(nom);
}
 
/trunk/src/org/tela_botanica/client/vues/observation/CartographieObservationVue.java
4,6 → 4,7
import org.tela_botanica.client.modeles.Configuration;
import org.tela_botanica.client.modeles.EntiteGeographiqueObservation;
import org.tela_botanica.client.observation.ObservationMediateur;
import org.tela_botanica.client.util.Util;
 
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.maps.client.InfoWindow;
252,8 → 253,8
LatLng coord = LatLng.newInstance(lat, lon);
valeurCommune = infos.getCommune();
codeCommune = infos.getIdLocalite();
valeurCommune = infos.getZoneGeo();
codeCommune = Util.convertirChaineZoneGeoVersDepartement(infos.getIdZoneGeo());
pointCommune = coord;
mettreAJourInfos(coord, "", niveauZoom);
/trunk/src/org/tela_botanica/client/vues/observation/filtres/ArbreMotsClesObservationVue.java
716,7 → 716,7
val = val.replaceFirst(";", "");
String[] valeursFiltres = {"mots_cles", val};
String[] valeursFiltres = {"id_mots_cles", val};
return valeursFiltres;
}
/trunk/src/org/tela_botanica/client/vues/observation/filtres/ArbreEntiteGeographiqueObservationFiltreVue.java
9,6 → 9,7
import org.tela_botanica.client.modeles.ListeEntiteGeographiqueObservation;
import org.tela_botanica.client.modeles.Observation;
import org.tela_botanica.client.observation.ObservationMediateur;
import org.tela_botanica.client.util.Util;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
195,22 → 196,22
observationMediateur.obtenirNombreObservation() ;
}
return ;
case 4: nomFiltre += "station,lieudit,location,id_location";
case 4: nomFiltre += "station,lieudit,commune,departement";
nomPere = ((String[])node.getParentNode().getUserObject())[0] ;
nomGrandPere = ((String[])node.getParentNode().getParentNode().getUserObject())[0] ;
nomArriereGrandPere = ((String[])node.getParentNode().getParentNode().getParentNode().getUserObject())[0] ;
entitesGeographiquesEncours += node.getText()+","+nomPere+","+nomGrandPere+","+nomArriereGrandPere ;
break;
case 3: nomFiltre += "lieudit,location,id_location";
case 3: nomFiltre += "lieudit,commune,departement";
nomPere = ((String[])node.getParentNode().getUserObject())[0] ;
nomGrandPere = ((String[])node.getParentNode().getParentNode().getUserObject())[0] ;
entitesGeographiquesEncours += node.getText()+","+nomPere+","+nomGrandPere ;
break;
case 2: nomFiltre += "location,id_location";
case 2: nomFiltre += "commune,departement";
nomPere = ((String[])node.getParentNode().getUserObject())[0] ;
entitesGeographiquesEncours += node.getText()+","+nomPere ;
break;
case 1: nomFiltre += "id_location";
case 1: nomFiltre += "departement";
entitesGeographiquesEncours += node.getText() ;
break;
default:
498,26 → 499,27
*/
private void creerHierarchieNoeud(Tree arbre, TreeNode root, EntiteGeographiqueObservation ent) {
String idLocation=null;
String location=null;
String id_zone_geo=null;
String zone_geo=null;
String lieuDit=null;
String station=null;
// TODO creer une fonction plus efficace lors du passage au multi reférentiel
id_zone_geo = Util.convertirChaineZoneGeoVersDepartement(ent.getIdZoneGeo());
idLocation=ent.getIdLocalite();
idLocation = idLocation.replaceAll("\"", "");
idLocation = idLocation.replace('\\',' ');
idLocation = idLocation.trim();
location=ent.getCommune();
lieuDit=ent.getLieuDit();
station=ent.getStation();
id_zone_geo = id_zone_geo.replaceAll("\"", "");
id_zone_geo = id_zone_geo.replace('\\',' ');
id_zone_geo = id_zone_geo.trim();
zone_geo = ent.getZoneGeo();
lieuDit = ent.getLieuDit();
station = ent.getStation();
if(idLocation.contains("000null") || idLocation.equals(null) || (idLocation.trim()).equals("")) {
idLocation="Inconnue" ;
if(id_zone_geo.contains("000null") || id_zone_geo.equals(null) || (id_zone_geo.trim()).equals("")) {
id_zone_geo="Inconnue" ;
}
if(location.contains("000null") || location.equals(null) || (location.trim().equals(""))) {
location="Inconnue" ;
if(zone_geo.contains("000null") || zone_geo.equals(null) || (zone_geo.trim().equals(""))) {
zone_geo="Inconnue" ;
}
if(lieuDit.contains("000null") || lieuDit.equals(null) || (lieuDit.trim().equals(""))) {
528,36 → 530,36
station="Inconnue" ;
}
Node noeudMemeId = arbre.getNodeById(""+idLocation);
Node noeudMemeId = arbre.getNodeById(""+id_zone_geo);
if(noeudMemeId == null) {
// on crée le noeud de l'identifiant location
noeudMemeId = creerNoeud(""+idLocation,idLocation);
// on crée le noeud de l'identifiant zone_geo
noeudMemeId = creerNoeud(""+id_zone_geo,id_zone_geo);
root.appendChild(noeudMemeId) ;
}
// on teste si la localité existe
Node noeudMemeLoc = arbre.getNodeById(""+(idLocation+location));
Node noeudMemeLoc = arbre.getNodeById(""+(id_zone_geo+zone_geo));
if(noeudMemeLoc == null)
{
// on crée le noeud de la location
noeudMemeLoc = creerNoeud(""+idLocation+location, location);
// on crée le noeud de la zone_geo
noeudMemeLoc = creerNoeud(""+id_zone_geo+zone_geo, zone_geo);
noeudMemeId.appendChild(noeudMemeLoc) ;
}
// on teste si le lieu dit existe
Node noeudMemeLieu = arbre.getNodeById(""+(idLocation+location+lieuDit));
Node noeudMemeLieu = arbre.getNodeById(""+(id_zone_geo+zone_geo+lieuDit));
if(noeudMemeLieu == null)
{
// on crée le noeud du lieu dit
noeudMemeLieu = creerNoeud(idLocation+location+lieuDit, lieuDit);
noeudMemeLieu = creerNoeud(id_zone_geo+zone_geo+lieuDit, lieuDit);
noeudMemeLoc.appendChild(noeudMemeLieu) ;
}
// on teste si la station existe
Node noeudMemeStation = arbre.getNodeById(""+(idLocation+location+lieuDit+station));
Node noeudMemeStation = arbre.getNodeById(""+(id_zone_geo+zone_geo+lieuDit+station));
if(noeudMemeStation == null) {
// on crée le noeud de la station
noeudMemeStation = creerNoeud(idLocation+location+lieuDit+station,station);
noeudMemeStation = creerNoeud(id_zone_geo+zone_geo+lieuDit+station,station);
noeudMemeLieu.appendChild(noeudMemeStation);
}
607,11 → 609,11
int profondeur = 0;
if(nom.equals("id_location")) {
if(nom.equals("departement")) {
profondeur = 1;
}
if(nom.equals("location")) {
if(nom.equals("commune")) {
profondeur = 2;
}
/trunk/src/org/tela_botanica/client/vues/image/filtres/DateFiltreVue.java
File deleted
/trunk/src/org/tela_botanica/client/vues/image/filtres/PanneauFiltresImagesVues.java
45,16 → 45,11
private ArbreDateImageFiltreVue arbreDateImageFiltreVue = null;
/**
* La barre de recherche par commentaires
* La barre de recherche libre
*/
private BarreRechercheFiltreVue rechercheLibreFiltreVue = null;
 
/**
* Recherche par date
*/
private DateFiltreVue dateFiltreVues = null;
 
/**
* Recherche par contenu du tampon
*/
private SelectionFiltreVue selectionFiltreVue = null;
202,11 → 197,11
 
public void viderFiltre(String nom) {
if(nom.equals("ci_meta_mots_cles")) {
if(nom.equals("id_mots_cles")) {
motsClesFiltres.viderFiltre();
}
if(nom.equals("ci_recherche_generale")) {
if(nom.equals("recherche")) {
rechercheLibreFiltreVue.viderFiltre();
}
/trunk/src/org/tela_botanica/client/vues/image/filtres/BarreRechercheFiltreVue.java
149,7 → 149,7
*/
public String renvoyerNomFiltre() {
 
return "Recherche Commentaires";
return "Recherche ";
}
 
/**
160,7 → 160,7
public String[] renvoyerValeursAFiltrer() {
 
valider() ;
String[] valeurFiltre = { "ci_recherche_generale", motsAChercher };
String[] valeurFiltre = { "recherche", motsAChercher };
return valeurFiltre;
}
 
/trunk/src/org/tela_botanica/client/vues/image/PanneauMetadonneesVue.java
5,6 → 5,7
import org.tela_botanica.client.vues.ArbreMotsClesVue;
import org.tela_botanica.client.vues.image.filtres.RechercheFiltreTaxonVue;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
/trunk/src/org/tela_botanica/client/vues/image/BarreOutilsVue.java
166,7 → 166,7
texteFiltresEnCours += "<span class=\"affichage_filtre\">"+
transformerNomFiltre(filtresEnCours[i][0])+": "+transformerValeurFiltre(filtresEnCours[i][0], filtresEnCours[i][1])+
" <input value=\"X\" type=\"button\" rel=\""+filtresEnCours[i][0]+"\" id=\"bouton_raz_filtres_img"+filtresEnCours[i][0]+"\" />"+
" <input value=\"X\" type=\"button\" rel=\""+filtresEnCours[i][0]+"\" id=\"bouton_raz_filtres_img_"+filtresEnCours[i][0]+"\" />"+
"</span>";
}
}
180,9 → 180,9
for(int i = 0; i < filtresEnCours.length; i++) {
if(Util.filtreValide(filtresEnCours[i])) {
if(Ext.get("bouton_raz_filtres_img"+filtresEnCours[i][0]) != null) {
if(Ext.get("bouton_raz_filtres_img_"+filtresEnCours[i][0]) != null) {
Ext.get("bouton_raz_filtres_img"+filtresEnCours[i][0]).addListener("click", new EventCallback() {
Ext.get("bouton_raz_filtres_img_"+filtresEnCours[i][0]).addListener("click", new EventCallback() {
public void execute(EventObject e) {
e.stopEvent();
196,16 → 196,8
}
private String transformerNomFiltre(String nomFiltre) {
//TODO: si le nombre de filtre s'agrandit faire une hashmap
// (pas la peine pour le moment, un seul nom à changer)
if(nomFiltre.equals("ci_recherche_generale")) {
nomFiltre = "recherche";
}
//TODO: si le nombre de filtre s'agrandit faire une hashmap
// (pas la peine pour le moment, un seul nom à changer)
if(nomFiltre.equals("ci_meta_mots_cles")) {
if(nomFiltre.equals("id_mots_cles")) {
nomFiltre = "mots clés";
}
217,7 → 209,7
String valeurFiltreTransformee = valeurFiltre;
if(nomFiltre.equals("ci_meta_mots_cles")) {
if(nomFiltre.equals("id_mots_cles")) {
String[] tabMotsCles = valeurFiltre.split(";");
String[] tabMotsClesTexte = iMediateur.obtenirTexteMotsCles(tabMotsCles);
/trunk/src/org/tela_botanica/client/modeles/UtilisateurAsynchroneDAO.java
154,7 → 154,7
try {
String postData = "acceptation_licence=1";
String postData = "licence=1";
rb.sendRequest(postData, new RequestCallback() {
 
/trunk/src/org/tela_botanica/client/modeles/EntiteGeographiqueObservation.java
2,7 → 2,7
 
/**
*
* Classe representant une idLocalite geographique (localite, commune, lieu dit) presente dans la liste des observations
* Classe representant une idZoneGeo geographique (localite, zoneGeo, lieu dit) presente dans la liste des observations
*
*/
 
10,8 → 10,8
 
 
private String idLocalite=null;
private String commune=null;
private String idZoneGeo=null;
private String zoneGeo=null;
private String lieuDit=null;
private String station=null;
private String lat=null;
25,14 → 25,14
 
/**
* @param commune
* @param zoneGeo
* @param departement
*/
public EntiteGeographiqueObservation(String idLocalite, String commune, String lieuDit, String station) {
public EntiteGeographiqueObservation(String idZoneGeo, String zoneGeo, String lieuDit, String station) {
this.idLocalite = idLocalite;
this.commune = commune;
this.idZoneGeo = idZoneGeo;
this.zoneGeo = zoneGeo;
this.lieuDit = lieuDit;
this.station = station;
54,13 → 54,13
return lon;
}
 
public String getIdLocalite() {
return idLocalite;
public String getIdZoneGeo() {
return idZoneGeo;
}
 
 
public String getCommune() {
return commune;
public String getZoneGeo() {
return zoneGeo;
}
 
 
71,8 → 71,4
public String getStation() {
return station;
}
 
 
 
}
/trunk/src/org/tela_botanica/client/modeles/ListeObservationAsynchroneDAO.java
13,6 → 13,7
import com.google.gwt.http.client.Response;
import com.google.gwt.http.client.URL;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
54,9 → 55,7
* @param criteres un tableau nom/valeur des critères pour les observations
*/
public final void obtenirListeObservation(final Rafraichissable r, final String utilisateur, final String[][] criteres)
{
{
String requete = "" ;
if(criteres != null)
66,8 → 65,6
for (int i = 0; i < criteres.length; i++) {
GWT.log(criteres[i][0]+" : "+criteres[i][1]);
if(criteres[i][1] != null && !criteres[i][1].equals(""))
{
if(i!= 0)
102,7 → 99,7
// si c'est un tableau
if ((reponse=responseValue.isArray()) != null) {
JSONArray observation;
JSONObject observation;
final int taillemax = reponse.size();
observationData = new ListeObservation(taillemax);
109,34 → 106,34
for (int i = 0; i < taillemax; i++) {
if ((observation=reponse.get(i).isArray()) != null) {
if ((observation=reponse.get(i).isObject()) != null) {
String transmis=((JSONString) observation.get(13)).stringValue();
String identifiantLocalite=((JSONString) observation.get(14)).toString();
String nomSaisi=Util.toCelString(((JSONString) observation.get(0)).toString());
String nomRetenu=Util.toCelString(((JSONString) observation.get(2)).toString());
String numeroNomenclaturalSaisi=((JSONString) observation.get(1)).stringValue();
String numeroNomenclaturalRetenu=((JSONString) observation.get(3)).stringValue();
String numeroTaxonomique=((JSONString) observation.get(4)).stringValue();
String famille=Util.toCelString(((JSONString) observation .get(5)).toString());
String localite=Util.toCelString(((JSONString) observation .get(6)).toString());
String lieudit=Util.toCelString(((JSONString) observation .get(9)).toString());
String station=Util.toCelString(((JSONString) observation .get(10)).toString());
String milieu=Util.toCelString(((JSONString) observation .get(11)).toString());
String commentaire=Util.toCelString(((JSONString) observation .get(12)).toString());
String date=((JSONString) observation .get(8)).stringValue();
String numeroOrdre=((JSONString) observation.get(7)).stringValue();
String coordX=((JSONString) observation.get(15)).stringValue();
String coordY=((JSONString) observation.get(16)).stringValue();
String motsCles=((JSONString) observation.get(17)).stringValue();
String transmis=((JSONString) observation.get("transmission")).stringValue();
String identifiantLocalite=((JSONString) observation.get("ce_zone_geo")).toString();
String nomSaisi=Util.toCelString(((JSONString) observation.get("nom_sel")).toString());
String nomRetenu=Util.toCelString(((JSONString) observation.get("nom_ret")).toString());
String numeroNomenclaturalSaisi=((JSONString) observation.get("nom_sel_nn")).stringValue();
String numeroNomenclaturalRetenu=((JSONString) observation.get("nom_ret_nn")).stringValue();
String numeroTaxonomique=((JSONString) observation.get("nt")).stringValue();
String famille=Util.toCelString(((JSONString) observation .get("famille")).toString());
String localite=Util.toCelString(((JSONString) observation .get("zone_geo")).toString());
String lieudit=Util.toCelString(((JSONString) observation .get("lieudit")).toString());
String station=Util.toCelString(((JSONString) observation .get("station")).toString());
String milieu=Util.toCelString(((JSONString) observation .get("milieu")).toString());
String commentaire=Util.toCelString(((JSONString) observation .get("commentaire")).toString());
String date=((JSONString) observation .get("date_observation")).stringValue();
String numeroOrdre=((JSONString) observation.get("ordre")).stringValue();
String numeroId=((JSONString) observation.get("id_observation")).stringValue();
String coordX=((JSONString) observation.get("latitude")).stringValue();
String coordY=((JSONString) observation.get("longitude")).stringValue();
String motsCles=((JSONString) observation.get("mots_cles")).stringValue();
Observation obs=new Observation(transmis, nomSaisi, nomRetenu, numeroNomenclaturalSaisi, numeroNomenclaturalRetenu ,numeroTaxonomique, famille, localite, identifiantLocalite, lieudit, station, milieu, commentaire, date, numeroOrdre/*, motsCles*/);
obs.setCoordonneeX(coordX);
obs.setCoordonneeY(coordY);
obs.setId(numeroId);
obs.setMotsCles(motsCles);
observationData.put(obs.getNumeroOrdre(),obs);
observationData.put(obs.getNumeroOrdre(),obs);
}
}
} else {
200,12 → 197,12
postData += "&commentaire="+obs.getCommentaire();
}
if(obs.getCoordonneeX() != null ) {
postData += "&coord_x="+URL.encodeComponent(""+obs.getCoordonneeX());
if(obs.getLatitude() != null ) {
postData += "&coord_x="+URL.encodeComponent(""+obs.getLatitude());
}
if(obs.getCoordonneeY() != null) {
postData += "&coord_y="+URL.encodeComponent(""+obs.getCoordonneeY());
if(obs.getLongitude() != null) {
postData += "&coord_y="+URL.encodeComponent(""+obs.getLongitude());
}
 
try {
/trunk/src/org/tela_botanica/client/modeles/NombreObservationAsynchroneDAO.java
14,7 → 14,6
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
import com.google.gwt.user.client.HTTPRequest;
import com.google.gwt.user.client.ResponseTextHandler;
import com.google.gwt.user.client.Window;
 
87,13 → 86,13
final JSONValue responseValue = JSONParser.parse(response.getText());
// si la requete se passe bien on reçoit un tableau JSON
if(responseValue.isArray() != null)
if(responseValue.isString() != null)
{
// qui contient une valeur : le nombre d'images correspondant au critères
JSONValue res = responseValue.isArray().get(0) ;
JSONString reponseNombre = res.isString() ;
int maxObservations = Integer.parseInt(reponseNombre.stringValue()) ;
JSONString res = responseValue.isString() ;
int maxObservations = Integer.parseInt(res.stringValue()) ;
int[] nbObservations = {maxObservations} ;
 
// on le met dans un tableau d'entiers qu'on tranmset au demandeur de la mise à jour
r.rafraichir(nbObservations, true) ;
} else {
/trunk/src/org/tela_botanica/client/modeles/ImageCarnet.java
4,7 → 4,12
import java.util.Iterator;
import java.util.Set;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.xml.client.Document;
import com.google.gwt.xml.client.NodeList;
import com.google.gwt.xml.client.XMLParser;
import com.google.gwt.xml.client.impl.DOMParseException;
 
/**
*
107,7 → 112,7
*/
public String getId() {
 
return renvoyerValeurCorrecte("ci_id_image");
return renvoyerValeurCorrecte("id_image");
}
 
/**
117,7 → 122,7
*/
public String getOrdre() {
 
return renvoyerValeurCorrecte("ci_ordre");
return renvoyerValeurCorrecte("ordre");
}
 
/**
241,13 → 246,13
* @return un tableau de deux string contenant la hauteur puis la largeur
*/
public String[] getTailleImage() {
String[] XY = { renvoyerValeurCorrecte("ci_meta_height"),
renvoyerValeurCorrecte("ci_meta_width") };
String[] XY = { renvoyerValeurCorrecte("hauteur"),
renvoyerValeurCorrecte("largeur") };
return XY;
}
 
public String[] getNote() {
String[] note = { renvoyerValeurCorrecte("ci_note_image") };
String[] note = { renvoyerValeurCorrecte("note_qualite") };
return note;
}
 
258,11 → 263,11
*/
public String getDate() {
 
if(renvoyerValeurCorrecte("ci_meta_date").equals("00/00/0000"))
if(renvoyerValeurCorrecte("date_prise_de_vue").equals("00/00/0000"))
{
return "" ;
}
return renvoyerValeurCorrecte("ci_meta_date");
return renvoyerValeurCorrecte("date_prise_de_vue");
}
 
/**
272,7 → 277,7
*/
public Object getIptcCity() {
 
return renvoyerValeurCorrecte("ci_meta_iptc_city");
return renvoyerValeurCorrecte("");
}
 
/**
282,7 → 287,7
*/
public String getMake() {
 
return renvoyerValeurCorrecte("ci_meta_make");
return renvoyerValeurCorrecte("appareil_fabricant");
}
 
/**
292,7 → 297,7
*/
public String getModel() {
 
return renvoyerValeurCorrecte("ci_meta_model");
return renvoyerValeurCorrecte("appareil_modele");
}
 
/**
301,31 → 306,37
* @return les métadonnées iptc
*/
public String[][] getMetadonnesIptc() {
String[][] metaIptc = {{},{}};
String xml = renvoyerValeurCorrecte("meta_iptc");
String invalidXmlPattern = "[^"
+ "\\u0009\\u000A\\u000D"
+ "\\u0020-\\uD7FF"
+ "\\uE000-\\uFFFD"
+ "\\u10000-\\u10FFFF"
+ "]+";
xml = xml.replaceAll(invalidXmlPattern, " ");
try {
Document d = XMLParser.parse(xml);
NodeList attributs = d.getFirstChild().getChildNodes();
 
String[][] metaIptc = new String[14][2];
int elem = 0;
 
for (Iterator<String> it = this.keySet().iterator(); it.hasNext();) {
 
String key = it.next();
 
// on filtre le "ci"
String type[] = key.split("_", 3);
 
// si c'est une metadonnee exif ou iptc
if (type[1].equals("meta")) {
String[] genre = type[2].split("_", 2);
if (genre[0].equals("iptc")) {
String nom = genre[1];
metaIptc[elem][0] = nom;
metaIptc[elem][1] = renvoyerValeurCorrecte(key);
elem++;
}
 
int taille = attributs.getLength();
metaIptc = new String[taille][2];
for(int i = 0; i < taille; i++) {
XMLParser.removeWhitespace(attributs.item(i));
attributs.item(i).normalize();
metaIptc[i][0] = attributs.item(i).getNodeName();
metaIptc[i][1] = attributs.item(i).getNodeValue();
}
 
}
 
return metaIptc;
} catch(DOMParseException e) {
}
return metaIptc;
}
 
335,31 → 346,35
* @return les métadonnées Exif
*/
public String[][] getMetadonnesExif() {
String[][] metaExif = {{},{}};
String xml = renvoyerValeurCorrecte("meta_exif");
String invalidXmlPattern = "[^"
+ "\\u0009\\u000A\\u000D"
+ "\\u0020-\\uD7FF"
+ "\\uE000-\\uFFFD"
+ "\\u10000-\\u10FFFF"
+ "]+";
xml = xml.replaceAll(invalidXmlPattern, " ");
 
String[][] metaExif = new String[31][2];
int elem = 0;
 
for (Iterator<String> it = this.keySet().iterator(); it.hasNext();) {
 
String key = it.next();
 
// on filtre le "ci"
String type[] = key.split("_", 3);
 
// si c'est une metadonnee exif ou iptc
if (type[1].equals("meta")) {
String[] genre = type[2].split("_", 2);
if (genre[0].equals("exif")) {
String nom = genre[1];
metaExif[elem][0] = nom;
metaExif[elem][1] = renvoyerValeurCorrecte(key);
elem++;
}
 
try {
Document d = XMLParser.parse(xml);
NodeList attributs = d.getFirstChild().getChildNodes();
int taille = attributs.getLength();
metaExif = new String[taille][2];
for(int i = 0; i < taille; i++) {
XMLParser.removeWhitespace(attributs.item(i));
attributs.item(i).normalize();
metaExif[i][0] = attributs.item(i).getNodeName();
metaExif[i][1] = attributs.item(i).getNodeValue();
}
 
}
 
} catch(DOMParseException e) {
}
return metaExif;
 
}
373,11 → 388,11
 
String[][] metaGen = new String[2][2];
 
metaGen[0][0] = "ci_meta_comment";
metaGen[0][1] = this.renvoyerValeurCorrecte("ci_meta_comment");
metaGen[0][0] = "commentaire";
metaGen[0][1] = this.renvoyerValeurCorrecte("commentaire");
 
metaGen[1][0] = "ci_meta_date";
metaGen[1][1] = this.renvoyerValeurCorrecte("ci_meta_date");
metaGen[1][0] = "date_prise_de_vue";
metaGen[1][1] = this.renvoyerValeurCorrecte("date_prise_de_vue");
 
return metaGen;
}
389,7 → 404,7
*/
public String getMotsCles() {
 
return renvoyerValeurCorrecte("ci_meta_mots_cles");
return renvoyerValeurCorrecte("mots_cles");
}
 
/**
402,9 → 417,9
*/
public void miseAJourInfoGenerales(String commentaires, String date,
String note) {
put("ci_meta_comment", commentaires);
put("ci_note_image", note);
put("ci_meta_date", date);
put("commentaire", commentaires);
put("note_qualite", note);
put("date_prise_de_vue", date);
}
 
/**
415,12 → 430,12
*/
public void mettreAjourMotsCles(String motsClesEnCours) {
 
put("ci_meta_mots_cles", motsClesEnCours);
put("mots_cles", motsClesEnCours);
 
}
public void mettreAjourObsAssociees(String idsObsAssociees) {
put("ci_ce_observation", idsObsAssociees);
put("id_observation", idsObsAssociees);
}
/**
429,12 → 444,12
* @return le nom orginal de l'image
*/
public String getNomOriginal() {
return renvoyerValeurCorrecte("ci_nom_original");
return renvoyerValeurCorrecte("nom_original");
}
public String getIdsObsAssociees() {
String observationsAssociees = renvoyerValeurCorrecte("ci_ce_observation");
String observationsAssociees = renvoyerValeurCorrecte("id_observation");
observationsAssociees = observationsAssociees.replaceAll("null", "");
return observationsAssociees;
/trunk/src/org/tela_botanica/client/modeles/LiaisonMotsClesAsynchroneDAO.java
43,13 → 43,12
* @param motcle
* le mots clés à ajouter avec son parent et son identifiant
*/
public void modifier(final Rafraichissable r, String utilisateur, String idObs, String idMC) {
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,Configuration.getServiceBaseUrl()+ "/InventoryKeyWordObsLink/" + utilisateur + "/" +idObs+ "/") ;
RequestBuilder rb = new RequestBuilder(RequestBuilder.POST,Configuration.getServiceBaseUrl()+ "/InventoryKeyWordObsLink/") ;
String postData = "identifiant="
+ utilisateur
String postData = "ce_utilisateur="+utilisateur
+"&observations="+idObs
+"&mots_cles="+URL.encodeComponent(""+idMC);
try {
/trunk/src/org/tela_botanica/client/modeles/NombreImageAsynchroneDAO.java
68,7 → 68,7
// on fait un get asynchrone
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()
+ "/InventoryImageCount/"
+ iModele.getIdentifiant()
+ Utilisateur.getInstance().getIdentifiantUtilisateurConsulte()
+ "/"
+ requete);
try {
85,12 → 85,11
final JSONValue responseValue = JSONParser.parse(response
.getText());
 
// si la requete se passe bien on reçoit un tableau JSON
if (responseValue.isArray() != null) {
// si la requete se passe bien on reçoit une chaine JSON
if (responseValue.isString() != null) {
// qui contient une valeur : le nombre d'images
// correspondant au critères
JSONValue res = responseValue.isArray().get(0);
JSONString reponseNombre = res.isString();
JSONString reponseNombre = responseValue.isString();
int maxImages = Integer.parseInt(reponseNombre
.stringValue());
int[] nbImages = { maxImages };
/trunk/src/org/tela_botanica/client/modeles/ListeEntiteGeographiqueObservationAsynchroneDAO.java
3,7 → 3,9
import org.tela_botanica.client.interfaces.FournisseurListe;
import org.tela_botanica.client.interfaces.Rafraichissable;
import org.tela_botanica.client.observation.ObservationModele;
import org.tela_botanica.client.util.Util;
 
import com.google.gwt.core.client.GWT;
import com.google.gwt.http.client.Request;
import com.google.gwt.http.client.RequestBuilder;
import com.google.gwt.http.client.RequestCallback;
10,6 → 12,7
import com.google.gwt.http.client.RequestException;
import com.google.gwt.http.client.Response;
import com.google.gwt.json.client.JSONArray;
import com.google.gwt.json.client.JSONObject;
import com.google.gwt.json.client.JSONParser;
import com.google.gwt.json.client.JSONString;
import com.google.gwt.json.client.JSONValue;
78,20 → 81,20
// si c'est un tableau
if ((reponse = responseValue.isArray()) != null) {
JSONArray entites;
JSONObject entites;
final int taillemax = reponse.size();
listeEntiteGeographiqueObservation = new ListeEntiteGeographiqueObservation(taillemax);
for (int i = 0; i < taillemax; i++) {
if ((entites = reponse.get(i).isArray()) != null) {
if ((entites = reponse.get(i).isObject()) != null) {
String localite = ((JSONString) entites.get(0)).stringValue();
String commune = ((JSONString) entites.get(1)).stringValue();
String lieuDit = ((JSONString) entites.get(2)).stringValue();
String station = ((JSONString) entites.get(3)).stringValue();
String idZoneGeo = Util.convertirChaineZoneGeoVersDepartement(((JSONString) entites.get("ce_zone_geo")).stringValue());
String zoneGeo = ((JSONString) entites.get("zone_geo")).stringValue();
String lieuDit = ((JSONString) entites.get("lieudit")).stringValue();
String station = ((JSONString) entites.get("station")).stringValue();
EntiteGeographiqueObservation ent = new EntiteGeographiqueObservation(localite, commune, lieuDit, station);
EntiteGeographiqueObservation ent = new EntiteGeographiqueObservation(idZoneGeo, zoneGeo, lieuDit, station);
listeEntiteGeographiqueObservation.put(ent);
}
}