Subversion Repositories eFlore/Archives.cel-v1

Rev

Rev 27 | Rev 29 | Go to most recent revision | Only display areas with differences | Ignore 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
		
18
		
31
		// General
-
 
32
	
-
 
33
	
-
 
34
		private WidgetContainer west = null;
-
 
35
		private WidgetContainer south = null;
-
 
36
		private WidgetContainer center = null;
-
 
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
23
		private TopPanel topPanel=null; // Information de connexion
-
 
24
		private String user = null; // Utilisateur connecte ou bien identifiant de session
-
 
25
		private boolean connected=false;
-
 
26
 
-
 
27
		// Filtres 
-
 
28
		private LeftPanel leftPanel=null; // Containeur filtre date, lieu, lieu-dit ...
-
 
29
		private LocationList locationList = null; // Filtre sur lieu de releve
-
 
30
		private DateList dateList = null; // Filtre sur date d'observation
-
 
31
		private StationList stationList = null; // Filtre sur station d'observation
-
 
-
 
42
		
-
 
43
		private ConnexionView connexionView=null; // Information de connexion
-
 
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
-
 
46
		
-
 
47
 
-
 
48
		// Filtres sur les releves 
-
 
49
		private InventoryFilterView inventoryFilterView=null; // Containeur filtre date, lieu, lieu-dit ...
-
 
50
		private LocationFilterPanel locationFilterPanel = null; // Filtre sur lieu de releve
-
 
51
		private DateFilterPanel dateFilterPanel = null; // Filtre sur date 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
 
-
 
46
 
-
 
47
		// Liste des observations
-
 
48
		private InventoryItemList inventoryItemList = null; // Liste de releves saisis
-
 
-
 
66
 
-
 
67
		
-
 
68
		// Liste de releves saisis
-
 
69
		
-
 
70
		private InventoryListView inventoryListView = null;  // Liste de releves
-
 
71
		
-
 
72
 
-
 
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
		
-
 
56
 
-
 
57
		// Point d'entree (pour fin d'initialisation)
-
 
58
 
-
 
59
		private Cel cel = null;
-
 
60
 
81
		
-
 
82
		
-
 
83
		Mediator() {
-
 
84
 
-
 
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;
-
 
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
-
 
97
							}
-
 
98
							_Mediator();
61
		
99
						}
-
 
100
					});
-
 
101
 
-
 
102
		}
-
 
103
		
-
 
104
		// Fin initialisation
-
 
105
		
-
 
106
		private void _Mediator() {
-
 
107
			  
-
 
108
			// Navigateur
-
 
109
			
-
 
110
			Viewport viewport = new Viewport();
-
 
111
			viewport.setStyleName("my-border-layout");
-
 
112
			viewport.setBorders(true);
-
 
113
			viewport.setLayout(new BorderLayout());
-
 
114
 
-
 
115
			
-
 
116
			center = new WidgetContainer();
-
 
117
			center.setLayout(new BorderLayout());
-
 
118
			center.setBorders(true);
-
 
119
 
-
 
120
			west = new WidgetContainer();
-
 
121
			west.setLayout(new FillLayout());
-
 
122
			west.setBorders(true);
-
 
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
-
 
138
			actionView = new ActionView(this); // Action sur releves saisis
-
 
139
		//	searchPanel = new SearchPanel(this); // Recherche dans releves
-
 
140
			  
-
 
141
		        
-
 
142
			  
-
 
143
			//applicationPanel.add(searchPanel);
-
 
144
		      
-
 
145
			
-
 
146
		    BorderLayoutData westData = new BorderLayoutData(Style.WEST, 200, 150, 300);
-
 
147
		    westData.resizeable = true;
-
 
148
		    viewport.add(west, westData);
-
 
149
 
-
 
150
		    
-
 
151
		    BorderLayoutData centerData = new BorderLayoutData(Style.CENTER, 400, 400, 800);
-
 
152
		    viewport.add(center, centerData);
-
 
153
 
-
 
154
 
-
 
155
		    BorderLayoutData northData = new BorderLayoutData(Style.NORTH, 20, 20, 20);
-
 
156
		    viewport.add(north, northData);
-
 
157
 
-
 
158
		    BorderLayoutData southData = new BorderLayoutData(Style.SOUTH, 400, 400, 800);
-
 
159
//		    viewport.add(south, southData);
-
 
160
 
62
		Mediator() {
161
		    viewport.layout();
63
			
162
		    onInit();
64
		}
163
 
65
		
164
			    
66
		
165
			  
67
		// Methodes Private 
166
		// Methodes Private 
68
	
167
	    }	
69
		
168
		
70
		
169
		
71
		/**
170
		/**
72
		 * Recuperation du prefixe d'appel des services
171
		 * Recuperation du prefixe d'appel des services
73
		 * @return prefix appel des service
172
		 * @return prefix appel des service
74
		 */
173
		 */
75
 
174
 
76
		private String getServiceBaseUrlFromDictionnary() {
175
		private String getServiceBaseUrlFromDictionnary() {
77
 
176
 
78
			Dictionary theme = Dictionary.getDictionary("Parameters");
177
			Dictionary theme = Dictionary.getDictionary("Parameters");
79
			return theme.get("serviceBaseUrl");
178
			return theme.get("serviceBaseUrl");
80
 
179
 
81
		}
180
		}
82
 
-
 
83
 
-
 
84
		// Appel aux services :
-
 
85
		
-
 
86
 
-
 
87
		/**
-
 
88
		 * Recherche distante et asynchrone de l'utilisateur connecte, en retour lancement methode initialisation
-
 
89
		 * de l'appellant Cel. (initAsync)
-
 
90
		 * 
-
 
91
		 */
-
 
92
		
-
 
93
		private void getUserFromService() {
-
 
94
 
-
 
95
 
-
 
96
			HTTPRequest.asyncGet(serviceBaseUrl + "/User/",
-
 
97
					new ResponseTextHandler() {
-
 
98
 
-
 
99
						public void onCompletion(String str) {
-
 
100
							JSONValue jsonValue = JSONParser.parse(str);
-
 
101
							JSONArray jsonArray;
-
 
102
							if ((jsonArray = jsonValue.isArray()) != null) {
-
 
103
									user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur ou identifiant de session si non connecte
-
 
104
									connected = ((JSONBoolean) jsonArray.get(1)).booleanValue();  // Drapeau leve si utilisateur identifie
-
 
105
							}
-
 
106
							cel.initAsync();
-
 
107
						}
-
 
108
					});
-
 
109
 
-
 
110
		}
-
 
111
 
-
 
112
		
181
		
113
 
182
 
114
		
183
		
115
		// Methodes Public
184
		// Methodes Public
116
		
185
		
117
		
186
		
118
		
-
 
119
		// Information sur Etat du systeme
-
 
120
		
-
 
121
		/**
-
 
122
		 * Recuperation information utilisateur
-
 
123
		 *
-
 
124
		 */
-
 
125
		
-
 
126
		public void initUser() {
-
 
127
			getUserFromService(); // Appel distant recherche de l'utilisateur
-
 
128
		}
187
		
129
		
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
		}
-
 
238
		
-
 
239
		
-
 
240
		
178
		
241
		
179
 
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) {
369
		
422
	
370
			inventoryItemList.setLocation(loc);
423
			// Positionnement Filtre affichage
371
			inventoryItemList.updateCount();
424
			inventoryListView.setLocation(loc);
372
			
-
 
373
			inventoryItemList.displayFilter();
425
			inventoryListView.updateCount();
-
 
426
 
-
 
427
			// Affichage des filtres
-
 
428
			inventoryListView.displayFilter();
-
 
429
 
-
 
430
			// Positionnement Filtre affichage
374
 
431
 
375
			dateList.setLocation(loc);
432
			dateFilterPanel.setLocation(loc);
-
 
433
			dateFilterPanel.updateCount();
-
 
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
 
479
		
421
		/**
-
 
422
		 * Declaration InventoryItem  : une observation
-
 
423
		 * @param cel
-
 
424
		 */
-
 
425
 
-
 
426
		public void registerInventoryItem(InventoryItem inventoryItem) {
-
 
427
			
-
 
428
			this.inventoryItem=inventoryItem;
-
 
429
		}
-
 
430
 
480
 
431
 
481
 
432
		
482
		
433
		/**
483
		/**
434
		 * Declaration InventoryItemList  : liste d'observation
484
		 * Declaration date : date observation
435
		 * @param inventoryItemList
485
		 * @param date
436
		 */
486
		 */
437
		
487
		
-
 
488
		public void registerDate(TextBox date) {
438
		public void registerInventoryItemList(InventoryItemList inventoryItemList) {
-
 
439
			
-
 
440
			this.inventoryItemList=inventoryItemList;
489
			this.date=date;
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;
490
			
452
		}
491
		}
-
 
492
	
453
	
493
	
454
		
494
		
455
		
495
		/**
-
 
496
		 * Declaration lieu dit : lieu dit d'observation
456
		/**
-
 
457
		 * Declaration DateList : filtre date observation
497
		 * 
-
 
498
		 * @param milieu
458
		 * @param locationList
499
		 */
459
		 */
500
		
-
 
501
		public void registerLieudit(TextBox lieudit) {
460
		
502
			this.lieudit=lieudit;
461
		public void registerDateList(DateList dateList) {
503
			
462
			
504
		}
-
 
505
 
463
			this.dateList=dateList;
-
 
464
		}
506
 
465
 
-
 
466
		
-
 
467
		/**
507
		
468
		 * Declaration InfoPopup : information complementaire taxon en cours
508
		/**
469
		 * @param infoPopup
509
		 * Declaration milieu : milieu d'observation
470
		 */
510
		 * 
471
		
511
		 * @param milieu
-
 
512
		 */
472
		public void registerInfoPopup(InfoPopup infoPopup) {
-
 
473
			
513
		
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;
514
		public void registerMilieu(TextBox milieu) {
487
		}
515
			this.milieu=milieu;
488
 
516
			
489
		
517
		}
490
		
518
		
491
		/**
519
		/**
492
		 * Declaration Cel : point d'entree
520
		 * Declaration commentaire b 
493
		 * @param cel
521
		 * @param commentaire
494
		 */
522
		 */
495
 
523
		
496
		public void registerCel(Cel cel) {
524
		public void registerComment(TextBox comment) {
497
			
525
			this.comment=comment;
498
			this.cel=cel;
526
			
499
		}
527
		}
500
 
528
		
501
		
529
 
502
		/**
530
		/**
503
		 * Declaration NameAssistant  : completion nom scientifique
531
		 * Declaration NameAssistant  : completion nom scientifique
504
		 * @param nameassistant
532
		 * @param nameassistant
505
		 */
533
		 */
506
		
534
		
507
		public void registerNameAssistant(NameAssistant nameAssistant) {
535
		public void registerNameAssistant(NameAssistant nameAssistant) {
508
			this.nameAssistant=nameAssistant;
536
			this.nameAssistant=nameAssistant;
509
			
537
			
510
		}
538
		}
511
		
-
 
512
		/**
-
 
513
		 * Declaration LocationAssistant : completion commune
-
 
514
		 * @param locationassistant
-
 
515
		 */
-
 
516
		
-
 
517
		public void registerLocationAssistant(LocationAssistant locationAssistant) {
-
 
518
			this.locationAssistant=locationAssistant;
-
 
519
			
-
 
520
		}
-
 
521
 
-
 
522
	
539
		
523
		
540
	
524
		/**
541
		/**
525
		 * Declaration date : date observation
542
		 * Declaration DateFilterPanel : filtre date observation
526
		 * @param date
543
		 * @param locationList
527
		 */
-
 
-
 
544
		 */
528
		
545
		
529
		public void registerDate(TextBox date) {
-
 
530
			this.date=date;
546
		public void registerDateFilterPanel(DateFilterPanel dateFilterPanel) {
-
 
547
			
531
			
548
			this.dateFilterPanel=dateFilterPanel;
532
		}
549
		}
533
	
-
 
534
	
550
 
535
		
551
		
536
		/**
552
 
537
		 * Declaration lieu dit : lieu dit d'observation
553
		/**
538
		 * 
554
		 * Declaration LocationAssistant : completion commune
539
		 * @param milieu
555
		 * @param locationassistant
540
		 */
556
		 */
541
		
557
		
542
		public void registerLieudit(TextBox lieudit) {
558
		public void registerLocationAssistant(LocationAssistant locationAssistant) {
543
			this.lieudit=lieudit;
559
			this.locationAssistant=locationAssistant;
544
			
560
			
545
		}
561
		}
546
 
-
 
547
 
-
 
548
		
562
 
549
		/**
563
		/**
550
		 * Declaration milieu : milieu d'observation
-
 
551
		 * 
564
		 * Declaration LocationFilterPanel : filtre lieu observation
552
		 * @param milieu
565
		 * @param locationList
553
		 */
566
		 */
554
		
-
 
-
 
567
		
555
		public void registerMilieu(TextBox milieu) {
568
		public void registerLocationFilterPanel(LocationFilterPanel locationFilterPanel) {
556
			this.milieu=milieu;
569
			
557
			
-
 
558
		}
-
 
559
 
-
 
560
		/**
-
 
561
		 * Declaration Entry Panel : formulaire de saisie observation
-
 
562
		 */
-
 
563
 
-
 
564
		
-
 
565
	    public void  registerEntryPanel(EntryPanel entryPanel) {
-
 
566
	    	this.entryPanel=entryPanel;
-
 
567
		}
-
 
568
 
-
 
569
 
-
 
570
		/**
-
 
571
		 * Declaration Action Panel : actions sur liste des observations
-
 
572
		 */
-
 
573
 
-
 
574
	    
-
 
575
	    public void  registerActionPanel(ActionPanel actionPanel) {
-
 
576
	    	this.actionPanel=actionPanel;
570
			this.locationFilterPanel=locationFilterPanel;
577
		}
571
		}
578
 
-
 
579
 
-
 
580
		/**
-
 
581
		 * Declaration TopPanel : panneau de connexion
-
 
582
		 */
-
 
583
	    
-
 
584
 
-
 
585
	    public void  registerTopPanel(TopPanel topPanel) {
-
 
586
	    	this.topPanel=topPanel;
-
 
587
		}
-
 
588
 
-
 
589
	    
572
	
590
	    
573
		
591
		/**
574
		/**
592
		 * Declaration commentaire 
-
 
-
 
575
		 * Declaration StationFilterPanel : filtre par station
593
		 * @param commentaire
576
		 * @param locationList
594
		 */
-
 
595
		
-
 
596
		public void registerComment(TextBox comment) {
-
 
597
			this.comment=comment;
-
 
598
			
-
 
599
		}
-
 
600
		
-
 
601
 
-
 
602
		/* 
-
 
603
		 * Declaration LeftPanel Panneau gauche filtre sur liste d'observation
-
 
604
		 * 
577
		 */
605
		 */
578
		
606
		
579
		public void registerStationFilterPanel(StationFilterPanel stationFilterPanel) {
607
		public void registerLeftPanel(LeftPanel leftPanel) {
580
			
608
			this.leftPanel=leftPanel;
581
			this.stationFilterPanel=stationFilterPanel;
609
			
582
		}
610
		}
583
 
611
		
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;
640
 
616
		}
641
		
617
		
642
		public InventoryItemList getInventoryItemList() {
618
		public WidgetContainer getNorthContainer() {
643
			return inventoryItemList;
619
			return north;
644
		}
620
		}
645
 
621
 
646
		public LocationList getLocationList() {
622
		public WidgetContainer getWestContainer() {
647
			return locationList;
623
			return west;
648
		}
624
		}
649
 
625
 
650
		public DateList getDateList() {
626
		public WidgetContainer getSouthContainer() {
651
			return dateList;
627
			return south;
652
		}
628
		}
653
 
629
 
-
 
630
		
-
 
631
		public InventoryListView getInventoryListView() {
-
 
632
			return inventoryListView;
-
 
633
		}
-
 
634
 
-
 
635
		public LocationFilterPanel getLocationList() {
-
 
636
			return locationFilterPanel;
-
 
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
	}