Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 964 → Rev 965

/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;
}