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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sun Mar 13 08:52:08 EDT 2011


Author: armin11
Date: 2011-03-13 05:52:08 -0700 (Sun, 13 Mar 2011)
New Revision: 7703

Modified:
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
Log:
Debug handling of wms_metadata editor - there is s.th. to do: the checkboxes of the layertree will give only one id if the layer is a parent - this should be altered so that all activated layers are in the layer_searchable array! See line 143+ of mb_metadata_layerTree.js.

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2011-03-13 10:52:40 UTC (rev 7702)
+++ trunk/mapbender/http/classes/class_wms.php	2011-03-13 12:52:08 UTC (rev 7703)
@@ -1743,6 +1743,8 @@
 				$this->objLayer[$i]->layer_abstract, $l_id		
 			);
 		$t = array('i','s','s','i','i','i','s','s','i', 's','i');
+		$e = new mb_notice("class_wms.php: update layer sql:".$sql);
+		$e = new mb_notice("class_wms.php: layerid: ".$l_id." layersearchable: ".$this->objLayer[$i]->layer_searchable);
 		$res = db_prep_query($sql,$v,$t);
 		if($this->overwrite == true){
 			$sql = "UPDATE layer SET ";

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2011-03-13 10:52:40 UTC (rev 7702)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2011-03-13 12:52:08 UTC (rev 7703)
@@ -354,16 +354,22 @@
 
 		if (is_array($data->wms->layer_searchable)) {
 			foreach ($wms->objLayer as &$layer) {
-				$layer->layer_searchable = 0;
+				$layer->layer_searchable = 0;//why
+				$e = new mb_notice("mb_metadata_server.php: Check layer with id ".$layer->layer_uid." to be searchable");
 				for ($i = 0; $i < count($data->wms->layer_searchable); $i++) {
+					//$e = new mb_exception("mb_metadata_server.php: Layer with id ".$id." found to be searchable");
 					$id = $data->wms->layer_searchable[$i];
-					if ($id !== intval($layer->layer_uid)) {
-						continue;						
+					$e = new mb_notice("mb_metadata_server.php: Layer with id ".$id." found to be searchable");
+					if ($id == intval($layer->layer_uid)) {
+						$e = new mb_notice("mb_metadata_server.php: Layer identical - update it in wms object");
+						$layer->layer_searchable = 1;					
+					} else {
+						continue; //with next 
 					}
-					$layer->layer_searchable = 1;
-					break;
+					unset($id);
+					//$layer->layer_searchable = 1;
+					//break;
 				}
-				unset($id);
 			}
 		}
 
@@ -377,7 +383,7 @@
 		}
 		
 		if ($layerId) {
-			$e = new mb_exception("Got following layer id from wms metadata editor client: ".$layerId);
+			$e = new mb_notice("Got following layer id from wms metadata editor client: ".$layerId);
 			try {
 				$layer = &$wms->getLayerReferenceById($layerId);
 			}
@@ -397,7 +403,7 @@
 
 			foreach ($columns as $c) {
 				$value = $data->layer->$c;
-				$e = new mb_exception("plugins/mb_metadata_server.php: layer entry for ".$c.": ".$data->layer->$c);
+				$e = new mb_notice("plugins/mb_metadata_server.php: layer entry for ".$c.": ".$data->layer->$c);
 				if ($c === "layer_keyword") {
 					$layer->$c = explode(",", $value);
 					foreach ($layer->$c as &$val) {



More information about the Mapbender_commits mailing list