Subversion Repositories eFlore/Archives.cel-v1

Rev

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

Rev 26 Rev 27
Line 10... Line 10...
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;
-
 
16
import com.google.gwt.user.client.ui.TextBox;
15
import com.google.gwt.user.client.ui.TextBox;
Line 17... Line 16...
17
 
16
 
Line 18... Line 17...
18
public class Mediator implements AutoCompleteAsyncTextBoxListener {
17
public class Mediator implements AutoCompleteAsyncTextBoxListener {
19
		
-
 
20
		
-
 
21
		private String serviceBaseUrl = getServiceBaseUrlFromDictionnary();
-
 
22
		private String user = null;
-
 
23
		private InventoryItemList inventoryItemList = null;
-
 
24
		private LocationList locationList = null;
-
 
25
		private DateList dateList = null;
-
 
26
		private StationList stationList = null;
-
 
27
		private NameAssistant nameAssistant=null;
-
 
28
		private LocationAssistant locationAssistant=null;
-
 
29
		private InventoryItem inventoryItem=null;
-
 
30
		private EntryPanel entryPanel=null;
-
 
31
		private ActionPanel actionPanel=null;
-
 
32
		private TopPanel topPanel=null;
-
 
33
		private LeftPanel leftPanel=null;
-
 
34
		private InfoPopup infoPopup=null;
-
 
35
		
-
 
Line -... Line 18...
-
 
18
		
-
 
19
		
-
 
20
		private String serviceBaseUrl = getServiceBaseUrlFromDictionnary(); // Recherche url de base des services distants
36
		private TextBox date = null; 
21
		
Line -... Line 22...
-
 
22
		// 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
-
 
32
		
-
 
33
		// Saisie d'une observation
-
 
34
		
-
 
35
		private EntryPanel entryPanel=null;  // Formulaire de saisie observation
-
 
36
	
-
 
37
		private NameAssistant nameAssistant=null; //  Assistant de saisie nom scientifique
-
 
38
		private LocationAssistant locationAssistant=null; // Assistant de saisie nom de commune
-
 
39
		
-
 
40
		private TextBox date = null; // date observation 
-
 
41
		private TextBox milieu = null;  // milieu observation
-
 
42
		private TextBox lieudit = null;  // lieu dit observation
-
 
43
		private TextBox comment = null; // commentaire observation
-
 
44
		private InventoryItem inventoryItem=null;  // Une observation saisie
-
 
45
 
-
 
46
 
-
 
47
		// Liste des observations
-
 
48
		private InventoryItemList inventoryItemList = null; // Liste de releves saisis
-
 
49
		private ActionPanel actionPanel=null; // Action sur les observations
-
 
50
		
-
 
51
		
-
 
52
		// Informations 
Line 37... Line 53...
37
		private TextBox complementLocation = null; 
53
		
Line 38... Line 54...
38
		private TextBox comment = null;
54
		private InfoPopup infoPopup=null; // Information complementaire sur un taxon (photo, repartition)
Line 39... Line 55...
39
 
55
		
Line -... Line 56...
-
 
56
 
-
 
57
		// Point d'entree (pour fin d'initialisation)
-
 
58
 
-
 
59
		private Cel cel = null;
-
 
60
 
-
 
61
		
-
 
62
		Mediator() {
-
 
63
			
-
 
64
		}
-
 
65
		
-
 
66
		
-
 
67
		// Methodes Private 
-
 
68
	
-
 
69
		
-
 
70
		
-
 
71
		/**
-
 
72
		 * Recuperation du prefixe d'appel des services
-
 
73
		 * @return prefix appel des service
-
 
74
		 */
-
 
75
 
-
 
76
		private String getServiceBaseUrlFromDictionnary() {
-
 
77
 
-
 
78
			Dictionary theme = Dictionary.getDictionary("Parameters");
-
 
79
			return theme.get("serviceBaseUrl");
-
 
80
 
-
 
81
		}
-
 
82
 
-
 
83
 
-
 
84
		// Appel aux services :
-
 
85
		
-
 
86
 
-
 
87
		/**
-
 
88
		 * Recherche distante et asynchrone de l'utilisateur connecte, en retour lancement methode initialisation
-
 
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
		}
40
		boolean connected=false;
111
 
41
 
112
		
42
 
113
 
43
		private Cel cel = null;
114
		
Line 44... Line 115...
44
 
115
		// Methodes Public
45
		
116
		
46
		Mediator() {
117
		
Line -... Line 118...
-
 
118
		
-
 
119
		// Information sur Etat du systeme
47
			
120
		
48
		}
121
		/**
49
	
122
		 * Recuperation information utilisateur
Line 50... Line -...
50
		/**
-
 
51
		 * Recuperation information utilisateur
123
		 *
Line 52... Line 124...
52
		 *
124
		 */
53
		 */
125
		
Line 71... Line 143...
71
			this.onLocationSelected("all");
143
			this.onLocationSelected("all");
Line 72... Line 144...
72
			
144
			
Line -... Line 145...
-
 
145
		}
-
 
146
		
Line 73... Line 147...
73
		}
147
		
74
		
148
		// Actions sur formulaire de saisie 
75
		
149
		
76
 
150
 
77
		/**
151
		/**
78
		 * Action lancee par la completion d'un nom dans l'assistant de saisie
152
		 * Action lancee par la completion d'un nom dans un assistant de saisie
Line 79... Line 153...
79
		 * Recherche d'information compl�mentaires ....
153
		 * Recherche d'information complementaires ....
Line 88... Line 162...
88
			}
162
			}
Line 89... Line 163...
89
 
163
 
Line 90... Line -...
90
		}	
-
 
91
		 
164
		}	
92
		
165
		 
93
 
-
 
94
		/**
-
 
95
		 * Action lancee par la selection d'un nom dans l'assistant de saisie. Lance
166
		
96
		 * la recherche d'informations compl�mentaires (famille, numero
-
 
97
		 * nomenclaturaux etc) et met a jour l'inventaire (addelement())
167
		/**
98
		 * 
-
 
99
		 * @return void
-
 
Line -... Line 168...
-
 
168
		 * Action suivant la completion d'un nom
100
		 */
169
		 * 
101
		public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,
170
		 */
102
				  String str, String value) {
171
 
103
		
-
 
104
		  	if (getEntryPanel().getOrdre()==null) {
-
 
105
				     onAddInventoryItem(); 
172
		public void  onNameCompleted(String value) {
106
			  	}
173
			if (infoPopup==null) {
Line -... Line 174...
-
 
174
				infoPopup = new InfoPopup(this);
-
 
175
			}
-
 
176
			infoPopup.setImageUrl(value);
-
 
177
		}
-
 
178
		
-
 
179
 
-
 
180
		
-
 
181
		/**
-
 
182
		 * Action prealable a l'ajout d'une observation : controle presence champs requis et lancement mise a jour 
-
 
183
		 * 
-
 
184
		 */
-
 
185
		
107
			else {
186
		public void onAddInventoryItem() {
Line -... Line 187...
-
 
187
		
-
 
188
			// Lazy instantiation
-
 
189
			if (inventoryItem==null) {
-
 
190
				registerInventoryItem(new InventoryItem());
Line 108... Line 191...
108
			     onModifyInventoryItem(getEntryPanel().getOrdre()); 
191
			}
109
			     getEntryPanel().setOrdre(null);
192
			
-
 
193
			inventoryItem.setContent(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),milieu.getText(),comment.getText(),"null");
110
			 }
194
			inventoryItemList.addelement();
Line -... Line 195...
-
 
195
			
Line -... Line 196...
-
 
196
		}
-
 
197
		
111
 
198
 
-
 
199
		
Line -... Line 200...
-
 
200
		/**
-
 
201
		 * Action prealable a la modification d'une observation : controle presence champs requis et lancement mise a jour 
Line 112... Line -...
112
		}
-
 
113
		
202
		 * 
Line 114... Line -...
114
 
-
 
Line -... Line 203...
-
 
203
		 */
-
 
204
 
-
 
205
		public void onModifyInventoryItem(String ordre) {
-
 
206
 
-
 
207
		// Lazy instantiation
-
 
208
		if (inventoryItem==null) {
-
 
209
			registerInventoryItem(new InventoryItem());
-
 
210
		}
115
	
211
 
Line -... Line 212...
-
 
212
		inventoryItem.setContent(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),milieu.getText(),comment.getText(),ordre);
-
 
213
		inventoryItemList.updateElement();
-
 
214
 
Line 116... Line 215...
116
		
215
		}
117
		/**
216
 
-
 
217
		
-
 
218
		public boolean inventoryItemIsValid() {
-
 
219
			// TODO : controle date
-
 
220
			
118
		 * Action suite ajout, modification, suppression element inventaire
221
		    if (inventoryItem.getName().compareTo("")==0) {
Line 119... Line -...
119
		 */
-
 
Line 120... Line 222...
120
		
222
		    	return false;
121
	
223
		    }
Line -... Line 224...
-
 
224
		    else {
-
 
225
		    	return true;
-
 
226
		    }
-
 
227
			
-
 
228
		}
-
 
229
 
-
 
230
 
Line 122... Line 231...
122
		public void onInventoryUpdated(String location) {
231
 
Line -... Line 232...
-
 
232
		/**
-
 
233
		 * Action lancee par la selection d'un nom dans un assistant de saisie. Lance
123
 
234
		 * la recherche d'informations complementaires (famille, numero
124
			
235
		 * nomenclaturaux etc) et met a jour l'inventaire (addelement())
125
			locationList.setLocation(location);
236
		 * 
Line 126... Line -...
126
			locationList.updateCount();
-
 
Line 127... Line 237...
127
 
237
		 * @return void
Line -... Line 238...
-
 
238
		 */
128
			this.onLocationSelected(location);
239
		
Line -... Line 240...
-
 
240
		
Line -... Line 241...
-
 
241
		public void onValidate(SourcesAutoCompleteAsyncTextBoxEvents sender,
Line 129... Line 242...
129
			
242
				  String str, String value) {
130
		}
243
		
131
		
244
		  	if (getEntryPanel().getOrdre()==null) { // Nouvelle observation 
Line 132... Line 245...
132
		
245
				     onAddInventoryItem(); 
Line 133... Line -...
133
		/**
-
 
134
		 * Action sur selection d'une observation : affichage du detail
-
 
135
		 */
-
 
136
		
246
			  	}
137
		public void onInventoryItemSelected(String ordre) {
247
			else {
Line 138... Line 248...
138
		
248
			     onModifyInventoryItem(getEntryPanel().getOrdre());   // Modification d'une observation
Line 139... Line -...
139
			entryPanel.setOrdre(ordre);
-
 
140
			entryPanel.update();
249
			     getEntryPanel().setOrdre(null);
141
			
250
			 }
142
			
-
 
143
		}
251
 
Line 144... Line 252...
144
 
252
		}
Line 145... Line 253...
145
		
253
		
146
		/**
-
 
Line 147... Line 254...
147
		 * Action sur deselection d'une observation : affichage du detail
254
	
Line 148... Line -...
148
		 */
-
 
149
		
-
 
Line 150... Line -...
150
		public void onInventoryItemUnselected(String ordre) {
-
 
151
		
-
 
Line -... Line 255...
-
 
255
		// Action portant sur la liste des observations
152
			entryPanel.setOrdre(null);
256
		
Line -... Line 257...
-
 
257
		/**
Line 153... Line 258...
153
			
258
		 * Action suite ajout, modification, suppression d'un element inventaire 
154
		}
259
		 */
155
 
260
		
156
 
261
	
Line 157... Line 262...
157
 
262
		public void onInventoryUpdated(String location) {
Line 229... Line 334...
229
			dateList.setUser(user);
334
			dateList.setUser(user);
230
			stationList.setUser(user);
335
			stationList.setUser(user);
231
			entryPanel.setUser(user);
336
			entryPanel.setUser(user);
232
			locationList.setUser(user);
337
			locationList.setUser(user);
233
			this.onInit();
338
			this.onInit();
234
			
-
 
235
		}
339
		}
Line 236... Line -...
236
 
-
 
237
		/**
-
 
238
		 * Action sur selection d'une station : affichage de la liste des taxons correspondants
-
 
Line 239... Line -...
239
		 */
-
 
Line 240... Line -...
240
		
-
 
241
		public void onStationSelected(String station) {
340
		
Line -... Line 341...
-
 
341
		
242
 
342
		
-
 
343
		// Filtre recherche contenu
Line 243... Line 344...
243
			inventoryItemList.setStation(station);
344
		
Line -... Line 345...
-
 
345
		/**
-
 
346
		 * Action sur recherche  : affichage de la liste des taxons correspondants
-
 
347
		 */
-
 
348
		
-
 
349
		public void onSearch(String search) {
Line 244... Line 350...
244
			inventoryItemList.updateCount();
350
	
Line -... Line 351...
-
 
351
			if (search.trim().compareTo("")==0) {
Line 245... Line 352...
245
			
352
				search="all";
246
			inventoryItemList.displayFilter();
353
			}
-
 
354
			inventoryItemList.setSearch(search);
247
 
355
			inventoryItemList.updateCount();
Line 248... Line 356...
248
//			nameAssistant.setValue(null);
356
			
Line 249... Line 357...
249
 
357
		}
250
 
358
 
Line 251... Line 359...
251
		}
359
		
Line 252... Line 360...
252
 
360
		
-
 
361
		// Filtre  selection lieu
Line -... Line 362...
-
 
362
		
-
 
363
		/**
Line 253... Line 364...
253
 
364
		 * Action sur selection d'un lieu : affichage de la liste des taxons correspondants
Line -... Line 365...
-
 
365
		 * TODO : gerer asynchronicite ?
-
 
366
		 */
-
 
367
		
254
 
368
		public void onLocationSelected(String loc) {
255
		
369
		
256
		/**
-
 
257
		 * Action sur selection d'une date : affichage de la liste des taxons correspondants
370
			inventoryItemList.setLocation(loc);
Line 258... Line 371...
258
		 */
371
			inventoryItemList.updateCount();
259
		
-
 
260
		public void onDateSelected(String date) {
-
 
261
 
-
 
262
			inventoryItemList.setDate(date);
-
 
263
			inventoryItemList.updateCount();
-
 
Line -... Line 372...
-
 
372
			
-
 
373
			inventoryItemList.displayFilter();
Line 264... Line -...
264
			
-
 
265
			inventoryItemList.displayFilter();
374
 
266
 
-
 
267
	//		nameAssistant.setValue(null);
-
 
Line 268... Line -...
268
 
-
 
Line 269... Line -...
269
 
-
 
270
		}
-
 
271
 
-
 
Line 272... Line 375...
272
		/**
375
			dateList.setLocation(loc);
Line -... Line 376...
-
 
376
			dateList.updateCount();
-
 
377
			
Line 273... Line 378...
273
		 * Action suivant la completion d'un nom
378
			stationList.setLocation(loc);
274
		 * 
379
			stationList.updateCount();
275
		 */
-
 
276
 
380
			
Line 277... Line 381...
277
		public void  onNameCompleted(String value) {
381
		}
Line 278... Line 382...
278
			if (infoPopup==null) {
382
		
279
				infoPopup = new InfoPopup(this);
-
 
280
			}
383
 
Line 281... Line 384...
281
			infoPopup.setImageUrl(value);
384
		// Filtre station
Line 282... Line -...
282
		}
-
 
283
		
-
 
Line 284... Line -...
284
		
-
 
285
		/**
-
 
286
		 * Action prealable a l'ajout d'une observation : controle presence champs requis et lancement mise a jour 
-
 
287
		 * 
-
 
288
		 */
-
 
289
		
385
		
Line 290... Line 386...
290
		public void onAddInventoryItem() {
386
		/**
Line 291... Line 387...
291
		
387
		 * Action sur selection d'une station : affichage de la liste des taxons correspondants
292
			// TODO : singleton ?
388
		 */
293
			registerInventoryItem(new InventoryItem(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),complementLocation.getText(),comment.getText(),"null"));
389
		
294
			inventoryItemList.addelement();
390
		public void onStationSelected(String station) {
Line 295... Line 391...
295
			
391
 
Line 296... Line 392...
296
		}
392
			inventoryItemList.setStation(station);
297
 
393
			inventoryItemList.updateCount();
Line 298... Line -...
298
		
-
 
299
		/**
394
			
300
		 * Action prealable a la modification d'une observation : controle presence champs requis et lancement mise a jour 
395
			inventoryItemList.displayFilter();
301
		 * 
396
 
302
		 */
397
 
Line 303... Line 398...
303
 
398
 
Line 304... Line 399...
304
		public void onModifyInventoryItem(String ordre) {
399
		}
Line 305... Line 400...
305
 
400
 
Line 306... Line 401...
306
		// TODO : singleton ?
401
		// Filtre date d'observation
307
		registerInventoryItem(new InventoryItem(nameAssistant.getText(),nameAssistant.getValue(),locationAssistant.getText(),locationAssistant.getValue(),date.getText(),complementLocation.getText(),comment.getText(),ordre));
402
 
308
		inventoryItemList.updateElement();
403
		
309
 
404
		/**
Line 310... Line 405...
310
		}
405
		 * Action sur selection d'une date : affichage de la liste des taxons correspondants
Line 357... Line 452...
357
		}
452
		}
Line 358... Line 453...
358
	
453
	
359
		
454
		
360
		
455
		
361
		/**
456
		/**
Line 362... Line 457...
362
		 * Declaration DateList
457
		 * Declaration DateList : filtre date observation
Line 363... Line 458...
363
		 * @param locationList
458
		 * @param locationList
364
		 */
459
		 */
Line 365... Line 460...
365
		
460
		
366
		public void registerDateList(DateList dateList) {
461
		public void registerDateList(DateList dateList) {
367
			
462
			
368
			this.dateList=dateList;
463
			this.dateList=dateList;
Line 369... Line 464...
369
		}
464
		}
Line 380... Line 475...
380
		}
475
		}
Line 381... Line 476...
381
 
476
 
382
 
477
 
383
		
478
		
384
		/**
479
		/**
Line 385... Line 480...
385
		 * Declaration StationList
480
		 * Declaration StationList : filtre par station
Line 392... Line 487...
392
		}
487
		}
Line 393... Line 488...
393
 
488
 
394
		
489
		
395
		
490
		
396
		/**
491
		/**
Line 397... Line 492...
397
		 * Declaration Cel
492
		 * Declaration Cel : point d'entree
Line 398... Line 493...
398
		 * @param cel
493
		 * @param cel
399
		 */
494
		 */
Line 400... Line 495...
400
 
495
 
401
		public void registerCel(Cel cel) {
496
		public void registerCel(Cel cel) {
402
			
497
			
403
			this.cel=cel;
498
			this.cel=cel;
Line 404... Line 499...
404
		}
499
		}
405
 
500
 
Line 406... Line 501...
406
		
501
		
Line 407... Line 502...
407
		/**
502
		/**
408
		 * Declaration NameAssistant 
503
		 * Declaration NameAssistant  : completion nom scientifique
409
		 * @param nameassistant
504
		 * @param nameassistant
410
		 */
505
		 */
Line 411... Line 506...
411
		
506
		
412
		public void registerNameAssistant(NameAssistant nameAssistant) {
507
		public void registerNameAssistant(NameAssistant nameAssistant) {
Line 425... Line 520...
425
		}
520
		}
Line 426... Line 521...
426
 
521
 
427
		
522
	
428
		
523
		
429
		/**
524
		/**
Line 430... Line 525...
430
		 * Declaration date
525
		 * Declaration date : date observation
431
		 * @param date
526
		 * @param date
Line 437... Line 532...
437
		}
532
		}
Line 438... Line 533...
438
	
533
	
439
		
534
	
-
 
535
		
440
		
536
		/**
441
		/**
537
		 * Declaration lieu dit : lieu dit d'observation
Line 442... Line 538...
442
		 * Declaration complementLocation
538
		 * 
443
		 * @param complementLocation
539
		 * @param milieu
Line 444... Line 540...
444
		 */
540
		 */
Line -... Line 541...
-
 
541
		
-
 
542
		public void registerLieudit(TextBox lieudit) {
-
 
543
			this.lieudit=lieudit;
-
 
544
			
-
 
545
		}
-
 
546
 
-
 
547
 
-
 
548
		
-
 
549
		/**
-
 
550
		 * Declaration milieu : milieu d'observation
-
 
551
		 * 
-
 
552
		 * @param milieu
-
 
553
		 */
-
 
554
		
-
 
555
		public void registerMilieu(TextBox milieu) {
-
 
556
			this.milieu=milieu;
-
 
557
			
445
		
558
		}
446
		public void registerComplementLocation(TextBox complementLocation) {
559
 
447
			this.complementLocation=complementLocation;
560
		/**
Line -... Line 561...
-
 
561
		 * Declaration Entry Panel : formulaire de saisie observation
-
 
562
		 */
-
 
563
 
-
 
564
		
-
 
565
	    public void  registerEntryPanel(EntryPanel entryPanel) {
448
			
566
	    	this.entryPanel=entryPanel;
449
		}
567
		}
450
		
568
 
Line -... Line 569...
-
 
569
 
-
 
570
		/**
-
 
571
		 * Declaration Action Panel : actions sur liste des observations
-
 
572
		 */
Line 451... Line 573...
451
		
573
 
452
	    public void  registerEntryPanel(EntryPanel entryPanel) {
574
	    
453
	    	this.entryPanel=entryPanel;
575
	    public void  registerActionPanel(ActionPanel actionPanel) {
Line 475... Line 597...
475
			this.comment=comment;
597
			this.comment=comment;
Line 476... Line 598...
476
			
598
			
Line 477... Line 599...
477
		}
599
		}
-
 
600
		
478
		
601
 
479
 
602
		/* 
Line 480... Line 603...
480
		/* Panneau gauche 
603
		 * Declaration LeftPanel Panneau gauche filtre sur liste d'observation
481
		 * 
604
		 * 
Line 482... Line 605...
482
		 */
605
		 */
Line -... Line 606...
-
 
606
		
Line 483... Line 607...
483
		
607
		public void registerLeftPanel(LeftPanel leftPanel) {
484
		public void registerLeftPanel(LeftPanel leftPanel) {
-
 
485
			this.leftPanel=leftPanel;
-
 
486
			
-
 
487
		}
-
 
488
		
-
 
489
		
-
 
490
		
-
 
491
 
-
 
492
		/**
-
 
493
		 * Recherche distante et asynchrone de l'utilisateur connecte, en retour lancement methode initialisation
-
 
494
		 * de l'appellant Cel. (initAsync)
-
 
495
		 * 
-
 
496
		 */
-
 
497
		
-
 
498
		private void getUserFromService() {
-
 
499
 
-
 
500
 
-
 
501
			HTTPRequest.asyncGet(serviceBaseUrl + "/User/",
-
 
502
					new ResponseTextHandler() {
-
 
503
 
-
 
504
						public void onCompletion(String str) {
-
 
505
							JSONValue jsonValue = JSONParser.parse(str);
-
 
506
							JSONArray jsonArray;
-
 
507
							if ((jsonArray = jsonValue.isArray()) != null) {
-
 
508
									user = ((JSONString) jsonArray.get(0)).stringValue(); // Identifiant utilisateur ou identifiant de session si non connecte
-
 
509
									connected = ((JSONBoolean) jsonArray.get(1)).booleanValue();  // Drapeau leve si utilisateur identifie
608
			this.leftPanel=leftPanel;
510
							}
609
			
511
							cel.initAsync();
610
		}
Line 512... Line 611...
512
						}
611
		
Line 525... Line 624...
525
 
624
 
Line 526... Line 625...
526
		}
625
		}
527
 
-
 
528
		
-
 
529
		/**
-
 
530
		 * Recuperation du prefixe d'appel des services
-
 
531
		 * @return prefix appel des service
-
 
532
		 */
-
 
533
 
-
 
534
		private String getServiceBaseUrlFromDictionnary() {
-
 
535
 
-
 
536
			Dictionary theme = Dictionary.getDictionary("Parameters");
-
 
537
			return theme.get("serviceBaseUrl");
-
 
538
 
-
 
539
		}
-
 
540
 
626
 
541
 
627
	
542
		/**
628
		/**
Line 543... Line 629...
543
		 *  Accesseur Utilisateur
629
		 *  Accesseur Utilisateur
544
		 * @return utilisateur connecte ou identifiant de session
630
		 * @return utilisateur connecte ou identifiant de session
545
		 */
631
		 */
Line 546... Line -...
546
		
-
 
547
		public String getUser() {
-
 
548
			return user;
632
		
549
		}
633
		public String getUser() {
550
 
634
			return user;
Line 551... Line -...
551
		
-
 
552
 
635
		}
553
		public void setUser(String user) {
636
 
554
			this.user=user;
637
		public void setUser(String user) {
Line 555... Line 638...
555
		}
638
			this.user=user;