[Mapbender-commits] r8503 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Nov 2 04:40:36 PDT 2012


Author: armin11
Date: 2012-11-02 04:40:35 -0700 (Fri, 02 Nov 2012)
New Revision: 8503

Modified:
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/classes/class_wfs_1_0_factory.php
   trunk/mapbender/http/classes/class_wfs_1_1_factory.php
   trunk/mapbender/http/classes/class_wmc.php
   trunk/mapbender/http/classes/class_wmcToXml.php
Log:
Some bugfixes for wfs cap xml parsing of geoserver 2.2

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2012-10-15 11:39:38 UTC (rev 8502)
+++ trunk/mapbender/http/classes/class_iso19139.php	2012-11-02 11:40:35 UTC (rev 8503)
@@ -119,7 +119,7 @@
 			return false;
 		}
 		//if parsing was successful
-		if ($iso19139Xml != false) {
+		if ($iso19139Xml !== false) {
 			//add namespaces to xml if not given - how? - it is to late now - maybe they were given in the csw tag!
 			$e = new mb_exception("Parsing of xml metadata file was successfull"); 
 			$this->fileIdentifier = $iso19139Xml->xpath('/gmd:MD_Metadata/gmd:fileIdentifier/gco:CharacterString');
@@ -734,7 +734,7 @@
 				//following information must be given:
 				//randomId, href, format, type, origin, owner
 				//TODO: that empty identifier not identified - see comparing linkage
-				if ((($this->type == 'ISO19115:2003' || $this->type == 'ISO 19115:2003') && $this->format =='text/xml') || ($this->type == 'TC211' && $this->format =='text/xml') || (($this->type == 'ISO19115:2003' || $this->type == 'ISO 19115:2003') && $this->format =='application/vnd.iso.19139+xml')) {
+				if ((($this->type == 'ISO19115:2003' || $this->type == 'ISO 19115:2003') && $this->format =='text/xml') || ($this->type == 'TC211' && $this->format =='text/xml') || (($this->type == 'ISO19115:2003' || $this->type == 'ISO 19115:2003') && ($this->format =='application/vnd.iso.19139+xml' || $this->format =='application/xml'))) {
 					$e = new mb_notice("class_Iso19139:"."try to parse: ".$this->href);
 					$metadata = $this->createFromUrl($this->href); //will alter object itself
 					$e = new mb_notice("class_Iso19139:"."Metadata found: ".$this->metadata);

Modified: trunk/mapbender/http/classes/class_wfs_1_0_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_0_factory.php	2012-10-15 11:39:38 UTC (rev 8502)
+++ trunk/mapbender/http/classes/class_wfs_1_0_factory.php	2012-11-02 11:40:35 UTC (rev 8503)
@@ -148,7 +148,7 @@
     				$e = new mb_exception($e->getMessage());
 			}	
 		
-			if ($wfs10Cap != false) {
+			if ($wfs10Cap !== false) {
 				//read all relevant information an put them into the mapbender wfs object
 				//xmlns="http://www.opengis.net/wfs"
 				//Setup default namespace

Modified: trunk/mapbender/http/classes/class_wfs_1_1_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_1_factory.php	2012-10-15 11:39:38 UTC (rev 8502)
+++ trunk/mapbender/http/classes/class_wfs_1_1_factory.php	2012-11-02 11:40:35 UTC (rev 8503)
@@ -193,7 +193,7 @@
     				$e = new mb_exception($e->getMessage());
 			}	
 
-			if ($wfs11Cap != false) {
+			if ($wfs11Cap !== false) {
 				//read all relevant information an put them into the mapbender wfs object
 				//xmlns="http://www.opengis.net/wfs"
 				//Setup default namespace
@@ -226,7 +226,7 @@
 				$myWfs->positionName = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:PositionName');
 				$myWfs->positionName = $myWfs->positionName[0];
 
-				$myWfs->providerName = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ProviderName');
+				$myWfs->providerName = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ProviderName');
 				$myWfs->providerName = $myWfs->providerName[0];
 				
 				$myWfs->city = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ContactInfo/ows:Address/ows:City');

Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php	2012-10-15 11:39:38 UTC (rev 8502)
+++ trunk/mapbender/http/classes/class_wmc.php	2012-11-02 11:40:35 UTC (rev 8503)
@@ -184,17 +184,16 @@
 		$this->mainMap = map::selectMainMapByApplication($appId);
 		$this->overviewMap = map::selectOverviewMapByApplication($appId);
 
-		// a  wWFS is basically just a vectorlayer, and a WFSconf is just a configured WFS,
+		// a  WFS is basically just a vectorlayer, and a WFSconf is just a configured WFS,
 		// so it makes sense to attach the WFSCONFIDstring to to the mapobject
 		// this clearly needs a better solution though...
 		try{
 			$ev = new ElementVar($appId,"mapframe1","wfsConfIdString");
 			$this->generalExtensionArray['WFSCONFIDSTRING'] = $ev->value;
 		}catch(Exception $E){
-			// ... exceprtions are a terribkle way to do this, but I am not going to rewrite the ElementVar class
+			// ... exceptions are a terrible way to do this, but I am not going to rewrite the ElementVar class
 			$this->generalExtensionArray['WFSCONFIDSTRING'] = "";
 		}
-
 		$this->createXml();
 		$this->saveAsFile();
 	}
@@ -1075,15 +1074,19 @@
 	}
 
 	public function wmsToJavaScript() {
+		$e = new mb_exception("class_wmc.php: create wms array from main map");
 		$wmsArray = $this->mainMap->getWmsArray();
 
 		$wmcJsArray = array();
+		$e = new mb_exception("class_wmc.php: iterate over wms array");
+		$e = new mb_exception("class_wmc.php: count of wms array: ".count($wmsArray));
 		for ($i = 0; $i < count($wmsArray); $i++) {
 			$currentWms = $wmsArray[$i];
-
+			$e = new mb_exception("class_wmc.php: createJsObjFromWMS number: ".$i);
 			$wmcJsArray[] = $currentWms->createJsObjFromWMS_();
 			$this->incrementLoadCount($currentWms);
 		}
+		$e = new mb_exception("class_wmc.php: wmcJsArray created!");
 		return $wmcJsArray;
 	}
 

Modified: trunk/mapbender/http/classes/class_wmcToXml.php
===================================================================
--- trunk/mapbender/http/classes/class_wmcToXml.php	2012-10-15 11:39:38 UTC (rev 8502)
+++ trunk/mapbender/http/classes/class_wmcToXml.php	2012-11-02 11:40:35 UTC (rev 8503)
@@ -61,7 +61,6 @@
 	// ---------------------------------------------------------------------
 	
 	private function toXml () {
-
 		// generate XML
 		$this->doc = new DOMDocument("1.0", CHARSET);
 		$this->doc->preserveWhiteSpace = false;
@@ -89,7 +88,6 @@
 			$currentOverviewWmsArray = $this->wmc->overviewMap->getWmsArray();
 			for ($k = 0; $k < count($currentOverviewWmsArray); $k++) {
 				$currentOverviewWms = $currentOverviewWmsArray[$k];
-
 				for ($l = 0; $l < count($currentOverviewWms->objLayer); $l++) {
 					$currentOverviewLayer = $currentOverviewWms->objLayer[$l];
 					array_push($overviewLayerArray, $currentOverviewLayer);
@@ -127,7 +125,6 @@
 		$this->doc->appendChild($e_view_context);
 //		$this->xml = $this->doc->saveXML($this->doc->documentElement);
 		$this->xml = $this->doc->saveXML();
-		
 //		$e = new mb_notice($this->xml);
 	}
 



More information about the Mapbender_commits mailing list