Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 195 Rev 206
Line 115... Line 115...
115
	
115
	
Line 116... Line 116...
116
	private Tool exporterObservations = null ;
116
	private Tool exporterObservations = null ;
Line -... Line 117...
-
 
117
	
-
 
118
	private final int KEY_ENTER = 13;
117
	
119
	
118
	private final int KEY_ENTER = 13;
120
	private String modeleLieu = "IDLOCCOMMUNE, LIEUDIT, STATION";
119
	
121
	
120
	/**
122
	/**
121
	 * Constructeur sans arguments (privé car ne doit pas être utilisé)
123
	 * Constructeur sans arguments (privé car ne doit pas être utilisé)
Line 463... Line 465...
463
				for (Iterator it = data.keySet().iterator(); it.hasNext();) 
465
				for (Iterator it = data.keySet().iterator(); it.hasNext();) 
464
				{
466
				{
Line 465... Line 467...
465
					
467
					
Line 466... Line 468...
466
					Observation obs=(Observation) data.get(it.next());
468
					Observation obs=(Observation) data.get(it.next());
467
					
469
					
468
					observationData[i][0]= obs.getTransmis();
470
					observationData[i][0] = obs.getTransmis();
469
					observationData[i][1]= obs.getNomSaisi();
-
 
470
					observationData[i][2]= obs.getNomRetenu();
-
 
471
					String lieu=obs.getLieudit();
-
 
472
					if(lieu.contains("000null") || lieu.equals(null) || (lieu.trim()).equals("")) {
471
					observationData[i][1] = obs.getNomSaisi();
473
						observationData[i][3]= obs.getLocalite();
-
 
474
					}
472
					observationData[i][2] = obs.getNomRetenu();
475
					else {
-
 
476
						observationData[i][3]= obs.getLocalite()+", "+obs.getLieudit();
473
 
477
					}
474
					observationData[i][3] = fabriquerLieu(obs);
478
					observationData[i][4]= obs.getDate();
475
					observationData[i][4] = obs.getDate();
Line 479... Line -...
479
					observationData[i][5]= obs.getNumeroOrdre();		
-
 
480
					observationData[i][6]= obs.getNumeroNomenclaturalSaisi();
476
					observationData[i][5] = obs.getNumeroOrdre();		
481
									
477
					observationData[i][6] = obs.getNumeroNomenclaturalSaisi();
Line 482... Line 478...
482
				
478
									
483
					i++ ;
-
 
484
				}
479
					i++ ;
485
		
480
				}
486
				// creation du store qui les contient
481
		
487
				
482
				// creation du store qui les contient
488
				FieldDef defEtatObservation = new StringFieldDef("etat_observation");
483
				FieldDef defEtatObservation = new StringFieldDef("etat_observation");
Line 759... Line 754...
759
		}
754
		}
760
		else {
755
		else {
761
			return false;
756
			return false;
762
		}
757
		}
763
	}
758
	}
-
 
759
	
-
 
760
	private String fabriquerLieu(Observation obs) {
-
 
761
		
-
 
762
		String commune = obs.getLocalite(); 
-
 
763
		String lieuDit = obs.getLieudit();
-
 
764
		String station = obs.getStation();
-
 
765
		
-
 
766
		String lieuCommuneFormate = "";
-
 
767
		String lieuDitFormate = "";
-
 
768
		String stationFormatee = "";
-
 
769
		
-
 
770
		if(commune != null && !commune.contains("000null") && !commune.trim().equals("")) {
-
 
771
			String	idLoc =obs.getIdentifiantLocalite().replaceAll(" ","/");
-
 
772
			if(idLoc != null && !idLoc.contains("000null") && !idLoc.trim().equals("")) {
-
 
773
 
-
 
774
				idLoc = idLoc.replaceAll("%","");
-
 
775
				idLoc = idLoc.replaceAll("\"","");
-
 
776
				idLoc = idLoc.replace('\\',' ');
-
 
777
				idLoc = idLoc.trim();
-
 
778
				lieuCommuneFormate += idLoc+" - ";
-
 
779
			}
-
 
780
			lieuCommuneFormate += commune;
-
 
781
			modeleLieu = modeleLieu.replaceAll("IDLOCCOMMUNE", lieuCommuneFormate);
-
 
782
		} else {
-
 
783
			
-
 
784
			modeleLieu = modeleLieu.replaceAll("IDLOCCOMMUNE,", lieuCommuneFormate);
-
 
785
		}
-
 
786
		
-
 
787
		if(lieuDit != null && !lieuDit.contains("000null") && !lieuDit.trim().equals("")) {
-
 
788
			lieuDitFormate += lieuDit;
-
 
789
			modeleLieu = modeleLieu.replaceAll("LIEUDIT", lieuDitFormate);
-
 
790
		} else {
-
 
791
			modeleLieu = modeleLieu.replaceAll("LIEUDIT,", lieuDitFormate);
-
 
792
		}
-
 
793
		
-
 
794
		if(station != null && !station.contains("000null") && !station.trim().equals("")) {
-
 
795
			stationFormatee += station;
-
 
796
			modeleLieu = modeleLieu.replaceAll("STATION", stationFormatee);
-
 
797
		} else {
-
 
798
			modeleLieu = modeleLieu.replaceAll("STATION,", stationFormatee);
-
 
799
		}
-
 
800
		
-
 
801
		return modeleLieu;
-
 
802
	}
Line 764... Line 803...
764
 
803