changeset 238:e672f5134d6e

Remove all non numeric chars from port string.
author raimund renkert <raimund.renkert@intevation.de>
date Mon, 08 Aug 2011 17:06:17 +0200
parents 4f6356a908e1
children 8aefef8a1626
files ChangeLog src/java/de/intevation/mxd/writer/MapScriptWriter.java
diffstat 2 files changed, 19 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Fri Aug 05 10:03:56 2011 +0200
+++ b/ChangeLog	Mon Aug 08 17:06:17 2011 +0200
@@ -1,3 +1,8 @@
+2011-08-08  Raimund Renkert  <raimund.renkert@intevation.de>
+
+	* src/java/de/intevation/mxd/writer/MapScriptWriter.java:
+	  Remove all non numeric chars from port string.
+
 2011-07-22  Stephan Holl  <stephan.holl@intevation.de>
 
 	* website/download-de.htm4, website/index.htm4: repaired broken
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Fri Aug 05 10:03:56 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Mon Aug 08 17:06:17 2011 +0200
@@ -281,9 +281,22 @@
 				" Setting to \"sde\" as default.");
 		    database_auth = "sde";
 		}
+
+		String port = layerElement.getAttribute("instance");
+                StringBuffer strBuff = new StringBuffer();
+                char c;
+    
+                for (int j = 0; j < port.length() ; j++) {
+                    c = port.charAt(j);
+        
+                    if(Character.isDigit(c)) {
+                        strBuff.append(c);
+                    }
+                }
+		
                 layer.setConnection(
                 layerElement.getAttribute("server") + "," +
-                    "port:" + layerElement.getAttribute("instance") + "," +
+                    "port:" + strBuff.toString() + "," +
                 database_auth + "," +
                 layerElement.getAttribute("user") + ",<PASSWORD>");
                 layer.setData(
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)