Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1641 → Rev 1672

/trunk/src/org/tela_botanica/client/modeles/dao/ListeReferentielNomAsynchroneDAO.java
34,8 → 34,8
* Le modèle associé au DAO
*/
private ObservationModele observationModele = null ;
private String referentiel = null;
/**
* Cache
*
61,6 → 61,10
{
ListeReferentielNom referentielNomDataFromCache=null;
if(this.referentiel != referentiel) {
cache.clear();
}
// En cache ?
if ((referentielNomDataFromCache=getFromCache(critere))!=null) {
r.rafraichir(referentielNomDataFromCache,true);
80,7 → 84,8
} else {
urlParams += URL.encode(critere);
}
this.referentiel = referentiel;
RequestBuilder rb = new RequestBuilder(RequestBuilder.GET, Configuration.getServiceBaseUrl()+urlParams);
try {
/trunk/src/org/tela_botanica/client/modeles/dao/ExportObservationsDAO.java
35,7 → 35,11
}
}
Window.open(Configuration.getServiceBaseUrl()+"/InventoryExport/"+identifiant+"/?"+requete,"Export",null) ;
if(requete != "") {
requete += "&";
}
requete += "id_utilisateur="+identifiant+"&format=xls";
Window.open(Configuration.getServiceBaseUrl()+"/CelWidgetExport/export/?"+requete,"Export",null) ;
}
/trunk/src/org/tela_botanica/client/modeles/objets/Observation.java
228,7 → 228,22
return numeroTaxonomique;
}
 
public void setNomRetenu(String nomRetenu) {
this.nomRetenu = nomRetenu;
}
 
public void setNumeroNomenclaturalSaisi(String numeroNomenclaturalSaisi) {
this.numeroNomenclaturalSaisi = numeroNomenclaturalSaisi;
}
 
public void setNumeroNomenclaturalRetenu(String numeroNomenclaturalRetenu) {
this.numeroNomenclaturalRetenu = numeroNomenclaturalRetenu;
}
 
public void setNumeroTaxonomique(String numeroTaxonomique) {
this.numeroTaxonomique = numeroTaxonomique;
}
 
public String getStation() {
return station;
}
/trunk/src/org/tela_botanica/client/util/Util.java
171,7 → 171,9
}
public static String convertirChaineZoneGeoVersDepartement(String chaineZoneGeo) {
return (!chaineZoneGeo.equals("000null") && !chaineZoneGeo.equals("")) ? chaineZoneGeo.replaceAll("INSEE-C:", "").substring(0, 2): chaineZoneGeo;
return (!chaineZoneGeo.equals("000null") && !chaineZoneGeo.equals("") && chaineZoneGeo.replaceAll("INSEE-C:", "").length() >= 2) ?
chaineZoneGeo.replaceAll("INSEE-C:", "").substring(0, 2) :
chaineZoneGeo;
}
public static String convertirChaineZoneGeoVersCodeInsee(String chaineZoneGeo) {
/trunk/src/org/tela_botanica/client/vues/observation/FormulaireImportObservationVue.java
66,7 → 66,7
form.add(holder);
nPan.add(form);
form.setAction(Configuration.getServiceBaseUrl() + "/InventoryImportExcel");
form.setAction(Configuration.getServiceBaseUrl() + "/ImportXLS");
form.addSubmitCompleteHandler(new SubmitCompleteHandler() {
/trunk/src/org/tela_botanica/client/vues/observation/FormulaireSaisieObservationVue.java
819,10 → 819,7
selecteurReferentielTaxo.addListener(new ComboBoxListenerAdapter() {
@Override
public void onSelect(ComboBox comboBox, Record record, int index) {
espece.setValue("");
numeroNom = "";
especeModifiee = true;
public void onSelect(ComboBox comboBox, Record record, int index) {
referentielTaxo = record.getAsString("valeur");
observationMediateur.setRefTaxSelectionne(index);
referentielTaxoModifie = true;
1078,119 → 1075,118
public void rafraichir(Object nouvelleDonnees, boolean repandreRaffraichissement) {
// si l'on a reçu une liste du referentiel commune (completion referentiel commune)
if(nouvelleDonnees instanceof ListeReferentielCommune)
{
ListeReferentielCommune data = (ListeReferentielCommune) nouvelleDonnees ;
Object[][] communeData = new Object[data.size()][3];
int i = 0 ;
// on la parse et on récupère les informations quiç nous interessent
for (Iterator it = data.keySet().iterator(); it.hasNext();)
{
ReferentielCommune ref=data.get(it.next());
communeData[i][0]= ref.getCommune();
communeData[i][1]= ref.getDepartement();
communeData[i][2]= ref.getCodeInsee();
i++ ;
}
if(nouvelleDonnees instanceof ListeReferentielCommune)
{
ListeReferentielCommune data = (ListeReferentielCommune) nouvelleDonnees ;
Object[][] communeData = new Object[data.size()][3];
int i = 0 ;
// on la parse et on récupère les informations quiç nous interessent
for (Iterator it = data.keySet().iterator(); it.hasNext();)
{
ReferentielCommune ref=data.get(it.next());
// creation du store
FieldDef defCommune = new StringFieldDef("commune");
FieldDef defDepartement = new StringFieldDef("departement");
FieldDef defCodeInsee = new StringFieldDef("codeInsee");
FieldDef[] defTab = { defCommune, defDepartement, defCodeInsee};
RecordDef rd = new RecordDef(defTab);
final MemoryProxy dataProxy = new MemoryProxy(communeData);
final ArrayReader reader = new ArrayReader(rd);
Store store=new Store(dataProxy,reader);
commune.setStore(store);
store.load();
communeData[i][0]= ref.getCommune();
communeData[i][1]= ref.getDepartement();
communeData[i][2]= ref.getCodeInsee();
i++ ;
}
// si l'on a reçu une liste du référentiel nom (complétion referentiel nom)
if(nouvelleDonnees instanceof ListeReferentielNom)
{
ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
Object[][] nomData = new Object[data.size()][3];
int i = 0 ;
 
// on la parse et on récupère les informations qui nous interessent
for (Iterator it = data.keySet().iterator(); it.hasNext();)
{
ReferentielNom ref=data.get(it.next());
nomData[i][0]= ref.getNom();
nomData[i][1]= ref.getNumeroNom();
if (ref.getStatut().equals("3")) {
nomData[i][2]="nom_retenu";
}
else {
nomData[i][2]="";
}
i++ ;
}
 
FieldDef defNom = new StringFieldDef("nom");
FieldDef defNumeroNom = new StringFieldDef("numeroNom");
FieldDef indicateurNomRetenu = new StringFieldDef("indicateurNomRetenu");
// creation du store
FieldDef defCommune = new StringFieldDef("commune");
FieldDef defDepartement = new StringFieldDef("departement");
FieldDef defCodeInsee = new StringFieldDef("codeInsee");
FieldDef[] defTab = { defNom, defNumeroNom, indicateurNomRetenu};
RecordDef rd = new RecordDef(defTab);
final MemoryProxy dataProxy = new MemoryProxy(nomData);
final ArrayReader reader = new ArrayReader(rd);
Store store=new Store(dataProxy,reader);
espece.setStore(store);
store.load() ;
}
FieldDef[] defTab = { defCommune, defDepartement, defCodeInsee};
// On recoit une observation dont on veut afficher le detail
RecordDef rd = new RecordDef(defTab);
if(nouvelleDonnees instanceof Observation)
final MemoryProxy dataProxy = new MemoryProxy(communeData);
final ArrayReader reader = new ArrayReader(rd);
Store store=new Store(dataProxy,reader);
commune.setStore(store);
store.load();
}
// si l'on a reçu une liste du référentiel nom (complétion referentiel nom)
if(nouvelleDonnees instanceof ListeReferentielNom)
{
ListeReferentielNom data = (ListeReferentielNom) nouvelleDonnees ;
Object[][] nomData = new Object[data.size()][3];
int i = 0 ;
 
// on la parse et on récupère les informations qui nous interessent
for (Iterator it = data.keySet().iterator(); it.hasNext();)
{
Observation obs = (Observation)nouvelleDonnees ;
setSelectionMultiple(false);
afficherDetailsObservation(obs) ;
}
if(nouvelleDonnees instanceof ListeObservation) {
ListeObservation listeObs = (ListeObservation)nouvelleDonnees;
setSelectionMultiple(true);
calculerAfficherDifferences(listeObs);
ReferentielNom ref=data.get(it.next());
nomData[i][0]= ref.getNom();
nomData[i][1]= ref.getNumeroNom();
if (ref.getStatut().equals("3")) {
nomData[i][2]="nom_retenu";
}
else {
nomData[i][2]="";
}
i++ ;
}
 
FieldDef defNom = new StringFieldDef("nom");
FieldDef defNumeroNom = new StringFieldDef("numeroNom");
FieldDef indicateurNomRetenu = new StringFieldDef("indicateurNomRetenu");
FieldDef[] defTab = { defNom, defNumeroNom, indicateurNomRetenu};
if(nouvelleDonnees instanceof String)
{
String str = (String)nouvelleDonnees ;
observationMediateur.obtenirNombreObservation() ;
}
RecordDef rd = new RecordDef(defTab);
if(nouvelleDonnees instanceof String[]) {
String[] anumNom = (String[])nouvelleDonnees ;
numeroNom = anumNom[1];
espece.setValue(anumNom[0]);
}
final MemoryProxy dataProxy = new MemoryProxy(nomData);
final ArrayReader reader = new ArrayReader(rd);
if(nouvelleDonnees instanceof EntiteGeographiqueObservation)
{
EntiteGeographiqueObservation infosComm = (EntiteGeographiqueObservation)nouvelleDonnees ;
if(rechercheCommuneEnCours) {
afficherIndicationCommune(infosComm);
} else {
rafraichirCommuneEtCoord(infosComm);
}
Store store=new Store(dataProxy,reader);
espece.setStore(store);
store.load() ;
}
// On recoit une observation dont on veut afficher le detail
if(nouvelleDonnees instanceof Observation)
{
Observation obs = (Observation)nouvelleDonnees ;
setSelectionMultiple(false);
afficherDetailsObservation(obs) ;
}
if(nouvelleDonnees instanceof ListeObservation) {
ListeObservation listeObs = (ListeObservation)nouvelleDonnees;
setSelectionMultiple(true);
calculerAfficherDifferences(listeObs);
}
if(nouvelleDonnees instanceof String)
{
String str = (String)nouvelleDonnees ;
observationMediateur.obtenirNombreObservation() ;
}
if(nouvelleDonnees instanceof String[]) {
String[] anumNom = (String[])nouvelleDonnees ;
numeroNom = anumNom[1];
espece.setValue(anumNom[0]);
}
if(nouvelleDonnees instanceof EntiteGeographiqueObservation)
{
EntiteGeographiqueObservation infosComm = (EntiteGeographiqueObservation)nouvelleDonnees ;
if(rechercheCommuneEnCours) {
afficherIndicationCommune(infosComm);
} else {
rafraichirCommuneEtCoord(infosComm);
}
 
}
}
private void afficherIndicationCommune(
1314,7 → 1310,7
public void ajouterObservation() {
if(!Util.verifierDateFormatCel(date.getRawValue()) && !date.getRawValue().equals("")) {
if(date.getRawValue() != null && !date.getRawValue().equals("") && !Util.verifierDateFormatCel(date.getRawValue())) {
Window.alert("Attention la date saisie est invalide, la date doit être au format jj/mm/aaaa");
date.setInvalidText("Date invalide");
return;
1366,7 → 1362,11
 
private void modifierObservation() {
if(!Util.verifierDateFormatCel(date.getRawValue()) && !date.getRawValue().equals("")) {
if(!Window.confirm("Êtes-vous sur de vouloir modifier l'observation sélectionnée ?")) {
return;
}
if(date.getRawValue() != null && !date.getRawValue().equals("") && !Util.verifierDateFormatCel(date.getRawValue())) {
Window.alert("Attention la date saisie est invalide, la date doit être au format jj/mm/aaaa");
date.setInvalidText("Date invalide");
return;
1399,7 → 1399,7
Observation obs=new Observation(espece.getText(),numeroNom,commune.getText(),departement,lieudit.getText(),station.getText(),milieu.getText(), comment.getText(),dateObs);
obs.setNumeroOrdre(numeroOrdre);
String[] coords = getValeurCoordonnees();
obs.setLatitude(coords[0]);
1716,7 → 1716,7
conteneurChampEtenduGauche = new FormPanel();
conteneurChampEtenduDroite = new FormPanel();
if(obs.getChampsEtendus().size() > 0) {
if(obs.getChampsEtendus() != null && obs.getChampsEtendus().size() > 0) {
lienAfficherChampsEtendus.setVisible(true);
conteneurChampEtenduGauche.setAutoWidth(true);
conteneurChampEtenduGauche.setStyle("conteneurChampsEtendus");