Subversion Repositories eFlore/Archives.cel-v2

Rev

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

Rev 9 Rev 13
1
/**
1
/**
2
 David Delon david.delon@clapas.net 2007
2
 David Delon david.delon@clapas.net 2007
3
 
3
 
4
 */
4
 */
5
 
5
 
6
 
6
 
7
/*
7
/*
8
 * ListeObservationsVue.java  (Composite de Panel)
8
 * ListeObservationsVue.java  (Composite de Panel)
9
 *
9
 *
10
 * Cas d'utilisation :
10
 * Cas d'utilisation :
11
 * 
11
 * 
12
 * Affichage de releve 
12
 * Affichage de releve 
13
 *
13
 *
14
 * 1 : Recherche du nombre de releves associe au navigateur ou a l'utilisateur est connecte, en fonction des criteres de selection
14
 * 1 : Recherche du nombre de releves associe au navigateur ou a l'utilisateur est connecte, en fonction des criteres de selection
15
 * 2 : Recherche des releves correspondant au critere precedent
15
 * 2 : Recherche des releves correspondant au critere precedent
16
 * 3 : Affichage des releves avec positionnement sur le dernier releve
16
 * 3 : Affichage des releves avec positionnement sur le dernier releve
17
 * 
17
 * 
18
 * Selection de releve
18
 * Selection de releve
19
 * 
19
 * 
20
 * 1 : L'utilisateur selectionne un releve : lancement de l'affichage detaille pour le releve selectionne
20
 * 1 : L'utilisateur selectionne un releve : lancement de l'affichage detaille pour le releve selectionne
21
 * 
21
 * 
22
 * 
22
 * 
23
 * Pagination :
23
 * Pagination :
24
 * 
24
 * 
25
 * 1 : Avancement ou recul d'une page
25
 * 1 : Avancement ou recul d'une page
26
 *
26
 *
27
 *
27
 *
28
 * 
28
 * 
29
 *  Suppression d'une liste d'element 
29
 *  Suppression d'une liste d'element 
30
 */
30
 */
31
 
31
 
32
 
32
 
33
/* Actions declenchees :
33
/* Actions declenchees :
34
 * 
34
 * 
35
 * onInventoryItemSelected(numero d'ordre de la ligne selectionne) : selection d'une ligne
35
 * onInventoryItemSelected(numero d'ordre de la ligne selectionne) : selection d'une ligne
36
 * onInventoryItemUnselected(numero d'ordre de la ligne selectionne) : deselection d'une ligne
36
 * onInventoryItemUnselected(numero d'ordre de la ligne selectionne) : deselection d'une ligne
37
 * onInventoryUpdated(localite) : action suite a la modification, suppression, creation d'un element d'inventaire
37
 * onInventoryUpdated(localite) : action suite a la modification, suppression, creation d'un element d'inventaire
38
 * 
38
 * 
39
 */
39
 */
40
 
40
 
41
 
41
 
42
package org.tela_botanica.client.observation;
42
package org.tela_botanica.client.observation;
43
 
-
 
44
 
43
 
45
import org.tela_botanica.client.modeles.Observation;
44
import org.tela_botanica.client.modeles.Observation;
46
 
-
 
47
 
45
 
48
import com.google.gwt.user.client.HTTPRequest;
46
import com.google.gwt.user.client.HTTPRequest;
49
import com.google.gwt.user.client.ResponseTextHandler;
47
import com.google.gwt.user.client.ResponseTextHandler;
50
import com.google.gwt.user.client.ui.Composite;
48
import com.google.gwt.user.client.ui.Composite;
51
import com.google.gwt.user.client.ui.DockPanel;
49
import com.google.gwt.user.client.ui.DockPanel;
52
import com.google.gwt.user.client.ui.HorizontalPanel;
50
import com.google.gwt.user.client.ui.HorizontalPanel;
53
import com.google.gwt.user.client.ui.Button;
51
import com.google.gwt.user.client.ui.Button;
54
import com.google.gwt.user.client.ui.Label;
52
import com.google.gwt.user.client.ui.Label;
55
import com.google.gwt.user.client.ui.Widget;
53
import com.google.gwt.user.client.ui.Widget;
56
import com.google.gwt.user.client.ui.ClickListener;
54
import com.google.gwt.user.client.ui.ClickListener;
57
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
55
import com.google.gwt.user.client.ui.HasHorizontalAlignment;
58
import com.google.gwt.user.client.ui.HasVerticalAlignment;
56
import com.google.gwt.user.client.ui.HasVerticalAlignment;
59
 
57
 
60
 
58
 
61
public class ListeObservationsVue extends Composite
59
public class ListeObservationsVue extends Composite
62
		 {
60
		 {
63
 
61
 
64
	// Debut Barre de navigation
62
	// Debut Barre de navigation
65
 
63
 
66
	private class NavBar extends Composite implements ClickListener {
64
	private class NavBar extends Composite implements ClickListener {
67
 
65
 
68
		
66
		
69
		public final DockPanel bar = new DockPanel();
67
		public final DockPanel bar = new DockPanel();
70
		
68
		
71
 
69
 
72
		public final Button gotoFirst = new Button("<<", this);
70
		public final Button gotoFirst = new Button("<<", this);
73
		public final Button gotoNext = new Button(">", this);
71
		public final Button gotoNext = new Button(">", this);
74
		public final Button gotoPrev = new Button("<", this);
72
		public final Button gotoPrev = new Button("<", this);
75
		public final Button gotoEnd = new Button(">>", this);
73
		public final Button gotoEnd = new Button(">>", this);
76
		public final Label status = new Label();
74
		public final Label status = new Label();
77
		
75
		
78
 
76
 
79
		public NavBar() {
77
		public NavBar() {
80
			
78
			
81
			initWidget(bar);
79
			initWidget(bar);
82
			
80
			
83
			status.setWordWrap(false);
81
			status.setWordWrap(false);
84
 
82
 
85
			HorizontalPanel buttons = new HorizontalPanel();
83
			HorizontalPanel buttons = new HorizontalPanel();
86
			
84
			
87
			buttons.add(status);
85
			buttons.add(status);
88
			buttons.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT);
86
			buttons.setCellHorizontalAlignment(status, HasHorizontalAlignment.ALIGN_RIGHT);
89
			buttons.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE);
87
			buttons.setCellVerticalAlignment(status, HasVerticalAlignment.ALIGN_MIDDLE);
90
 
88
 
91
 
89
 
92
			buttons.add(gotoFirst);
90
			buttons.add(gotoFirst);
93
			buttons.add(gotoPrev);
91
			buttons.add(gotoPrev);
94
			buttons.add(gotoNext);
92
			buttons.add(gotoNext);
95
			buttons.add(gotoEnd);
93
			buttons.add(gotoEnd);
96
			
94
			
97
			bar.add(buttons, DockPanel.EAST);
95
			bar.add(buttons, DockPanel.EAST);
98
 
96
 
99
			
97
			
100
		}
98
		}
101
		
99
		
102
 
100
 
103
		public void onClick(Widget sender) {
101
		public void onClick(Widget sender) {
104
			if (sender == gotoNext) {
102
			if (sender == gotoNext) {
105
				// Move forward a page.
103
				// Move forward a page.
106
				startIndex += VISIBLE_TAXON_COUNT;
104
				startIndex += VISIBLE_TAXON_COUNT;
107
				if (startIndex >= count)
105
				if (startIndex >= count)
108
					startIndex -= VISIBLE_TAXON_COUNT;
106
					startIndex -= VISIBLE_TAXON_COUNT;
109
			} else {
107
			} else {
110
				if (sender == gotoPrev) {
108
				if (sender == gotoPrev) {
111
					// Move back a page.
109
					// Move back a page.
112
					startIndex -= VISIBLE_TAXON_COUNT;
110
					startIndex -= VISIBLE_TAXON_COUNT;
113
					if (startIndex < 0)
111
					if (startIndex < 0)
114
						startIndex = 0;
112
						startIndex = 0;
115
				} else {
113
				} else {
116
					if (sender == gotoEnd) {
114
					if (sender == gotoEnd) {
117
						gotoEnd();
115
						gotoEnd();
118
					} else {
116
					} else {
119
						if (sender == gotoFirst) {
117
						if (sender == gotoFirst) {
120
							startIndex = 0;
118
							startIndex = 0;
121
						}
119
						}
122
					}
120
					}
123
				}
121
				}
124
			}
122
			}
125
			getListeObservation();
123
			getListeObservation();
126
		}
124
		}
127
 
125
 
128
	}
126
	}
129
 
127
 
130
	// Fin Barre de navigation
128
	// Fin Barre de navigation
131
 
129
 
132
	// Conteneur (header et table sont dans panel)
130
	// Conteneur (header et table sont dans panel)
133
//	private ContentPanel panel =null;
131
//	private ContentPanel panel =null;
134
//	private Table table = null;
132
//	private Table table = null;
135
	
133
	
136
	// Services 
134
	// Services 
137
	private String serviceBaseUrl = null;
135
	private String serviceBaseUrl = null;
138
	private String user;
136
	private String user;
139
	private ObservationMediateur observationMediateur = null;
137
	private ObservationMediateur observationMediateur = null;
140
 
138
 
141
	// Navigation
139
	// Navigation
142
	private int startIndex = 0;
140
	private int startIndex = 0;
143
	private int count = 0;
141
	private int count = 0;
144
	private static final int VISIBLE_TAXON_COUNT = 15;
142
	private static final int VISIBLE_TAXON_COUNT = 15;
145
	private NavBar navBar=null;
143
	private NavBar navBar=null;
146
 
144
 
147
	// Filtre par defaut :
145
	// Filtre par defaut :
148
	
146
	
149
	private String identifiantLocalite = "all";
147
	private String identifiantLocalite = "all";
150
	private String localite = "all";
148
	private String localite = "all";
151
	private String annee = "all";
149
	private String annee = "all";
152
	private String mois = "all";
150
	private String mois = "all";
153
	private String jour = "all";
151
	private String jour = "all";
154
	private String rechercheLibre = "all";
152
	private String rechercheLibre = "all";
155
	private String lieudit = "all";
153
	private String lieudit = "all";
156
	private String ordre= null;
154
	private String ordre= null;
157
	
155
	
158
	
156
	
159
 
157
 
160
 
158
 
161
	public ListeObservationsVue(ObservationMediateur observationMediateur) {
159
	public ListeObservationsVue(ObservationMediateur observationMediateur) {
162
		
160
		
163
		
161
		
164
		// Traitement contexte utilisateur et service
162
		// Traitement contexte utilisateur et service
165
 
163
 
166
		this.observationMediateur=observationMediateur;
164
		this.observationMediateur=observationMediateur;
167
 
165
 
168
	    
166
	    
169
	//    panel= new ContentPanel(Style.HEADER);
167
	//    panel= new ContentPanel(Style.HEADER);
170
	  //  panel.setLayout(new FillLayout());
168
	  //  panel.setLayout(new FillLayout());
171
	    
169
	    
172
	    
170
	    
173
	    // Barre navigation integree au header 
171
	    // Barre navigation integree au header 
174
	    
172
	    
175
		navBar = new NavBar();
173
		navBar = new NavBar();
176
	//	panel.getHeader().addWidget(navBar);
174
	//	panel.getHeader().addWidget(navBar);
177
 
175
 
178
		
176
		
179
		//  Contenu :
177
		//  Contenu :
180
		
178
		
181
		
179
		
182
		//  Colonnes :
180
		//  Colonnes :
183
		
181
		
184
//		TableColumn[] columns = new TableColumn[6]; 
182
//		TableColumn[] columns = new TableColumn[6]; 
185
		
183
		
186
		// TODO : renderer date, alignement etc
184
		// TODO : renderer date, alignement etc
187
	/*	
185
	/*	
188
		columns[0] = new TableColumn("etat","Aransmis", 50);  
186
		columns[0] = new TableColumn("etat","Aransmis", 50);  
189
 
187
 
190
		columns[1] = new TableColumn("nom","Nom saisi", 250);  
188
		columns[1] = new TableColumn("nom","Nom saisi", 250);  
191
		
189
		
192
		columns[2] = new TableColumn("nomr","Nom retenu", 250);  
190
		columns[2] = new TableColumn("nomr","Nom retenu", 250);  
193
 
191
 
194
		columns[3] = new TableColumn("lieu","Lieu", 350);  
192
		columns[3] = new TableColumn("lieu","Lieu", 350);  
195
 
193
 
196
		columns[4] = new TableColumn("date","Date", 75);  
194
		columns[4] = new TableColumn("date","Date", 75);  
197
 
195
 
198
		columns[5] = new TableColumn("ordre","Ordre", 50);  
196
		columns[5] = new TableColumn("ordre","Ordre", 50);  
199
		
197
		
200
	
198
	
201
		TableColumnModel cm = new TableColumnModel(columns);  
199
		TableColumnModel cm = new TableColumnModel(columns);  
202
		
200
		
203
		// Table : 
201
		// Table : 
204
		
202
		
205
		table = new Table(Style.MULTI | Style.HORIZONTAL, cm);  
203
		table = new Table(Style.MULTI | Style.HORIZONTAL, cm);  
206
		table.setBorders(false);  
204
		table.setBorders(false);  
207
		
205
		
208
		
206
		
209
		panel.add(table);
207
		panel.add(table);
210
		
208
		
211
		
209
		
212
 
210
 
213
		// Selection d'une ligne 
211
		// Selection d'une ligne 
214
		table.addListener(Events.RowClick, new Listener() {
212
		table.addListener(Events.RowClick, new Listener() {
215
 
213
 
216
		      public void handleEvent(BaseEvent be) {
214
		      public void handleEvent(BaseEvent be) {
217
		        TableItem item=(TableItem) be.item;
215
		        TableItem item=(TableItem) be.item;
218
		        if (item!=null) {
216
		        if (item!=null) {
219
		        	if (ordre==null) { // Affichage de la ligne selectionne
217
		        	if (ordre==null) { // Affichage de la ligne selectionne
220
		        		ordre= (String) item.getValue(5);
218
		        		ordre= (String) item.getValue(5);
221
	//	        		observationMediateur.onInventoryItemSelected(ordre);
219
	//	        		observationMediateur.onInventoryItemSelected(ordre);
222
		        	}
220
		        	}
223
		        	else { 
221
		        	else { 
224
		        		// Si une ligne etait deja selectionne 
222
		        		// Si une ligne etait deja selectionne 
225
		        		if (ordre.compareTo((String) item.getValue(5))==0) { // C'est la meme, on la deselectionne
223
		        		if (ordre.compareTo((String) item.getValue(5))==0) { // C'est la meme, on la deselectionne
226
		        			ordre=null;
224
		        			ordre=null;
227
		        			table.deselect(be.rowIndex);
225
		        			table.deselect(be.rowIndex);
228
		//        			observationMediateur.onInventoryItemUnselected();
226
		//        			observationMediateur.onInventoryItemUnselected();
229
		        		}
227
		        		}
230
		        		else {
228
		        		else {
231
			        		ordre= (String) item.getValue(5); // C'est une autre, on la selectionne
229
			        		ordre= (String) item.getValue(5); // C'est une autre, on la selectionne
232
//		        			observationMediateur.onInventoryItemSelected(ordre);
230
//		        			observationMediateur.onInventoryItemSelected(ordre);
233
		        		}
231
		        		}
234
		        		
232
		        		
235
		        	}
233
		        	}
236
		        }
234
		        }
237
		      }
235
		      }
238
		});
236
		});
239
		*/
237
		*/
240
	
238
	
241
	// initWidget(panel);
239
	// initWidget(panel);
242
 
240
 
243
 
241
 
244
	}
242
	}
245
	
243
	
246
	
244
	
247
	/**
245
	/**
248
	 * Suppression d'un ensemble d'element de la liste d'inventaire, on garde ici car s'applique a plusieurs elements
246
	 * Suppression d'un ensemble d'element de la liste d'inventaire, on garde ici car s'applique a plusieurs elements
249
	 * 
247
	 * 
250
	 */
248
	 */
251
 
249
 
252
	public void deleteElement() {
250
	public void deleteElement() {
253
/*
251
/*
254
		setStatusDisabled();
252
		setStatusDisabled();
255
		TableItem[] selection=table.getSelection();
253
		TableItem[] selection=table.getSelection();
256
 
254
 
257
		StringBuffer ids=new StringBuffer();
255
		StringBuffer ids=new StringBuffer();
258
		for (int i = 0; i < selection.length; i++) {
256
		for (int i = 0; i < selection.length; i++) {
259
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
257
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
260
			if (i<(selection.length-1)) ids.append(",");
258
			if (i<(selection.length-1)) ids.append(",");
261
		} 
259
		} 
262
		
260
		
263
		if (ids.length()>0) {
261
		if (ids.length()>0) {
264
			
262
			
265
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
263
			HTTPRequest.asyncPost(serviceBaseUrl + "/Inventory/" + user
266
							+ "/" + ids.toString(), "action=DELETE",
264
							+ "/" + ids.toString(), "action=DELETE",
267
							
265
							
268
							new ResponseTextHandler() {
266
							new ResponseTextHandler() {
269
								public void onCompletion(String str) {
267
								public void onCompletion(String str) {
270
	//										observationMediateur.onInventoryUpdated(identifiantLocalite,"all","all");
268
	//										observationMediateur.onInventoryUpdated(identifiantLocalite,"all","all");
271
		//									observationMediateur.getEntryView().clear();
269
		//									observationMediateur.getEntryView().clear();
272
								}
270
								}
273
							});
271
							});
274
		}
272
		}
275
	
273
	
276
		setStatusEnabled();
274
		setStatusEnabled();
277
*/
275
*/
278
	}
276
	}
279
	
277
	
280
	
278
	
281
	
279
	
282
	
280
	
283
	/**
281
	/**
284
	 * Transmission de releve a Tela, on garde ici car s'applique a plusieurs elements
282
	 * Transmission de releve a Tela, on garde ici car s'applique a plusieurs elements
285
	 */
283
	 */
286
 
284
 
287
	
285
	
288
	public void transmitElement() {
286
	public void transmitElement() {
289
	
287
	
290
		setStatusDisabled();
288
		setStatusDisabled();
291
		
289
		
292
/*		TableItem[] selection=table.getSelection();
290
/*		TableItem[] selection=table.getSelection();
293
 
291
 
294
		StringBuffer ids=new StringBuffer();
292
		StringBuffer ids=new StringBuffer();
295
		for (int i = 0; i < selection.length; i++) {
293
		for (int i = 0; i < selection.length; i++) {
296
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
294
			ids.append((String)(((TableItem) selection[i]).getValue(5)));
297
			if (i<(selection.length-1)) ids.append(",");
295
			if (i<(selection.length-1)) ids.append(",");
298
		} 
296
		} 
299
	
297
	
300
		if (ids.length()>0) {
298
		if (ids.length()>0) {
301
		
299
		
302
			HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user
300
			HTTPRequest.asyncPost(serviceBaseUrl + "/InventoryTransmit/" + user
303
							+ "/" + ids.toString(), "transmission=1",
301
							+ "/" + ids.toString(), "transmission=1",
304
							
302
							
305
							new ResponseTextHandler() {
303
							new ResponseTextHandler() {
306
								public void onCompletion(String str) {
304
								public void onCompletion(String str) {
307
											getListeObservation(); // Pour affichage logo 
305
											getListeObservation(); // Pour affichage logo 
308
								}
306
								}
309
							});
307
							});
310
		}
308
		}
311
	
309
	
312
		setStatusEnabled();
310
		setStatusEnabled();
313
 
311
 
314
		*/
312
		*/
315
	}
313
	}
316
	
314
	
317
	
315
	
318
	/**
316
	/**
319
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
317
	 * Recherche nombre d'enregistrement pour l'utilisateur et la localite en cours
320
	 * 
318
	 * 
321
	 */
319
	 */
322
	
320
	
323
	public void initialiser() {
321
	public void initialiser() {
324
		
322
		
325
		setStatusDisabled();
323
		setStatusDisabled();
326
 
324
 
327
	//	observationMediateur.addListener(ObservationMediateur.NOMBRE_OBSERVATION,this);
325
	//	observationMediateur.addListener(ObservationMediateur.NOMBRE_OBSERVATION,this);
328
		observationMediateur.getNombreObservation(identifiantLocalite,localite,annee, mois, jour ,lieudit,rechercheLibre); // Retour dans handlevent() NOMBRE_OBSERVATION
326
		observationMediateur.getNombreObservation(identifiantLocalite,localite,annee, mois, jour ,lieudit,rechercheLibre); // Retour dans handlevent() NOMBRE_OBSERVATION
329
 
327
 
330
		
328
		
331
	}
329
	}
332
	
330
	
333
	/**
331
	/**
334
	 * Mise a jour de l'affichage, a partir des donnaes d'inventaire deja
332
	 * Mise a jour de l'affichage, a partir des donnaes d'inventaire deja
335
	 * saisies. La valeur de this.startIndex permet de determiner quelles
333
	 * saisies. La valeur de this.startIndex permet de determiner quelles
336
	 * donnaes seront affichees
334
	 * donnaes seront affichees
337
	 * 
335
	 * 
338
	 */
336
	 */
339
 
337
 
340
	public void getListeObservation() {
338
	public void getListeObservation() {
341
 
339
 
342
	//	observationMediateur.addListener(ObservationMediateur.LISTE_OBSERVATION,this);
340
	//	observationMediateur.addListener(ObservationMediateur.LISTE_OBSERVATION,this);
343
		observationMediateur.getListeObservation(identifiantLocalite,localite,annee, mois, jour ,lieudit,rechercheLibre, startIndex, VISIBLE_TAXON_COUNT); // Retour dans handlevent() LISTE_OBSERVATION
341
		observationMediateur.getListeObservation(identifiantLocalite,localite,annee, mois, jour ,lieudit,rechercheLibre, startIndex, VISIBLE_TAXON_COUNT); // Retour dans handlevent() LISTE_OBSERVATION
344
		
342
		
345
	}
343
	}
346
	
344
	
347
	public void afficherListeObservation() {
345
	public void afficherListeObservation() {
348
 
346
 
349
		Observation[] listeObservation =observationMediateur.getObservation().getListeObservation();
347
		Observation[] listeObservation =observationMediateur.getObservation().getListeObservation();
350
		
348
		
351
		for (int i=0;i<listeObservation.length;i++) {
349
		for (int i=0;i<listeObservation.length;i++) {
352
		
350
		
353
			Object[] values = new Object[6];
351
			Object[] values = new Object[6];
354
			values[0]="0";
352
			values[0]="0";
355
			values[2]="2";
353
			values[2]="2";
356
			values[3]="3";
354
			values[3]="3";
357
			values[4]="4";
355
			values[4]="4";
358
			values[5]="5";
356
			values[5]="5";
359
			values[1]=listeObservation[i].getNomSaisi();
357
			values[1]=listeObservation[i].getNomSaisi();
360
			
358
			
361
    	//	table.add(new TableItem(values));
359
    	//	table.add(new TableItem(values));
362
			
360
			
363
		}
361
		}
364
		
362
		
365
//      Ligne d'information 
363
//      Ligne d'information 
366
 
364
 
367
		// Toutes date par defaut
365
		// Toutes date par defaut
368
/*		
366
/*		
369
 
367
 
370
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + identifiantLocalite + "/" + URL.encodeComponent(localite) +"/" + annee  + "/"  + mois  + "/"  + jour   + "/" + URL.encodeComponent(rechercheLibre) + "/" + URL.encodeComponent(lieudit) + "/"
368
		HTTPRequest.asyncGet(serviceBaseUrl + "/InventoryItemList/" + user + "/" + identifiantLocalite + "/" + URL.encodeComponent(localite) +"/" + annee  + "/"  + mois  + "/"  + jour   + "/" + URL.encodeComponent(rechercheLibre) + "/" + URL.encodeComponent(lieudit) + "/"
371
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
369
				+ startIndex + "/" + VISIBLE_TAXON_COUNT,
372
 
370
 
373
		new ResponseTextHandler() {
371
		new ResponseTextHandler() {
374
 
372
 
375
			public void onCompletion(String str) {
373
			public void onCompletion(String str) {
376
 
374
 
377
				JSONValue jsonValue = JSONParser.parse(str);
375
				JSONValue jsonValue = JSONParser.parse(str);
378
				JSONArray jsonArray;
376
				JSONArray jsonArray;
379
				JSONArray jsonArrayNested;
377
				JSONArray jsonArrayNested;
380
				
378
				
381
				int i=0;
379
				int i=0;
382
 
380
 
383
				if ((jsonArray = jsonValue.isArray()) != null) {
381
				if ((jsonArray = jsonValue.isArray()) != null) {
384
					
382
					
385
					StringBuffer lieu=null;
383
					StringBuffer lieu=null;
386
 
384
 
387
					int arraySize = jsonArray.size();
385
					int arraySize = jsonArray.size();
388
					
386
					
389
					for (i = 0; i < arraySize; ++i) {
387
					for (i = 0; i < arraySize; ++i) {
390
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
388
						if ((jsonArrayNested = jsonArray.get(i).isArray()) != null) {
391
							
389
							
392
 
390
 
393
							Object[] values = new Object[6];
391
							Object[] values = new Object[6];
394
							
392
							
395
													
393
													
396
							// Statut Observation transmise ?
394
							// Statut Observation transmise ?
397
							
395
							
398
							String atransmit=((JSONString) jsonArrayNested .get(13)).stringValue();
396
							String atransmit=((JSONString) jsonArrayNested .get(13)).stringValue();
399
							
397
							
400
							if (atransmit.compareTo("1")==0) {
398
							if (atransmit.compareTo("1")==0) {
401
								values[0] = new Image("tela.gif");
399
								values[0] = new Image("tela.gif");
402
							}
400
							}
403
							else {
401
							else {
404
								values[0] = new HTML("&nbsp;");
402
								values[0] = new HTML("&nbsp;");
405
							}
403
							}
406
							
404
							
407
						
405
						
408
							// Nom saisi
406
							// Nom saisi
409
							
407
							
410
							values[1] = new HTML("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>");
408
							values[1] = new HTML("<b>"+Util.toCelString(((JSONString) jsonArrayNested .get(0)).toString())+"</b>");
411
							
409
							
412
							
410
							
413
 
411
 
414
							// Nom retenu
412
							// Nom retenu
415
							String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString());
413
							String aname=Util.toCelString(((JSONString) jsonArrayNested .get(2)).toString());
416
							
414
							
417
							if (aname.compareTo("null")==0) {
415
							if (aname.compareTo("null")==0) {
418
								values[2] = new HTML("&nbsp;");
416
								values[2] = new HTML("&nbsp;");
419
							}
417
							}
420
							else {
418
							else {
421
								values[2] = new HTML(aname);
419
								values[2] = new HTML(aname);
422
							}
420
							}
423
							/*
421
							/*
424
							 
422
							 
425
							 /*
423
							 /*
426
							// Num nomenclatural
424
							// Num nomenclatural
427
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
425
							String ann=((JSONString) jsonArrayNested .get(3)).stringValue();
428
							
426
							
429
							if (ann.compareTo("0")!=0) {
427
							if (ann.compareTo("0")!=0) {
430
								observationText.append(""+ann+"-");
428
								observationText.append(""+ann+"-");
431
							}
429
							}
432
							else {
430
							else {
433
								observationText.append("0-");
431
								observationText.append("0-");
434
							}
432
							}
435
							
433
							
436
							
434
							
437
							// Num Taxonomique
435
							// Num Taxonomique
438
							
436
							
439
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
437
							String ant=((JSONString) jsonArrayNested .get(4)).stringValue();
440
							
438
							
441
							if (ant.compareTo("0")!=0) {
439
							if (ant.compareTo("0")!=0) {
442
								observationText.append(ant+", ");
440
								observationText.append(ant+", ");
443
							}
441
							}
444
							else {
442
							else {
445
								observationText.append("0, ");
443
								observationText.append("0, ");
446
							}
444
							}
447
							
445
							
448
							// Famille
446
							// Famille
449
							
447
							
450
							
448
							
451
							String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString());
449
							String afamily=Util.toCelString(((JSONString) jsonArrayNested .get(5)).toString());
452
							
450
							
453
							if (afamily.compareTo("null")==0) {
451
							if (afamily.compareTo("null")==0) {
454
								//
452
								//
455
							}
453
							}
456
							else {
454
							else {
457
								observationText.append(afamily+", ");
455
								observationText.append(afamily+", ");
458
							}
456
							}
459
							*/
457
							*/
460
		/*
458
		/*
461
		
459
		
462
//							Localisation - Lieu
460
//							Localisation - Lieu
463
 
461
 
464
							lieu=new StringBuffer();
462
							lieu=new StringBuffer();
465
 
463
 
466
							String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString());
464
							String aloc=Util.toCelString(((JSONString) jsonArrayNested .get(6)).toString());
467
								
465
								
468
								if (aloc.compareTo("000null")==0) {
466
								if (aloc.compareTo("000null")==0) {
469
									if (lieu.length()==0) {
467
									if (lieu.length()==0) {
470
										lieu.append("Commune absente");
468
										lieu.append("Commune absente");
471
									}
469
									}
472
									else {
470
									else {
473
										lieu.append("commune absente");
471
										lieu.append("commune absente");
474
									}
472
									}
475
								}
473
								}
476
								else {
474
								else {
477
									if (lieu.length()==0) {
475
									if (lieu.length()==0) {
478
										lieu.append("Commune de "+aloc);
476
										lieu.append("Commune de "+aloc);
479
									}
477
									}
480
									else {
478
									else {
481
										lieu.append("commune de "+aloc);
479
										lieu.append("commune de "+aloc);
482
									}
480
									}
483
										
481
										
484
								}
482
								}
485
							
483
							
486
								
484
								
487
								String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString());
485
								String alieudit=Util.toCelString(((JSONString) jsonArrayNested .get(9)).toString());
488
							
486
							
489
//								Localisation - Lieu dit
487
//								Localisation - Lieu dit
490
								
488
								
491
								if (alieudit.compareTo("000null")!=0) {
489
								if (alieudit.compareTo("000null")!=0) {
492
									lieu.append(", "+alieudit);
490
									lieu.append(", "+alieudit);
493
								}
491
								}
494
								
492
								
495
								
493
								
496
//								Station -
494
//								Station -
497
								
495
								
498
								String astation=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString());
496
								String astation=Util.toCelString(((JSONString) jsonArrayNested .get(10)).toString());
499
 
497
 
500
								
498
								
501
								if (astation.compareTo("000null")!=0) {
499
								if (astation.compareTo("000null")!=0) {
502
									lieu.append(", "+astation);
500
									lieu.append(", "+astation);
503
								}
501
								}
504
 
502
 
505
								
503
								
506
//								Milieu
504
//								Milieu
507
								
505
								
508
								String amilieu=Util.toCelString(((JSONString) jsonArrayNested .get(11)).toString());
506
								String amilieu=Util.toCelString(((JSONString) jsonArrayNested .get(11)).toString());
509
 
507
 
510
								
508
								
511
								if (amilieu.compareTo("000null")!=0) {
509
								if (amilieu.compareTo("000null")!=0) {
512
									lieu.append(", "+amilieu);
510
									lieu.append(", "+amilieu);
513
								}								
511
								}								
514
							
512
							
515
								String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(12)).toString());
513
								String acomment=Util.toCelString(((JSONString) jsonArrayNested .get(12)).toString());
516
//								Commentaire
514
//								Commentaire
517
								
515
								
518
								if (acomment.compareTo("null")!=0) {
516
								if (acomment.compareTo("null")!=0) {
519
									lieu.append(", "+acomment);
517
									lieu.append(", "+acomment);
520
								}
518
								}
521
 
519
 
522
								
520
								
523
								if (lieu.toString().compareTo("")==0) {
521
								if (lieu.toString().compareTo("")==0) {
524
									values[3] = new HTML("&nbsp;");
522
									values[3] = new HTML("&nbsp;");
525
								}
523
								}
526
								else {
524
								else {
527
									values[3] = new HTML(lieu.toString());
525
									values[3] = new HTML(lieu.toString());
528
								}
526
								}
529
 
527
 
530
								
528
								
531
								String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
529
								String adate=((JSONString) jsonArrayNested .get(8)).stringValue();
532
								
530
								
533
//								Date 
531
//								Date 
534
								if (adate.compareTo("0000-00-00 00:00:00")!=0) {
532
								if (adate.compareTo("0000-00-00 00:00:00")!=0) {
535
									values[4]=new HTML("<b>"+adate+"</b>"); 
533
									values[4]=new HTML("<b>"+adate+"</b>"); 
536
								}
534
								}
537
								else { 
535
								else { 
538
									values[4] = new HTML("&nbsp;");
536
									values[4] = new HTML("&nbsp;");
539
								}
537
								}
540
									
538
									
541
 
539
 
542
							
540
							
543
							String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
541
							String aordre=((JSONString) jsonArrayNested.get(7)).stringValue();
544
						
542
						
545
							// Numero d'ordre (cache)
543
							// Numero d'ordre (cache)
546
							
544
							
547
							values[5] = aordre;
545
							values[5] = aordre;
548
							
546
							
549
							
547
							
550
						
548
						
551
							
549
							
552
					    	if (i>=table.getItemCount()) {
550
					    	if (i>=table.getItemCount()) {
553
					    		TableItem item = new TableItem(values);
551
					    		TableItem item = new TableItem(values);
554
					    		table.add(item);
552
					    		table.add(item);
555
							}
553
							}
556
							else {
554
							else {
557
								TableItem item=table.getItem(i);
555
								TableItem item=table.getItem(i);
558
								item.setValue(0,values[0]);
556
								item.setValue(0,values[0]);
559
								item.setValue(1,values[1]);
557
								item.setValue(1,values[1]);
560
								item.setValue(2,values[2]);
558
								item.setValue(2,values[2]);
561
								item.setValue(3,values[3]);
559
								item.setValue(3,values[3]);
562
								item.setValue(4,values[4]);
560
								item.setValue(4,values[4]);
563
								item.setValue(5,values[5]);
561
								item.setValue(5,values[5]);
564
							}
562
							}
565
					    	
563
					    	
566
					    	// Spagetti
564
					    	// Spagetti
567
							if (ordre!=null) {
565
							if (ordre!=null) {
568
								if (aordre.compareTo(ordre)==0) {
566
								if (aordre.compareTo(ordre)==0) {
569
									table.select(i);
567
									table.select(i);
570
								}
568
								}
571
								else {
569
								else {
572
									table.deselect(i);
570
									table.deselect(i);
573
								}
571
								}
574
							}
572
							}
575
							
573
							
576
						}
574
						}
577
 
575
 
578
					}
576
					}
579
				}
577
				}
580
 
578
 
581
				// Suppression fin ancien affichage
579
				// Suppression fin ancien affichage
582
				if (i<table.getItemCount()) {
580
				if (i<table.getItemCount()) {
583
					 for (int j = table.getItemCount() -1 ; j >= i; j--) {
581
					 for (int j = table.getItemCount() -1 ; j >= i; j--) {
584
						 TableItem item=table.getItem(j);
582
						 TableItem item=table.getItem(j);
585
						 table.remove(item);
583
						 table.remove(item);
586
					 }
584
					 }
587
				}
585
				}
588
				
586
				
589
				setStatusEnabled();
587
				setStatusEnabled();
590
				
588
				
591
				
589
				
592
			}
590
			}
593
		});
591
		});
594
				*/
592
				*/
595
		
593
		
596
 
594
 
597
	}
595
	}
598
 
596
 
599
 
597
 
600
	/**
598
	/**
601
	 * Affichage message d'attente et desactivation navigation
599
	 * Affichage message d'attente et desactivation navigation
602
	 * 
600
	 * 
603
	 * @param
601
	 * @param
604
	 * @return void
602
	 * @return void
605
	 */
603
	 */
606
 
604
 
607
	private void setStatusDisabled() {
605
	private void setStatusDisabled() {
608
 
606
 
609
		navBar.gotoFirst.setEnabled(false);
607
		navBar.gotoFirst.setEnabled(false);
610
		navBar.gotoPrev.setEnabled(false);
608
		navBar.gotoPrev.setEnabled(false);
611
		navBar.gotoNext.setEnabled(false);
609
		navBar.gotoNext.setEnabled(false);
612
		navBar.gotoEnd.setEnabled(false);
610
		navBar.gotoEnd.setEnabled(false);
613
 
611
 
614
		navBar.status.setText("Patientez ...");
612
		navBar.status.setText("Patientez ...");
615
	}
613
	}
616
 
614
 
617
	/**
615
	/**
618
	 * Affichage numero de page et gestion de la navigation
616
	 * Affichage numero de page et gestion de la navigation
619
	 * 
617
	 * 
620
	 */
618
	 */
621
 
619
 
622
	private void setStatusEnabled() {
620
	private void setStatusEnabled() {
623
 
621
 
624
		// Il y a forcemment un disabled avant d'arriver ici
622
		// Il y a forcemment un disabled avant d'arriver ici
625
 
623
 
626
		if (count > 0) {
624
		if (count > 0) {
627
 
625
 
628
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
626
			if (startIndex >= VISIBLE_TAXON_COUNT) { // Au dela de la
629
														// premiere page
627
														// premiere page
630
				navBar.gotoPrev.setEnabled(true);
628
				navBar.gotoPrev.setEnabled(true);
631
				navBar.gotoFirst.setEnabled(true);
629
				navBar.gotoFirst.setEnabled(true);
632
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
630
				if (startIndex < (count - VISIBLE_TAXON_COUNT)) { // Pas la
633
																	// derniere
631
																	// derniere
634
																	// page
632
																	// page
635
					navBar.gotoNext.setEnabled(true);
633
					navBar.gotoNext.setEnabled(true);
636
					navBar.gotoEnd.setEnabled(true);
634
					navBar.gotoEnd.setEnabled(true);
637
					navBar.status.setText((startIndex + 1) + " - "
635
					navBar.status.setText((startIndex + 1) + " - "
638
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
636
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count );
639
				} else { // Derniere page
637
				} else { // Derniere page
640
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count );
638
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count );
641
				}
639
				}
642
			} else { // Premiere page
640
			} else { // Premiere page
643
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
641
				if (count > VISIBLE_TAXON_COUNT) { // Des pages derrieres
644
					navBar.gotoNext.setEnabled(true);
642
					navBar.gotoNext.setEnabled(true);
645
					navBar.gotoEnd.setEnabled(true);
643
					navBar.gotoEnd.setEnabled(true);
646
					navBar.status.setText((startIndex + 1) + " - "
644
					navBar.status.setText((startIndex + 1) + " - "
647
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
645
							+ (startIndex + VISIBLE_TAXON_COUNT) + " sur " + count);
648
				} else {
646
				} else {
649
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count);
647
					navBar.status.setText((startIndex + 1) + " - " + count + " sur " + count);
650
				}
648
				}
651
			}
649
			}
652
		}
650
		}
653
 
651
 
654
		else { // Pas d'inventaire, pas de navigation
652
		else { // Pas d'inventaire, pas de navigation
655
			navBar.status.setText("0 - 0 sur 0");
653
			navBar.status.setText("0 - 0 sur 0");
656
		}
654
		}
657
	}
655
	}
658
 
656
 
659
	/*
657
	/*
660
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
658
	 * Positionnement index de parcours (this.startIndex) pour affichage de la
661
	 * derniere page
659
	 * derniere page
662
	 * 
660
	 * 
663
	 * @param
661
	 * @param
664
	 * @return void
662
	 * @return void
665
	 */
663
	 */
666
 
664
 
667
	private void gotoEnd() {
665
	private void gotoEnd() {
668
 
666
 
669
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
667
		if ((count == 0) || (count % VISIBLE_TAXON_COUNT) > 0) {
670
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
668
			startIndex = count - (count % VISIBLE_TAXON_COUNT);
671
		} else {
669
		} else {
672
			startIndex = count - VISIBLE_TAXON_COUNT;
670
			startIndex = count - VISIBLE_TAXON_COUNT;
673
		}
671
		}
674
 
672
 
675
	}
673
	}
676
 
674
 
677
	/*
675
	/*
678
	 * Recherche en cours
676
	 * Recherche en cours
679
	 * 
677
	 * 
680
	 */
678
	 */
681
	
679
	
682
	public void setRechercheLibre(String search) {
680
	public void setRechercheLibre(String search) {
683
		this.rechercheLibre = search;
681
		this.rechercheLibre = search;
684
	}
682
	}
685
 
683
 
686
 
684
 
687
	
685
	
688
	/*
686
	/*
689
	 * Departement en cours 
687
	 * Departement en cours 
690
	 * 
688
	 * 
691
	 */
689
	 */
692
	
690
	
693
	public void setIdLocation(String id_location) {
691
	public void setIdLocation(String id_location) {
694
		this.identifiantLocalite = id_location;
692
		this.identifiantLocalite = id_location;
695
	}
693
	}
696
 
694
 
697
 
695
 
698
	
696
	
699
	/*
697
	/*
700
	 * Localite en cours 
698
	 * Localite en cours 
701
	 * 
699
	 * 
702
	 */
700
	 */
703
	
701
	
704
	public void setLocalite(String location) {
702
	public void setLocalite(String location) {
705
		this.localite = location;
703
		this.localite = location;
706
	}
704
	}
707
 
705
 
708
 
706
 
709
	
707
	
710
	/*
708
	/*
711
	 * Lieudit en cours 
709
	 * Lieudit en cours 
712
	 * 
710
	 * 
713
	 */
711
	 */
714
 
712
 
715
	public void setLieudit(String lieudit) {
713
	public void setLieudit(String lieudit) {
716
		this.lieudit = lieudit;
714
		this.lieudit = lieudit;
717
	}
715
	}
718
 
716
 
719
	
717
	
720
	
718
	
721
	/*
719
	/*
722
	 * Date en cours 
720
	 * Date en cours 
723
	 * 
721
	 * 
724
	 */
722
	 */
725
	
723
	
726
 
724
 
727
	public void setAnnee(String year) {
725
	public void setAnnee(String year) {
728
		this.annee = year;
726
		this.annee = year;
729
	}
727
	}
730
 
728
 
731
 
729
 
732
	public void setMois(String month) {
730
	public void setMois(String month) {
733
		this.mois = month;
731
		this.mois = month;
734
	}
732
	}
735
 
733
 
736
	public void setJour(String day) {
734
	public void setJour(String day) {
737
		this.jour = day;
735
		this.jour = day;
738
	}
736
	}
739
 
737
 
740
	
738
	
741
	/*
739
	/*
742
	 * Utilisateur en cours 
740
	 * Utilisateur en cours 
743
	 * 
741
	 * 
744
	 */
742
	 */
745
	
743
	
746
 
744
 
747
	
745
	
748
	public void setUser(String user) {
746
	public void setUser(String user) {
749
		this.user = user;
747
		this.user = user;
750
	}
748
	}
751
 
749
 
752
 
750
 
753
	public void displayFilter() {
751
	public void displayFilter() {
754
		
752
		
755
		
753
		
756
	
754
	
757
	// Mise a jour boutton export feuille de calcul
755
	// Mise a jour boutton export feuille de calcul
758
 
756
 
759
		/*
757
		/*
760
	observationMediateur.getActionView().getExportButton().setHTML("<a href=\""+observationMediateur.getServiceBaseUrl()+"/InventoryExport/" 
758
	observationMediateur.getActionView().getExportButton().setHTML("<a href=\""+observationMediateur.getServiceBaseUrl()+"/InventoryExport/" 
761
			+  user + "/"
759
			+  user + "/"
762
			+ URL.encodeComponent(identifiantLocalite) + "/"
760
			+ URL.encodeComponent(identifiantLocalite) + "/"
763
			+ URL.encodeComponent(localite) + "/"
761
			+ URL.encodeComponent(localite) + "/"
764
			+ URL.encodeComponent(lieudit)+ "/"
762
			+ URL.encodeComponent(lieudit)+ "/"
765
			+ annee + "/"
763
			+ annee + "/"
766
			+ mois  + "/"
764
			+ mois  + "/"
767
			+ jour 
765
			+ jour 
768
			+ "\">"+"Export&nbsp;tableur</a>");
766
			+ "\">"+"Export&nbsp;tableur</a>");
769
 
767
 
770
	*/
768
	*/
771
	// Mise a jour ligne de selection 
769
	// Mise a jour ligne de selection 
772
	
770
	
773
	
771
	
774
	
772
	
775
	String dep;
773
	String dep;
776
	if (identifiantLocalite.compareTo("all")==0) {
774
	if (identifiantLocalite.compareTo("all")==0) {
777
		dep="Tous d&eacute;partements";
775
		dep="Tous d&eacute;partements";
778
	}
776
	}
779
	else {
777
	else {
780
		if (identifiantLocalite.compareTo("000null")==0) {
778
		if (identifiantLocalite.compareTo("000null")==0) {
781
			dep="D&eacute;partements non renseign&eacute;es ";
779
			dep="D&eacute;partements non renseign&eacute;es ";
782
		}
780
		}
783
		else {
781
		else {
784
		dep="Département "+identifiantLocalite;
782
		dep="Département "+identifiantLocalite;
785
		}
783
		}
786
	}
784
	}
787
	
785
	
788
	
786
	
789
	
787
	
790
	String com;
788
	String com;
791
	if (localite.compareTo("all")==0) {
789
	if (localite.compareTo("all")==0) {
792
		com=", toutes communes";
790
		com=", toutes communes";
793
	}
791
	}
794
	else {
792
	else {
795
		if (localite.compareTo("000null")==0) {
793
		if (localite.compareTo("000null")==0) {
796
			com=", communes non renseign&eacute;es";
794
			com=", communes non renseign&eacute;es";
797
		}
795
		}
798
		else {
796
		else {
799
		com=", commune de "+localite;
797
		com=", commune de "+localite;
800
		}
798
		}
801
	}
799
	}
802
 
800
 
803
	
801
	
804
	
802
	
805
	String lieu;
803
	String lieu;
806
	
804
	
807
	if (lieudit.compareTo("all")==0) {
805
	if (lieudit.compareTo("all")==0) {
808
		lieu=", tous lieux dits";
806
		lieu=", tous lieux dits";
809
	}
807
	}
810
	else {
808
	else {
811
		if (lieudit.compareTo("000null")==0) {
809
		if (lieudit.compareTo("000null")==0) {
812
			lieu=", lieu-dit non renseign&eacute;es";
810
			lieu=", lieu-dit non renseign&eacute;es";
813
		}
811
		}
814
		else {
812
		else {
815
			lieu=", lieu-dit "+ lieudit;
813
			lieu=", lieu-dit "+ lieudit;
816
		}
814
		}
817
	}
815
	}
818
	
816
	
819
	String dat;
817
	String dat;
820
	
818
	
821
	if ((annee.compareTo("all")==0) && (mois.compareTo("all")==0) && (jour.compareTo("all")==0)) {
819
	if ((annee.compareTo("all")==0) && (mois.compareTo("all")==0) && (jour.compareTo("all")==0)) {
822
		dat=", toutes periodes";
820
		dat=", toutes periodes";
823
	}
821
	}
824
	
822
	
825
	else {
823
	else {
826
	
824
	
827
    	String yea="";
825
    	String yea="";
828
       	String da="";
826
       	String da="";
829
       	String mont="";
827
       	String mont="";
830
       	
828
       	
831
    	if (annee.compareTo("all")==0) {
829
    	if (annee.compareTo("all")==0) {
832
    		yea=", toutes ann&eacute;es";
830
    		yea=", toutes ann&eacute;es";
833
    	}
831
    	}
834
    	else {
832
    	else {
835
    		if (annee.compareTo("0")==0) {
833
    		if (annee.compareTo("0")==0) {
836
    			yea=", periode non renseign&eacute;e";
834
    			yea=", periode non renseign&eacute;e";
837
    		}
835
    		}
838
    		else {
836
    		else {
839
    			yea=", "+ annee;
837
    			yea=", "+ annee;
840
    
838
    
841
            	if (mois.compareTo("all")==0) {
839
            	if (mois.compareTo("all")==0) {
842
            		mont=", tous mois";
840
            		mont=", tous mois";
843
            	}
841
            	}
844
            	else {
842
            	else {
845
            			mont="/"+ mois;
843
            			mont="/"+ mois;
846
            	}
844
            	}
847
            
845
            
848
            
846
            
849
            	if (jour.compareTo("all")==0) {
847
            	if (jour.compareTo("all")==0) {
850
            		da=", tous jours";
848
            		da=", tous jours";
851
            	}
849
            	}
852
            	else {
850
            	else {
853
            			da="/"+ jour;
851
            			da="/"+ jour;
854
            	}
852
            	}
855
    		}
853
    		}
856
    	}
854
    	}
857
            	
855
            	
858
        dat=yea + mont + da;
856
        dat=yea + mont + da;
859
    	
857
    	
860
	}
858
	}
861
 
859
 
862
	
860
	
863
	//panel.getHeader().setText(dep + com + lieu + dat);
861
	//panel.getHeader().setText(dep + com + lieu + dat);
864
 
862
 
865
 
863
 
866
	
864
	
867
}
865
}
868
 
866
 
869
 
867
 
870
 
868
 
871
	/// EVENEMENTS 
869
	/// EVENEMENTS 
872
	
870
	
873
/**
871
/**
874
 * Evenements
872
 * Evenements
875
 * 
873
 * 
876
 */	
874
 */	
877
	/*
875
	/*
878
	public void handleEvent(BaseEvent be) {
876
	public void handleEvent(BaseEvent be) {
879
		switch (be.type) {
877
		switch (be.type) {
880
			case ObservationMediateur.NOMBRE_OBSERVATION:
878
			case ObservationMediateur.NOMBRE_OBSERVATION:
881
				gotoEnd();
879
				gotoEnd();
882
				getListeObservation();	
880
				getListeObservation();	
883
				break;
881
				break;
884
			case ObservationMediateur.LISTE_OBSERVATION:
882
			case ObservationMediateur.LISTE_OBSERVATION:
885
				afficherListeObservation();
883
				afficherListeObservation();
886
				break;
884
				break;
887
		}
885
		}
888
	}
886
	}
889
*/
887
*/
890
 
888
 
891
 
889
 
892
}
890
}
893
 
891
 
894
/* +--Fin du code ---------------------------------------------------------------------------------------+
892
/* +--Fin du code ---------------------------------------------------------------------------------------+
895
* $Log$
893
* $Log$
-
 
894
* Revision 1.2  2008-06-09 16:29:01  ddelon
-
 
895
* import branche observation
-
 
896
*
896
* Revision 1.1  2008-06-09 14:19:37  ddelon
897
* Revision 1.1  2008-06-09 14:19:37  ddelon
897
* Initialisation observation
898
* Initialisation observation
898
*
899
*
899
* Revision 1.3  2008-04-28 13:10:43  ddelon
900
* Revision 1.3  2008-04-28 13:10:43  ddelon
900
* Integration MyGwt
901
* Integration MyGwt
901
*
902
*
902
* Revision 1.2  2008-01-30 08:55:40  ddelon
903
* Revision 1.2  2008-01-30 08:55:40  ddelon
903
* fin mise en place mygwt
904
* fin mise en place mygwt
904
*
905
*
905
* Revision 1.1  2008-01-02 21:26:04  ddelon
906
* Revision 1.1  2008-01-02 21:26:04  ddelon
906
* mise en place mygwt
907
* mise en place mygwt
907
*
908
*
908
* Revision 1.8  2007-12-22 14:48:53  ddelon
909
* Revision 1.8  2007-12-22 14:48:53  ddelon
909
* Documentation et refactorisation
910
* Documentation et refactorisation
910
*
911
*
911
* Revision 1.7  2007-09-17 19:25:34  ddelon
912
* Revision 1.7  2007-09-17 19:25:34  ddelon
912
* Documentation
913
* Documentation
913
*
914
*
914
*/
915
*/