[Mapbender-commits] r1958 - trunk/mapbender/http/javascripts

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 14 06:21:58 EST 2008


Author: greq
Date: 2008-01-14 06:21:58 -0500 (Mon, 14 Jan 2008)
New Revision: 1958

Modified:
   trunk/mapbender/http/javascripts/wfs.js
Log:
Ticket: 159  	
Summary:
By WFS-T Insert (Digitizing) GeoServer version >= 1.5.4 needs only used namespaces

Edit: function get_wfs_str()
Not every namespace now will be written in the WFT-Request. Only 4 necessary namespaces(gml, ogc, xsi, wfs) + the dynamic FeatureTypeNamespace(featureNS) will be written.


Modified: trunk/mapbender/http/javascripts/wfs.js
===================================================================
--- trunk/mapbender/http/javascripts/wfs.js	2008-01-14 11:07:29 UTC (rev 1957)
+++ trunk/mapbender/http/javascripts/wfs.js	2008-01-14 11:21:58 UTC (rev 1958)
@@ -192,23 +192,39 @@
 }
 
 function get_wfs_str(myconf, d, m, type, fid) {
-	var str = '<wfs:Transaction version="1.0.0" service="WFS" xmlns="http://www.someserver.com/myns" ';
 
-	var ns_gml = false;	var ns_ogc = false;	var ns_xsi = false;	var ns_wfs = false;	var ns_topp = false;
+	<!-- Getting the Namspace for the FeautureType -->	
+	var featureTypeArray = myconf['featuretype_name'].split(':')
+	var featureNS = featureTypeArray[0];
+
+	var str = '<wfs:Transaction version="1.0.0" service="WFS" ';
+
+	var ns_gml = false;	var ns_ogc = false;	var ns_xsi = false;	var ns_wfs = false;	var ns_featureNS = false;
 	
 	for (var q = 0 ; q < myconf['namespaces'].length ; q++) {
-		if (myconf['namespaces'][q]['name'] == "gml") ns_gml = true;
-		else if (myconf['namespaces'][q]['name'] == "ogc") ns_ogc = true;
-		else if (myconf['namespaces'][q]['name'] == "xsi") ns_xsi = true;
-		else if (myconf['namespaces'][q]['name'] == "wfs") ns_wfs = true;
-		else if (myconf['namespaces'][q]['name'] == "topp") ns_topp = true;
-		str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
+	
+		if (myconf['namespaces'][q]['name'] == "gml"){		
+			 ns_gml = true;
+			 str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
+		} else if (myconf['namespaces'][q]['name'] == "ogc") {
+			ns_ogc = true;
+			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
+		} else if (myconf['namespaces'][q]['name'] == "xsi") {
+			ns_xsi = true;
+			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
+		} else if (myconf['namespaces'][q]['name'] == "wfs") {
+			ns_wfs = true;
+			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
+		} else if (myconf['namespaces'][q]['name'] == featureNS) {
+			ns_featureNS = true;
+			str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
+		}		
 	}
 	
 	if (ns_gml == false) str += 'xmlns:gml="http://www.opengis.net/gml" ';
 	if (ns_ogc == false) str += 'xmlns:ogc="http://www.opengis.net/ogc" ';
 	if (ns_xsi == false) str += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';
-	if (ns_topp == false) str += 'xmlns:topp="http://www.someserver.com/topp" ';
+	if (ns_featureNS == false) str += 'xmlns:"+featureNS+"="http://www.someserver.com/"+featureNS+"" ';
 	if (ns_wfs == false) str += 'xmlns:wfs="http://www.opengis.net/wfs" ';
 	
 	str += 'xsi:schemaLocation="http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd">';



More information about the Mapbender_commits mailing list