Subversion Repositories eFlore/Applications.cel

Rev

Rev 1489 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1489 Rev 1542
Line 61... Line 61...
61
	/**
61
	/**
62
	 * Le médiateur associé à la vue
62
	 * Le médiateur associé à la vue
63
	 */
63
	 */
64
	private ObservationMediateur	observationMediateur		= null;
64
	private ObservationMediateur	observationMediateur		= null;
Line 65... Line -...
65
 
-
 
66
 
65
 
67
	/**
66
	/**
68
	 * Config de colonne
67
	 * Config de colonne
69
	 */
68
	 */
70
	private ColumnConfig	etatObservation;
-
 
71
	/**
69
	private ColumnConfig	etatObservation;
72
	 * Config de colonne
-
 
73
	 */
70
	private ColumnConfig	referentielTaxoObservation;
74
	private ColumnConfig	nomSaisiObservation;
-
 
75
	/**
-
 
76
	 * Config de colonne
-
 
77
	 */
71
	private ColumnConfig	nomSaisiObservation;
78
	private ColumnConfig	nomRetenuObservation;
-
 
79
	/**
-
 
80
	 * Config de colonne
-
 
81
	 */
72
	private ColumnConfig	nomRetenuObservation;
82
	private ColumnConfig	lieuObservation;
-
 
83
	/**
-
 
84
	 * Config de colonne
-
 
85
	 */
73
	private ColumnConfig	lieuObservation;
86
	private ColumnConfig	dateObservation;
-
 
87
	/**
-
 
88
	 * Config de colonne
-
 
89
	 */
74
	private ColumnConfig	dateObservation;
90
	private ColumnConfig	ordreObservation;
-
 
91
	/**
-
 
92
	 * Config de colonne
-
 
93
	 */
75
	private ColumnConfig	ordreObservation;
94
	private ColumnConfig abondanceObservation;
-
 
95
	/**
-
 
96
	 * Config de colonne
-
 
97
	 */
76
	private ColumnConfig 	abondanceObservation;
98
	private ColumnConfig certitudeObservation;
-
 
99
	
-
 
100
	/**
-
 
101
	 * Modele de colonnes
-
 
102
	 */
77
	private ColumnConfig 	certitudeObservation;
Line 103... Line -...
103
	private ColumnModel		modeleColonnes;
-
 
104
 
78
	private ColumnModel		modeleColonnes;
105
	
79
 
106
	/**
80
	/**
107
	 * Store qui contient les données à afficher
81
	 * Store qui contient les données à afficher
108
	 */
-
 
109
	private Store			st				= null;
-
 
110
	
82
	 */
111
	
83
	private Store			st				= null;
112
	/**
84
	/**
113
	 * Barre de pagination
85
	 * Barre de pagination
114
	 */
-
 
115
	private BarrePaginationVue bt = null ;
86
	 */
116
 
87
	private BarrePaginationVue bt = null ;
117
	/**
88
	/**
118
	 * Numéro de page en cours
89
	 * Numéro de page en cours
119
	 */
90
	 */
Line 139... Line 110...
139
	
110
	
Line 140... Line 111...
140
	private String modeleLieu = "IDLOCCOMMUNE, LIEUDIT, STATION";
111
	private String modeleLieu = "IDLOCCOMMUNE, LIEUDIT, STATION";
-
 
112
 
-
 
113
 
Line 141... Line 114...
141
 
114
	private boolean tailleInitialisee = false ;
142
 
115
 
143
	private boolean tailleInitialisee = false ;
116
	private ColumnConfig phenologieObservation;
144
	
117
	
Line 159... Line 132...
159
		
132
		
Line 160... Line 133...
160
		this.observationMediateur = obs;
133
		this.observationMediateur = obs;
Line 161... Line 134...
161
		
134
		
162
		setId("x-list-obs");
-
 
163
		
-
 
164
		setHeader(true);
135
		setId("x-list-obs");
165
		
136
		
166
        
137
		setHeader(true);  
167
		// on place la barre de pagination
138
		// on place la barre de pagination
168
		bt = new BarrePaginationVue(this);		
139
		bt = new BarrePaginationVue(this);		
Line 256... Line 227...
256
 
227
 
257
			@Override
228
			@Override
258
			public String render(Object value, CellMetadata cellMetadata,
229
			public String render(Object value, CellMetadata cellMetadata,
Line -... Line 230...
-
 
230
					Record record, int rowIndex, int colNum, Store store) {
259
					Record record, int rowIndex, int colNum, Store store) {
231
				
260
				
-
 
261
				if(value == null || value.equals("null") || value.equals("000null") || value.equals("0000-00-00 00:00:00")) {
232
				String valeur = "";
262
				
-
 
263
					return "" ;
-
 
264
				}	
-
 
265
				else
-
 
266
				{
233
				if(value != null && !value.equals("null") && !value.equals("000null") && !value.equals("0000-00-00 00:00:00")) {			
267
					
-
 
268
				}
234
					valeur = value.toString() ;
269
				
235
				}
270
				return value.toString() ;
-
 
271
			}
236
				return valeur;
Line 272... Line 237...
272
			
237
			}
Line 273... Line 238...
273
		} ;
238
		} ;
Line 311... Line 276...
311
					return "" ;
276
					return "" ;
312
				}
277
				}
313
			}
278
			}
Line 314... Line 279...
314
			
279
			
-
 
280
		});		
315
		});		
281
		referentielTaxoObservation = new ColumnConfig("Référentiel", "referentiel_taxo_observation", 15, true, colRend);
316
		nomSaisiObservation = new ColumnConfig("Nom saisi", "nomSaisi_observation", 200, true, colRend);
282
		nomSaisiObservation = new ColumnConfig("Nom saisi", "nomSaisi_observation", 130, true, colRend);
317
		nomRetenuObservation = new ColumnConfig("Nom retenu", "nomRetenu_observation", 200, true, colRend);
283
		nomRetenuObservation = new ColumnConfig("Nom retenu", "nomRetenu_observation", 130, true, colRend);
318
		lieuObservation = new ColumnConfig("Lieu", "lieu_observation", 200, true, colRend);
284
		lieuObservation = new ColumnConfig("Lieu", "lieu_observation", 130, true, colRend);
319
		dateObservation = new ColumnConfig("Date", "date_observation", 70, true, dateRend);
285
		dateObservation = new ColumnConfig("Date", "date_observation", 70, true, dateRend);
320
		abondanceObservation = new ColumnConfig("Abondance", "abondance", 50, true, colRend);
286
		abondanceObservation = new ColumnConfig("Abondance", "abondance", 50, true, colRend);
321
		certitudeObservation = new ColumnConfig("Identification", "certitude", 50, true, new Renderer() {
287
		certitudeObservation = new ColumnConfig("Identification", "certitude", 50, true, new Renderer() {
322
			@Override
288
			@Override
323
			public String render(Object value, CellMetadata cellMetadata,
289
			public String render(Object value, CellMetadata cellMetadata,
324
					Record record, int rowIndex, int colNum, Store store) {
290
					Record record, int rowIndex, int colNum, Store store) {
325
				return Ontologies.getCorrespondanceCertitude(record.getAsString("certitude"));
291
				return Ontologies.getCorrespondanceCertitude(record.getAsString("certitude"));
Line 326... Line 292...
326
			}
292
			}
-
 
293
			
327
			
294
		});
328
		});
295
		phenologieObservation = new ColumnConfig("Phénologie", "phenologie", 40, true, colRend);	
Line 329... Line 296...
329
		ordreObservation = new ColumnConfig("Ordre", "ordre_observation", 50, true, colRend);		
296
		ordreObservation = new ColumnConfig("Ordre", "ordre_observation", 70, true, colRend);		
330
		ColumnConfig[] cm = {etatObservation, nomSaisiObservation, certitudeObservation, nomRetenuObservation, abondanceObservation, lieuObservation, dateObservation, ordreObservation};
297
		ColumnConfig[] cm = {etatObservation, referentielTaxoObservation, nomSaisiObservation, certitudeObservation, nomRetenuObservation, abondanceObservation, phenologieObservation, lieuObservation, dateObservation, ordreObservation};
Line 573... Line 540...
573
	public void rafraichir(Object nouvelleDonnees, boolean repandreRafraichissement) {
540
	public void rafraichir(Object nouvelleDonnees, boolean repandreRafraichissement) {
574
		// si l'on a reçu une liste d'observation
541
		// si l'on a reçu une liste d'observation
575
		if(nouvelleDonnees instanceof ListeObservation)
542
		if(nouvelleDonnees instanceof ListeObservation)
576
		{	
543
		{	
577
				ListeObservation data = (ListeObservation) nouvelleDonnees ;
544
				ListeObservation data = (ListeObservation) nouvelleDonnees ;
578
				Object[][] observationData = new Object[data.size()][9];
545
				Object[][] observationData = new Object[data.size()][11];
579
				int i = 0 ;
546
				int i = 0 ;
Line 580... Line 547...
580
				
547
				
581
				if(data.size() == 0)
548
				if(data.size() == 0)
582
				{
549
				{
Line 588... Line 555...
588
				{
555
				{
Line 589... Line 556...
589
					
556
					
Line 590... Line 557...
590
					Observation obs=data.get(it.next());
557
					Observation obs=data.get(it.next());
-
 
558
					
591
					
559
					observationData[i][0] = obs.getTransmis();
592
					observationData[i][0] = obs.getTransmis();
560
					observationData[i][1] = obs.getCodeCourtReferentielTaxo();
593
					observationData[i][1] = obs.getNomSaisi();
561
					observationData[i][2] = obs.getNomSaisi();
594
					observationData[i][2] = obs.getCertitude();
562
					observationData[i][3] = obs.getCertitude();
-
 
563
					observationData[i][4] = obs.getNomRetenu();
595
					observationData[i][3] = obs.getNomRetenu();
564
					observationData[i][5] = obs.getAbondance();
596
					observationData[i][4] = obs.getAbondance();
565
					observationData[i][6] = obs.getPhenologie();
597
					observationData[i][5] = Util.formaterLieu(obs, modeleLieu);
566
					observationData[i][7] = Util.formaterLieu(obs, modeleLieu);
598
					observationData[i][6] = obs.getDate();
567
					observationData[i][8] = obs.getDate();
Line 599... Line 568...
599
					observationData[i][7] = obs.getNumeroOrdre();		
568
					observationData[i][9] = obs.getNumeroOrdre();		
600
					observationData[i][8] = obs.getNumeroNomenclaturalSaisi();
569
					observationData[i][10] = obs.getNumeroNomenclaturalSaisi();
Line 601... Line 570...
601
									
570
									
Line 632... Line 601...
632
			
601
			
633
			
602
			
Line -... Line 603...
-
 
603
			// et on notifie de le mediateur du changement des valeurs
634
			// et on notifie de le mediateur du changement des valeurs
604
			changerPageMaxEtCourante(pageMax,pageEncours,taillePage,pages[0]) ;
635
			changerPageMaxEtCourante(pageMax,pageEncours,taillePage,pages[0]) ;
605
			
-
 
606
			if(nbElements > 0) {
-
 
607
				masquerChargement();
-
 
608
				observationMediateur.obtenirListeObservation(this);
636
			
609
			} else {
Line 637... Line 610...
637
			masquerChargement();
610
				this.rafraichir(new ListeObservation(0), false);
638
			observationMediateur.obtenirListeObservation(this);
611
			}
Line 675... Line 648...
675
	}
648
	}
Line 676... Line 649...
676
	
649
	
677
	private FieldDef[] getDefinitionChamps() {
650
	private FieldDef[] getDefinitionChamps() {
678
		// creation du store qui les contient
651
		// creation du store qui les contient
-
 
652
		FieldDef defEtatObservation = new StringFieldDef("etat_observation");
679
		FieldDef defEtatObservation = new StringFieldDef("etat_observation");
653
		FieldDef defRefTaxObservation = new StringFieldDef("referentiel_taxo_observation");
680
		FieldDef defNomSaisiObservation = new StringFieldDef("nomSaisi_observation");
654
		FieldDef defNomSaisiObservation = new StringFieldDef("nomSaisi_observation");
681
		FieldDef defCertitudeObservation = new StringFieldDef("certitude");
655
		FieldDef defCertitudeObservation = new StringFieldDef("certitude");
682
		FieldDef defNomRetenuObservation = new StringFieldDef("nomRetenu_observation");
656
		FieldDef defNomRetenuObservation = new StringFieldDef("nomRetenu_observation");
-
 
657
		FieldDef defAbondanceObservation = new StringFieldDef("abondance");
683
		FieldDef defAbondanceObservation = new StringFieldDef("abondance");
658
		FieldDef defPhenologieObservation = new StringFieldDef("phenologie");
684
		FieldDef defLieuObservation = new StringFieldDef("lieu_observation");
659
		FieldDef defLieuObservation = new StringFieldDef("lieu_observation");
685
		FieldDef defDateObservation = new StringFieldDef("date_observation");
660
		FieldDef defDateObservation = new StringFieldDef("date_observation");
Line 686... Line 661...
686
		FieldDef defOrdreObservation = new IntegerFieldDef("ordre_observation");
661
		FieldDef defOrdreObservation = new IntegerFieldDef("ordre_observation");
687
		
662
		
Line 688... Line 663...
688
		// Non affiches :
663
		// Non affiches :
689
		FieldDef defNumeroNomenclaturalSaisiObservation = new StringFieldDef("numeroNomenclaturalSaisi_observation");
664
		FieldDef defNumeroNomenclaturalSaisiObservation = new StringFieldDef("numeroNomenclaturalSaisi_observation");
Line 690... Line 665...
690
 
665
 
691
		FieldDef[] defTab = { defEtatObservation, defNomSaisiObservation, defCertitudeObservation, defNomRetenuObservation, defAbondanceObservation,
666
		FieldDef[] defTab = {defEtatObservation, defRefTaxObservation,defNomSaisiObservation, defCertitudeObservation, defNomRetenuObservation, defAbondanceObservation,