Subversion Repositories eFlore/Applications.del

Rev

Rev 1130 | Rev 1393 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1130 Rev 1367
Line 1... Line 1...
1
package org.tela_botanica.del.client.composants.moteurrecherche;
1
package org.tela_botanica.del.client.composants.moteurrecherche;
Line -... Line 2...
-
 
2
 
-
 
3
import java.util.Map;
2
 
4
 
3
import org.tela_botanica.del.client.cache.CacheClient;
5
import org.tela_botanica.del.client.cache.CacheClient;
4
import org.tela_botanica.del.client.composants.formulaires.autocompletion.AutoCompletionComboBoxPresenteur;
6
import org.tela_botanica.del.client.composants.formulaires.autocompletion.AutoCompletionComboBoxPresenteur;
5
import org.tela_botanica.del.client.composants.formulaires.autocompletion.AutoCompletionComboBoxVue;
7
import org.tela_botanica.del.client.composants.formulaires.autocompletion.AutoCompletionComboBoxVue;
6
import org.tela_botanica.del.client.composants.presenteur.Presenteur;
8
import org.tela_botanica.del.client.composants.presenteur.Presenteur;
7
import org.tela_botanica.del.client.composants.rss.RssPresenteur;
9
import org.tela_botanica.del.client.composants.rss.RssPresenteur;
8
import org.tela_botanica.del.client.composants.rss.RssVue;
10
import org.tela_botanica.del.client.composants.rss.RssVue;
9
import org.tela_botanica.del.client.config.Config;
11
import org.tela_botanica.del.client.config.Config;
10
import org.tela_botanica.del.client.modeles.InformationsRecherche;
12
import org.tela_botanica.del.client.modeles.InformationsRecherche;
-
 
13
import org.tela_botanica.del.client.modeles.ModeRecherche;
11
import org.tela_botanica.del.client.modeles.ModeRecherche;
14
import org.tela_botanica.del.client.services.ReferentielService;
Line 12... Line 15...
12
import org.tela_botanica.del.client.utils.UtilitairesAutoCompletionService;
15
import org.tela_botanica.del.client.utils.UtilitairesAutoCompletionService;
13
 
16
 
14
import com.google.gwt.event.dom.client.ClickEvent;
17
import com.google.gwt.event.dom.client.ClickEvent;
15
import com.google.gwt.event.dom.client.ClickHandler;
18
import com.google.gwt.event.dom.client.ClickHandler;
16
import com.google.gwt.event.dom.client.HasClickHandlers;
19
import com.google.gwt.event.dom.client.HasClickHandlers;
17
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
20
import com.google.gwt.event.dom.client.HasKeyPressHandlers;
18
import com.google.gwt.event.dom.client.KeyCodes;
21
import com.google.gwt.event.dom.client.KeyCodes;
19
import com.google.gwt.event.dom.client.KeyPressEvent;
22
import com.google.gwt.event.dom.client.KeyPressEvent;
20
import com.google.gwt.event.dom.client.KeyPressHandler;
-
 
21
import com.google.gwt.http.client.Response;
23
import com.google.gwt.event.dom.client.KeyPressHandler;
22
import com.google.gwt.user.client.Window;
24
import com.google.gwt.http.client.Response;
Line 23... Line 25...
23
import com.google.gwt.user.client.ui.HasWidgets;
25
import com.google.gwt.user.client.ui.HasWidgets;
Line 92... Line 94...
92
		
94
		
Line 93... Line 95...
93
		public HasKeyPressHandlers getChampsContientMots();
95
		public HasKeyPressHandlers getChampsContientMots();
Line -... Line 96...
-
 
96
		
-
 
97
		public HasWidgets getZoneRss();
-
 
98
 
-
 
99
		public String getReferentiel();
-
 
100
		
-
 
101
		public void setReferentielLectureSeule(boolean lectureSeule);
94
		
102
 
Line 95... Line 103...
95
		public HasWidgets getZoneRss();
103
		void remplirListeReferentiels(Map<String, String> listeReferentiels);
96
 
104
 
97
	}
105
	}
Line 132... Line 140...
132
		if (completionTaxonsPresenteur == null)
140
		if (completionTaxonsPresenteur == null)
133
			this.creerCompletionTaxons();
141
			this.creerCompletionTaxons();
134
		if (completionCommunesPresenteur == null)
142
		if (completionCommunesPresenteur == null)
135
			this.creerCompletionCommunes();
143
			this.creerCompletionCommunes();
136
		gererEvenements();
144
		gererEvenements();
-
 
145
		
-
 
146
		vue.remplirListeReferentiels(ReferentielService.getReferentiels());
-
 
147
		if(CacheClient.getInstance().getReferentielNonModifiable()) {
-
 
148
			vue.setReferentielLectureSeule(true);
-
 
149
		}
137
	}
150
	}
Line 138... Line 151...
138
 
151
 
139
	public ModeRecherche getMode() {
152
	public ModeRecherche getMode() {
140
		return modeRecherche;
153
		return modeRecherche;
Line 162... Line 175...
162
 
175
 
163
	private void creerCompletionTaxons() {
176
	private void creerCompletionTaxons() {
164
		String url = this.config.getServiceBaseUrl() + "nomstaxons";
177
		String url = this.config.getServiceBaseUrl() + "nomstaxons";
165
		completionTaxonsPresenteur = new AutoCompletionComboBoxPresenteur(new AutoCompletionComboBoxVue(), url) {
178
		completionTaxonsPresenteur = new AutoCompletionComboBoxPresenteur(new AutoCompletionComboBoxVue(), url) {
-
 
179
			protected String effectuerPreTraitementChaineRequete(String requete) {
-
 
180
				// si aucun référentiel selectionné, pas de requete
166
			protected String effectuerPreTraitementChaineRequete(String requete) {
181
				if(vue.getReferentiel() != null && !vue.getReferentiel().equals("")) {
167
				requete = "?masque.nom=" + requete;
182
					requete = "?masque.nom=" + requete + "&masque.referentiel=" + vue.getReferentiel();
-
 
183
					return UtilitairesAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceSlash(requete);
-
 
184
				} else {
-
 
185
					return null;
168
				return UtilitairesAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceSlash(requete);
186
				}
169
				// A décommenter lors de l'utilisation des web services eflore
187
				// A décommenter lors de l'utilisation des web services eflore
170
				// return
188
				// return
171
				// RetourAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceEflore(requete);
189
				// RetourAutoCompletionService.effectuerPreTraitementChaineRequeteGenreEspeceEflore(requete);
Line 315... Line 333...
315
			informationRecherche.setGenre(vue.getGenre());
333
			informationRecherche.setGenre(vue.getGenre());
316
			informationRecherche.setMotClef(vue.getMotCle());
334
			informationRecherche.setMotClef(vue.getMotCle());
317
			informationRecherche.setTag(vue.getMotCle());
335
			informationRecherche.setTag(vue.getMotCle());
318
			informationRecherche.setAuteur(vue.getAuteur());
336
			informationRecherche.setAuteur(vue.getAuteur());
319
			informationRecherche.setDate(vue.getDate());
337
			informationRecherche.setDate(vue.getDate());
-
 
338
			informationRecherche.setReferentiel(vue.getReferentiel());
-
 
339
		}
-
 
340
		
-
 
341
		if(CacheClient.getInstance().getReferentielNonModifiable()) {
-
 
342
			informationRecherche.setReferentiel(CacheClient.getInstance().getReferentielCourant());
320
		}
343
		}
Line 321... Line 344...
321
 
344
 
322
		if (estPourRechercheImages()) {
345
		if (estPourRechercheImages()) {
323
			CacheClient.getInstance().setPageCouranteRechercheImages(1);
346
			CacheClient.getInstance().setPageCouranteRechercheImages(1);
Line 338... Line 361...
338
			rechercheLibre = vue.getContientMots();
361
			rechercheLibre = vue.getContientMots();
339
			break;
362
			break;
340
		default:
363
		default:
341
			// TODO : voir comment gérer les exceptions proprement
364
			// TODO : voir comment gérer les exceptions proprement
342
			// throw new
365
			// throw new
343
			// Exception("Le type de moteur de recherche indiqué n'est pas disponilbe");
366
			// Exception("Le type de moteur de recherche indiqué n'est pas disponible");
344
		}
367
		}
345
		return rechercheLibre;
368
		return rechercheLibre;
346
	}
369
	}
Line 347... Line 370...
347
 
370