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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Nov 17 05:17:38 EST 2011


Author: armin11
Date: 2011-11-17 02:17:38 -0800 (Thu, 17 Nov 2011)
New Revision: 8206

Modified:
   trunk/mapbender/http/classes/class_wms.php
Log:
Bugfix

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2011-11-17 09:11:00 UTC (rev 8205)
+++ trunk/mapbender/http/classes/class_wms.php	2011-11-17 10:17:38 UTC (rev 8206)
@@ -66,6 +66,13 @@
 	var $default_epsg = 0;
 	var $overwrite = true;
 	
+
+	//GeoRSS feed
+	//
+	var $geoRssFactory; // = new GeoRssFactory();
+ 	
+	var $geoRss; //= $this->geoRssFactory->loadOrCreate(GEO_RSS_FILE);
+
 	// write a GeoRSS feed?
 	const GEORSS = true;
 	// append items to the feed when a new WMS is inserted?
@@ -102,7 +109,7 @@
 		#	"$1php/mod_layerMetadata.php?id=", 
 		#	LOGIN
 		#) . $wmsId;
-		return LOGIN."/../../mapbender/php/mod_showMetadata.php?resource=wms&id=".$wmsId;
+		return LOGIN."/../../php/mod_showMetadata.php?resource=wms&id=".$wmsId;
 		//the following may be activated if the metadata for the resources can be accessed over restful urls - maybe with help of apaches mod_rewrite
 		#return "http://www.geoportal.rlp.de/wms/".$wmsId;
 	}
@@ -112,7 +119,7 @@
 		#	"$1php/mod_layerMetadata.php?id=", 
 		#	LOGIN
 		#) . $wmsId;
-		return LOGIN."/../../mapbender/php/mod_showMetadata.php?resource=layer&id=".$layerId;
+		return LOGIN."/../../php/mod_showMetadata.php?resource=layer&id=".$layerId;
 		//the following may be activated if the metadata for the resources can be accessed over restful urls - maybe with help of apaches mod_rewrite
 		#return "http://www.geoportal.rlp.de/layer/".$layerId;
 	}
@@ -1527,6 +1534,8 @@
 		$admin = new administration();
 		$uuid = new Uuid();
 		$this->checkObj();
+		$this->geoRssFactory = new GeoRssFactory();
+		$this->geoRss = $this->geoRssFactory->loadOrCreate(GEO_RSS_FILE);
 		db_begin();
 	
 		# TABLE wms
@@ -1640,9 +1649,11 @@
 		//
 		// update GeoRSS feed
 		//
-		$geoRssFactory = new GeoRssFactory();
-		$geoRss = $geoRssFactory->loadOrCreate(GEO_RSS_FILE);
-		if (!is_null($geoRss)) {
+		//$geoRssFactory = new GeoRssFactory();
+		//$geoRss = $geoRssFactory->loadOrCreate(GEO_RSS_FILE);
+		$e = new mb_exception("class_wms.php: writeObjInDB: test if geoRss maybe null!");
+		if (!is_null($this->geoRss)) {
+			$e = new mb_exception("class_wms.php: writeObjInDB: geoRss was not NULL!");
 			$geoRssItem = new GeoRssItem();
 			$geoRssItem->setTitle("NEW WMS: " . $this->wms_title." (".$myWMS.")");
 			$geoRssItem->setDescription($this->wms_abstract);
@@ -1663,11 +1674,8 @@
 					break;
 				}
 			}
-			//for debugging: 
-			//print_r($geoRss);
-			//die();
-			$geoRss->appendTop($geoRssItem);
-			$geoRss->saveAsFile();
+			$this->geoRss->appendTop($geoRssItem);
+			$this->geoRss->saveAsFile();
 		}
 		if (TWITTER_NEWS == true) {
 			//new WMS
@@ -1735,7 +1743,7 @@
 			//update messages for twitter and georss
 			$currentLayer = $this->objLayer[$i];
 			$geoRssItemNewLayer = new GeoRssItem();
-			if (!is_null($geoRss)) {
+			if (!is_null($this->geoRss)) {
 				$geoRssItemNewLayer->setTitle("NEW LAYER: " . $currentLayer->layer_title." (".$currentLayer->db_id.")");
 				$geoRssItemNewLayer->setDescription($currentLayer->layer_abstract);
 				$geoRssItemNewLayer->setUrl(self::getLayerMetadataUrl($currentLayer->db_id));
@@ -1754,7 +1762,7 @@
 						break;
 					}
 				}
-				$geoRss->appendTop($geoRssItemNewLayer);
+				$this->geoRss->appendTop($geoRssItemNewLayer);
 			}
 			if (TWITTER_NEWS == true) {
 				//new LAYER
@@ -2463,6 +2471,8 @@
 		if (!isset($this->wms_network_access) || ($this->wms_network_access == '')) {
 			$this->wms_network_access = intval('0');
 		}
+		$this->geoRssFactory = new GeoRssFactory();
+		$this->geoRss = $this->geoRssFactory->loadOrCreate(GEO_RSS_FILE);
 		$admin = new administration();
 		db_begin();
 		
@@ -2666,10 +2676,10 @@
 		//
 		// update GeoRSS feed
 		//
-		$geoRssFactory = new GeoRssFactory();
-		$geoRss = $geoRssFactory->loadOrCreate(GEO_RSS_FILE);
+		//$geoRssFactory = new GeoRssFactory();
+		//$geoRss = $geoRssFactory->loadOrCreate(GEO_RSS_FILE);
 		
-		if (!is_null($geoRss)) {
+		if (!is_null($this->geoRss)) {
 
 			$geoRssItem = new GeoRssItem();
 			$geoRssItem->setTitle("UPDATED WMS: " . $this->wms_title." (".$myWMS.")");
@@ -2690,7 +2700,7 @@
 					break;
 				}
 			}
-			$geoRss->appendTop($geoRssItem);
+			$this->geoRss->appendTop($geoRssItem);
 
 			foreach ($oldLayerNameArray as $oldLayer) {
 				$geoRssItemOldLayer = new GeoRssItem();
@@ -2699,9 +2709,9 @@
 				$geoRssItemOldLayer->setDescription($oldLayer["abstract"]);
 				$geoRssItemOldLayer->setPubDate(self::rssDate());
 //				$geoRssItem->setUrl();
-				$geoRss->appendTop($geoRssItemOldLayer);
+				$this->geoRss->appendTop($geoRssItemOldLayer);
 			}
-			$geoRss->saveAsFile();
+			
 		}
 		//twitter out changes
 		if (TWITTER_NEWS == true) {
@@ -2724,7 +2734,7 @@
 			}
 			
 		}
-		
+		$this->geoRss->saveAsFile();
 		return;	
 	}
 



More information about the Mapbender_commits mailing list