Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2558 Rev 2568
Line 77... Line 77...
77
	
77
	
Line 78... Line 78...
78
	public static String formaterLieu(Observation obs, String modeleLieu) {
78
	public static String formaterLieu(Observation obs, String modeleLieu) {
Line 79... Line 79...
79
		
79
		
80
		String lieuModele = modeleLieu;
80
		String lieuModele = modeleLieu;
81
		
81
		
Line 82... Line 82...
82
		String commune = obs.getLocalite(); 
82
		String localite = obs.getLocalite(); 
83
		String lieuDit = obs.getLieudit();
83
		String lieuDit = obs.getLieudit();
84
		String station = obs.getStation();
84
		String station = obs.getStation();
Line 85... Line 85...
85
		
85
		
86
		String lieuCommuneFormate = "";
86
		String lieulocaliteFormate = "";
87
		String lieuDitFormate = "";
87
		String lieuDitFormate = "";
Line 88... Line 88...
88
		String stationFormatee = "";
88
		String stationFormatee = "";
89
		
89
		
90
		if(commune != null && !commune.contains("000null") && !commune.trim().equals("")) {
90
		if(localite != null && !localite.contains("000null") && !localite.trim().equals("")) {
91
			String	idLoc =obs.getIdentifiantLocalite().replaceAll(" ","/");
91
			String	idLoc =obs.getIdentifiantLocalite().replaceAll(" ","/");
92
			if(idLoc != null && !idLoc.contains("000null") && !idLoc.trim().equals("")) {
92
			if(idLoc != null && !idLoc.contains("000null") && !idLoc.trim().equals("")) {
93
 
93
 
94
				idLoc = idLoc.replaceAll("%","");
94
				idLoc = idLoc.replaceAll("%","");
95
				idLoc = idLoc.replaceAll("\"","");
95
				idLoc = idLoc.replaceAll("\"","");
96
				idLoc = idLoc.replace('\\',' ');
96
				idLoc = idLoc.replace('\\',' ');
97
				idLoc = idLoc.trim();
97
				idLoc = idLoc.trim();
98
				if(idLoc.length() > 2) {
98
				if(idLoc.length() > 2) {
99
					idLoc = idLoc.substring(0,2);
99
					idLoc = idLoc.substring(0,2);
Line 100... Line 100...
100
				}
100
				}
101
				lieuCommuneFormate += idLoc+" - ";
101
				lieulocaliteFormate += idLoc+" - ";
Line 102... Line 102...
102
			}
102
			}
103
			lieuCommuneFormate += commune;
103
			lieulocaliteFormate += localite;
104
			lieuModele = lieuModele.replaceAll("IDLOCCOMMUNE", lieuCommuneFormate);
104
			lieuModele = lieuModele.replaceAll("IDLOCLOCALITE", lieulocaliteFormate);
Line 126... Line 126...
126
		lieuModele = lieuModele.replaceAll(",^$",", ");
126
		lieuModele = lieuModele.replaceAll(",^$",", ");
Line 127... Line 127...
127
		
127
		
128
		return lieuModele;
128
		return lieuModele;
Line 129... Line 129...
129
	}
129
	}
Line 130... Line 130...
130
	
130
	
131
	public static String obtenirIdLocAPartirChaineCommune(String commune) {
131
	public static String obtenirIdLocAPartirChaineLocalite(String localite) {
132
		
132
		
133
		String idLoc = "";	
133
		String idLoc = "";	
134
		String[] depCom = commune.split(" ");
134
		String[] depCom = localite.split(" ");
135
		if(depCom.length > 1) {
135
		if(depCom.length > 1) {
136
			idLoc = depCom[1].replace('(', ' ');
136
			idLoc = depCom[1].replace('(', ' ');