Project

General

Profile

« Previous | Next » 

Revision 892efc69

Added by Andreas Kohlbecker almost 14 years ago

merging /branches/cdmlib/SPRINT-Chichorieae1/ to trunk

View differences:

cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/EditGeoServiceUtilities.java
11 11
package eu.etaxonomy.cdm.ext;
12 12

  
13 13
import java.awt.Color;
14
import java.io.UnsupportedEncodingException;
15
import java.net.URLEncoder;
14 16
import java.util.ArrayList;
15 17
import java.util.HashMap;
16 18
import java.util.HashSet;
......
75 77
		String adLayerSeparator = ":";
76 78
		String styleInAreaDataSeparator = "|";
77 79
		String msSeparator = ","; //Separator for the ms parameter values , e.g. 'x' => ms=600x400
80
		//double borderWidth = 0.1;
78 81
		double borderWidth = 0.1;
79 82
		
80 83
		
......
164 167
			}
165 168
			Representation representation = status.getPreferredRepresentation(languages);
166 169
			String statusLabel = representation.getLabel();
170
			//statusLabel.replace('introduced: ', '');
171
			statusLabel = statusLabel.replace("introduced: ", "introduced, ");
172
			statusLabel = statusLabel.replace("native: ", "native,  ");
167 173
			areaTitle += "|" + style + ":" + statusLabel;
168 174
			
169 175
			//getting the area color
......
188 194
		}
189 195
		
190 196
		if(areaStyle.length() > 0){
191
			areaStyle = "as=" + areaStyle.substring(1); //remove first |
197
			areaStyle = "as=" + encode(areaStyle); //remove first |
192 198
		}
193 199
		if(areaTitle.length() > 0){
194
			areaTitle = "title=" + areaTitle.substring(1); //remove first |
200
			areaTitle = "title=" + encode(areaTitle); //remove first |
195 201
		}
196 202
		
197 203
		boolean separateLevels = false; //FIXME as parameter
......
222 228
			if(separateLevels){
223 229
				//result per level
224 230
				result = CdmUtils.concat("&", new String[] {layer, "ad=" + areaData.substring(0), areaStyle, areaTitle, bbox, ms});
231
				//result = CdmUtils.concat("&", new String[] {layer, "ad=" + areaData.substring(0), areaStyle, bbox, ms});
225 232
				resultMap.put(layerString, result);
226 233
			}
227 234
		}
......
230 237
		
231 238
		//result
232 239
		result = CdmUtils.concat("&", new String[] {layer, areaData, areaStyle, areaTitle, bbox, ms});
240
		//result = CdmUtils.concat("&", new String[] {layer, areaData, areaStyle, bbox, ms});
233 241
		if (logger.isDebugEnabled()){logger.debug("getEditGeoServiceUrlParameterString end");}
234 242
		
235 243
		return result;
236 244
	}
245

  
246
	private static String encode(String areaStyle) {
247
		String encoded = areaStyle;
248
		try {
249
			encoded = URLEncoder.encode(areaStyle.substring(1), "UTF-8");
250
		} catch (UnsupportedEncodingException e) {
251
			logger.error(e);
252
		}
253
		return encoded;
254
	}
237 255
	
238 256
	private static Map<PresenceAbsenceTermBase<?>,Color> makeDefaultColorMap(){
239 257
		Map<PresenceAbsenceTermBase<?>,Color> result = new HashMap<PresenceAbsenceTermBase<?>, Color>();

Also available in: Unified diff