Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 25 Rev 26
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
6
 
6
 
7
import com.google.gwt.i18n.client.Dictionary;
7
import com.google.gwt.i18n.client.Dictionary;
8
import com.google.gwt.json.client.JSONArray;
8
import com.google.gwt.json.client.JSONArray;
9
import com.google.gwt.json.client.JSONBoolean;
9
import com.google.gwt.json.client.JSONBoolean;
10
import com.google.gwt.json.client.JSONParser;
10
import com.google.gwt.json.client.JSONParser;
11
import com.google.gwt.json.client.JSONString;
11
import com.google.gwt.json.client.JSONString;
12
import com.google.gwt.json.client.JSONValue;
12
import com.google.gwt.json.client.JSONValue;
13
import com.google.gwt.user.client.HTTPRequest;
13
import com.google.gwt.user.client.HTTPRequest;
14
import com.google.gwt.user.client.ResponseTextHandler;
14
import com.google.gwt.user.client.ResponseTextHandler;
-
 
15
import com.google.gwt.user.client.Window;
15
import com.google.gwt.user.client.ui.TextBox;
16
import com.google.gwt.user.client.ui.TextBox;
16
 
17
 
17
public class Mediator {
18
public class Mediator implements AutoCompleteAsyncTextBoxListener {
18
		
19
		
19
		
20
		
20
		private String serviceBaseUrl = getServiceBaseUrlFromDictionnary();
21
		private String serviceBaseUrl = getServiceBaseUrlFromDictionnary();
21
		private String user = null;
22
		private String user = null;
22
		private InventoryItemList inventoryItemList = null;
23
		private InventoryItemList inventoryItemList = null;
23
		private LocationList locationList = null;
24
		private LocationList locationList = null;
24
		private DateList dateList = null;
25
		private DateList dateList = null;
25
		private StationList stationList = null;
26
		private StationList stationList = null;
26
		private NameAssistant nameAssistant=null;
27
		private NameAssistant nameAssistant=null;
27
		private LocationAssistant locationAssistant=null;
28
		private LocationAssistant locationAssistant=null;
28
		private InventoryItem inventoryItem=null;
29
		private InventoryItem inventoryItem=null;
29
		private EntryPanel entryPanel=null;
30
		private EntryPanel entryPanel=null;
30
		private ActionPanel actionPanel=null;
31
		private ActionPanel actionPanel=null;
31
		private TopPanel topPanel=null;
32
		private TopPanel topPanel=null;
32
		private LeftPanel leftPanel=null;
33
		private LeftPanel leftPanel=null;
33
		private InfoPopup infoPopup=null;
34
		private InfoPopup infoPopup=null;
34
		
35
		
35
		private TextBox date = null; 
36
		private TextBox date = null; 
36
		private TextBox complementLocation = null; 
37
		private TextBox complementLocation = null; 
37
		private TextBox comment = null;
38
		private TextBox comment = null;
38
 
39
 
39
		boolean connected=false;
40
		boolean connected=false;
40
 
41
 
41
 
42
 
42
		private Cel cel = null;
43
		private Cel cel = null;
43
 
44
 
44
		
45
		
45
		Mediator() {
46
		Mediator() {
46
			
-
 
47
			
47
			
48
		}
48
		}
49
	
49
	
50
		/**
50
		/**
51
		 * Recuperation information utilisateur
51
		 * Recuperation information utilisateur
52
		 *
52
		 *
53
		 */
53
		 */
54
		
54
		
55
		public void initUser() {
55
		public void initUser() {
56
			getUserFromService();
56
			getUserFromService(); // Appel distant recherche de l'utilisateur
57
			
-
 
58
		}
57
		}
59
		
58
		
60
		
59
		
61
		/**
60
		/**
62
		 * Action initialisation
61
		 * Action initialisation
63
		 */
62
		 */
64
		
63
		
65
	
64
	
66
		public void onInit() {
65
		public void onInit() {
67
 
66
 
68
			
67
			
69
			locationList.setLocation("all");
68
			locationList.setLocation("all");
70
			locationList.updateCount();
69
			locationList.updateCount();
71
 
70
 
72
			this.onLocationSelected("all");
71
			this.onLocationSelected("all");
73
			
72
			
74
		}
73
		}
75
		
74
		
-
 
75
		
-
 
76
 
-
 
77
		/**
-
 
78
		 * Action lancee par la completion d'un nom dans l'assistant de saisie
-
 
79
		 * Recherche d'information compl�mentaires ....
-
 
80
		 * 
-
 
81
		 * @return void
-
 
82
		 */
-
 
83
		  
-
 
84
		public void onComplete(ResponseTextHandler sender, String str, String value) {
-
 
85
			
-
 
86
			if (sender instanceof NameAssistant) {
-
 
87
				onNameCompleted(value);
-
 
88
			}
-
 
89
 
-
 
90
		}	
-
 
91
		 
-
 
92
		
-
 
93
 
-
 
94
		/**
-
 
95
		 * Action lancee par la selection d'un nom dans l'assistant de saisie. Lance
-
 
96
		 * la recherche d'informations compl�mentaires (famille, numero
-
 
97
		 * nomenclaturaux etc) et met a jour l'inventaire (addelement())
-
 
98
		 * 
-
 
99
		 * @return void
-
 
100
		 */
-
 
101
		public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,
-
 
102
				  String str, String value) {
-
 
103
		
-
 
104
		  	if (getEntryPanel().getOrdre()==null) {
-
 
105
				     onAddInventoryItem(); 
-
 
106
			  	}
-
 
107
			else {
-
 
108
			     onModifyInventoryItem(getEntryPanel().getOrdre()); 
-
 
109
			     getEntryPanel().setOrdre(null);
-
 
110
			 }
-
 
111
 
-
 
112
		}
-
 
113
		
-
 
114
 
-
 
115
	
76
		
116
		
77
		/**
117
		/**
78
		 * Action suite ajout, modification, suppression element inventaire
118
		 * Action suite ajout, modification, suppression element inventaire
79
		 */
119
		 */
80
		
120
		
81
	
121
	
82
		public void onInventoryUpdated(String location) {
122
		public void onInventoryUpdated(String location) {
83
 
123
 
84
			
124
			
85
			locationList.setLocation(location);
125
			locationList.setLocation(location);
86
			locationList.updateCount();
126
			locationList.updateCount();
87
 
127
 
88
			this.onLocationSelected(location);
128
			this.onLocationSelected(location);
89
			
129
			
90
		}
130
		}
91
		
131
		
92
		
132
		
93
		/**
133
		/**
94
		 * Action sur selection d'une observation : affichage du detail
134
		 * Action sur selection d'une observation : affichage du detail
95
		 */
135
		 */
96
		
136
		
97
		public void onInventoryItemSelected(String ordre) {
137
		public void onInventoryItemSelected(String ordre) {
98
		
138
		
99
			entryPanel.setOrdre(ordre);
139
			entryPanel.setOrdre(ordre);
100
			entryPanel.update();
140
			entryPanel.update();
101
			
141
			
102
			
142
			
103
		}
143
		}
104
 
144
 
105
		
145
		
106
		/**
146
		/**
-
 
147
		 * Action sur deselection d'une observation : affichage du detail
-
 
148
		 */
-
 
149
		
-
 
150
		public void onInventoryItemUnselected(String ordre) {
-
 
151
		
-
 
152
			entryPanel.setOrdre(null);
-
 
153
			
-
 
154
		}
-
 
155
 
-
 
156
 
-
 
157
 
-
 
158
		
-
 
159
		/**
107
		 * Action sur recherche  : affichage de la liste des taxons correspondants
160
		 * Action sur recherche  : affichage de la liste des taxons correspondants
108
		 */
161
		 */
109
		
162
		
110
		public void onSearch(String search) {
163
		public void onSearch(String search) {
111
	
164
	
112
			if (search.trim().compareTo("")==0) {
165
			if (search.trim().compareTo("")==0) {
113
				search="all";
166
				search="all";
114
			}
167
			}
115
			inventoryItemList.setSearch(search);
168
			inventoryItemList.setSearch(search);
116
			inventoryItemList.updateCount();
169
			inventoryItemList.updateCount();
117
			
170
			
118
		}
171
		}
119
 
172
 
120
		
173
		
121
		
174
		
122
		/**
175
		/**
123
		 * Action sur selection d'un lieu : affichage de la liste des taxons correspondants
176
		 * Action sur selection d'un lieu : affichage de la liste des taxons correspondants
124
		 * TODO : gerer asynchronicite ?
177
		 * TODO : gerer asynchronicite ?
125
		 */
178
		 */
126
		
179
		
127
		public void onLocationSelected(String loc) {
180
		public void onLocationSelected(String loc) {
128
		
181
		
129
			inventoryItemList.setLocation(loc);
182
			inventoryItemList.setLocation(loc);
130
//			inventoryItemList.setDate("all");
-
 
131
//			inventoryItemList.setStation("all");
-
 
132
			inventoryItemList.updateCount();
183
			inventoryItemList.updateCount();
133
			
184
			
134
	//		nameAssistant.setValue(null);
185
			inventoryItemList.displayFilter();
135
 
-
 
136
			dateList.setLocation(loc);
186
 
-
 
187
			dateList.setLocation(loc);
137
//			dateList.setDate("all");
188
			dateList.updateCount();
138
			dateList.updateCount();
-
 
139
			stationList.setLocation(loc);
189
			
140
//			stationList.setStation("all");
190
			stationList.setLocation(loc);
141
			stationList.updateCount();
191
			stationList.updateCount();
142
			
192
			
143
		}
193
		}
-
 
194
			
-
 
195
			
144
		
196
		
145
		/**
197
		/**
146
		 * Action sur login
198
		 * Action sur login
147
		 * @param user
199
		 * @param user
148
		 */
200
		 */
149
		
201
		
150
		
202
		
151
		public void onLogin(String user) {
203
		public void onLogin(String user) {
152
			
204
			
153
			
205
			
154
			this.user=user;
206
			this.user=user;
155
			topPanel.getSignLabel().setText(user+ " (deconnexion)");
207
			topPanel.getSignLabel().setText(user+ " (deconnexion)");
156
			inventoryItemList.setUser(user);
208
			inventoryItemList.setUser(user);
157
			dateList.setUser(user);
209
			dateList.setUser(user);
158
			stationList.setUser(user);
210
			stationList.setUser(user);
159
			entryPanel.setUser(user);
211
			entryPanel.setUser(user);
160
			locationList.setUser(user);
212
			locationList.setUser(user);
161
			this.onInit();
213
			this.onInit();
162
			
214
			
163
		}
215
		}
164
		
216
		
165
		
217
		
166
		/**
218
		/**
167
		 * Action sur logoff
219
		 * Action sur logoff
168
		 * @param user
220
		 * @param user
169
		 */
221
		 */
170
		
222
		
171
		
223
		
172
		public void onLogoff(String user) {
224
		public void onLogoff(String user) {
173
			
225
			
174
			this.user=user;
226
			this.user=user;
175
			topPanel.getSignLabel().setText("Connexion");
227
			topPanel.getSignLabel().setText("Connexion");
176
			inventoryItemList.setUser(user);
228
			inventoryItemList.setUser(user);
177
			dateList.setUser(user);
229
			dateList.setUser(user);
178
			stationList.setUser(user);
230
			stationList.setUser(user);
179
			entryPanel.setUser(user);
231
			entryPanel.setUser(user);
180
			locationList.setUser(user);
232
			locationList.setUser(user);
181
			this.onInit();
233
			this.onInit();
182
			
234
			
183
		}
235
		}
184
 
236
 
185
		/**
237
		/**
186
		 * Action sur selection d'une station : affichage de la liste des taxons correspondants
238
		 * Action sur selection d'une station : affichage de la liste des taxons correspondants
187
		 */
239
		 */
188
		
240
		
189
		public void onStationSelected(String station) {
241
		public void onStationSelected(String station) {
190
 
242
 
191
			inventoryItemList.setStation(station);
243
			inventoryItemList.setStation(station);
192
			inventoryItemList.updateCount();
244
			inventoryItemList.updateCount();
-
 
245
			
-
 
246
			inventoryItemList.displayFilter();
-
 
247
 
193
//			nameAssistant.setValue(null);
248
//			nameAssistant.setValue(null);
194
 
249
 
195
 
250
 
196
		}
251
		}
197
 
252
 
198
 
253
 
199
 
254
 
200
		
255
		
201
		/**
256
		/**
202
		 * Action sur selection d'une date : affichage de la liste des taxons correspondants
257
		 * Action sur selection d'une date : affichage de la liste des taxons correspondants
203
		 */
258
		 */
204
		
259
		
205
		public void onDateSelected(String date) {
260
		public void onDateSelected(String date) {
206
 
261
 
207
			inventoryItemList.setDate(date);
262
			inventoryItemList.setDate(date);
208
			inventoryItemList.updateCount();
263
			inventoryItemList.updateCount();
-
 
264
			
-
 
265
			inventoryItemList.displayFilter();
-
 
266
 
209
	//		nameAssistant.setValue(null);
267
	//		nameAssistant.setValue(null);
210
 
268
 
211
 
269
 
212
		}
270
		}
213
 
271
 
214
		/**
272
		/**
215
		 * Action suivant la complétion d'un nom
273
		 * Action suivant la completion d'un nom
216
		 * 
274
		 * 
217
		 */
275
		 */
218
 
276
 
219
		public void  onNameCompleted(String value) {
277
		public void  onNameCompleted(String value) {
-
 
278
			if (infoPopup==null) {
-
 
279
				infoPopup = new InfoPopup(this);
-
 
280
			}
220
			infoPopup.setImageUrl(value);
281
			infoPopup.setImageUrl(value);
221
		}
282
		}
222
		
283
		
223
		
284
		
224
		/**
285
		/**
225
		 * Action prealable à l'ajout d'une observation : controle presence champs requis et lancement mise a jour 
286
		 * Action prealable a l'ajout d'une observation : controle presence champs requis et lancement mise a jour 
226
		 * 
287
		 * 
227
		 */
288
		 */
228
		
289
		
229
		public void onAddInventoryItem() {
290
		public void onAddInventoryItem() {
230
		
291
		
231
			// TODO : singleton ?
292
			// TODO : singleton ?
232
			registerInventoryItem(new InventoryItem(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),complementLocation.getText(),comment.getText(),"null"));
293
			registerInventoryItem(new InventoryItem(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),complementLocation.getText(),comment.getText(),"null"));
233
			inventoryItemList.addelement();
294
			inventoryItemList.addelement();
234
			
295
			
235
		}
296
		}
236
 
297
 
237
		
298
		
238
		/**
299
		/**
239
		 * Action prealable à la modification d'une observation : controle presence champs requis et lancement mise a jour 
300
		 * Action prealable a la modification d'une observation : controle presence champs requis et lancement mise a jour 
240
		 * 
301
		 * 
241
		 */
302
		 */
242
 
303
 
243
		public void onModifyInventoryItem(String ordre) {
304
		public void onModifyInventoryItem(String ordre) {
244
 
305
 
245
		// TODO : singleton ?
306
		// TODO : singleton ?
246
		registerInventoryItem(new InventoryItem(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),complementLocation.getText(),comment.getText(),ordre));
307
		registerInventoryItem(new InventoryItem(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),complementLocation.getText(),comment.getText(),ordre));
247
		inventoryItemList.updateElement();
308
		inventoryItemList.updateElement();
248
 
309
 
249
		}
310
		}
250
 
311
 
251
		
312
		
252
		public boolean inventoryItemIsValid() {
313
		public boolean inventoryItemIsValid() {
253
			// TODO : controle date
314
			// TODO : controle date
254
			
315
			
255
		    if (inventoryItem.getName().compareTo("")==0) {
316
		    if (inventoryItem.getName().compareTo("")==0) {
256
		    	return false;
317
		    	return false;
257
		    }
318
		    }
258
		    else {
319
		    else {
259
		    	return true;
320
		    	return true;
260
		    }
321
		    }
261
			
322
			
262
		}
323
		}
263
 
324
 
264
		/**
325
		/**
265
		 * Declaration InventoryItem
326
		 * Declaration InventoryItem
266
		 * @param cel
327
		 * @param cel
267
		 */
328
		 */
268
 
329
 
269
		public void registerInventoryItem(InventoryItem inventoryItem) {
330
		public void registerInventoryItem(InventoryItem inventoryItem) {
270
			
331
			
271
			this.inventoryItem=inventoryItem;
332
			this.inventoryItem=inventoryItem;
272
		}
333
		}
273
 
334
 
274
 
335
 
275
		
336
		
276
		
337
		
277
		/**
338
		/**
278
		 * Declaration InventoryItemList 
339
		 * Declaration InventoryItemList 
279
		 * @param inventoryItemList
340
		 * @param inventoryItemList
280
		 */
341
		 */
281
		
342
		
282
		public void registerInventoryItemList(InventoryItemList inventoryItemList) {
343
		public void registerInventoryItemList(InventoryItemList inventoryItemList) {
283
			
344
			
284
			this.inventoryItemList=inventoryItemList;
345
			this.inventoryItemList=inventoryItemList;
285
		
346
		
286
		}
347
		}
287
	
348
	
288
		/**
349
		/**
289
		 * Declaration LocationList
350
		 * Declaration LocationList
290
		 * @param locationList
351
		 * @param locationList
291
		 */
352
		 */
292
		
353
		
293
		public void registerLocationList(LocationList locationList) {
354
		public void registerLocationList(LocationList locationList) {
294
			
355
			
295
			this.locationList=locationList;
356
			this.locationList=locationList;
296
		}
357
		}
297
	
358
	
298
		
359
		
299
		
360
		
300
		/**
361
		/**
301
		 * Declaration DateList
362
		 * Declaration DateList
302
		 * @param locationList
363
		 * @param locationList
303
		 */
364
		 */
304
		
365
		
305
		public void registerDateList(DateList dateList) {
366
		public void registerDateList(DateList dateList) {
306
			
367
			
307
			this.dateList=dateList;
368
			this.dateList=dateList;
308
		}
369
		}
309
 
370
 
310
		
371
		
311
		/**
372
		/**
312
		 * Declaration InfoPopup
373
		 * Declaration InfoPopup
313
		 * @param infoPopup
374
		 * @param infoPopup
314
		 */
375
		 */
315
		
376
		
316
		public void registerInfoPopup(InfoPopup infoPopup) {
377
		public void registerInfoPopup(InfoPopup infoPopup) {
317
			
378
			
318
			this.infoPopup=infoPopup;
379
			this.infoPopup=infoPopup;
319
		}
380
		}
320
 
381
 
321
 
382
 
322
		
383
		
323
		/**
384
		/**
324
		 * Declaration StationList
385
		 * Declaration StationList
325
		 * @param locationList
386
		 * @param locationList
326
		 */
387
		 */
327
		
388
		
328
		public void registerStationList(StationList stationList) {
389
		public void registerStationList(StationList stationList) {
329
			
390
			
330
			this.stationList=stationList;
391
			this.stationList=stationList;
331
		}
392
		}
332
 
393
 
333
		
394
		
334
		
395
		
335
		/**
396
		/**
336
		 * Declaration Cel
397
		 * Declaration Cel
337
		 * @param cel
398
		 * @param cel
338
		 */
399
		 */
339
 
400
 
340
		public void registerCel(Cel cel) {
401
		public void registerCel(Cel cel) {
341
			
402
			
342
			this.cel=cel;
403
			this.cel=cel;
343
		}
404
		}
344
 
405
 
345
		
406
		
346
		/**
407
		/**
347
		 * Declaration NameAssistant 
408
		 * Declaration NameAssistant 
348
		 * @param nameassistant
409
		 * @param nameassistant
349
		 */
410
		 */
350
		
411
		
351
		public void registerNameAssistant(NameAssistant nameAssistant) {
412
		public void registerNameAssistant(NameAssistant nameAssistant) {
352
			this.nameAssistant=nameAssistant;
413
			this.nameAssistant=nameAssistant;
353
			
414
			
354
		}
415
		}
355
		
416
		
356
		/**
417
		/**
357
		 * Declaration LocationAssistant 
418
		 * Declaration LocationAssistant 
358
		 * @param locationassistant
419
		 * @param locationassistant
359
		 */
420
		 */
360
		
421
		
361
		public void registerLocationAssistant(LocationAssistant locationAssistant) {
422
		public void registerLocationAssistant(LocationAssistant locationAssistant) {
362
			this.locationAssistant=locationAssistant;
423
			this.locationAssistant=locationAssistant;
363
			
424
			
364
		}
425
		}
365
 
426
 
366
		
427
		
367
		
428
		
368
		/**
429
		/**
369
		 * Declaration date
430
		 * Declaration date
370
		 * @param date
431
		 * @param date
371
		 */
432
		 */
372
		
433
		
373
		public void registerDate(TextBox date) {
434
		public void registerDate(TextBox date) {
374
			this.date=date;
435
			this.date=date;
375
			
436
			
376
		}
437
		}
377
	
438
	
378
		
439
		
379
		
440
		
380
		/**
441
		/**
381
		 * Declaration complementLocation
442
		 * Declaration complementLocation
382
		 * @param complementLocation
443
		 * @param complementLocation
383
		 */
444
		 */
384
		
445
		
385
		public void registerComplementLocation(TextBox complementLocation) {
446
		public void registerComplementLocation(TextBox complementLocation) {
386
			this.complementLocation=complementLocation;
447
			this.complementLocation=complementLocation;
387
			
448
			
388
		}
449
		}
389
		
450
		
390
		
451
		
391
	    public void  registerEntryPanel(EntryPanel entryPanel) {
452
	    public void  registerEntryPanel(EntryPanel entryPanel) {
392
	    	this.entryPanel=entryPanel;
453
	    	this.entryPanel=entryPanel;
393
		}
454
		}
394
 
455
 
395
	    
456
	    
396
	    public void  registerActionPanel(ActionPanel actionPanel) {
457
	    public void  registerActionPanel(ActionPanel actionPanel) {
397
	    	this.actionPanel=actionPanel;
458
	    	this.actionPanel=actionPanel;
398
		}
459
		}
399
 
460
 
400
	    
461
	    
401
 
462
 
402
	    public void  registerTopPanel(TopPanel topPanel) {
463
	    public void  registerTopPanel(TopPanel topPanel) {
403
	    	this.topPanel=topPanel;
464
	    	this.topPanel=topPanel;
404
		}
465
		}
405
 
466
 
406
	    
467
	    
407
	    
468
	    
408
		/**
469
		/**
409
		 * Declaration commentaire 
470
		 * Declaration commentaire 
410
		 * @param commentaire
471
		 * @param commentaire
411
		 */
472
		 */
412
		
473
		
413
		public void registerComment(TextBox comment) {
474
		public void registerComment(TextBox comment) {
414
			this.comment=comment;
475
			this.comment=comment;
415
			
476
			
416
		}
477
		}
417
		
478
		
418
 
479
 
419
		/* Panneau gauche 
480
		/* Panneau gauche 
420
		 * 
481
		 * 
421
		 */
482
		 */
422
		
483
		
423
		public void registerLeftPanel(LeftPanel leftPanel) {
484
		public void registerLeftPanel(LeftPanel leftPanel) {
424
			this.leftPanel=leftPanel;
485
			this.leftPanel=leftPanel;
425
			
486
			
426
		}
487
		}
427
		
488
		
428
		
489
		
429
		
490
		
430
 
491
 
431
		/**
492
		/**
432
		 * Recherche distante et asynchrone de l'utilisateur connecté, en retour lancement methode initialisation
493
		 * Recherche distante et asynchrone de l'utilisateur connecte, en retour lancement methode initialisation
433
		 * de l'appellant Cel. (initAsync)
494
		 * de l'appellant Cel. (initAsync)
434
		 * 
495
		 * 
435
		 */
496
		 */
436
		
497
		
437
		private void getUserFromService() {
498
		private void getUserFromService() {
438
 
499
 
439
 
500
 
440
			HTTPRequest.asyncGet(serviceBaseUrl + "/User/",
501
			HTTPRequest.asyncGet(serviceBaseUrl + "/User/",
441
					new ResponseTextHandler() {
502
					new ResponseTextHandler() {
442
 
503
 
443
						public void onCompletion(String str) {
504
						public void onCompletion(String str) {
444
							JSONValue jsonValue = JSONParser.parse(str);
505
							JSONValue jsonValue = JSONParser.parse(str);
445
							JSONArray jsonArray;
506
							JSONArray jsonArray;
446
							if ((jsonArray = jsonValue.isArray()) != null) {
507
							if ((jsonArray = jsonValue.isArray()) != null) {
447
									user = ((JSONString) jsonArray.get(0)).stringValue();
508
									user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur ou identifiant de session si non connecte
448
									connected = ((JSONBoolean) jsonArray.get(1)).booleanValue();
509
									connected = ((JSONBoolean) jsonArray.get(1)).booleanValue();  // Drapeau leve si utilisateur identifie
449
							}
510
							}
450
							cel.initAsync();
511
							cel.initAsync();
451
						}
512
						}
452
					});
513
					});
453
 
514
 
454
		}
515
		}
455
	
516
	
456
		/**
517
		/**
457
		 * Accesseur Url de base
518
		 * Accesseur Url de base
458
		 * @return Url de base
519
		 * @return Url de base
459
		 */
520
		 */
460
		
521
		
461
		public String getServiceBaseUrl() {
522
		public String getServiceBaseUrl() {
462
			
523
			
463
			return serviceBaseUrl;
524
			return serviceBaseUrl;
464
 
525
 
465
		}
526
		}
466
 
527
 
467
		
528
		
468
		/**
529
		/**
469
		 * Recuperation du prefixe d'appel des services
530
		 * Recuperation du prefixe d'appel des services
470
		 * @return prefix appel des service
531
		 * @return prefix appel des service
471
		 */
532
		 */
472
 
533
 
473
		private String getServiceBaseUrlFromDictionnary() {
534
		private String getServiceBaseUrlFromDictionnary() {
474
 
535
 
475
			Dictionary theme = Dictionary.getDictionary("Parameters");
536
			Dictionary theme = Dictionary.getDictionary("Parameters");
476
			return theme.get("serviceBaseUrl");
537
			return theme.get("serviceBaseUrl");
477
 
538
 
478
		}
539
		}
479
 
540
 
480
 
541
 
481
		/**
542
		/**
482
		 *  Accesseur Utilisateur
543
		 *  Accesseur Utilisateur
483
		 * @return utilisateur connecté ou identifiant de session
544
		 * @return utilisateur connecte ou identifiant de session
484
		 */
545
		 */
485
		
546
		
486
		public String getUser() {
547
		public String getUser() {
487
			return user;
548
			return user;
488
		}
549
		}
489
 
550
 
490
		
551
		
491
 
552
 
492
		public void setUser(String user) {
553
		public void setUser(String user) {
493
			this.user=user;
554
			this.user=user;
494
		}
555
		}
495
 
556
 
496
 
557
 
497
		
558
		
498
		public InventoryItemList getInventoryItemList() {
559
		public InventoryItemList getInventoryItemList() {
499
			return inventoryItemList;
560
			return inventoryItemList;
500
		}
561
		}
501
 
562
 
502
		public LocationList getLocationList() {
563
		public LocationList getLocationList() {
503
			return locationList;
564
			return locationList;
504
		}
565
		}
505
 
566
 
506
		public DateList getDateList() {
567
		public DateList getDateList() {
507
			return dateList;
568
			return dateList;
508
		}
569
		}
509
 
570
 
510
		
571
		
511
		public NameAssistant getNameAssistant() {
572
		public NameAssistant getNameAssistant() {
512
			return nameAssistant;
573
			return nameAssistant;
513
		}
574
		}
514
 
575
 
515
		public LocationAssistant getLocationAssistant() {
576
		public LocationAssistant getLocationAssistant() {
516
			return locationAssistant;
577
			return locationAssistant;
517
		}
578
		}
518
 
579
 
519
		public InventoryItem getInventoryItem() {
580
		public InventoryItem getInventoryItem() {
520
			return inventoryItem;
581
			return inventoryItem;
521
		}
582
		}
522
 
583
 
523
		public EntryPanel getEntryPanel() {
584
		public EntryPanel getEntryPanel() {
524
			return entryPanel;
585
			return entryPanel;
525
		}
586
		}
526
 
587
 
527
 
588
 
528
		public LeftPanel getLeftPanel() {
589
		public LeftPanel getLeftPanel() {
529
			return leftPanel;
590
			return leftPanel;
530
		}
591
		}
531
 
592
 
532
		public InfoPopup getInfoPopup() {
593
		public InfoPopup getInfoPopup() {
-
 
594
			if (infoPopup==null) {
-
 
595
				infoPopup = new InfoPopup(this);
-
 
596
			}
533
			return infoPopup;
597
			return infoPopup;
534
		}
598
		}
535
 
599
 
536
		public void setConnected(boolean connected) {
600
		public void setConnected(boolean connected) {
537
		
601
		
538
			this.connected=connected;
602
			this.connected=connected;
539
		}
603
		}
540
		
604
		
541
		public boolean getConnected() {
605
		public boolean getConnected() {
542
			
606
			
543
			return this.connected;
607
			return this.connected;
544
		}
608
		}
545
 
609
 
546
		
610
		
547
		public ActionPanel getActionPanel() {
611
		public ActionPanel getActionPanel() {
548
			
612
			
549
			return this.actionPanel;
613
			return this.actionPanel;
550
		}
614
		}
551
 
615
 
552
	}
616
	}