1,5 → 1,7 |
package org.tela_botanica.del.client.composants.moteurrecherche; |
|
import java.util.Map; |
|
import org.tela_botanica.del.client.cache.CacheClient; |
import org.tela_botanica.del.client.composants.formulaires.autocompletion.AutoCompletionComboBoxPresenteur; |
import org.tela_botanica.del.client.composants.formulaires.autocompletion.AutoCompletionComboBoxVue; |
9,6 → 11,7 |
import org.tela_botanica.del.client.config.Config; |
import org.tela_botanica.del.client.modeles.InformationsRecherche; |
import org.tela_botanica.del.client.modeles.ModeRecherche; |
import org.tela_botanica.del.client.services.ReferentielService; |
import org.tela_botanica.del.client.utils.UtilitairesAutoCompletionService; |
|
import com.google.gwt.event.dom.client.ClickEvent; |
19,7 → 22,6 |
import com.google.gwt.event.dom.client.KeyPressEvent; |
import com.google.gwt.event.dom.client.KeyPressHandler; |
import com.google.gwt.http.client.Response; |
import com.google.gwt.user.client.Window; |
import com.google.gwt.user.client.ui.HasWidgets; |
import com.google.gwt.user.client.ui.IsWidget; |
|
94,6 → 96,12 |
|
public HasWidgets getZoneRss(); |
|
public String getReferentiel(); |
|
public void setReferentielLectureSeule(boolean lectureSeule); |
|
void remplirListeReferentiels(Map<String, String> listeReferentiels); |
|
} |
|
private Vue vue; |
134,7 → 142,12 |
if (completionCommunesPresenteur == null) |
this.creerCompletionCommunes(); |
gererEvenements(); |
|
vue.remplirListeReferentiels(ReferentielService.getReferentiels()); |
if(CacheClient.getInstance().getReferentielNonModifiable()) { |
vue.setReferentielLectureSeule(true); |
} |
} |
|
public ModeRecherche getMode() { |
return modeRecherche; |
164,8 → 177,13 |
String url = this.config.getServiceBaseUrl() + "nomstaxons"; |
completionTaxonsPresenteur = new AutoCompletionComboBoxPresenteur(new AutoCompletionComboBoxVue(), url) { |
protected String effectuerPreTraitementChaineRequete(String requete) { |
requete = "?masque.nom=" + requete; |
// si aucun référentiel selectionné, pas de requete |
if(vue.getReferentiel() != null && !vue.getReferentiel().equals("")) { |
requete = "?masque.nom=" + requete + "&masque.referentiel=" + vue.getReferentiel(); |
return UtilitairesAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceSlash(requete); |
} else { |
return null; |
} |
// A décommenter lors de l'utilisation des web services eflore |
// return |
// RetourAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceEflore(requete); |
317,8 → 335,13 |
informationRecherche.setTag(vue.getMotCle()); |
informationRecherche.setAuteur(vue.getAuteur()); |
informationRecherche.setDate(vue.getDate()); |
informationRecherche.setReferentiel(vue.getReferentiel()); |
} |
|
if(CacheClient.getInstance().getReferentielNonModifiable()) { |
informationRecherche.setReferentiel(CacheClient.getInstance().getReferentielCourant()); |
} |
|
if (estPourRechercheImages()) { |
CacheClient.getInstance().setPageCouranteRechercheImages(1); |
CacheClient.getInstance().setInformationsRechercheImage(informationRecherche); |
340,7 → 363,7 |
default: |
// TODO : voir comment gérer les exceptions proprement |
// throw new |
// Exception("Le type de moteur de recherche indiqué n'est pas disponilbe"); |
// Exception("Le type de moteur de recherche indiqué n'est pas disponible"); |
} |
return rechercheLibre; |
} |