[Mapbender-commits] r7660 - in trunk/mapbender: http/classes http/plugins http_auth/http

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sun Feb 27 18:04:07 EST 2011


Author: armin11
Date: 2011-02-27 15:04:07 -0800 (Sun, 27 Feb 2011)
New Revision: 7660

Modified:
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
   trunk/mapbender/http_auth/http/index.php
Log:
Give new georss entry if the metadata of one layer will be updated and some less logs.

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2011-02-27 22:04:02 UTC (rev 7659)
+++ trunk/mapbender/http/classes/class_wms.php	2011-02-27 23:04:07 UTC (rev 7660)
@@ -244,7 +244,7 @@
 		}
 		throw new Exception ("Layer not found.");
 	}
-	public function &getLayerReferenceById ($id) {
+	public function &getLayerReferenceById ($id) {//this is done to update one layer with the metadata editor!
 		$adm = new administration();
 		for ($i = 0; $i < count($this->objLayer); $i++) {
 			if (strval($this->objLayer[$i]->layer_uid) === strval($id)) {
@@ -253,6 +253,34 @@
 							$this->objLayer[$i]->layer_name, 
 							Mapbender::session()->get("mb_user_id")
 				)) {
+				//
+				// update GeoRSS feed if wished
+				//
+				$geoRssFactory = new GeoRssFactory();
+				$geoRss = $geoRssFactory->loadOrCreate(GEO_RSS_FILE);
+				if (!is_null($geoRss)) {
+					$currentLayer = $this->objLayer[$i];
+					$geoRssItemUpdatedLayer = new GeoRssItem();
+					$geoRssItemUpdatedLayer->setTitle("UPDATED LAYER: " . $currentLayer->layer_title." (".$currentLayer->layer_uid.")");
+					$geoRssItemUpdatedLayer->setDescription($currentLayer->layer_abstract);
+					$geoRssItemUpdatedLayer->setUrl(self::getLayerMetadataUrl($currentLayer->layer_uid));
+					$geoRssItemUpdatedLayer->setPubDate(self::rssDate());
+					for ($j = 0; $j < count($currentLayer->layer_epsg); $j++) {
+						$currentEpsg = $currentLayer->layer_epsg[$j];
+						if ($currentEpsg["epsg"] === "EPSG:4326") {
+							$currentBbox = new Mapbender_bbox(
+								$currentEpsg["minx"],
+								$currentEpsg["miny"],
+								$currentEpsg["maxx"],
+								$currentEpsg["maxy"],
+								$currentEpsg["epsg"]
+							);
+							$geoRssItemUpdatedLayer->setBbox($currentBbox);
+							break;
+						}
+					}
+					$geoRss->appendTop($geoRssItemUpdatedLayer);
+					//return the reference to the layer which will be updated
 					return $this->objLayer[$i];
 				}
 				else {

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2011-02-27 22:04:02 UTC (rev 7659)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2011-02-27 23:04:07 UTC (rev 7660)
@@ -177,7 +177,7 @@
 		while ($row = db_fetch_assoc($res)) {
 			foreach ($row as $key => $value) {
 				$resultObj[$key] = $value;
-				$e = new mb_exception("plugins/mb_metadata_server.php: get ".$value." for ".$key);
+				$e = new mb_notice("plugins/mb_metadata_server.php: get ".$value." for ".$key);
 			}
 		}
 

Modified: trunk/mapbender/http_auth/http/index.php
===================================================================
--- trunk/mapbender/http_auth/http/index.php	2011-02-27 22:04:02 UTC (rev 7659)
+++ trunk/mapbender/http_auth/http/index.php	2011-02-27 23:04:07 UTC (rev 7660)
@@ -483,7 +483,7 @@
 
 function checkLayerPermission($wms_id,$l,$userId){
 	global $n, $owsproxyService;
-	$e = new mb_exception("owsproxy: checkLayerpermission: wms: ".$wms_id.", layer: ".$l.' user_id: '.$userId);
+	$e = new mb_notice("owsproxy: checkLayerpermission: wms: ".$wms_id.", layer: ".$l.' user_id: '.$userId);
 	$myl = split(",",$l);
 	$r = array();
 	foreach($myl as $mysl){



More information about the Mapbender_commits mailing list