Subversion Repositories eFlore/Archives.cel-v1

Rev

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

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