Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 27 | Rev 29 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 27 Rev 28
1
package org.tela_botanica.client;
1
package org.tela_botanica.client;
2
 
2
 
3
 
3
 
4
// TODO : sortie User vers une classe ...
4
// TODO : sortie User vers une classe ...
5
// TODO : sortie les boutons supprimer et exporter et inclure ici
5
// TODO : sortie les boutons supprimer et exporter et inclure ici : vraiment ?
-
 
6
 
-
 
7
// TODO : optimisation, ne pas rechercher stations ou date si non affichés
-
 
8
 
-
 
9
 
-
 
10
 
-
 
11
 
-
 
12
import net.mygwt.ui.client.Style;
-
 
13
import net.mygwt.ui.client.widget.Viewport;
-
 
14
import net.mygwt.ui.client.widget.WidgetContainer;
-
 
15
import net.mygwt.ui.client.widget.layout.BorderLayout;
-
 
16
import net.mygwt.ui.client.widget.layout.BorderLayoutData;
-
 
17
import net.mygwt.ui.client.widget.layout.FillLayout;
6
 
18
 
7
import com.google.gwt.i18n.client.Dictionary;
19
import com.google.gwt.i18n.client.Dictionary;
8
import com.google.gwt.json.client.JSONArray;
20
import com.google.gwt.json.client.JSONArray;
9
import com.google.gwt.json.client.JSONBoolean;
21
import com.google.gwt.json.client.JSONBoolean;
10
import com.google.gwt.json.client.JSONParser;
22
import com.google.gwt.json.client.JSONParser;
11
import com.google.gwt.json.client.JSONString;
23
import com.google.gwt.json.client.JSONString;
12
import com.google.gwt.json.client.JSONValue;
24
import com.google.gwt.json.client.JSONValue;
13
import com.google.gwt.user.client.HTTPRequest;
25
import com.google.gwt.user.client.HTTPRequest;
14
import com.google.gwt.user.client.ResponseTextHandler;
26
import com.google.gwt.user.client.ResponseTextHandler;
15
import com.google.gwt.user.client.ui.TextBox;
27
import com.google.gwt.user.client.ui.TextBox;
16
 
28
 
17
public class Mediator implements AutoCompleteAsyncTextBoxListener {
29
public class Mediator implements AutoCompleteAsyncTextBoxListener {
-
 
30
		
-
 
31
		// General
-
 
32
	
-
 
33
	
-
 
34
		private WidgetContainer west = null;
-
 
35
		private WidgetContainer south = null;
-
 
36
		private WidgetContainer center = null;
18
		
37
		private WidgetContainer north = null;
19
		
38
	
20
		private String serviceBaseUrl = getServiceBaseUrlFromDictionnary(); // Recherche url de base des services distants
39
		private String serviceBaseUrl = getServiceBaseUrlFromDictionnary(); // Recherche url de base des services distants
21
		
40
		
22
		// Utilisateur
41
		// Utilisateur
-
 
42
		
23
		private TopPanel topPanel=null; // Information de connexion
43
		private ConnexionView connexionView=null; // Information de connexion
24
		private String user = null; // Utilisateur connecte ou bien identifiant de session
44
		private String user = null; // Identifiant utilisateur connecte ou bien identifiant de session en cours
25
		private boolean connected=false;
45
		private boolean connected=false; // Positionne a vrai si identification reussie
-
 
46
		
26
 
47
 
27
		// Filtres 
48
		// Filtres sur les releves 
28
		private LeftPanel leftPanel=null; // Containeur filtre date, lieu, lieu-dit ...
49
		private InventoryFilterView inventoryFilterView=null; // Containeur filtre date, lieu, lieu-dit ...
29
		private LocationList locationList = null; // Filtre sur lieu de releve
50
		private LocationFilterPanel locationFilterPanel = null; // Filtre sur lieu de releve
30
		private DateList dateList = null; // Filtre sur date d'observation
51
		private DateFilterPanel dateFilterPanel = null; // Filtre sur date d'observation
31
		private StationList stationList = null; // Filtre sur station d'observation
52
		private StationFilterPanel stationFilterPanel = null; // Filtre sur station d'observation
32
		
53
 
33
		// Saisie d'une observation
54
		// Saisie d'une observation
34
		
55
		
35
		private EntryPanel entryPanel=null;  // Formulaire de saisie observation
56
		private EntryView entryView=null;  // Formulaire de saisie observation
36
	
57
	
37
		private NameAssistant nameAssistant=null; //  Assistant de saisie nom scientifique
58
		private NameAssistant nameAssistant=null; //  Assistant de saisie nom scientifique
38
		private LocationAssistant locationAssistant=null; // Assistant de saisie nom de commune
59
		private LocationAssistant locationAssistant=null; // Assistant de saisie nom de commune
39
		
60
		
40
		private TextBox date = null; // date observation 
61
		private TextBox date = null; // date observation 
41
		private TextBox milieu = null;  // milieu observation
62
		private TextBox milieu = null;  // milieu observation
42
		private TextBox lieudit = null;  // lieu dit observation
63
		private TextBox lieudit = null;  // lieu dit observation
43
		private TextBox comment = null; // commentaire observation
64
		private TextBox comment = null; // commentaire observation
44
		private InventoryItem inventoryItem=null;  // Une observation saisie
65
		private InventoryItem inventoryItem=null;  // Une observation saisie
45
 
66
 
46
 
67
		
-
 
68
		// Liste de releves saisis
47
		// Liste des observations
69
		
-
 
70
		private InventoryListView inventoryListView = null;  // Liste de releves
-
 
71
		
-
 
72
 
48
		private InventoryItemList inventoryItemList = null; // Liste de releves saisis
73
		// Actions sur les releves
-
 
74
		private ActionView actionView=null; // Action sur les observations
49
		private ActionPanel actionPanel=null; // Action sur les observations
75
		private SearchPanel searchPanel = null; // Recherche dans les relevés saisis
50
		
76
 
51
		
77
		
52
		// Informations 
78
		// Informations 
53
		
79
		
54
		private InfoPopup infoPopup=null; // Information complementaire sur un taxon (photo, repartition)
80
		private InfoPopup infoPopup=null; // Information complementaire sur un taxon (photo, repartition)
55
		
81
		
56
 
82
		
57
		// Point d'entree (pour fin d'initialisation)
-
 
-
 
83
		Mediator() {
-
 
84
 
58
 
85
			
-
 
86
			// Recherche identifiant utilisateur connecte
-
 
87
			
-
 
88
			HTTPRequest.asyncGet(serviceBaseUrl + "/User/",
-
 
89
					new ResponseTextHandler() {
-
 
90
 
-
 
91
						public void onCompletion(String str) {
-
 
92
							JSONValue jsonValue = JSONParser.parse(str);
-
 
93
							JSONArray jsonArray;
59
		private Cel cel = null;
94
							if ((jsonArray = jsonValue.isArray()) != null) {
-
 
95
									user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur ou identifiant de session si non connecte
-
 
96
									connected = ((JSONBoolean) jsonArray.get(1)).booleanValue();  // Drapeau leve si utilisateur identifie
60
 
97
							}
-
 
98
							_Mediator();
-
 
99
						}
61
		
100
					});
62
		Mediator() {
101
 
63
			
102
		}
64
		}
103
		
65
		
-
 
66
		
104
		// Fin initialisation
-
 
105
		
67
		// Methodes Private 
106
		private void _Mediator() {
-
 
107
			  
-
 
108
			// Navigateur
68
	
109
			
-
 
110
			Viewport viewport = new Viewport();
-
 
111
			viewport.setStyleName("my-border-layout");
-
 
112
			viewport.setBorders(true);
-
 
113
			viewport.setLayout(new BorderLayout());
-
 
114
 
69
		
115
			
70
		
-
 
71
		/**
116
			center = new WidgetContainer();
72
		 * Recuperation du prefixe d'appel des services
117
			center.setLayout(new BorderLayout());
73
		 * @return prefix appel des service
-
 
74
		 */
-
 
-
 
118
			center.setBorders(true);
75
 
119
 
-
 
120
			west = new WidgetContainer();
-
 
121
			west.setLayout(new FillLayout());
76
		private String getServiceBaseUrlFromDictionnary() {
-
 
77
 
-
 
78
			Dictionary theme = Dictionary.getDictionary("Parameters");
122
			west.setBorders(true);
79
			return theme.get("serviceBaseUrl");
-
 
80
 
-
 
81
		}
-
 
82
 
-
 
83
 
-
 
84
		// Appel aux services :
-
 
85
		
-
 
86
 
-
 
87
		/**
-
 
88
		 * Recherche distante et asynchrone de l'utilisateur connecte, en retour lancement methode initialisation
-
 
-
 
123
			
-
 
124
			south = new WidgetContainer();
-
 
125
			south.setLayout(new FillLayout());
-
 
126
			south.setBorders(true);
-
 
127
 
-
 
128
			north = new WidgetContainer();
-
 
129
			north.setLayout(new FillLayout());
-
 
130
			north.setBorders(true);
-
 
131
 
-
 
132
			    
-
 
133
			inventoryListView = new InventoryListView(this); // Liste de releves 
-
 
134
			connexionView = new ConnexionView(this); // Identifiant de connection
-
 
135
		    
-
 
136
			inventoryFilterView = new InventoryFilterView(this); // Ensemble de filtres sur liste de releves
-
 
137
			entryView = new EntryView(this); // Formulaire de saisie
89
		 * de l'appellant Cel. (initAsync)
-
 
-
 
138
			actionView = new ActionView(this); // Action sur releves saisis
-
 
139
		//	searchPanel = new SearchPanel(this); // Recherche dans releves
90
		 * 
-
 
91
		 */
140
			  
92
		
141
		        
93
		private void getUserFromService() {
142
			  
94
 
143
			//applicationPanel.add(searchPanel);
95
 
144
		      
-
 
145
			
96
			HTTPRequest.asyncGet(serviceBaseUrl + "/User/",
146
		    BorderLayoutData westData = new BorderLayoutData(Style.WEST, 200, 150, 300);
-
 
147
		    westData.resizeable = true;
-
 
148
		    viewport.add(west, westData);
97
					new ResponseTextHandler() {
149
 
98
 
150
		    
99
						public void onCompletion(String str) {
151
		    BorderLayoutData centerData = new BorderLayoutData(Style.CENTER, 400, 400, 800);
100
							JSONValue jsonValue = JSONParser.parse(str);
152
		    viewport.add(center, centerData);
101
							JSONArray jsonArray;
153
 
102
							if ((jsonArray = jsonValue.isArray()) != null) {
154
 
103
									user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur ou identifiant de session si non connecte
155
		    BorderLayoutData northData = new BorderLayoutData(Style.NORTH, 20, 20, 20);
104
									connected = ((JSONBoolean) jsonArray.get(1)).booleanValue();  // Drapeau leve si utilisateur identifie
156
		    viewport.add(north, northData);
105
							}
157
 
106
							cel.initAsync();
158
		    BorderLayoutData southData = new BorderLayoutData(Style.SOUTH, 400, 400, 800);
107
						}
159
//		    viewport.add(south, southData);
108
					});
160
 
109
 
161
		    viewport.layout();
110
		}
162
		    onInit();
111
 
163
 
112
		
164
			    
113
 
165
			  
114
		
166
		// Methodes Private 
115
		// Methodes Public
167
	    }	
116
		
168
		
117
		
169
		
118
		
170
		/**
119
		// Information sur Etat du systeme
171
		 * Recuperation du prefixe d'appel des services
120
		
172
		 * @return prefix appel des service
121
		/**
173
		 */
122
		 * Recuperation information utilisateur
174
 
123
		 *
175
		private String getServiceBaseUrlFromDictionnary() {
124
		 */
176
 
125
		
177
			Dictionary theme = Dictionary.getDictionary("Parameters");
126
		public void initUser() {
178
			return theme.get("serviceBaseUrl");
127
			getUserFromService(); // Appel distant recherche de l'utilisateur
179
 
128
		}
180
		}
129
		
181
		
-
 
182
 
-
 
183
		
-
 
184
		// Methodes Public
-
 
185
		
-
 
186
		
-
 
187
		
-
 
188
		
130
		
189
		
131
		// Actions declanchee par le systeme
190
		// Actions declanchee par le systeme
132
		
191
		
133
		/**
192
		/**
134
		 * Action initialisation premier affichage 
193
		 * Action initialisation premier affichage 
135
		 */
194
		 */
136
		
195
		
137
		public void onInit() {
196
		public void onInit() {
-
 
197
 
138
 
198
			// Filtre par defaut : all et action selection de toutes les stations
139
			
199
			
140
			locationList.setLocation("all");
200
			locationFilterPanel.setLocation("all");
141
			locationList.updateCount();
201
			locationFilterPanel.updateCount();
142
 
202
 
143
			this.onLocationSelected("all");
203
			this.onLocationSelected("all");
144
			
204
			
145
		}
205
		}
146
		
206
		
147
		
207
		
148
		// Actions sur formulaire de saisie 
208
		// Actions sur formulaire de saisie 
149
		
209
		
150
 
210
 
151
		/**
211
		/**
152
		 * Action lancee par la completion d'un nom dans un assistant de saisie
212
		 * Action lancee par la completion d'un nom dans un assistant de saisie
153
		 * Recherche d'information complementaires ....
213
		 * Recherche d'information complementaires ....
154
		 * 
214
		 * 
155
		 * @return void
215
		 * @return void
156
		 */
216
		 */
157
		  
217
		  
158
		public void onComplete(ResponseTextHandler sender, String str, String value) {
218
		public void onComplete(ResponseTextHandler sender, String str, String value) {
159
			
219
			
160
			if (sender instanceof NameAssistant) {
220
			if (sender instanceof NameAssistant) {
161
				onNameCompleted(value);
221
				onNameCompleted(value);
162
			}
222
			}
163
 
223
 
164
		}	
224
		}	
165
		 
225
		 
166
		
226
		
167
		/**
227
		/**
168
		 * Action suivant la completion d'un nom
228
		 * Action suivant la completion d'un nom
169
		 * 
229
		 * 
170
		 */
230
		 */
171
 
231
 
172
		public void  onNameCompleted(String value) {
232
		public void  onNameCompleted(String value) {
173
			if (infoPopup==null) {
233
			if (infoPopup==null) {
174
				infoPopup = new InfoPopup(this);
234
				infoPopup = new InfoPopup(this);
175
			}
235
			}
176
			infoPopup.setImageUrl(value);
236
			infoPopup.setImageUrl(value);
177
		}
237
		}
178
		
238
		
179
 
239
		
-
 
240
		
-
 
241
		
-
 
242
 
180
		
243
		
181
		/**
244
		/**
182
		 * Action prealable a l'ajout d'une observation : controle presence champs requis et lancement mise a jour 
245
		 * Action prealable a l'ajout d'une observation : controle presence champs requis et lancement mise a jour 
183
		 * 
246
		 * 
184
		 */
247
		 */
185
		
248
		
186
		public void onAddInventoryItem() {
249
		public void onAddInventoryItem() {
187
		
250
		
188
			// Lazy instantiation
251
			// Lazy instantiation
189
			if (inventoryItem==null) {
252
			if (inventoryItem==null) {
190
				registerInventoryItem(new InventoryItem());
253
				inventoryItem=new InventoryItem(this);
191
			}
254
			}
192
			
255
			
193
			inventoryItem.setContent(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),milieu.getText(),comment.getText(),"null");
256
			inventoryItem.setContent(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),milieu.getText(),comment.getText(),"null");
194
			inventoryItemList.addelement();
257
			inventoryItem.addelement();
195
			
258
			
196
		}
259
		}
197
		
260
		
198
 
261
 
199
		
262
		
200
		/**
263
		/**
201
		 * Action prealable a la modification d'une observation : controle presence champs requis et lancement mise a jour 
264
		 * Action prealable a la modification d'une observation : controle presence champs requis et lancement mise a jour 
202
		 * 
265
		 * 
203
		 */
266
		 */
204
 
267
 
205
		public void onModifyInventoryItem(String ordre) {
268
		public void onModifyInventoryItem(String ordre) {
206
 
269
 
207
		// Lazy instantiation
270
		// Lazy instantiation
208
		if (inventoryItem==null) {
271
		if (inventoryItem==null) {
209
			registerInventoryItem(new InventoryItem());
272
			inventoryItem=new InventoryItem(this);
210
		}
273
		}
211
 
274
 
212
		inventoryItem.setContent(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),milieu.getText(),comment.getText(),ordre);
275
		inventoryItem.setContent(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),milieu.getText(),comment.getText(),ordre);
213
		inventoryItemList.updateElement();
276
		inventoryItem.updateElement();
214
 
-
 
215
		}
-
 
216
 
-
 
217
		
-
 
218
		public boolean inventoryItemIsValid() {
-
 
219
			// TODO : controle date
-
 
220
			
-
 
221
		    if (inventoryItem.getName().compareTo("")==0) {
-
 
222
		    	return false;
-
 
223
		    }
-
 
224
		    else {
-
 
225
		    	return true;
-
 
226
		    }
-
 
227
			
277
 
228
		}
278
		}
229
 
279
 
230
 
280
 
231
 
281
 
232
		/**
282
		/**
233
		 * Action lancee par la selection d'un nom dans un assistant de saisie. Lance
283
		 * Action lancee par la selection d'un nom dans un assistant de saisie. Lance
234
		 * la recherche d'informations complementaires (famille, numero
284
		 * la recherche d'informations complementaires (famille, numero
235
		 * nomenclaturaux etc) et met a jour l'inventaire (addelement())
285
		 * nomenclaturaux etc) et met a jour l'inventaire (addelement())
236
		 * 
286
		 * 
237
		 * @return void
287
		 * @return void
238
		 */
288
		 */
239
		
289
		
240
		
290
		
241
		public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,
291
		public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,
242
				  String str, String value) {
292
				  String str, String value) {
243
		
293
		
244
		  	if (getEntryPanel().getOrdre()==null) { // Nouvelle observation 
294
		  	if (entryView.getOrdre()==null) { // Nouvelle observation 
245
				     onAddInventoryItem(); 
295
				     onAddInventoryItem(); 
246
			  	}
296
			  	}
247
			else {
297
			else {
248
			     onModifyInventoryItem(getEntryPanel().getOrdre());   // Modification d'une observation
298
			     onModifyInventoryItem(entryView.getOrdre());   // Modification d'une observation
249
			     getEntryPanel().setOrdre(null);
299
			     entryView.setOrdre(null);
250
			 }
300
			 }
251
 
301
 
252
		}
302
		}
253
		
303
		
254
	
304
	
255
		// Action portant sur la liste des observations
305
		// Action portant sur la liste des observations
256
		
306
		
257
		/**
307
		/**
258
		 * Action suite ajout, modification, suppression d'un element inventaire 
308
		 * Action suite ajout, modification, suppression d'un element inventaire 
259
		 */
309
		 */
260
		
310
		
261
	
311
	
262
		public void onInventoryUpdated(String location) {
312
		public void onInventoryUpdated(String location) {
-
 
313
			
-
 
314
			if (location.compareTo("")==0) {
-
 
315
				location="000null";
-
 
316
			}
263
 
317
 
264
			locationList.setLocation(location); // Mise a jour filtre localite
318
			locationFilterPanel.setLocation(location); // Mise a jour filtre localite
265
			locationList.updateCount(); 
319
			locationFilterPanel.updateCount(); 
266
 
320
 
267
			this.onLocationSelected(location); // Selection localite
321
			this.onLocationSelected(location); // Selection localite
268
			
322
			
269
		}
323
		}
270
		
324
		
271
		
325
		
272
		/**
326
		/**
273
		 * Action sur selection d'une observation : affichage du detail
327
		 * Action sur selection d'une observation : affichage du detail
274
		 */
328
		 */
275
		
329
		
276
		public void onInventoryItemSelected(String ordre) {
330
		public void onInventoryItemSelected(String ordre) {
277
		
331
		
278
			entryPanel.setOrdre(ordre); // Mise a jour du formulaire de saisie avec l'element selectionne
332
			entryView.setOrdre(ordre); // Mise a jour du formulaire de saisie avec l'element selectionne
279
			entryPanel.update();
333
			entryView.update();
280
			
334
			
281
		}
335
		}
282
 
336
 
283
		
337
		
284
		/**
338
		/**
285
		 * Action sur deselection d'une observation : remise a zero
339
		 * Action sur deselection d'une observation : remise a zero
286
		 */
340
		 */
287
		
341
		
288
		public void onInventoryItemUnselected(String ordre) {
342
		public void onInventoryItemUnselected() {
289
		
343
		
290
			entryPanel.setOrdre(null); //  Mise a jour du formulaire de saisie avec l'element selectionne
344
			entryView.setOrdre(null); //  Mise a jour du formulaire de saisie avec l'element selectionne
291
			
345
			
292
		}
346
		}
293
 
347
 
294
 
348
 
295
		
349
		
296
		// Action sur Filtrage 
350
		// Action sur Filtrage 
297
 
351
 
298
 
352
 
299
		// Filtre identification 
353
		// Filtre identification 
300
		
354
		
301
		
355
		
302
		/**
356
		/**
303
		 * Action sur login : initialisation filtres pour cette utilisateur
357
		 * Action sur login : initialisation filtres pour cette utilisateur
304
		 * @param user
358
		 * @param user
305
		 */
359
		 */
306
		
360
		
307
		
361
		
308
		public void onLogin(String user) {
362
		public void onLogin(String user) {
309
			
363
			
310
			
364
			
311
			this.user=user;
365
			this.user=user;
312
			topPanel.getSignLabel().setText(user+ " (deconnexion)");
366
			connexionView.getSignLabel().setText(user+ " (deconnexion)");
313
			inventoryItemList.setUser(user);
367
			inventoryListView.setUser(user);
314
			dateList.setUser(user);
368
			dateFilterPanel.setUser(user);
315
			stationList.setUser(user);
369
			stationFilterPanel.setUser(user);
316
			entryPanel.setUser(user);
370
			entryView.setUser(user);
317
			locationList.setUser(user);
371
			locationFilterPanel.setUser(user);
318
			this.onInit();
372
			this.onInit();
319
			
373
			
320
		}
374
		}
321
		
375
		
322
		
376
		
323
		/**
377
		/**
324
		 * Action sur logoff
378
		 * Action sur logoff
325
		 * @param user
379
		 * @param user
326
		 */
380
		 */
327
		
381
		
328
		
382
		
329
		public void onLogoff(String user) {
383
		public void onLogoff(String user) {
330
			
384
			
331
			this.user=user;
385
			this.user=user;
332
			topPanel.getSignLabel().setText("Connexion");
386
			connexionView.getSignLabel().setText("Connexion");
333
			inventoryItemList.setUser(user);
387
			inventoryListView.setUser(user);
334
			dateList.setUser(user);
388
			dateFilterPanel.setUser(user);
335
			stationList.setUser(user);
389
			stationFilterPanel.setUser(user);
336
			entryPanel.setUser(user);
390
			entryView.setUser(user);
337
			locationList.setUser(user);
391
			locationFilterPanel.setUser(user);
338
			this.onInit();
392
			this.onInit();
339
		}
393
		}
340
		
394
		
341
		
395
		
342
		
396
		
343
		// Filtre recherche contenu
397
		// Filtre recherche contenu
344
		
398
		
345
		/**
399
		/**
346
		 * Action sur recherche  : affichage de la liste des taxons correspondants
400
		 * Action sur recherche  : affichage de la liste des taxons correspondants
347
		 */
401
		 */
348
		
402
		
349
		public void onSearch(String search) {
403
		public void onSearch(String search) {
350
	
404
	
351
			if (search.trim().compareTo("")==0) {
405
			if (search.trim().compareTo("")==0) {
352
				search="all";
406
				search="all";
353
			}
407
			}
354
			inventoryItemList.setSearch(search);
408
			inventoryListView.setSearch(search);
355
			inventoryItemList.updateCount();
409
			inventoryListView.updateCount();
356
			
410
			
357
		}
411
		}
358
 
412
 
359
		
413
		
360
		
414
		
361
		// Filtre  selection lieu
415
		// Filtre  selection lieu
362
		
416
		
363
		/**
417
		/**
364
		 * Action sur selection d'un lieu : affichage de la liste des taxons correspondants
418
		 * Action sur selection d'un lieu : affichage de la liste des taxons correspondants au filtrage
365
		 * TODO : gerer asynchronicite ?
-
 
366
		 */
419
		 */
367
		
420
		
368
		public void onLocationSelected(String loc) {
421
		public void onLocationSelected(String loc) {
-
 
422
	
369
		
423
			// Positionnement Filtre affichage
370
			inventoryItemList.setLocation(loc);
424
			inventoryListView.setLocation(loc);
-
 
425
			inventoryListView.updateCount();
371
			inventoryItemList.updateCount();
426
 
372
			
427
			// Affichage des filtres
373
			inventoryItemList.displayFilter();
-
 
-
 
428
			inventoryListView.displayFilter();
-
 
429
 
-
 
430
			// Positionnement Filtre affichage
-
 
431
 
-
 
432
			dateFilterPanel.setLocation(loc);
374
 
433
			dateFilterPanel.updateCount();
375
			dateList.setLocation(loc);
434
 
376
			dateList.updateCount();
435
			// Positionnement Filtre affichage
377
			
436
 
378
			stationList.setLocation(loc);
437
			stationFilterPanel.setLocation(loc);
379
			stationList.updateCount();
438
			stationFilterPanel.updateCount();
380
			
439
			
381
		}
440
		}
382
		
441
		
383
 
442
 
384
		// Filtre station
443
		// Filtre station
385
		
444
		
386
		/**
445
		/**
387
		 * Action sur selection d'une station : affichage de la liste des taxons correspondants
446
		 * Action sur selection d'une station : affichage de la liste des taxons correspondants
388
		 */
447
		 */
389
		
448
		
390
		public void onStationSelected(String station) {
449
		public void onStationSelected(String station) {
391
 
450
 
392
			inventoryItemList.setStation(station);
451
			inventoryListView.setStation(station);
393
			inventoryItemList.updateCount();
452
			inventoryListView.updateCount();
394
			
453
			
395
			inventoryItemList.displayFilter();
454
			inventoryListView.displayFilter();
396
 
455
 
397
 
456
 
398
 
457
 
399
		}
458
		}
400
 
459
 
401
		// Filtre date d'observation
460
		// Filtre date d'observation
402
 
461
 
403
		
462
		
404
		/**
463
		/**
405
		 * Action sur selection d'une date : affichage de la liste des taxons correspondants
464
		 * Action sur selection d'une date : affichage de la liste des taxons correspondants
406
		 */
465
		 */
407
		
466
		
408
		public void onDateSelected(String date) {
467
		public void onDateSelected(String date) {
409
 
468
 
410
			inventoryItemList.setDate(date);
469
			inventoryListView.setDate(date);
411
			inventoryItemList.updateCount();
470
			inventoryListView.updateCount();
412
			
471
			
413
			inventoryItemList.displayFilter();
472
			inventoryListView.displayFilter();
414
 
473
 
415
 
474
 
416
 
475
 
417
		}
476
		}
418
 
477
 
419
		// Declaration, enregistrement 
478
		// Declaration, enregistrement 
420
 
-
 
421
		/**
-
 
422
		 * Declaration InventoryItem  : une observation
-
 
423
		 * @param cel
-
 
424
		 */
-
 
425
 
-
 
426
		public void registerInventoryItem(InventoryItem inventoryItem) {
-
 
427
			
-
 
428
			this.inventoryItem=inventoryItem;
-
 
429
		}
-
 
430
 
-
 
431
 
-
 
432
		
-
 
433
		/**
-
 
434
		 * Declaration InventoryItemList  : liste d'observation
-
 
435
		 * @param inventoryItemList
-
 
436
		 */
-
 
437
		
-
 
438
		public void registerInventoryItemList(InventoryItemList inventoryItemList) {
-
 
439
			
-
 
440
			this.inventoryItemList=inventoryItemList;
-
 
441
		
-
 
442
		}
-
 
443
	
-
 
444
		/**
-
 
445
		 * Declaration LocationList : filtre lieu observation
-
 
446
		 * @param locationList
-
 
447
		 */
-
 
448
		
-
 
449
		public void registerLocationList(LocationList locationList) {
-
 
450
			
-
 
451
			this.locationList=locationList;
-
 
452
		}
-
 
453
	
-
 
454
		
-
 
455
		
-
 
456
		/**
-
 
457
		 * Declaration DateList : filtre date observation
-
 
458
		 * @param locationList
-
 
459
		 */
-
 
460
		
-
 
461
		public void registerDateList(DateList dateList) {
-
 
462
			
-
 
463
			this.dateList=dateList;
-
 
464
		}
-
 
465
 
-
 
466
		
-
 
467
		/**
-
 
468
		 * Declaration InfoPopup : information complementaire taxon en cours
-
 
469
		 * @param infoPopup
-
 
470
		 */
-
 
471
		
-
 
472
		public void registerInfoPopup(InfoPopup infoPopup) {
-
 
473
			
-
 
474
			this.infoPopup=infoPopup;
-
 
475
		}
-
 
476
 
-
 
477
 
-
 
478
		
-
 
479
		/**
-
 
480
		 * Declaration StationList : filtre par station
-
 
481
		 * @param locationList
-
 
482
		 */
-
 
483
		
-
 
484
		public void registerStationList(StationList stationList) {
-
 
485
			
-
 
486
			this.stationList=stationList;
-
 
487
		}
-
 
488
 
-
 
489
		
-
 
490
		
-
 
491
		/**
-
 
492
		 * Declaration Cel : point d'entree
-
 
493
		 * @param cel
-
 
494
		 */
-
 
495
 
-
 
496
		public void registerCel(Cel cel) {
-
 
497
			
-
 
498
			this.cel=cel;
-
 
499
		}
-
 
500
 
-
 
501
		
-
 
502
		/**
-
 
503
		 * Declaration NameAssistant  : completion nom scientifique
-
 
504
		 * @param nameassistant
-
 
505
		 */
-
 
506
		
-
 
507
		public void registerNameAssistant(NameAssistant nameAssistant) {
-
 
508
			this.nameAssistant=nameAssistant;
-
 
509
			
-
 
510
		}
-
 
511
		
-
 
512
		/**
-
 
513
		 * Declaration LocationAssistant : completion commune
-
 
514
		 * @param locationassistant
-
 
515
		 */
-
 
516
		
-
 
517
		public void registerLocationAssistant(LocationAssistant locationAssistant) {
-
 
518
			this.locationAssistant=locationAssistant;
-
 
519
			
-
 
520
		}
479
		
521
 
480
 
522
	
481
 
523
		
482
		
524
		/**
483
		/**
525
		 * Declaration date : date observation
484
		 * Declaration date : date observation
526
		 * @param date
485
		 * @param date
527
		 */
486
		 */
528
		
487
		
529
		public void registerDate(TextBox date) {
488
		public void registerDate(TextBox date) {
530
			this.date=date;
489
			this.date=date;
531
			
490
			
532
		}
491
		}
533
	
492
	
534
	
493
	
535
		
494
		
536
		/**
495
		/**
537
		 * Declaration lieu dit : lieu dit d'observation
496
		 * Declaration lieu dit : lieu dit d'observation
538
		 * 
497
		 * 
539
		 * @param milieu
498
		 * @param milieu
540
		 */
499
		 */
541
		
500
		
542
		public void registerLieudit(TextBox lieudit) {
501
		public void registerLieudit(TextBox lieudit) {
543
			this.lieudit=lieudit;
502
			this.lieudit=lieudit;
544
			
503
			
545
		}
504
		}
546
 
505
 
547
 
506
 
548
		
507
		
549
		/**
508
		/**
550
		 * Declaration milieu : milieu d'observation
509
		 * Declaration milieu : milieu d'observation
551
		 * 
510
		 * 
552
		 * @param milieu
511
		 * @param milieu
553
		 */
512
		 */
554
		
513
		
555
		public void registerMilieu(TextBox milieu) {
514
		public void registerMilieu(TextBox milieu) {
556
			this.milieu=milieu;
515
			this.milieu=milieu;
557
			
516
			
558
		}
517
		}
559
 
518
		
560
		/**
519
		/**
561
		 * Declaration Entry Panel : formulaire de saisie observation
520
		 * Declaration commentaire b 
-
 
521
		 * @param commentaire
562
		 */
522
		 */
-
 
523
		
-
 
524
		public void registerComment(TextBox comment) {
563
 
-
 
564
		
-
 
565
	    public void  registerEntryPanel(EntryPanel entryPanel) {
525
			this.comment=comment;
566
	    	this.entryPanel=entryPanel;
526
			
567
		}
527
		}
568
 
528
		
569
 
529
 
570
		/**
530
		/**
571
		 * Declaration Action Panel : actions sur liste des observations
531
		 * Declaration NameAssistant  : completion nom scientifique
-
 
532
		 * @param nameassistant
572
		 */
533
		 */
-
 
534
		
-
 
535
		public void registerNameAssistant(NameAssistant nameAssistant) {
573
 
-
 
574
	    
-
 
575
	    public void  registerActionPanel(ActionPanel actionPanel) {
536
			this.nameAssistant=nameAssistant;
576
	    	this.actionPanel=actionPanel;
537
			
577
		}
538
		}
578
 
539
		
579
 
540
	
580
		/**
541
		/**
581
		 * Declaration TopPanel : panneau de connexion
542
		 * Declaration DateFilterPanel : filtre date observation
-
 
543
		 * @param locationList
582
		 */
544
		 */
-
 
545
		
583
	    
-
 
584
 
546
		public void registerDateFilterPanel(DateFilterPanel dateFilterPanel) {
585
	    public void  registerTopPanel(TopPanel topPanel) {
547
			
586
	    	this.topPanel=topPanel;
548
			this.dateFilterPanel=dateFilterPanel;
587
		}
549
		}
588
 
550
 
589
	    
551
		
590
	    
552
 
591
		/**
553
		/**
592
		 * Declaration commentaire 
554
		 * Declaration LocationAssistant : completion commune
593
		 * @param commentaire
555
		 * @param locationassistant
594
		 */
556
		 */
595
		
557
		
596
		public void registerComment(TextBox comment) {
558
		public void registerLocationAssistant(LocationAssistant locationAssistant) {
597
			this.comment=comment;
559
			this.locationAssistant=locationAssistant;
598
			
560
			
599
		}
561
		}
-
 
562
 
-
 
563
		/**
-
 
564
		 * Declaration LocationFilterPanel : filtre lieu observation
-
 
565
		 * @param locationList
-
 
566
		 */
-
 
567
		
-
 
568
		public void registerLocationFilterPanel(LocationFilterPanel locationFilterPanel) {
-
 
569
			
-
 
570
			this.locationFilterPanel=locationFilterPanel;
-
 
571
		}
600
		
572
	
601
 
573
		
602
		/* 
574
		/**
603
		 * Declaration LeftPanel Panneau gauche filtre sur liste d'observation
575
		 * Declaration StationFilterPanel : filtre par station
604
		 * 
576
		 * @param locationList
605
		 */
-
 
-
 
577
		 */
606
		
578
		
607
		public void registerLeftPanel(LeftPanel leftPanel) {
579
		public void registerStationFilterPanel(StationFilterPanel stationFilterPanel) {
608
			this.leftPanel=leftPanel;
580
			
609
			
581
			this.stationFilterPanel=stationFilterPanel;
610
		}
582
		}
611
		
583
 
-
 
584
		
612
		
585
		
613
		// Accesseurs et setteurs
586
		// Accesseurs et setteurs
614
		
587
		
615
		
588
		
616
		/**
589
		/**
617
		 * Accesseur Url de base
590
		 * Accesseur Url de base
618
		 * @return Url de base
591
		 * @return Url de base
619
		 */
592
		 */
620
		
593
		
621
		public String getServiceBaseUrl() {
594
		public String getServiceBaseUrl() {
622
			
595
			
623
			return serviceBaseUrl;
596
			return serviceBaseUrl;
624
 
597
 
625
		}
598
		}
626
 
599
 
627
	
600
	
628
		/**
601
		/**
629
		 *  Accesseur Utilisateur
602
		 *  Accesseur Utilisateur
630
		 * @return utilisateur connecte ou identifiant de session
603
		 * @return utilisateur connecte ou identifiant de session
631
		 */
604
		 */
632
		
605
		
633
		public String getUser() {
606
		public String getUser() {
634
			return user;
607
			return user;
635
		}
608
		}
636
 
609
 
637
		public void setUser(String user) {
610
		public void setUser(String user) {
638
			this.user=user;
611
			this.user=user;
639
		}
612
		}
-
 
613
 
-
 
614
		public WidgetContainer getCenterContainer() {
-
 
615
			return center;
-
 
616
		}
-
 
617
		
-
 
618
		public WidgetContainer getNorthContainer() {
-
 
619
			return north;
640
 
620
		}
641
		
621
 
642
		public InventoryItemList getInventoryItemList() {
622
		public WidgetContainer getWestContainer() {
643
			return inventoryItemList;
623
			return west;
644
		}
624
		}
645
 
625
 
-
 
626
		public WidgetContainer getSouthContainer() {
646
		public LocationList getLocationList() {
627
			return south;
647
			return locationList;
628
		}
648
		}
629
 
-
 
630
		
-
 
631
		public InventoryListView getInventoryListView() {
-
 
632
			return inventoryListView;
649
 
633
		}
650
		public DateList getDateList() {
634
 
651
			return dateList;
635
		public LocationFilterPanel getLocationList() {
652
		}
636
			return locationFilterPanel;
653
 
637
		}
654
		
638
 
655
		public NameAssistant getNameAssistant() {
639
		public NameAssistant getNameAssistant() {
656
			return nameAssistant;
640
			return nameAssistant;
657
		}
641
		}
658
 
642
 
659
		public LocationAssistant getLocationAssistant() {
643
		public LocationAssistant getLocationAssistant() {
660
			return locationAssistant;
644
			return locationAssistant;
661
		}
645
		}
662
 
646
 
663
		public InventoryItem getInventoryItem() {
647
		public InventoryItem getInventoryItem() {
664
			return inventoryItem;
648
			return inventoryItem;
665
		}
649
		}
666
 
650
 
667
		public EntryPanel getEntryPanel() {
651
		public EntryView entryView() {
668
			return entryPanel;
652
			return entryView;
669
		}
653
		}
670
 
654
 
671
 
655
 
672
		public LeftPanel getLeftPanel() {
656
		public InventoryFilterView getInventoryFilterView() {
673
			return leftPanel;
657
			return inventoryFilterView;
674
		}
658
		}
675
 
659
 
676
		public InfoPopup getInfoPopup() {
660
		public InfoPopup getInfoPopup() {
677
			if (infoPopup==null) {
661
			if (infoPopup==null) {
678
				infoPopup = new InfoPopup(this);
662
				infoPopup = new InfoPopup(this);
679
			}
663
			}
680
			return infoPopup;
664
			return infoPopup;
681
		}
665
		}
682
 
666
 
683
		public void setConnected(boolean connected) {
667
		public void setConnected(boolean connected) {
684
		
668
		
685
			this.connected=connected;
669
			this.connected=connected;
686
		}
670
		}
687
		
671
		
688
		public boolean getConnected() {
672
		public boolean getConnected() {
689
			
673
			
690
			return this.connected;
674
			return this.connected;
691
		}
675
		}
692
 
676
 
693
		
677
		
694
		public ActionPanel getActionPanel() {
678
		public ActionView getActionView() {
695
			
679
			
696
			return this.actionPanel;
680
			return this.actionView;
697
		}
681
		}
698
 
682
 
699
	}
683
	}