Subversion Repositories eFlore/Applications.del

Compare Revisions

Ignore whitespace Rev 445 → Rev 451

/trunk/src/org/tela_botanica/del/client/composants/moteurrecherche/MoteurRechercheVue.java
98,15 → 98,15
}
 
public void chargerValeursRecherchePrecedente(InformationsRecherche informationsRecherche) {
getRecherchePrincipale().setText(informationsRecherche.getRechercheLibre());
getDepartement().setText(informationsRecherche.getDepartement());
getCommune().setText(informationsRecherche.getCommune());
getFamille().setText(informationsRecherche.getFamille());
getGenre().setText(informationsRecherche.getGenre());
getTag().setText(informationsRecherche.getTag());
getMotCle().setText(informationsRecherche.getMotClef());
getAuteur().setText(informationsRecherche.getAuteur());
getDate().setText(informationsRecherche.getDate());
recherchePrincipale.setText(informationsRecherche.getRechercheLibre());
departement.setText(informationsRecherche.getDepartement());
commune.setText(informationsRecherche.getCommune());
famille.setText(informationsRecherche.getFamille());
genre.setText(informationsRecherche.getGenre());
tag.setText(informationsRecherche.getTag());
motCle.setText(informationsRecherche.getMotClef());
auteur.setText(informationsRecherche.getAuteur());
date.setText(informationsRecherche.getDate());
 
afficherLigneInfoRecherche(informationsRecherche);
}
160,16 → 160,16
chargerValeursRecherchePrecedente(new InformationsRecherche());
}
 
public HasText getRecherchePrincipale() {
return recherchePrincipale;
public String getRecherchePrincipale() {
return recherchePrincipale.getText();
}
 
public HasText getDepartement() {
return departement;
public String getDepartement() {
return departement.getText();
}
 
public HasText getCommune() {
return commune;
public String getCommune() {
return commune.getText();
}
 
public HasWidgets getTaxon() {
176,31 → 176,36
return taxon;
}
 
public HasText getFamille() {
return famille;
public String getFamille() {
return famille.getText();
}
 
public HasText getGenre() {
return genre;
public String getGenre() {
return genre.getText();
}
 
public HasText getTag() {
return tag;
public String getTag() {
return tag.getText();
}
 
public HasText getMotCle() {
return motCle;
public String getMotCle() {
return motCle.getText();
}
 
public HasText getAuteur() {
return auteur;
public String getAuteur() {
return auteur.getText();
}
 
public HasText getDate() {
return date;
public String getDate() {
return date.getText();
}
 
public void focusSaisie() {
this.recherchePrincipale.setFocus(true);
}
 
@Override
public void ajouterVue(HasWidgets composite) {
composite.add(this.asWidget());
}
}
/trunk/src/org/tela_botanica/del/client/composants/moteurrecherche/MoteurRecherchePresenteur.java
2,8 → 2,10
 
import org.tela_botanica.del.client.cache.CacheClient;
import org.tela_botanica.del.client.composants.formulaires.AutoCompletionComboBoxPresenteur;
import org.tela_botanica.del.client.composants.formulaires.AutoCompletionComboBoxVue;
import org.tela_botanica.del.client.composants.presenteur.Presenteur;
import org.tela_botanica.del.client.modeles.InformationsRecherche;
import org.tela_botanica.del.client.modeles.ModeRecherche;
import org.tela_botanica.del.client.services.UtilitairesAutoCompletionService;
 
import com.google.gwt.event.dom.client.ClickEvent;
22,67 → 24,42
 
public abstract interface Vue extends IsWidget {
 
public abstract void ajouterVue(HasWidgets composite);
public abstract HasClickHandlers getLienRechercheAvancee();
 
public abstract void basculerAffichageZoneCache();
 
public abstract HasClickHandlers getBoutonRechercheSimple();
 
public abstract HasClickHandlers getBoutonFermer();
 
public abstract HasClickHandlers getBoutonVider();
 
public abstract HasClickHandlers getBoutonRechercheAvancee();
 
public abstract HasKeyPressHandlers getChampSaisie();
 
public abstract HasClickHandlers getChampSaisieCliquable();
 
public abstract String getValeurRechercheSimple();
 
public void setValeurRechercheSimple(String valeurRecherche);
 
public String getLabelRecherche();
 
public HasText getRecherchePrincipale();
 
public HasText getDepartement();
 
public HasText getCommune();
 
public String getRecherchePrincipale();
public String getDepartement();
public String getCommune();
public HasWidgets getTaxon();
 
public HasText getFamille();
 
public HasText getGenre();
 
public HasText getTag();
 
public HasText getMotCle();
 
public HasText getAuteur();
 
public HasText getDate();
 
public String getFamille();
public String getGenre();
public String getTag();
public String getMotCle();
public String getAuteur();
public String getDate();
public void chargerValeursRecherchePrecedente(InformationsRecherche informationsRecherche);
 
public void focusSaisie();
 
public void nettoyer();
}
 
private final Vue vue;
private final boolean pourRechercheImages, pourRechercheObservations;
private boolean pourRechercheImages = false, pourRechercheObservations= false;
 
private AutoCompletionComboBoxPresenteur autoCompletionNomTaxonsPresenteur;
public MoteurRecherchePresenteur(Vue vue, ModeRecherche mode) {
AutoCompletionComboBoxPresenteur completionNomTaxonsPresenteur = new AutoCompletionComboBoxPresenteur(new AutoCompletionComboBoxVue(), UtilitairesAutoCompletionService.urlServiceCompletionNomLocale) {
 
public MoteurRecherchePresenteur(Vue vue, boolean pourRechercheImages, boolean pourRechercheObservations) {
this.vue = vue;
this.pourRechercheImages = pourRechercheImages;
this.pourRechercheObservations = pourRechercheObservations;
 
autoCompletionNomTaxonsPresenteur = new AutoCompletionComboBoxPresenteur(UtilitairesAutoCompletionService.urlServiceCompletionNomLocale) {
 
protected String effectuerPreTraitementChaineRequete(String requete) {
return UtilitairesAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceSlash(requete);
// A décommenter lors de l'utilisation des web services eflore
97,14 → 74,36
// return RetourAutoCompletionService.parserRetourOss(response);
}
};
this.vue = vue;
setMode(mode);
 
autoCompletionNomTaxonsPresenteur = completionNomTaxonsPresenteur;
gererEvenements();
}
private void setMode(ModeRecherche mode) {
switch(mode) {
case MODE_IMAGE:
this.pourRechercheImages = true;
break;
case MODE_OBSERVATION:
this.pourRechercheObservations = true;
}
}
public MoteurRecherchePresenteur(AutoCompletionComboBoxPresenteur presenteurAutoCompletion, Vue vue, ModeRecherche mode) {
this.vue = vue;
setMode(mode);
autoCompletionNomTaxonsPresenteur = presenteurAutoCompletion;
gererEvenements();
}
 
@Override
public void go(HasWidgets composite) {
afficherRequeteEtLancerRecherche();
autoCompletionNomTaxonsPresenteur.go(vue.getTaxon());
composite.add(vue.asWidget());
vue.ajouterVue(composite);
vue.focusSaisie();
}
 
140,9 → 139,9
vue.nettoyer();
 
InformationsRecherche infosRecherche = new InformationsRecherche();
if (isPourRechercheImages()) {
if (estPourRechercheImages()) {
CacheClient.getInstance().setInformationsRechercheImage(infosRecherche);
} else if (isPourRechercheObservations()) {
} else if (estPourRechercheObservations()) {
CacheClient.getInstance().setInformationsRechercheObservation(infosRecherche);
}
}
177,30 → 176,30
});
}
 
private void collecterInfosRecherche() {
public void collecterInfosRecherche() {
InformationsRecherche informationRecherche = new InformationsRecherche();
informationRecherche.setTaxon(autoCompletionNomTaxonsPresenteur.getValeur());
informationRecherche.setDepartement(vue.getDepartement().getText());
informationRecherche.setCommune(vue.getCommune().getText());
informationRecherche.setFamille(vue.getFamille().getText());
informationRecherche.setGenre(vue.getGenre().getText());
informationRecherche.setTag(vue.getTag().getText());
informationRecherche.setMotClef(vue.getMotCle().getText());
informationRecherche.setAuteur(vue.getAuteur().getText());
informationRecherche.setDate(vue.getDate().getText());
informationRecherche.setRechercheLibre(vue.getRecherchePrincipale().getText());
informationRecherche.setDepartement(vue.getDepartement());
informationRecherche.setCommune(vue.getCommune());
informationRecherche.setFamille(vue.getFamille());
informationRecherche.setGenre(vue.getGenre());
informationRecherche.setTag(vue.getTag());
informationRecherche.setMotClef(vue.getMotCle());
informationRecherche.setAuteur(vue.getAuteur());
informationRecherche.setDate(vue.getDate());
informationRecherche.setRechercheLibre(vue.getRecherchePrincipale());
 
if (isPourRechercheImages()) {
if (estPourRechercheImages()) {
CacheClient.getInstance().setInformationsRechercheImage(informationRecherche);
} else if (isPourRechercheObservations()) {
} else if (estPourRechercheObservations()) {
CacheClient.getInstance().setInformationsRechercheObservation(informationRecherche);
}
}
 
private InformationsRecherche getInformationsRechercheEnCache() {
if (isPourRechercheImages()) {
if (estPourRechercheImages()) {
return CacheClient.getInstance().getInformationsRechercheImage();
} else if (isPourRechercheObservations()) {
} else if (estPourRechercheObservations()) {
return CacheClient.getInstance().getInformationsRechercheObservation();
}
return null;
217,11 → 216,19
 
public abstract void lancerRecherche();
 
public boolean isPourRechercheImages() {
public boolean estPourRechercheImages() {
return pourRechercheImages;
}
 
public boolean isPourRechercheObservations() {
public boolean estPourRechercheObservations() {
return pourRechercheObservations;
}
public ModeRecherche getMode() {
if(estPourRechercheImages()) {
return ModeRecherche.MODE_IMAGE;
} else {
return ModeRecherche.MODE_OBSERVATION;
}
}
}