Subversion Repositories eFlore/Applications.cel

Rev

Rev 195 | Go to most recent revision | Show entire file | Regard 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 466... Line 468...
466
					Observation obs=(Observation) data.get(it.next());
468
					Observation obs=(Observation) data.get(it.next());
Line 467... Line 469...
467
					
469
					
468
					observationData[i][0]= obs.getTransmis();
470
					observationData[i][0] = obs.getTransmis();
469
					observationData[i][1]= obs.getNomSaisi();
471
					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("")) {
-
 
473
						observationData[i][3]= obs.getLocalite();
472
					observationData[i][2] = obs.getNomRetenu();
474
					}
-
 
475
					else {
473
 
476
						observationData[i][3]= obs.getLocalite()+", "+obs.getLieudit();
-
 
477
					}
474
					observationData[i][3] = fabriquerLieu(obs);
478
					observationData[i][4]= obs.getDate();
475
					observationData[i][4] = obs.getDate();
479
					observationData[i][5]= obs.getNumeroOrdre();		
476
					observationData[i][5] = obs.getNumeroOrdre();		
Line 480... Line -...
480
					observationData[i][6]= obs.getNumeroNomenclaturalSaisi();
-
 
481
									
477
					observationData[i][6] = obs.getNumeroNomenclaturalSaisi();
482
				
478
									
Line 483... Line 479...
483
					i++ ;
479
					i++ ;
484
				}
-
 
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");
489
				FieldDef defNomSaisiObservation = new StringFieldDef("nomSaisi_observation");
484
				FieldDef defNomSaisiObservation = new StringFieldDef("nomSaisi_observation");
Line 760... Line 755...
760
		else {
755
		else {
761
			return false;
756
			return false;
762
		}
757
		}
763
	}
758
	}
Line -... Line 759...
-
 
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
	}
764
 
803