Subversion Repositories eFlore/Applications.cel

Rev

Rev 2 | Rev 12 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 7
Line 1... Line 1...
1
package org.tela_botanica.client.observation;
1
package org.tela_botanica.client.observation;
Line 2... Line -...
2
 
-
 
3
 
-
 
4
 
-
 
5
 
2
 
6
import org.tela_botanica.client.CarnetEnLigneMediateur;
3
import org.tela_botanica.client.CarnetEnLigneMediateur;
7
import org.tela_botanica.client.interfaces.iMediateur;
4
import org.tela_botanica.client.interfaces.iMediateur;
8
import org.tela_botanica.client.interfaces.iRetourObservation;
5
import org.tela_botanica.client.interfaces.iRetourObservation;
Line 12... Line 9...
12
import com.google.gwt.user.client.ui.RootPanel;
9
import com.google.gwt.user.client.ui.RootPanel;
13
import com.google.gwt.user.client.ui.VerticalPanel;
10
import com.google.gwt.user.client.ui.VerticalPanel;
Line 14... Line 11...
14
 
11
 
Line 15... Line -...
15
public class ObservationMediateur implements iMediateur{
-
 
16
 
12
public class ObservationMediateur implements iMediateur {
17
 
13
 
Line 18... Line 14...
18
	// Evenenements
14
	// Evenenements
Line 19... Line -...
19
	final static public  int NOMBRE_OBSERVATION=1;
-
 
20
 
15
	final static public int NOMBRE_OBSERVATION = 1;
-
 
16
 
21
	final static public  int LISTE_OBSERVATION=2;
17
	final static public int LISTE_OBSERVATION = 2;
Line 22... Line 18...
22
	
18
 
Line 23... Line 19...
23
	
19
	private CarnetEnLigneMediateur carnetEnLigneMediateur = null; // Mediateur
24
	private CarnetEnLigneMediateur carnetEnLigneMediateur=null;  // Mediateur General
20
																	// General
Line 25... Line 21...
25
	private final ObservationModele observationModele=new ObservationModele();
21
	private final ObservationModele observationModele = new ObservationModele();
Line 26... Line 22...
26
 
22
 
-
 
23
	private Observation observation = null;
27
	private Observation observation=null; 
24
 
-
 
25
	// Variable interne
-
 
26
	private final String texteDeconnexion = "Utilisez ce carnet en ligne pour saisir vos observations, <u>identifiez-vous</u> pour les transmettre à Tela Botanica";
-
 
27
 
28
 
28
	// Composants graphiques
-
 
29
 
Line 29... Line 30...
29
	// Variable interne 
30
	private EtatConnexionVue etatConnexionVue = null; // Vue Etat de la
Line 30... Line -...
30
	private final String texteDeconnexion="Utilisez ce carnet en ligne pour saisir vos observations, <u>identifiez-vous</u> pour les transmettre à Tela Botanica"; 
-
 
31
 
31
														// connexion utilisateur
Line 32... Line -...
32
	// Composants graphiques
-
 
33
	
32
	private FormulaireDeConnexionVue formulaireDeConnexionVue = null; // Formulaire
Line 34... Line 33...
34
	private EtatConnexionVue etatConnexionVue=null; // Vue Etat de la connexion utilisateur
33
																		// de
35
	private FormulaireDeConnexionVue formulaireDeConnexionVue=null; // Formulaire de connexion utilisateur
34
																		// connexion
Line 50... Line 49...
50
		
49
 
Line 51... Line 50...
51
		panel.add(etatConnexionVue);
50
		panel.add(etatConnexionVue);
Line 52... Line -...
52
	
-
 
53
		panel.add(listeObservationsVue);
51
 
Line 54... Line 52...
54
	
52
		panel.add(listeObservationsVue);
Line 55... Line 53...
55
 
53
 
Line 56... Line -...
56
		RootPanel.get().add(panel);
-
 
57
		
54
		RootPanel.get().add(panel);
Line 58... Line 55...
58
		onInitialisation();
55
 
59
		
56
		onInitialisation();
60
	}
57
 
61
 
58
	}
62
	
59
 
Line 63... Line 60...
63
	/// Methodes privees 
60
	// / Methodes privees
Line 64... Line -...
64
 
-
 
65
	/**
61
 
66
	 * 
62
	/**
Line 67... Line -...
67
	 * Initialisations
-
 
68
	 * 
63
	 * 
Line 69... Line 64...
69
	 */
64
	 * Initialisations
Line 70... Line 65...
70
	
65
	 * 
71
	private void onInitialisation() {
66
	 */
-
 
67
 
72
	
68
	private void onInitialisation() {
Line 73... Line 69...
73
	
69
 
-
 
70
		afficheEtatConnexion();
Line 74... Line 71...
74
		afficheEtatConnexion();
71
		onFiltrageListeObservation("all", "all", "all");
75
		onFiltrageListeObservation("all","all","all");
72
 
76
		
73
	}
77
	
74
 
78
	}
75
	// Filtre selection lieu
Line 79... Line 76...
79
	
76
 
80
	// Filtre  selection lieu
77
	/**
Line 81... Line -...
81
	
-
 
82
	/**
78
	 * Action sur selection d'un lieu : affichage de la liste des taxons
Line 83... Line -...
83
	 * Action sur selection d'un lieu : affichage de la liste des taxons correspondants au filtrage
-
 
84
	 */
-
 
85
	
-
 
86
	public void onFiltrageListeObservation(String id_loc, String loc,String lieu) {
-
 
87
 
79
	 * correspondants au filtrage
Line 88... Line -...
88
		// Positionnement Filtre affichage
-
 
89
		listeObservationsVue.setIdLocation(id_loc);
80
	 */
90
		listeObservationsVue.setLocalite(loc);
81
 
91
		listeObservationsVue.setLieudit(lieu);
82
	public void onFiltrageListeObservation(String id_loc, String loc,
Line 92... Line -...
92
		listeObservationsVue.initialiser();
-
 
93
 
83
			String lieu) {
94
		// Affichage des filtres
84
 
95
		listeObservationsVue.displayFilter();
85
		// Positionnement Filtre affichage
96
 
-
 
97
		
86
		listeObservationsVue.setIdLocation(id_loc);
98
	}
87
		listeObservationsVue.setLocalite(loc);
-
 
88
		listeObservationsVue.setLieudit(lieu);
-
 
89
		listeObservationsVue.initialiser();
99
	
90
 
Line 100... Line 91...
100
 
91
		// Affichage des filtres
Line 101... Line -...
101
 
-
 
102
 
92
		listeObservationsVue.displayFilter();
103
	
93
 
104
	/// UTILISATEUR
94
	}
105
 
95
 
106
	
96
	// / UTILISATEUR
Line 137... Line 127...
137
		  formulaireDeConnexionVue.setPopupPosition(left, top);
127
		formulaireDeConnexionVue.setPopupPosition(left, top);
138
		  formulaireDeConnexionVue.show();
128
		formulaireDeConnexionVue.show();
Line 139... Line 129...
139
		
129
 
Line 140... Line -...
140
	}
-
 
141
 
130
	}
142
	
131
 
143
	/**
132
	/**
Line 144... Line 133...
144
	 * Deconnexion de l'utilisateur en cours 
133
	 * Deconnexion de l'utilisateur en cours
Line 149... Line 138...
149
	//	carnetEnLigneMediateur.addListener(CarnetEnLigneMediateur.DECONNEXION,this);
138
		// carnetEnLigneMediateur.addListener(CarnetEnLigneMediateur.DECONNEXION,this);
150
		carnetEnLigneMediateur.deconnecterUtilisateur();
139
		carnetEnLigneMediateur.deconnecterUtilisateur();
Line 151... Line 140...
151
	
140
 
Line 152... Line -...
152
	}
-
 
153
 
141
	}
154
 
142
 
-
 
143
	/**
155
	/**
144
	 * Tentative de connexion utilisateur
156
	 * Tentative de connexion utilisateur
145
	 * 
157
	 * @param login
146
	 * @param login
Line 158... Line -...
158
	 * @param password
-
 
159
	 */
147
	 * @param password
Line 160... Line 148...
160
	
148
	 */
161
	
149
 
Line 162... Line 150...
162
	public void connecterUtilisateur(String login, String password) {
150
	public void connecterUtilisateur(String login, String password) {
Line 163... Line -...
163
		
-
 
164
	//	carnetEnLigneMediateur.addListener(CarnetEnLigneMediateur.CONNEXION,this);
-
 
165
		carnetEnLigneMediateur.connecterUtilisateur(login, password);
151
 
Line 166... Line 152...
166
 
152
		// carnetEnLigneMediateur.addListener(CarnetEnLigneMediateur.CONNEXION,this);
167
	}
153
		carnetEnLigneMediateur.connecterUtilisateur(login, password);
-
 
154
 
168
 
155
	}
169
 
156
 
Line -... Line 157...
-
 
157
	// / OBSERVATION
-
 
158
 
-
 
159
	/**
Line 170... Line -...
170
 
-
 
171
	/// OBSERVATION
-
 
172
	
-
 
173
	/**
160
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en
174
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
-
 
175
	 * 
161
	 * cours
176
	 */
162
	 * 
177
	
163
	 */
178
	
164
 
Line 179... Line -...
179
	public void getNombreObservation (String identifiantLocalite, String localite, String annee,  String mois,  String jour, String lieudit, String rechercheLibre ) {
-
 
-
 
165
	public void getNombreObservation(String identifiantLocalite,
180
		
166
			String localite, String annee, String mois, String jour,
-
 
167
			String lieudit, String rechercheLibre) {
Line 181... Line 168...
181
 
168
 
Line 182... Line -...
182
		observationModele.getNombreObservation(
-
 
183
				new iRetourObservation() {
-
 
184
					public void onRetour(Observation obs) {
169
		observationModele.getNombreObservation(new iRetourObservation() {
Line -... Line 170...
-
 
170
			public void onRetour(Observation obs) {
-
 
171
				observation = obs;
185
						observation=obs;
172
				// fireEvent(NOMBRE_OBSERVATION);
186
						//fireEvent(NOMBRE_OBSERVATION); 
-
 
Line 187... Line 173...
187
					}
173
			}
188
 
-
 
189
					
174
 
190
				}, carnetEnLigneMediateur.getUtilisateur().getIdentifiant(), identifiantLocalite, localite , annee, mois, jour, lieudit ,rechercheLibre
175
		}, carnetEnLigneMediateur.getUtilisateur().getIdentifiant(),
191
				
176
				identifiantLocalite, localite, annee, mois, jour, lieudit,
192
		);
177
				rechercheLibre
Line 193... Line -...
193
		
-
 
-
 
178
 
194
		
179
		);
-
 
180
 
Line 195... Line 181...
195
		  
181
	}
Line 196... Line 182...
196
	}
182
 
Line 197... Line -...
197
 
-
 
198
	 public void getListeObservation (String identifiantLocalite, String localite, String annee, String mois, String jour, String lieudit, String rechercheLibre, int debut, int longueur) {
-
 
199
 
183
	public void getListeObservation(String identifiantLocalite,
200
			
184
			String localite, String annee, String mois, String jour,
201
			observationModele.getListeObservation(
185
			String lieudit, String rechercheLibre, int debut, int longueur) {
Line 202... Line -...
202
					new iRetourObservation() {
-
 
203
						public void onRetour(Observation obs) {
-
 
204
							observation=obs;
-
 
205
							//fireEvent(LISTE_OBSERVATION); 
186
 
Line 206... Line 187...
206
						}
187
		observationModele.getListeObservation(new iRetourObservation() {
207
 
188
			public void onRetour(Observation obs) {
208
						
189
				observation = obs;
209
					}, carnetEnLigneMediateur.getUtilisateur().getIdentifiant(), identifiantLocalite, localite , annee, mois, jour, lieudit ,rechercheLibre, debut, longueur
190
				// fireEvent(LISTE_OBSERVATION);
210
					
191
			}
211
			);
192
 
212
 
-
 
213
	}
193
		}, carnetEnLigneMediateur.getUtilisateur().getIdentifiant(),
214
 
-
 
215
 
-
 
216
			
194
				identifiantLocalite, localite, annee, mois, jour, lieudit,
217
	 public Observation getObservation() {
195
				rechercheLibre, debut, longueur
218
			return observation;
196
 
219
	}
-
 
220
 
-
 
221
 
-
 
222
	
197
		);
223
 
-
 
224
	/// EVENEMENTS 
198
 
225
	
199
	}
226
/**
-
 
227
 * Evenements
-
 
228
 * 
200
 
Line 229... Line -...
229
 */	
-
 
230
	/*
-
 
231
	public void handleEvent(BaseEvent be) {
-
 
232
		switch (be.type) {
-
 
233
			case CarnetEnLigneMediateur.DECONNEXION:
-
 
234
				afficheEtatConnexion();
-
 
235
				break;
201
	public Observation getObservation() {