From 861ef815521e48359ba7e84862fe69fb699aa1cf Mon Sep 17 00:00:00 2001 From: crschmidt Date: Tue, 10 Mar 2009 04:04:59 +0000 Subject: [PATCH] fix for WFS-T delete and update have improper typeName. Includes tests. Vague +1 from tschaub. WFS format now matches the more modern WFS-T v1 format as confirmed by cargo culting the WFS-T tests. (Closes #1787, #1471) git-svn-id: http://svn.openlayers.org/trunk/openlayers@8978 dc9f47b5-9b13-0410-9fdd-eb0c1a62fdaf --- lib/OpenLayers/Format/WFS.js | 6 ++- tests/Format/WFS.html | 81 ++++++++++++++++++++++++++++++++++++ tests/list-tests.html | 1 + 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 tests/Format/WFS.html diff --git a/lib/OpenLayers/Format/WFS.js b/lib/OpenLayers/Format/WFS.js index 9ac6d4a21d..a012234850 100644 --- a/lib/OpenLayers/Format/WFS.js +++ b/lib/OpenLayers/Format/WFS.js @@ -135,7 +135,8 @@ OpenLayers.Format.WFS = OpenLayers.Class(OpenLayers.Format.GML, { update: function(feature) { if (!feature.fid) { OpenLayers.Console.userError(OpenLayers.i18n("noFID")); } var updateNode = this.createElementNS(this.wfsns, 'wfs:Update'); - updateNode.setAttribute("typeName", this.layerName); + updateNode.setAttribute("typeName", this.featurePrefix + ':' + this.featureName); + updateNode.setAttribute("xmlns:" + this.featurePrefix, this.featureNS); var propertyNode = this.createElementNS(this.wfsns, 'wfs:Property'); var nameNode = this.createElementNS(this.wfsns, 'wfs:Name'); @@ -194,7 +195,8 @@ OpenLayers.Format.WFS = OpenLayers.Class(OpenLayers.Format.GML, { return false; } var deleteNode = this.createElementNS(this.wfsns, 'wfs:Delete'); - deleteNode.setAttribute("typeName", this.layerName); + deleteNode.setAttribute("typeName", this.featurePrefix + ':' + this.featureName); + deleteNode.setAttribute("xmlns:" + this.featurePrefix, this.featureNS); var filterNode = this.createElementNS(this.ogcns, 'ogc:Filter'); var filterIdNode = this.createElementNS(this.ogcns, 'ogc:FeatureId'); diff --git a/tests/Format/WFS.html b/tests/Format/WFS.html new file mode 100644 index 0000000000..113e219f11 --- /dev/null +++ b/tests/Format/WFS.html @@ -0,0 +1,81 @@ + + + + + + +
+
+ + diff --git a/tests/list-tests.html b/tests/list-tests.html index 713ccf5662..9875524a9a 100644 --- a/tests/list-tests.html +++ b/tests/list-tests.html @@ -57,6 +57,7 @@
  • Format/Filter/v1_0_0.html
  • Format/Filter/v1_1_0.html
  • Format/WFSDescribeFeatureType.html
  • +
  • Format/WFS.html
  • Format/WFST.html
  • Format/WFST/v1.html
  • Format/WFST/v1_0_0.html