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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed May 2 11:15:55 EDT 2012


Author: armin11
Date: 2012-05-02 08:15:55 -0700 (Wed, 02 May 2012)
New Revision: 8339

Modified:
   trunk/mapbender/http/classes/class_wfsToDb.php
   trunk/mapbender/http/classes/class_wfs_factory.php
   trunk/mapbender/http/classes/class_wfs_featuretype.php
   trunk/mapbender/http/geoportal/mod_readCSWResults.php
   trunk/mapbender/http/plugins/mb_metadata_wfs_server.php
Log:
More work on the wfs metadata editor for inspire download services and a bugfix in the csw client.

Modified: trunk/mapbender/http/classes/class_wfsToDb.php
===================================================================
--- trunk/mapbender/http/classes/class_wfsToDb.php	2012-04-27 12:50:52 UTC (rev 8338)
+++ trunk/mapbender/http/classes/class_wfsToDb.php	2012-05-02 15:15:55 UTC (rev 8339)
@@ -314,7 +314,7 @@
 			$aWfsFeatureTypeNamespace->value
 		);
 		$t = array("s", "s", "s", "s");
-		$e = new mb_exception("INSERTING FT NS $aWfsId, FT: $aWfsFeatureTypeId, NS: $aWfsFeatureTypeNamespace->name");
+		$e = new mb_notice("INSERTING FT NS $aWfsId, FT: $aWfsFeatureTypeId, NS: $aWfsFeatureTypeNamespace->name");
 		$res = db_prep_query($sql, $v, $t);
 
 		if (!$res) {
@@ -342,7 +342,7 @@
 		);
 		$t = array("i", "s", "s");
 		
-		$e = new mb_exception("INSERTING FT EL (FT: $aWfsFeatureTypeId, NS: $aWfsFeatureTypeElement->name");
+		$e = new mb_notice("INSERTING FT EL (FT: $aWfsFeatureTypeId, NS: $aWfsFeatureTypeElement->name");
 		$res = db_prep_query($sql, $v, $t);
 		
 		if (!$res) {
@@ -433,7 +433,7 @@
 		);
 		$t = array("s", "i", "i");
 
-		$e = new mb_exception("UPDATING FT EL (FT: $aWfsFeatureTypeId, NS: $aWfsFeatureTypeElement->name");
+		$e = new mb_notice("UPDATING FT EL (FT: $aWfsFeatureTypeId, NS: $aWfsFeatureTypeElement->name");
 		$res = db_prep_query($sql, $v, $t);
 
 		if (!$res) {
@@ -453,7 +453,7 @@
 	private static function insertFeatureType ($aWfsFeatureType) {
 		$uuid = new Uuid();
 		$sql = "INSERT INTO wfs_featuretype (fkey_wfs_id, featuretype_name, " . 
-				"featuretype_title, featuretype_abstract, featuretype_srs, uuid) " . 
+				"featuretype_title, featuretype_abstract, featuretype_searchable, featuretype_srs, uuid) " . 
 				"VALUES($1, $2, $3, $4, $5, $6)";
 
 		$v = array(
@@ -461,12 +461,13 @@
 			$aWfsFeatureType->name,
 			$aWfsFeatureType->title,
 			$aWfsFeatureType->summary,
+			1, //default to allow search for a inserted featuretype
 			$aWfsFeatureType->srs,
 			$uuid
 		);
-		$t = array('i','s','s','s','s','s');
+		$t = array('i','s','s','s','i','s','s');
 
-		$e = new mb_exception("INSERTING FT (FT: $aWfsFeatureType->name)");
+		$e = new mb_notice("INSERTING FT (FT: $aWfsFeatureType->name)");
 		$res = db_prep_query($sql,$v,$t);
 		if (!$res) {
 			$e = new mb_exception("Error while inserting WFS feature type into database.");
@@ -507,18 +508,20 @@
 		$sql = "UPDATE wfs_featuretype SET ";
 		$sql .= "featuretype_title = $1,";
 		$sql .= "featuretype_abstract = $2,";
-		$sql .= "featuretype_srs = $3 ";
-		$sql .= "WHERE featuretype_id = $4";
+		$sql .= "featuretype_searchable = $3,";
+		$sql .= "featuretype_srs = $4 ";
+		$sql .= "WHERE featuretype_id = $5";
 		$v = array(
 			$aWfsFeatureType->title,
 			$aWfsFeatureType->summary,
+			$aWfsFeatureType->searchable,
 			$aWfsFeatureType->srs,
 			$aWfsFeatureType->id
 		);
-		$t = array('s','s','s','i');
+		$t = array('s','s','s','s','i');
 
-		$e = new mb_exception("UPDATING FT (FT: $aWfsFeatureType->id)");
-
+		$e = new mb_notice("UPDATING FT (FT: $aWfsFeatureType->id)");
+		$e = new mb_exception("UPDATING FT (FT searchable: $aWfsFeatureType->searchable)");
 		$res = db_prep_query($sql,$v,$t);
 		if (!$res) {
 			$e = new mb_exception("Error while updating WFS feature type in database.");

Modified: trunk/mapbender/http/classes/class_wfs_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_factory.php	2012-04-27 12:50:52 UTC (rev 8338)
+++ trunk/mapbender/http/classes/class_wfs_factory.php	2012-05-02 15:15:55 UTC (rev 8339)
@@ -126,6 +126,7 @@
 				$ft->name = db_result($res_fe, $cnt_fe, "featuretype_name");
 				$ft->title = db_result($res_fe, $cnt_fe, "featuretype_title");
 				$ft->summary = db_result($res_fe, $cnt_fe, "featuretype_abstract");
+				$ft->searchable = db_result($res_fe, $cnt_fe, "featuretype_searchable");
 				$ft->srs = db_result($res_fe, $cnt_fe, "featuretype_srs");
 				$ft->uuid = db_result($res_fe, $cnt_fe, "uuid");
 				

Modified: trunk/mapbender/http/classes/class_wfs_featuretype.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_featuretype.php	2012-04-27 12:50:52 UTC (rev 8338)
+++ trunk/mapbender/http/classes/class_wfs_featuretype.php	2012-05-02 15:15:55 UTC (rev 8339)
@@ -18,7 +18,7 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
 require_once(dirname(__FILE__)."/../../core/globalSettings.php");
-require_once(dirname(__FILE__)."/class_connector.php");
+require_once(dirname(__FILE__)."/class_connector.php");
 require_once(dirname(__FILE__)."/class_administration.php");
 require_once(dirname(__FILE__)."/class_wfs.php");
 
@@ -27,6 +27,7 @@
 	var $name;
 	var $title;
 	var $summary;
+	var $searchable;
 	var $srs;
 	var $wfs;
 	var $namespaceArray = array();
@@ -118,4 +119,4 @@
 		return $this->toHtml();
 	}
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/geoportal/mod_readCSWResults.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_readCSWResults.php	2012-04-27 12:50:52 UTC (rev 8338)
+++ trunk/mapbender/http/geoportal/mod_readCSWResults.php	2012-05-02 15:15:55 UTC (rev 8339)
@@ -345,7 +345,6 @@
 			$getRecords .= '          <ogc:PropertyName>Type</ogc:PropertyName>';
 			$getRecords .= '          <ogc:Literal>dataset</ogc:Literal>';
 			$getRecords .= '          </ogc:PropertyIsEqualTo>';
-			$getRecords .= '          </ogc:PropertyIsLike>';
 			$getRecords .= '          <ogc:PropertyIsEqualTo>';
 			$getRecords .= '          <ogc:PropertyName>Type</ogc:PropertyName>';
 			$getRecords .= '          <ogc:Literal>series</ogc:Literal>';

Modified: trunk/mapbender/http/plugins/mb_metadata_wfs_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wfs_server.php	2012-04-27 12:50:52 UTC (rev 8338)
+++ trunk/mapbender/http/plugins/mb_metadata_wfs_server.php	2012-05-02 15:15:55 UTC (rev 8339)
@@ -1008,12 +1008,37 @@
 			}
 		}
 		
+		if (is_array($data->wfs->featuretype_searchable)) {
+			foreach ($wfs->featureTypeArray as &$featuretype) {//for each existing featuretype
+				$featuretype->searchable = 0;//initialize new
+				$e = new mb_exception("mb_metadata_wfs_server.php: Check ft with id ".$featuretype->id." to be searchable");
+				for ($i = 0; $i < count($data->wfs->featuretype_searchable); $i++) {
+					$id = $data->wfs->featuretype_searchable[$i];
+					$e = new mb_notice("mb_metadata_wfs_server.php: ft with id ".$id." found to be searchable");
+					if ($id == intval($featuretype->id)) {
+						$e = new mb_exception("mb_metadata_wfs_server.php: ft identical - update it in wfs object");
+						$featuretype->searchable = 1;					
+					} else {
+						continue; //with next 
+					}
+					unset($id);
+					//$layer->layer_searchable = 1;
+					//break;
+				}
+			}
+		}
+
+
 		try {
 			$featuretypeId = intval($data->featuretype->featuretype_id);
 		}
 		catch (Exception $e) {
 		}
 
+
+
+
+
 		if ($featuretypeId) {
 			$featuretype = $wfs->findFeatureTypeById($featuretypeId);
 			if (!is_null($featuretype)) {



More information about the Mapbender_commits mailing list