[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mapbender-commits
Subject:    [Mapbender-commits] r7728 - trunk/mapbender/http/classes
From:       svn_mapbender () osgeo ! org
Date:       2011-03-31 9:12:58
Message-ID: 20110331091258.C91173903A4 () trac ! osgeo ! org
[Download RAW message or body]

Author: kmq
Date: 2011-03-31 02:12:58 -0700 (Thu, 31 Mar 2011)
New Revision: 7728

Modified:
   trunk/mapbender/http/classes/class_wfs_1_0_factory.php
   trunk/mapbender/http/classes/class_wfs_1_1_factory.php
Log:
reintroduce quirky featuretype parsing to work with older code

Modified: trunk/mapbender/http/classes/class_wfs_1_0_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_0_factory.php	2011-03-30 09:31:06 UTC (rev 7727)
+++ trunk/mapbender/http/classes/class_wfs_1_0_factory.php	2011-03-31 09:12:58 UTC (rev 7728)
@@ -89,7 +89,16 @@
 			$query = sprintf("//xs:complexType[@name='%s']//xs:element",$elementTypeLocalname);
 			$subElementList = $xpath->query($query);
 			foreach($subElementList as $subElement){
-				$newFeatureType->addElement($subElement->getAttribute('name'), $subElement->getAttribute('type'));
+                // Since this is a rewrite of the old way, it reproduces it quirks
+                // in this case the namespace of the type was cut off for some reason
+				$name = $subElement->getAttribute('name');
+                $typeParts = explode(":",$subElement->getAttribute('type'));
+                if(count($typeParts) == 1){
+                    $type = $typeParts[0];
+                }else{
+                    $type = $typeParts[1];
+                }
+				$newFeatureType->addElement($name,$type);
 			}
 
 		}

Modified: trunk/mapbender/http/classes/class_wfs_1_1_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_1_factory.php	2011-03-30 09:31:06 UTC (rev 7727)
+++ trunk/mapbender/http/classes/class_wfs_1_1_factory.php	2011-03-31 09:12:58 UTC (rev 7728)
@@ -131,7 +131,16 @@
 			$subElementList = $xpath->query($query);
 			$e = new mb_exception("NNN sub $query $subElementList->length");
 			foreach($subElementList as $subElement){
-				$newFeatureType->addElement($subElement->getAttribute('name'), $subElement->getAttribute('type'));
+                // Since this is a rewrite of the old way, it reproduces it quirks
+                // in this case the namespace of the type was cut off for some reason
+				$name = $subElement->getAttribute('name');
+                $typeParts = explode(":",$subElement->getAttribute('type'));
+                if(count($typeParts) == 1){
+                    $type = $typeParts[0];
+                }else{
+                    $type = $typeParts[1];
+                }
+				$newFeatureType->addElement($name,$type);
 			}
 
 		}

_______________________________________________
Mapbender_commits mailing list
Mapbender_commits@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapbender_commits
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic