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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu May 24 09:58:31 EDT 2012


Author: armin11
Date: 2012-05-24 06:58:31 -0700 (Thu, 24 May 2012)
New Revision: 8363

Modified:
   trunk/mapbender/http/classes/class_wfs.php
   trunk/mapbender/http/classes/class_wfsToDb.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_wfs_factory.php
   trunk/mapbender/http/classes/class_wfs_featuretype.php
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/geoportal/gaz_geom.php
   trunk/mapbender/http/geoportal/gaz_geom_mobile.php
   trunk/mapbender/http/php/mod_inspireWmsDownloadFeed.php
   trunk/mapbender/http/plugins/mb_metadata_featuretype.php
   trunk/mapbender/http/plugins/mb_metadata_layer.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
   trunk/mapbender/http/plugins/mb_metadata_wfs_server.php
Log:
Things to fullfil INSPIRE demands. The wfs registration is altered - parsing caps now is done with simplexml.
Bugfix of wfs metadata editor.
Possibility to decide if wfs_featuretypes or wms_layer should be used to generate inspire pre defined datasets automatically. 

Some further things have to be done. Not yet ready - need 1 other week.

Modified: trunk/mapbender/http/classes/class_wfs.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/classes/class_wfs.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -67,7 +67,17 @@
 		new mb_exception("This WFS doesn't have a featuretype with ID " . $id);
 		return null;
 	}
-	
+
+	public function &findFeatureTypeReferenceById ($id) { //used by metadata editor
+		foreach ($this->featureTypeArray as $ft) {
+			if ($ft->id == $id) {
+				return $ft;
+			}
+		}
+		new mb_exception("This WFS doesn't have a featuretype with ID " . $id);
+		return null;
+	}
+
 	public static function getWfsIdByFeaturetypeId ($id) {
 		$sql = "SELECT DISTINCT fkey_wfs_id FROM wfs_featuretype WHERE featuretype_id = $1";
 		$res = db_prep_query($sql, array($id), array("i"));

Modified: trunk/mapbender/http/classes/class_wfsToDb.php
===================================================================
--- trunk/mapbender/http/classes/class_wfsToDb.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/classes/class_wfsToDb.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -228,6 +228,7 @@
 			db_rollback();
 			return false;
 		}
+		$e = new mb_exception("Number of featuretypes not to delete: ".count($featureTypeNameArray));
 		db_commit();
 		return true;		
 	}
@@ -480,8 +481,8 @@
 	private static function insertFeatureType ($aWfsFeatureType) {
 		$uuid = new Uuid();
 		$sql = "INSERT INTO wfs_featuretype (fkey_wfs_id, featuretype_name, " . 
-				"featuretype_title, featuretype_abstract, featuretype_searchable, featuretype_srs, featuretype_latlon_bbox, uuid) " . 
-				"VALUES($1, $2, $3, $4, $5, $6, $7, $8)";
+				"featuretype_title, featuretype_abstract, featuretype_searchable, featuretype_srs, featuretype_latlon_bbox, uuid, inspire_download) " . 
+				"VALUES($1, $2, $3, $4, $5, $6, $7, $8, $9)";
 
 		$v = array(
 			$aWfsFeatureType->wfs->id,
@@ -491,9 +492,10 @@
 			1, //default to allow search for a inserted featuretype (searchable)
 			$aWfsFeatureType->srs,
 			$aWfsFeatureType->latLonBboxArray['minx'].','.$aWfsFeatureType->latLonBboxArray['miny'].','.$aWfsFeatureType->latLonBboxArray['maxx'].','.$aWfsFeatureType->latLonBboxArray['maxy'],
-			$uuid
+			$uuid,
+			0 //default not generate a INSPIRE Download Feed
 		);
-		$t = array('i','s','s','s','i','s','s','s');
+		$t = array('i','s','s','s','i','s','s','s','i');
 
 		$e = new mb_notice("INSERTING FT (FT: $aWfsFeatureType->name)");
 		$res = db_prep_query($sql,$v,$t);
@@ -546,7 +548,8 @@
 		$sql .= "featuretype_abstract = $2,";
 		$sql .= "featuretype_searchable = $3,";
 		$sql .= "featuretype_srs = $4, ";
-		$sql .= "featuretype_latlon_bbox = $5 ";
+		$sql .= "featuretype_latlon_bbox = $5, ";
+		$sql .= "inspire_download = $7 ";
 		$sql .= "WHERE featuretype_id = $6";
 		$v = array(
 			$aWfsFeatureType->title,
@@ -554,12 +557,16 @@
 			$aWfsFeatureType->searchable,
 			$aWfsFeatureType->srs,
 			$aWfsFeatureType->latLonBboxArray['minx'].','.$aWfsFeatureType->latLonBboxArray['miny'].','.$aWfsFeatureType->latLonBboxArray['maxx'].','.$aWfsFeatureType->latLonBboxArray['maxy'],
-			$aWfsFeatureType->id
+			$aWfsFeatureType->id,
+			$aWfsFeatureType->inspire_download
 		);
-		$t = array('s','s','s','s','s','i');
+		$t = array('s','s','s','s','s','i','i');
 
-		$e = new mb_notice("UPDATING FT (FT: $aWfsFeatureType->id)");
-		$e = new mb_notice("UPDATING FT (FT searchable: $aWfsFeatureType->searchable)");
+		$e = new mb_exception("UPDATING FT (FT: $aWfsFeatureType->id)");
+		
+		$e = new mb_exception("UPDATING FT (FT searchable: $aWfsFeatureType->searchable)");
+		$e = new mb_exception("UPDATING FT (FT inspire_download: $aWfsFeatureType->inspire_download)");
+		$e = new mb_exception("");
 		$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_1_0_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_0_factory.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/classes/class_wfs_1_0_factory.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -49,7 +49,7 @@
 		$xpath =  new DOMXpath($doc);
 		$xpath->registerNamespace("xs","http://www.w3.org/2001/XMLSchema");
 
-		// populate a Namespaces Hastable where we can use thec namesopace as a lookup for the prefix
+		// populate a Namespaces Hashtable where we can use the namespace as a lookup for the prefix
 		// and also keep a 
 		$namespaces = array();
 		$namespaceList = $xpath->query("//namespace::*");
@@ -126,111 +126,81 @@
 			
 			$myWfs = new Wfs_1_0();
 		
+			//new for parsing with simple xml:
 			$admin = new administration();
-			$values = $admin->parseXml($xml);
-			
 			$myWfs->getCapabilitiesDoc = $admin->char_encode($xml);
 			$myWfs->id = $this->createId();
+			
+			try {
+				$xml = str_replace('xlink:href', 'xlinkhref', $xml);
+				#http://forums.devshed.com/php-development-5/simplexml-namespace-attributes-problem-452278.html
+				#http://www.leftontheweb.com/message/A_small_SimpleXML_gotcha_with_namespaces
+				$wfs10Cap = new SimpleXMLElement($xml);
+				//$wfs10Cap =  new SimpleXMLElement($xml);
+				if ($wfs10Cap === false) {
+					foreach(libxml_get_errors() as $error) {
+        					$e = new mb_exception($error->message);
+    					}
+					throw new Exception('Cannot parse WFS 1.0.0 Capabilities!');
+				}
+			}
+			catch (Exception $e) {
+    				$e = new mb_exception($e->getMessage());
+			}	
 		
-			foreach ($values as $element) {
-				$tag = strtoupper($element[tag]);
+			if ($wfs10Cap != false) {
+				//read all relevant information an put them into the mapbender wfs object
+				//xmlns="http://www.opengis.net/wfs"
+				//Setup default namespace
+				$wfs10Cap->registerXPathNamespace("wfs", "http://www.opengis.net/wfs");
+				$wfs10Cap->registerXPathNamespace("ogc", "http://www.opengis.net/ogc");
+				$wfs10Cap->registerXPathNamespace("xlink", "http://www.w3.org/1999/xlink");
+				//some debug
+				//$e = new mb_notice("XML string from memory: ".$wfs10Cap->asXML());
+				$myWfs->version = $wfs10Cap->xpath('/wfs:WFS_Capabilities/@version');
+				$myWfs->version = $myWfs->version[0];
+				$myWfs->name = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:Service/wfs:Name');
+				$myWfs->name = $myWfs->name[0];
+				$myWfs->title = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:Service/wfs:Title');
+				$myWfs->title = $this->stripEndlineAndCarriageReturn($myWfs->title[0]);
+				$myWfs->summary = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:Service/wfs:Abstract');
+				$myWfs->summary = $this->stripEndlineAndCarriageReturn($myWfs->summary[0]);
+				$myWfs->fees = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:Service/wfs:Fees');
+				$myWfs->fees = $myWfs->fees[0];
+				$myWfs->accessconstraints = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:Service/wfs:AccessConstraints');
+				$myWfs->accessconstraints = $myWfs->accessconstraints[0];
 
-				if($tag == "WFS_CAPABILITIES" && $element[type] == "open"){
-					$myWfs->version = $element[attributes][version];
-					if ($myWfs->version !== "1.0.0") {
-						throw new Exception("Not a WFS 1.0.0 capabilities document.");
-					}
-				}
-				if($tag == "NAME"  && $element[level] == '3'){
-					$myWfs->name = $element[value];
-				}
-				if($tag == "TITLE"  && $element[level] == '3'){
-					$myWfs->title = $this->stripEndlineAndCarriageReturn($element[value]);
-				}
-				if($tag == "ABSTRACT" && $element[level] == '3'){
-					$myWfs->summary = $this->stripEndlineAndCarriageReturn($element[value]);
-				}
-				if($tag == "FEES"){
-					$myWfs->fees = $element[value];
-				}
-				if($tag == "ACCESSCONSTRAINTS"){
-					$myWfs->accessconstraints = $element[value];
-				}
+				$myWfs->getCapabilities = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:Capability/wfs:Request/wfs:GetCapabilities/wfs:DCPType/wfs:HTTP/wfs:Get/@onlineResource');
+				$myWfs->getCapabilities = $myWfs->getCapabilities[0];
+				$myWfs->describeFeatureType = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:Capability/wfs:Request/wfs:DescribeFeatureType/wfs:DCPType/wfs:HTTP/wfs:Post/@onlineResource');
+				$myWfs->describeFeatureType = $myWfs->describeFeatureType[0];
+				$myWfs->getFeature = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:Capability/wfs:Request/wfs:GetFeature/wfs:DCPType/wfs:HTTP/wfs:Post/@onlineResource');
+				$myWfs->getFeature = $myWfs->getFeature[0];
+				$myWfs->transaction = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:Capability/wfs:Request/wfs:Transaction/wfs:DCPType/wfs:HTTP/wfs:Post/@onlineResource');
+				$myWfs->transaction = $myWfs->transaction[0];
+
+				$capFeatureTypes = $wfs10Cap->xpath('/wfs:WFS_Capabilities/wfs:FeatureTypeList/wfs:FeatureType');
 				
-				# getCapabilities
-				if($tag == "GETCAPABILITIES" && $element[type] == "open"){
-					$section = "getcapabilities";
-				}
-				if($section == "getcapabilities" && $tag == "GET"){
-					$myWfs->getCapabilities = $element[attributes][onlineResource];
-				}
-				
-				# descriptFeatureType
-				if($tag == "DESCRIBEFEATURETYPE" && $element[type] == "open"){
-					$section = "describefeaturetype";
-					$myWfs->describeFeatureType = $element[attributes][onlineResource];
-					
-					
-				}
-				if($section == "describefeaturetype" && $tag == "POST"){
-					$myWfs->describeFeatureType = $element[attributes][onlineResource];
-				}
-				
-				# getFeature
-				if($tag == "GETFEATURE" && $element[type] == "open"){
-					$section = "getfeature";
-				}
+				foreach ($capFeatureTypes as $featureType) {
 
-				if($section == "getfeature" && $tag == "POST"){
-					$myWfs->getFeature = $element[attributes][onlineResource];
-				}
+					$featuretype_name = $featureType->Name[0];
+					$featuretype_title = $featureType->Title[0];
+					$featuretype_abstract = $featureType->Abstract[0];
+					$featuretype_srs = $featureType->SRS[0];
+					$LatLongBoundingBox = $featureType->LatLongBoundingBox[0];
+					//read bbox of featuretype
+					$featuretype_latlon_minx = $LatLongBoundingBox->xpath('@minx');
+					$featuretype_latlon_minx = $featuretype_latlon_minx[0];
+					$featuretype_latlon_miny = $LatLongBoundingBox->xpath('@miny');
+					$featuretype_latlon_miny = $featuretype_latlon_miny[0];
+					$featuretype_latlon_maxx = $LatLongBoundingBox->xpath('@maxx');
+					$featuretype_latlon_maxx = $featuretype_latlon_maxx[0];
+					$featuretype_latlon_maxy = $LatLongBoundingBox->xpath('@maxy');
+					$featuretype_latlon_maxy = $featuretype_latlon_maxy[0];
 
-				if($tag == "GETFEATURE" && $element[type] == "close"){
-					$section = "";
-				}			
-				# transaction
-				if($tag == "TRANSACTION" && $element[type] == "open"){
-					$section = "transaction";
-				}
-
-				if($section == "transaction" && $tag == "POST"){
-					$myWfs->transaction = $element[attributes][onlineResource];
-				}
-
-				if($tag == "TRANSACTION" && $element[type] == "close"){
-					$section = "";
-				}
-
-				if($tag == "FEATURETYPE" && $element[type] == "open"){
-					$section = "featuretype";
-				}
-
-				//part for featuretypes
-				if($section == "featuretype" && $tag == "NAME"){
-					$featuretype_name = $element[value];
-				}
-
-				if($section == "featuretype" && $tag == "TITLE"){
-					$featuretype_title = $this->stripEndlineAndCarriageReturn($element[value]);
-				}
-
-				if($section == "featuretype" && $tag == "ABSTRACT"){
-					$featuretype_abstract = $element[value];
-				}
-				if($section == "featuretype" && $tag == "SRS"){
-					$featuretype_srs = $element[value];
-				}
-				//The last element to be parsed
-				if($section == "featuretype" && $tag == "LATLONGBOUNDINGBOX"){
-					$featuretype_latlon_minx = $element[attributes][minx];
-					$featuretype_latlon_miny = $element[attributes][miny];
-					$featuretype_latlon_maxx = $element[attributes][maxx];
-					$featuretype_latlon_maxy = $element[attributes][maxy];
-				
-					// Do not add defective featuretypes
+					//do not add defective featuretypes - first request them via net
 					try {
 						$currentFeatureType = $this->createFeatureTypeFromUrl($myWfs, $featuretype_name);
-					
 						if ($currentFeatureType !== null) {
 							$currentFeatureType->name = $featuretype_name;
 							$currentFeatureType->title = $featuretype_title;
@@ -245,9 +215,9 @@
 					}
 					catch (Exception $e) {
 						new mb_exception("Failed to load featuretype " . $featuretype_name);
-					}
-				}
-			}
+					}		
+				} //end for each featuretype
+			} //end of parsing wfs capabilities
 			return $myWfs;
 		}
 		catch (Exception $e) {

Modified: trunk/mapbender/http/classes/class_wfs_1_1_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_1_factory.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/classes/class_wfs_1_1_factory.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -170,169 +170,137 @@
 			$myWfs = new Wfs_1_1();
 
 			$admin = new administration();
-			$values = $admin->parseXml($xml);
-
 			$myWfs->getCapabilitiesDoc = $admin->char_encode($xml);
 			$myWfs->id = $this->createId();
 
-			$featuretype_crsArray = array();
-	
-			foreach ($values as $element) {
-				$tag = $this->sepNameSpace(strtoupper($element[tag]));
+			$featuretype_crsArray = array();//new for wfs 1.1.0
 
-				if($tag == "WFS_CAPABILITIES" && $element[type] == "open"){
-					$myWfs->version = $element[attributes][version];
-					if ($myWfs->version !== "1.1.0") {
-						throw new Exception("Not a WFS 1.1.0 capabilities document.");
-					}
+			try {
+				$xml = str_replace('xlink:href', 'xlinkhref', $xml);
+				#http://forums.devshed.com/php-development-5/simplexml-namespace-attributes-problem-452278.html
+				#http://www.leftontheweb.com/message/A_small_SimpleXML_gotcha_with_namespaces
+
+				$wfs11Cap = new SimpleXMLElement($xml);
+
+				if ($wfs11Cap === false) {
+					foreach(libxml_get_errors() as $error) {
+        					$e = new mb_exception($error->message);
+    					}
+					throw new Exception('Cannot parse WFS 1.1.0 Capabilities!');
 				}
-				if($tag == "NAME"  && $element[level] == '3'){
-					$myWfs->name = $element[value];
-				}
-				if($tag == "TITLE"  && $element[level] == '3'){
-					$myWfs->title = $this->stripEndlineAndCarriageReturn($element[value]);
-				}
-				if($tag == "ABSTRACT" && $element[level] == '3'){
-					$myWfs->summary = $this->stripEndlineAndCarriageReturn($element[value]);
-				}
-				if($tag == "FEES"){
-					$myWfs->fees = $element[value];
-				}
-				if($tag == "ACCESSCONSTRAINTS"){
-					$myWfs->accessconstraints = $element[value];
-				}
-				if($tag == "INDIVIDUALNAME"){
-					$myWfs->individualName = $element[value];
-				}
-				if($tag == "POSITIONNAME"){
-					$myWfs->positionName = $element[value];
-				}
-				if($tag == "PROVIDERNAME"){
-					$myWfs->providerName = $element[value];
-				}
-				if($tag == "CITY"){
-					$myWfs->city = $element[value];
-				}
-				if($tag == "DELIVERYPOINT"){
-					$myWfs->deliveryPoint = $element[value];
-				}
-				if($tag == "ADMINISTRATIVEAREA"){
-					$myWfs->administrativeArea = $element[value];
-				}
-				if($tag == "POSTALCODE"){
-					$myWfs->postalCode = $element[value];
-				}
-				if($tag == "VOICE"){
-					$myWfs->voice = $element[value];
-				}
-				if($tag == "FACSIMILE"){
-					$myWfs->facsimile = $element[value];
-				}
-				if($tag == "ELECTRONICMAILADDRESS"){
-					$myWfs->electronicMailAddress = $element[value];
-				}
-				if($tag == "COUNTRY"){
-					$myWfs->country = $element[value];
-				}
-				if($tag == "OPERATION" && $element[type] == "open"){
-					switch ($element[attributes][name]) {
-						case "GetCapabilities" :
-							$section = "getcapabilities";
-							break;
-						case "DescribeFeatureType" :
-							$section = "describefeaturetype";
-							break;
-						case "GetFeature" :
-							$section = "getfeature";
-							break;
-						case "Transaction" :
-							$section = "transaction";
-							break;
-					}
-				}
+			}
+			catch (Exception $e) {
+    				$e = new mb_exception($e->getMessage());
+			}	
+
+			if ($wfs11Cap != false) {
+				//read all relevant information an put them into the mapbender wfs object
+				//xmlns="http://www.opengis.net/wfs"
+				//Setup default namespace
+
+				$wfs11Cap->registerXPathNamespace("wfs", "http://www.opengis.net/wfs");
+				$wfs11Cap->registerXPathNamespace("ows", "http://www.opengis.net/ows");
+				$wfs11Cap->registerXPathNamespace("xmlns", "http://www.opengis.net/gml");
+				$wfs11Cap->registerXPathNamespace("ogc", "http://www.opengis.net/ogc");
+				$wfs11Cap->registerXPathNamespace("xlink", "http://www.w3.org/1999/xlink");
+				$wfs11Cap->registerXPathNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance");
+				//some debug
+				//$e = new mb_notice("XML string from memory: ".$wfs11Cap->asXML());
+				$myWfs->version = $wfs11Cap->xpath('/wfs:WFS_Capabilities/@version');
+				$myWfs->version = $myWfs->version[0];
+				//identification part
+				$myWfs->name = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceIdentification/ows:Name');
+				$myWfs->name = $myWfs->name[0];
+				$myWfs->title = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceIdentifcation/ows:Title');
+				$myWfs->title = $this->stripEndlineAndCarriageReturn($myWfs->title[0]);
+				$myWfs->summary = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceIdentification/ows:Abstract');
+				$myWfs->summary = $this->stripEndlineAndCarriageReturn($myWfs->summary[0]);
+				$myWfs->fees = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceIdentification/ows:Fees');
+				$myWfs->fees = $myWfs->fees[0];
+				$myWfs->accessconstraints = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceIdentification/ows:AccessConstraints');
+				$myWfs->accessconstraints = $myWfs->accessconstraints[0];
+				//provider part
+				$myWfs->individualName = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:IndividualName');
+				$myWfs->individualName = $myWfs->individualName[0];
 				
-				# getCapabilities
-				if($section == "getcapabilities" && $tag == "GET"){
-					$myWfs->getCapabilities = html_entity_decode($element[attributes]["xlink:href"]);
-				}
+				$myWfs->positionName = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:PositionName');
+				$myWfs->positionName = $myWfs->positionName[0];
 
-				# descriptFeatureType
-#				if($section == "describefeaturetype" && $tag == "POST"){
-#					$myWfs->describeFeatureType = html_entity_decode($element[attributes]["xlink:href"]);
-#				}
+				$myWfs->providerName = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ProviderName');
+				$myWfs->providerName = $myWfs->providerName[0];
+				
+				$myWfs->city = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ContactInfo/ows:Address/ows:City');
+				$myWfs->city =$myWfs->city[0];
 
-				# descriptFeatureType
-				if($section == "describefeaturetype" && $tag == "GET"){
-					$myWfs->describeFeatureType = html_entity_decode($element[attributes]["xlink:href"]);
-				}
+				$myWfs->deliveryPoint = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ContactInfo/ows:Address/ows:DeliveryPoint');
+				$myWfs->deliveryPoint =$myWfs->deliveryPoint[0];
 
-				# getFeature
-				if($section == "getfeature" && $tag == "POST"){
-					$myWfs->getFeature = html_entity_decode($element[attributes]["xlink:href"]);
-				}
+				$myWfs->administrativeArea = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ContactInfo/ows:Address/ows:AdministrativeArea');
+				$myWfs->administrativeArea =$myWfs->administrativeArea[0];
 
-				# transaction
-				if($section == "transaction" && $tag == "POST"){
-					$myWfs->transaction = html_entity_decode($element[attributes]["xlink:href"]);
-				}
+				$myWfs->postalCode = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ContactInfo/ows:Address/ows:PostalCode');
+				$myWfs->postalCode =$myWfs->postalCode[0];
 
-				if($tag == "OPERATION" && $element[type] == "close"){
-					$section = "";
-				}
+				$myWfs->country = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ContactInfo/ows:Address/ows:Country');
+				$myWfs->country =$myWfs->country[0];
 
-				if($tag == "FEATURETYPE" && $element[type] == "open"){
-					$section = "featuretype";
-					$featureTypeNsArray = $element[attributes];
-				}
+				$myWfs->voice = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ContactInfo/ows:Phone/ows:Voice');
+				$myWfs->voice =$myWfs->voice[0];
 
-				if($section == "featuretype" && $tag == "NAME"){
-					$featuretype_name = $element[value];
-				}
+				$myWfs->facsimile = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ContactInfo/ows:Phone/ows:Facsimile');
+				$myWfs->facsimile =$myWfs->facsimile[0];
 
-				if($section == "featuretype" && $tag == "TITLE"){
-					$featuretype_title = $this->stripEndlineAndCarriageReturn($element[value]);
-				}
+				$myWfs->electronicMailAddress = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:ServiceProvider/ows:ServiceContact/ows:ContactInfo/ows:Address/ows:ElectronicMailAddress');
+				$myWfs->electronicMailAddress =$myWfs->electronicMailAddress[0];
 
-				if($section == "featuretype" && $tag == "ABSTRACT"){
-					$featuretype_abstract = $element[value];
-				}
 
-				//<DefaultSRS>urn:ogc:def:crs:EPSG::4326</DefaultSRS><OtherSRS>urn:ogc:def:crs:EPSG::4269</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::3978</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::3857</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::31466</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::25832</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::4258</OtherSRS>
-				if($section == "featuretype" && $tag == "DEFAULTSRS"){
-					$featuretype_srs = $element[value];
-				}
+				//Operation Metadata Part
 
-				if($section == "featuretype" && $tag == "OTHERSRS"){
-					$featuretype_crsArray[] = $element[value];
-				}
+				$myWfs->getCapabilities = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Operation[@name="GetCapabilities"]/ows:DCP/ows:HTTP/ows:Get/@xlinkhref');
+				$myWfs->getCapabilities = html_entity_decode($myWfs->getCapabilities[0]);
+				$e = new mb_exception($myWfs->getCapabilities);#get
 				
+				$myWfs->describeFeatureType = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Operation[@name="DescribeFeatureType"]/ows:DCP/ows:HTTP/ows:Get/@xlinkhref');
+				$myWfs->describeFeatureType = html_entity_decode($myWfs->describeFeatureType[0]);#get
+				
+				$myWfs->getFeature = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Operation[@name="GetFeature"]/ows:DCP/ows:HTTP/ows:Post/@xlinkhref');
+				$myWfs->getFeature = html_entity_decode($myWfs->getFeature[0]);#post
+				
+				$myWfs->transaction = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Operation[@name="Transaction"]/ows:DCP/ows:HTTP/ows:Post/@xlinkhref');
+				$myWfs->transaction = html_entity_decode($myWfs->transaction[0]);#post
 
-				//<ows:WGS84BoundingBox dimensions="2"><ows:LowerCorner>-9.16611817848171e+15 -3.4016616708962e+32</ows:LowerCorner><ows:UpperCorner>464605646503609 3.4016616708962e+32</ows:UpperCorner></ows:WGS84BoundingBox>
 
-				if($tag == "WGS84BOUNDINGBOX" && $element[type] == "open"){
-					$section = "bbox";
-				}
+				//get list of featuretypes
+				
+				$capFeatureTypes = $wfs11Cap->xpath('/wfs:WFS_Capabilities/wfs:FeatureTypeList/wfs:FeatureType');
+				$i = 1; //cause index of xml objects begin with 1
+				foreach ($capFeatureTypes as $featureType) {
 
-				if($section == "bbox" && $tag == "LOWERCORNER"){
-					$lowerCorner = explode(" ",$element[value]);
+					$featuretype_name = $featureType->Name[0];
+					$featuretype_title = $featureType->Title[0];
+					$featuretype_abstract = $featureType->Abstract[0];
+					//<DefaultSRS>urn:ogc:def:crs:EPSG::4326</DefaultSRS><OtherSRS>urn:ogc:def:crs:EPSG::4269</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::3978</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::3857</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::31466</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::25832</OtherSRS><OtherSRS>urn:ogc:def:crs:EPSG::4258</OtherSRS>
+					$featuretype_srs = $featureType->DefaultSRS[0];
+					$otherSRSArray = $featureType->OtherSRS;
+					foreach ($otherSRSArray as $otherSRS) {
+						//$e = new mb_exception("other srs: ".$otherSRS);
+						$featuretype_crsArray[] = $otherSRS;
+						
+					}
+					//<ows:WGS84BoundingBox dimensions="2"><ows:LowerCorner>-9.16611817848171e+15 -3.4016616708962e+32</ows:LowerCorner><ows:UpperCorner>464605646503609 3.4016616708962e+32</ows:UpperCorner></ows:WGS84BoundingBox>
+					$lowerCorner = $wfs11Cap->xpath('/wfs:WFS_Capabilities/wfs:FeatureTypeList/wfs:FeatureType['.$i.']/ows:WGS84BoundingBox/ows:LowerCorner');
+					$lowerCorner = $lowerCorner[0];
+					$lowerCorner = explode(" ",$lowerCorner);
+
+					$upperCorner = $wfs11Cap->xpath('/wfs:WFS_Capabilities/wfs:FeatureTypeList/wfs:FeatureType['.$i.']/ows:WGS84BoundingBox/ows:UpperCorner');
+					$upperCorner = $upperCorner[0];	
+					$upperCorner = explode(" ",$upperCorner);
+					
 					$featuretype_latlon_minx = $lowerCorner[0];
 					$featuretype_latlon_miny = $lowerCorner[1];
-				}
-				//The last element which has to be parsed
-				if($section == "bbox" && $tag == "UPPERCORNER"){
-					$upperCorner = explode(" ",$element[value]);
 					$featuretype_latlon_maxx = $upperCorner[0];
 					$featuretype_latlon_maxy = $upperCorner[1];
-				
 
-				
-				
-					$e = new mb_notice("class_wfs_1_1_factory.php: parse featuretype ".$featuretype_name);
-
-					foreach ( $featureTypeNsArray as $currentNamespace) {
-						$e = new mb_notice("class_wfs_1_1_factory.php: namespace: ".$currentNamespace);
-					}
-					// Do not add defective featuretypes
 					try {
 						$currentFeatureType = $this->createFeatureTypeFromUrlGet($myWfs, $featuretype_name, $featureTypeNsArray);
 						if ($currentFeatureType !== null) {
@@ -351,6 +319,8 @@
 					catch (Exception $e) {
 						$e = new mb_exception("Failed to load featuretype " . $featuretype_name);
 					}
+					$i++;
+
 				}
 			}
 			

Modified: trunk/mapbender/http/classes/class_wfs_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_factory.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/classes/class_wfs_factory.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -126,6 +126,7 @@
 				$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->inspire_download = db_result($res_fe, $cnt_fe, "inspire_download");
 				$ft->srs = db_result($res_fe, $cnt_fe, "featuretype_srs");
 				$latLonBbox = db_result($res_fe, $cnt_fe, "featuretype_latlon_bbox");
 				$e = new mb_notice("class_wfs_factory: FT latlonbbox: ".$latLonBbox);

Modified: trunk/mapbender/http/classes/class_wfs_featuretype.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_featuretype.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/classes/class_wfs_featuretype.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -28,9 +28,11 @@
 	var $title;
 	var $summary;
 	var $searchable;
+	var $inspire_download;
 	var $srs; // Tag DefaultSRS in wfs 1.1.0+
 	var $latLonBboxArray = array();
 	var $crsArray = array(); //new for wfs 1.1.0+ (tag OtherSRS)
+	var $metadataUrlArray = array();
 	var $wfs;
 	var $namespaceArray = array();
 	var $elementArray = array();
@@ -82,6 +84,12 @@
 		return $this;
 	}
 
+	public function addMetadataUrl ($metadataUrl) {
+		array_push($this->metadataUrlArray, $metadataUrl);
+		return $this;
+	}
+	
+
 	public function addElement ($name, $type) {
 		$newElement = new stdClass();
 

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/classes/class_wms.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -269,34 +269,7 @@
 							$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 the reference to the layer which will be updated
 					return $this->objLayer[$i];
 				}
 				else {
@@ -1721,9 +1694,9 @@
 INSERT INTO layer 
 (fkey_wms_id, layer_pos, layer_parent, layer_name, layer_title, 
 layer_queryable, layer_minscale, layer_maxscale, layer_dataurl,
-layer_metadataurl, layer_searchable, layer_abstract, uuid) 
+layer_metadataurl, layer_searchable, layer_abstract, uuid, inspire_download) 
 VALUES
-($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13)
+($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14)
 
 SQL;
 		if($this->objLayer[$i]->layer_id != null){
@@ -1741,8 +1714,9 @@
 				$this->objLayer[$i]->layer_maxscale,$this->objLayer[$i]->layer_dataurl[0]->href,
 				$this->objLayer[$i]->layer_metadataurl[0]->href, $this->objLayer[$i]->layer_searchable,
 				$this->objLayer[$i]->layer_abstract,
-				$uuid);
-		$t = array('i','i','s','s','s','i','i','i','s','s','i','s','s');
+				$uuid,
+				$this->objLayer[$i]->inspire_download);
+		$t = array('i','i','s','s','s','i','i','i','s','s','i','s','s','i');
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
 			db_rollback();	
@@ -1825,7 +1799,8 @@
 		$sql .= "layer_dataurl = $7, ";
 		$sql .= "layer_metadataurl = $8, ";
 		$sql .= "layer_searchable = $9, ";
-		$sql .= "layer_abstract = $10 ";
+		$sql .= "layer_abstract = $10, ";
+		$sql .= "inspire_download = $12 ";
 		$sql .= "WHERE layer_id = $11";
 		
 		if($this->objLayer[$i]->layer_id != null){
@@ -1842,9 +1817,10 @@
 				$this->objLayer[$i]->layer_queryable,$this->objLayer[$i]->layer_minscale,
 				$this->objLayer[$i]->layer_maxscale,$this->objLayer[$i]->layer_dataurl[0]->href,
 				$this->objLayer[$i]->layer_metadataurl[0]->href, $this->objLayer[$i]->layer_searchable,
-				$this->objLayer[$i]->layer_abstract, $l_id		
+				$this->objLayer[$i]->layer_abstract, $l_id, 
+				$this->objLayer[$i]->inspire_download
 			);
-		$t = array('i','s','s','i','i','i','s','s','i', 's','i');
+		$t = array('i','s','s','i','i','i','s','s','i', 's','i', '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);
@@ -2408,10 +2384,14 @@
 				//$e = new mb_exception($output);
 				$metaData = $output;
 				//parse metadata
+				libxml_use_internal_errors(true);
 				try {
-					//$iso19139Xml = simplexml_load_string($metaData);
-					$iso19139Xml =  new SimpleXMLElement($metaData);
-					if ($iso19139Xml == false) {
+					$iso19139Xml = simplexml_load_string($metaData);
+					//$iso19139Xml =  new SimpleXMLElement($metaData);
+					if ($iso19139Xml === false) {
+						foreach(libxml_get_errors() as $error) {
+        						$e = new mb_exception($error->message);
+    						}
 						throw new Exception('Cannot parse Metadata XML!');
 					}
 				}
@@ -2518,6 +2498,36 @@
 						$t = array('i');
 						$res = db_prep_query($sql,$v,$t);
 					}		
+				} else {
+				//paring was not ok - fill only the urls into database and give a reasonable error message
+					$sql = "INSERT INTO mb_metadata (link, origin, md_format, linktype) ";
+					$sql .= "VALUES($1, 'capabilities', $2, $3)";
+					$v = array($this->objLayer[$i]->layer_metadataurl[$j]->href,
+						$this->objLayer[$i]->layer_metadataurl[$j]->format,
+						$this->objLayer[$i]->layer_metadataurl[$j]->type		
+					);
+					$t = array('s','s','s');
+					$res = db_prep_query($sql,$v,$t);
+					if(!$res){
+						db_rollback();	
+					}
+					//get last inserted serial_id
+					$mdId = db_insert_id($con, 'mb_metadata','metadata_id');
+					//insert into ows_relation_metadata (fkey_layer_id, fkey_metadata_id) values (20131,3);
+					$sql = "INSERT INTO ows_relation_metadata (fkey_layer_id, fkey_metadata_id) values ($1, $2);";
+					$v = array($this->objLayer[$i]->db_id, $mdId);
+					$t = array('i','i');
+					$res = db_prep_query($sql,$v,$t);
+					if(!$res){
+						db_rollback();	
+					} else {
+						//set harvest result to 0 cause this metadata had problems while parsing
+						$sql = "UPDATE mb_metadata SET harvestresult = 0, harvestexception = 'Problem occured while parsing ISO19139 metadata!' where metadata_id = $1";
+						$v = array($mdId);
+						$t = array('i');
+						$res = db_prep_query($sql,$v,$t);
+					}
+				
 				}
 			} else {//no readable format given - only store the links!
 				//don't push single elements into database
@@ -3162,6 +3172,7 @@
 				//old one:
 				//$this->objLayer[$layer_cnt]->layer_metadataurl[0]->href = $row2["layer_metadataurl"];
 				$this->objLayer[$layer_cnt]->layer_searchable =$row2["layer_searchable"];
+				$this->objLayer[$layer_cnt]->inspire_download =$row2["inspire_download"];
 				$this->objLayer[$layer_cnt]->layer_pos =$row2["layer_pos"];						
 				$this->objLayer[$layer_cnt]->layer_queryable =$row2["layer_pos"];
 				$this->objLayer[$layer_cnt]->layer_queryable =$row2["layer_queryable"];
@@ -3372,6 +3383,7 @@
 			//old one:
 			//$this->objLayer[$layer_cnt]->layer_metadataurl[0]->href = $row2["layer_metadataurl"];
 			$this->objLayer[$layer_cnt]->layer_searchable =$row2["layer_searchable"];
+			$this->objLayer[$layer_cnt]->inspire_download =$row2["inspire_download"];
 			$this->objLayer[$layer_cnt]->layer_pos =$row2["layer_pos"];						
 			$this->objLayer[$layer_cnt]->layer_queryable =$row2["layer_queryable"];
 			$this->objLayer[$layer_cnt]->layer_minscale =$row2["layer_minscale"];
@@ -3611,6 +3623,7 @@
     	var $layer_dataurl_href;
     	var $layer_metadataurl;
 	var $layer_searchable;
+	var $inspire_download;
     	var $layer_keyword = array();
 	var $layer_epsg = array();
 	var $layer_style = array();

Modified: trunk/mapbender/http/geoportal/gaz_geom.php
===================================================================
--- trunk/mapbender/http/geoportal/gaz_geom.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/geoportal/gaz_geom.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -154,8 +154,8 @@
 	}
 	// workflow
 	if(count($both) == 2){
-		$a = strtoupper(trim($both[0]))."%";
-		$b = strtoupper(trim($both[1]))."%";
+		$a = "%".strtoupper(trim($both[0]))."%";
+		$b = "%".strtoupper(trim($both[1]))."%";
 		$v = array($a, $a);
 		$t = array('s', 's');
 		$sql = "SELECT DISTINCT * FROM (SELECT DISTINCT gem_schl_neu,gemeinde_neu AS gem FROM gemeinden ";
@@ -239,7 +239,7 @@
 		$str_schl_gem = array();
 		$ckeys = array();
 		$cnames = array();
-		$a = strtoupper(trim($o))."%";
+		$a = "%".strtoupper(trim($o))."%";
 		$v = array($a, $a);
 		$t = array('s', 's');
 		$sql = "SELECT DISTINCT * FROM (SELECT DISTINCT gem_schl_neu, gemeinde_neu AS gem FROM gemeinden ";
@@ -255,7 +255,7 @@
 		if(count($ckeys)>0){
 			for($i=0; $i<count($ckeys); $i++){	
 				
-				$v = array($ckeys[$i], strtoupper(trim($s)). "%");
+				$v = array($ckeys[$i], "%".strtoupper(trim($s)). "%");
 				$t = array('i', 's');
 				$sql = "SELECT DISTINCT strassenschluessel ";
 				$sql .= "FROM strassenschluessel WHERE gem_schl = $1 ";
@@ -264,6 +264,7 @@
 			
 
 				$res = db_prep_query($sql,$v,$t);
+
 				while($row = db_fetch_array($res)){
 					array_push($str_schl, $row['strassenschluessel']);
 					array_push($str_schl_gem, $cnames[$i]);
@@ -649,7 +650,7 @@
 }
 function getCKeysByName($city){
 	global $ckeys;
-	$city = strtoupper(trim($city))."%";
+	$city = "%".strtoupper(trim($city))."%";
 	$sql = "SELECT gem_schl_neu FROM wohnplatz ";
 	$sql .= "WHERE gemeinde_gem_teile_upper ILIKE $1 ";
 	$v = array($city);

Modified: trunk/mapbender/http/geoportal/gaz_geom_mobile.php
===================================================================
--- trunk/mapbender/http/geoportal/gaz_geom_mobile.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/geoportal/gaz_geom_mobile.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -234,10 +234,10 @@
 	}
 	// workflow
 	if(count($both) == 2){
-		//$a = "%".strtoupper(trim($both[0]))."%";
-		//$b = "%".strtoupper(trim($both[1]))."%";
-		$a = strtoupper(trim($both[0]))."%";
-		$b = strtoupper(trim($both[1]))."%";
+		$a = "%".strtoupper(trim($both[0]))."%";
+		$b = "%".strtoupper(trim($both[1]))."%";
+		//$a = strtoupper(trim($both[0]))."%";
+		//$b = strtoupper(trim($both[1]))."%";
 
 
 		$v = array($a, $a);
@@ -345,8 +345,8 @@
 		if(count($ckeys)>0){
 			for($i=0; $i<count($ckeys); $i++){	
 				
-				//$v = array($ckeys[$i], "%". strtoupper(trim($s)). "%");
-				$v = array($ckeys[$i], strtoupper(trim($s)). "%");
+				$v = array($ckeys[$i], "%". strtoupper(trim($s)). "%");
+				//$v = array($ckeys[$i], strtoupper(trim($s)). "%");
 				$t = array('i', 's');
 				$sql = "SELECT DISTINCT strassenschluessel ";
 				$sql .= "FROM strassenschluessel WHERE gem_schl = $1 ";
@@ -414,8 +414,8 @@
 		$sql .= "(ymax(the_geom) + ".$bufferSH.") as maxy ";
 		$sql .= "FROM hauskoordinaten ";
 		$sql .= "WHERE name ILIKE $1 AND hausnummer = $2 ";
-		//$v = array("%".$s."%",$h);
-		$v = array($s."%",$h);
+		$v = array("%".$s."%",$h);
+		//$v = array($s."%",$h);
 		$t = array('s','i');
 		if($z){
 			$sql .= "AND zusatz = $" . (count($v)+1);

Modified: trunk/mapbender/http/php/mod_inspireWmsDownloadFeed.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireWmsDownloadFeed.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/php/mod_inspireWmsDownloadFeed.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -2,8 +2,8 @@
 //http://www.geoportal.rlp.de/mapbender/php/mod_inspireWmsDownloadFeed.php?ID=20578&type=SERVICE
 //http://www.geoportal.rlp.de/mapbender/php/mod_inspireWmsDownloadFeed.php?ID=20578&type=DATASET
 //http://localhost/mapbender/php/mod_inspireWmsDownloadFeed.php?ID=20578&type=DATASET
-//http://www.geoportal.rlp.de/mapbender/php/mod_inspireWmsDownloadFeed.php?ID=20578&type=SERVICE
-
+//http://localhost/mapbender/php/mod_inspireWmsDownloadFeed.php?ID=20648&type=SERVICE
+//20648
 // $Id: mod_inspireWmsDownloadFeed.php 235
 // http://www.mapbender.org/index.php/
 // Copyright (C) 2002 CCGIS 
@@ -22,7 +22,7 @@
 // along with this program; if not, write to the Free Software
 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
-//Script to generate a feed for a predefined dataset download as it is demanded in the INSPIRE Download Service guidance 3.0 from 04.05.2012. It will be generated from given wms layers dataurl attributs which are registrated in the mapbender database. It works as a webservice. The requested id is the mapbender layers serial id. 
+//Script to generate a feed for a predefined dataset download as it is demanded in the INSPIRE Download Service guidance 3.0 from 04.05.2012. It will be generated from given wms layers dataurl attributs which are registrated in the mapbender database. The other possibility is, that the wms are used to built the download links. Therefore the wms must support the generation of image/tiff output format with geotiff tags. Many wms do this. These wms must also support a minimum of 1000x1000 pixel for a single getmap request. It works as a webservice. The requested id is the mapbender layers serial id. 
 
 require_once(dirname(__FILE__) . "/../../core/globalSettings.php");
 require_once(dirname(__FILE__) . "/../classes/class_connector.php");
@@ -33,9 +33,9 @@
 
 $admin = new administration();
 
-$imageResolution = 150;
+$imageResolution = 100;
 
-$maxImageSize = 100;
+$maxImageSize = 1000;
 
 //pull the needed things from tables datalink, md_metadata, layer, wms
  
@@ -148,21 +148,33 @@
 // - updated - timestamp of wms as done before
 // - 
 
-function generateFeed($feedDoc, $recordId) {
+function generateFeed($feedDoc, $recordId, $generateFromDataurl = false) {
 	global $admin, $type, $imageResolution, $maxImageSize;
-	$sql = <<<SQL
+	
 
+	if ($generateFromDataurl) {
+
+		$sql = <<<SQL
+
 select * from (select * from (select * from (select * from (select mb_metadata.metadata_id, layer_relation.layer_name, layer_relation.fkey_wms_id, layer_relation.layer_id, mb_metadata.uuid as metadata_uuid, mb_metadata.format,mb_metadata.title as metadata_title, mb_metadata.abstract as metadata_abstract, layer_relation.layer_title, layer_relation.layer_abstract, mb_metadata.ref_system as metadata_ref_system, mb_metadata.datasetid, mb_metadata.spatial_res_type, mb_metadata.spatial_res_value  from (select * from layer inner join ows_relation_metadata on layer.layer_id = ows_relation_metadata.fkey_layer_id where layer.layer_id = $1) as layer_relation inner join mb_metadata on layer_relation.fkey_metadata_id = mb_metadata.metadata_id) as layer_metadata inner join ows_relation_data on ows_relation_data.fkey_layer_id = layer_metadata.layer_id) as layer_relation_data inner join datalink on layer_relation_data.fkey_datalink_id = datalink.datalink_id) as layer_data inner join wms on 
 layer_data.fkey_wms_id = wms.wms_id)  as layer_wms, layer_epsg where layer_wms.layer_id = layer_epsg.fkey_layer_id and layer_epsg.epsg = 'EPSG:4326';  
 
 SQL;
+	} else { //dataurl is not given, therefor don't ask for such an entry ;-)
+	
+		$sql = <<<SQL
 
+select * from (select * from (select mb_metadata.metadata_id, layer_relation.layer_name, layer_relation.fkey_wms_id, layer_relation.layer_id, mb_metadata.uuid as metadata_uuid, mb_metadata.format,mb_metadata.title as metadata_title, mb_metadata.abstract as metadata_abstract, layer_relation.layer_title, layer_relation.layer_abstract, mb_metadata.ref_system as metadata_ref_system, mb_metadata.datasetid, mb_metadata.spatial_res_type, mb_metadata.spatial_res_value  from (select * from layer inner join ows_relation_metadata on layer.layer_id = ows_relation_metadata.fkey_layer_id where layer.layer_id = $1) as layer_relation inner join mb_metadata on layer_relation.fkey_metadata_id = mb_metadata.metadata_id) layer_data inner join wms on layer_data.fkey_wms_id = wms.wms_id)  as layer_wms, layer_epsg where layer_wms.layer_id = layer_epsg.fkey_layer_id and layer_epsg.epsg = 'EPSG:4326';  
+
+SQL;
+
+	}
+
 	$v = array((integer)$recordId);
 	$t = array('i');
 	$res = db_prep_query($sql,$v,$t);
 	$mapbenderMetadata = db_fetch_array($res);
 
-	$generateFromDataurl = true;
-
+	
 	if ($generateFromDataurl) {
 		//check if layer_id datalink_id and metadata_id are given and not empty!
 		if (!isset($mapbenderMetadata['datalink_id']) || $mapbenderMetadata['datalink_id'] == '') {
@@ -226,7 +238,7 @@
 	
 	$feed =  $feedDoc->createElementNS('http://www.w3.org/2005/Atom', 'feed');
 	$feed = $feedDoc->appendChild($feed);
-	$feed->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
+	//$feed->setAttribute("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
 	$feed->setAttribute("xmlns:georss", "http://www.georss.org/georss");
 	//echo "<test>".$mapbenderMetadata['fkey_wms_id'].":".$mapbenderMetadata['wms_owner']."</test>";
 	//qualifying id of the referenced ressource: Either dataset id or the id of the metadata record 
@@ -267,7 +279,7 @@
 	//<title>XYZ Example INSPIRE Download Service</title>
 	//<title>XYZ Example INSPIRE Dataset ABC Download</title>
 	$feedTitle = $feedDoc->createElement("title");
-	$feedTitle->setAttribute("xml:lang", "de");
+	//$feedTitle->setAttribute("xml:lang", "de");
 	//echo "<error>".$type."</error>";
 	//return;
 	if ($type == 'SERVICE') {
@@ -282,7 +294,7 @@
 	//<subtitle xml:lang="en">INSPIRE Download Service of organisation XYZ providing a data set for the Hydrography theme</subtitle>
 	//<subtitle>INSPIRE Download Service, of organisation XYZ providing dataset ABC for the Hydrography theme</subtitle>
 	$feedSubTitle = $feedDoc->createElement("subtitle");
-	$feedSubTitle->setAttribute("xml:lang", "de");
+	//$feedSubTitle->setAttribute("xml:lang", "de");
 	if ($type == 'SERVICE') {
 		$feedSubTitleText = $feedDoc->createTextNode("INSPIRE Download Service von ".$departmentMetadata['mb_group_title']."");
 	} else { //DATASET
@@ -305,6 +317,8 @@
 	}
 	$feedLink->setAttribute("rel", "describedby");
 	$feedLink->setAttribute("rel", "application/xml");
+	$feedLink->setAttribute("title", "Metadaten");
+	$feedLink->setAttribute("hreflang", "de");
 	$feed->appendChild($feedLink);
 
 	//self reference - 5.1.4 / 5.2
@@ -340,6 +354,7 @@
 		$feedLink->setAttribute("rel", "describedby");
 		$feedLink->setAttribute("type", "text/html");
 		$feedLink->setAttribute("hreflang", "de");
+		$feedLink->setAttribute("title", "Beschreibung des Datensatzes");
 		$feed->appendChild($feedLink);
 	}
 	//5.1.6 - 5.1.7
@@ -353,7 +368,7 @@
 	//<id>http://xyz.org/data</id> - also self reference - see 5.1.8 on page 39 of INSPIRE GD for Download Services V 3.0
 	// and 5.2.1
 	$feedId = $feedDoc->createElement("id");
-	$feedIdText = $feedDoc->createTextNode($selfReference);
+	$feedIdText = $feedDoc->createTextNode($ressourceId);
 	$feedId->appendChild($feedIdText);
 	$feed->appendChild($feedId);
 
@@ -423,7 +438,7 @@
 				$diffX = $maxx - $minx; //in m
 				$diffY = $maxy - $miny;	//in m
 				//echo $diffX .":". $diffY;
-
+				//calculate target number of pixels for x and y
 				switch ($mapbenderMetadata['spatial_res_type']) {
 					case "scaleDenominator":
 						//transform to pixel
@@ -438,17 +453,28 @@
 					break;
 				}
 				//echo $diffXPx.":".$diffYPx;
-				$nRows = ceil($diffXPx / floatval($maxImageSize));
-				$nCols = ceil($diffYPx / floatval($maxImageSize));
+				
+				$nRows = ceil($diffYPx / floatval($maxImageSize));
+				$nCols = ceil($diffXPx / floatval($maxImageSize));
 				//echo $nRows.":".$nCols;
 				$bboxWms = array();
-				
+				/*echo $diffXPx.":".$diffYPx.",";
+				echo $nRows.":".$nCols.",";
+				echo $minx.":".$miny.",";
+				echo $maxx.":".$maxy.",";*/
+				$incX = $diffX / ($diffXPx / floatval($maxImageSize));
+				$incY = $diffY / ($diffYPx / floatval($maxImageSize));
 				for ($j = 0; $j < $nRows; $j++) {
 					for ($k = 0; $k < $nCols; $k++) {
-						$minxWms = $minx + $k * $maxImageSize;
-						$minyWms = $miny + $j * $maxImageSize;
-						$maxxWms = $minx + ($k+1) * $maxImageSize;
-						$maxyWms = $miny + ($j+1) * $maxImageSize;
+						//echo "j: ".$k.",k: ".$j;
+						$minxWms = $minx + $k * $incX;
+						//echo "minxWms: ". $minxWms .",";
+						$minyWms = $miny + $j * $incY;
+						//echo "minyWms: ". $minyWms .",";
+						$maxxWms = $minx + ($k+1) * $incX;
+						//echo "maxxWms: ". $maxxWms .",";
+						$maxyWms = $miny + ($j+1) * $incY;
+						//echo "maxyWms: ". $maxyWms .",";
 						$bboxWms[] = $minxWms.",".$minyWms.",".$maxxWms.",".$maxyWms;
 					}
 				}
@@ -461,13 +487,14 @@
 
 	for ($i = 0; $i < $numberOfEntries; $i++) {
 		//<entry> 5.1.12 / 5.2.3
+	
 		$feedEntry = $feedDoc->createElement("entry");
 	
 		//<!-- title for pre-defined dataset -->
 		//<title xml:lang="en">Water network ABC</title>
 		//<title>Water network in CRS EPSG:4258 (GML)</title>
 		$feedEntryTitle = $feedDoc->createElement("title");
-		$feedEntryTitle->setAttribute("xml:lang", "de");
+		//$feedEntryTitle->setAttribute("xml:lang", "de");
 		if ($type == 'SERVICE') {
 			$feedEntryTitle->appendChild($feedDoc->createTextNode("Feed Entry für: ".$ressourceTitle)); //TODO: maybe add some category?
 		} else {
@@ -496,6 +523,11 @@
 				$furtherLinkTitle = $ressourceTitle." im CRS ".$mapbenderMetadata['metadata_ref_system']."(".$mapbenderMetadata['format'].")";
 			} else {
 				$furtherLink = $datasetLink; // dynamic generated links
+				//example:
+				//http://localhost/cgi-bin/mapserv?map=/data/umn/geoportal/karte_rp/testinspiredownload.map&VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=inspirewms&STYLES=&SRS=EPSG:4326&BBOX=6.92134,50.130465,6.93241,50.141535000000005&WIDTH=200&HEIGHT=200&FORMAT=image/png&BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage
+				$furtherLink = $mapbenderMetadata['wms_getmap']."REQUEST=GetMap&VERSION=".$mapbenderMetadata['wms_version']."&SERVICE=WMS&LAYERS=".$mapbenderMetadata['layer_name'];
+				$furtherLink .= "&STYLES=&SRS=".$crs."&BBOX=".$bboxWms[$i]."&WIDTH=".$maxImageSize."&HEIGHT=".$maxImageSize."&FORMAT=image/tiff&";
+				$furtherLink .= "BGCOLOR=0xffffff&TRANSPARENT=TRUE&EXCEPTIONS=application/vnd.ogc.se_inimage";
 				$furtherLinkType = $mapbenderMetadata['datalink_format']; //formats from layer_format - geotiff
 				$furtherLinkTitle = $ressourceTitle." im CRS ".$mapbenderMetadata['metadata_ref_system']."(".$mapbenderMetadata['format'].")";
 			}
@@ -514,7 +546,7 @@
 		//<!-- identifier for pre-defined dataset -->
 		//<id>http://xyz.org/data/waternetwork.gml/id>
 		$feedEntryId = $feedDoc->createElement("id");
-		$feedEntryId->appendChild($feedDoc->createTextNode($furtherLink));
+		$feedEntryId->appendChild($feedDoc->createTextNode($ressourceId."_tile_".$i));
 		$feedEntry->appendChild($feedEntryId);
 
 		//5.1.15 / 
@@ -546,7 +578,12 @@
 			//$georssPolygon = $mapbenderMetadata["minx"]." ".$mapbenderMetadata["miny"]." ".$mapbenderMetadata["maxx"]." ".$mapbenderMetadata["miny"]." ";
 			//$georssPolygon .= $mapbenderMetadata["maxx"]." ".$mapbenderMetadata["maxy"]." ".$mapbenderMetadata["minx"]." ".$mapbenderMetadata["maxy"]." ";
 			//$georssPolygon .= $mapbenderMetadata["minx"]." ".$mapbenderMetadata["miny"];
-			$georssPolygon = $bboxWms[$i];
+			//TODO: Transform them to epsg:4326 to be conform to georss polygon
+			$corners = $bboxWms[$i];
+			$corners = explode(",",$corners);
+			$georssPolygon = $corners[1]." ".$corners[0]." ".$corners[3]." ".$corners[0]." ";
+			$georssPolygon .= $corners[3]." ".$corners[2]." ".$corners[1]." ".$corners[2]." ";
+			$georssPolygon .= $corners[1]." ".$corners[0];
 		}
 		$feedEntryBbox->appendChild($feedDoc->createTextNode($georssPolygon));
 		$feedEntry->appendChild($feedEntryBbox);

Modified: trunk/mapbender/http/plugins/mb_metadata_featuretype.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_featuretype.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/plugins/mb_metadata_featuretype.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -56,6 +56,11 @@
 		   	<input disabled="disabled" name="featuretype_keyword" id="featuretype_keyword"/>
 		</p>
 		<p>
+		<label for="inspire_download"><?php echo _mb("Enable INSPIRE Download Service for predefined dataset.");?>:</label>
+			<input name="inspire_download" id="inspire_download" type="checkbox"/>
+			<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("If this function is enabled, the registry will generate a INSPIRE Download Service fascade for the specific featuretype. All datasets, which are coupled with this featuretype will get an entry in the INSPIRE TOP feed. On spatial dataset may consists of different featuretypes from different WFS. The dataset feed");?>'}" src="../img/questionmark.png" alt="" />
+		</p>
+		<p>
 		    <div id="buttons">
 			<fieldset>
 		    		<p>

Modified: trunk/mapbender/http/plugins/mb_metadata_layer.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_layer.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/plugins/mb_metadata_layer.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -58,6 +58,11 @@
 		   	<input disabled="disabled" name="layer_keyword" id="layer_keyword"/>
 		</p>
 		<p>
+		<label for="inspire_download"><?php echo _mb("Enable INSPIRE Download Service for predefined dataset.");?>:</label>
+      			<input name="inspire_download" id="inspire_download" type="checkbox"/>
+			<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("If this function is enabled, the registry will generate a INSPIRE Download Service fascade for the specific WMS layer. The WMS has to support GeoTIFF as ouput format and must support at minimum  1000x1000 pixel for a single GetMap request. The fascade is generated from the information of the coupled metadataset and the WMS itself. If the extent is more than 1000x1000 pixel, the whole dataset will be splitted into single tiles of 1000x1000 pixel.");?>'}" src="../img/questionmark.png" alt="" />
+		</p>
+		<p>
 		    <div id="buttons">
 			<fieldset>
 		    	<p>

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -223,7 +223,7 @@
 
 		$sql = <<<SQL
 	
-SELECT layer_id, layer_name, layer_title, layer_abstract, layer_searchable, fkey_wms_id as wms_id  
+SELECT layer_id, layer_name, layer_title, layer_abstract, layer_searchable, inspire_download, fkey_wms_id as wms_id  
 FROM layer WHERE layer_id = $layerId;
 
 SQL;
@@ -277,6 +277,11 @@
 		while ($row = db_fetch_assoc($res)) {
 			$resultObj["layer_keyword"][]= $row["keyword"];
 		}
+
+		$resultObj['inspire_download'] = $resultObj['inspire_download'] == 1 ? true : false;
+
+
+
 		//get MetadataURLs from md_metadata table
 		$sql = <<<SQL
 SELECT metadata_id, uuid, link, linktype, md_format, origin, relation.internal FROM mb_metadata 
@@ -310,7 +315,7 @@
 
 		$sql = <<<SQL
 	
-SELECT layer_id, f_count_layer_couplings(layer_id) as count_coupling, f_collect_inspire_cat_layer(layer_id) AS inspire_cats, layer_pos, layer_parent, layer_name, layer_title, layer_abstract, layer_searchable 
+SELECT layer_id, f_count_layer_couplings(layer_id) as count_coupling, f_collect_inspire_cat_layer(layer_id) AS inspire_cats, layer_pos, layer_parent, layer_name, layer_title, layer_abstract, layer_searchable, inspire_download 
 FROM layer WHERE fkey_wms_id = $wmsId ORDER BY layer_pos;
 
 SQL;
@@ -344,6 +349,7 @@
 					"layer_abstract" => $row["layer_abstract"],
 					"layer_searchable" => intval($row["layer_searchable"]),
 					"layer_coupling" => intval($row["count_coupling"]),
+					"inspire_download" => intval($row["inspire_download"]),
 					"inspire_cats" => intval($inspireCats)
 				)
 			);
@@ -489,10 +495,14 @@
 				"layer_abstract",
 				"layer_title",
 				"layer_keyword",
+				"inspire_download",
 				"layer_md_topic_category_id",
 				"layer_inspire_category_id",
 				"layer_custom_category_id"
 			);
+
+			
+			
 			//extract relevant information from json and fill them into the wms object
 			foreach ($columns as $c) {
 				$value = $data->layer->$c;
@@ -514,6 +524,13 @@
 						$layer->$c = $value;
 					}
 				}
+				elseif ($c === "inspire_download") {
+					if ($value == "on") {
+						$layer->$c = intval('1');
+					} else {
+						$layer->$c = intval('0');
+					}
+				}
 				else {
 					if (!is_null($value)) {
 						$layer->$c = $value;
@@ -526,6 +543,7 @@
 		} else {
 			$wms->wms_network_access = intval('0');
 		}
+
 		//try {
 			$wms->updateObjInDB($wmsId,true);
 		//}

Modified: trunk/mapbender/http/plugins/mb_metadata_wfs_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wfs_server.php	2012-05-24 08:08:23 UTC (rev 8362)
+++ trunk/mapbender/http/plugins/mb_metadata_wfs_server.php	2012-05-24 13:58:31 UTC (rev 8363)
@@ -208,7 +208,7 @@
 
 		$sql = <<<SQL
 	
-SELECT featuretype_id, featuretype_name, featuretype_title, featuretype_abstract, featuretype_searchable 
+SELECT featuretype_id, featuretype_name, featuretype_title, featuretype_abstract, featuretype_searchable, inspire_download 
 FROM wfs_featuretype WHERE featuretype_id = $featuretypeId;
 
 SQL;
@@ -261,6 +261,10 @@
 		while ($row = db_fetch_assoc($res)) {
 			$resultObj["featuretype_keyword"][]= $row["keyword"];
 		}
+
+		$resultObj['inspire_download'] = $resultObj['inspire_download'] == 1 ? true : false;
+
+
 		//get MetadataURLs from md_metadata table
 		$sql = <<<SQL
 SELECT metadata_id, uuid, link, linktype, md_format, origin, relation.internal FROM mb_metadata 
@@ -301,7 +305,7 @@
 
 		$sql = <<<SQL
 	
-SELECT featuretype_id, featuretype_name, f_count_featuretype_couplings(featuretype_id) as count_coupling, f_collect_inspire_cat_wfs_featuretype(featuretype_id) AS inspire_cats, featuretype_abstract, featuretype_searchable 
+SELECT featuretype_id, featuretype_name, f_count_featuretype_couplings(featuretype_id) as count_coupling, f_collect_inspire_cat_wfs_featuretype(featuretype_id) AS inspire_cats, featuretype_abstract, featuretype_searchable, inspire_download  
 FROM wfs_featuretype WHERE fkey_wfs_id = $wfsId ORDER BY featuretype_id;
 
 SQL;
@@ -331,6 +335,7 @@
 					"featuretype_title" => $row["featuretype_title"],
 					"featuretype_abstract" => $row["featuretype_abstract"],
 					"featuretype_searchable" => intval($row["featuretype_searchable"]),
+					"inspire_download" => intval($row["inspire_download"]),
 					"featuretype_coupling" => intval($row["count_coupling"]),
 					"inspire_cats" => intval($inspireCats)
 				)
@@ -1109,6 +1114,9 @@
 			$featuretypeId = intval($data->featuretype->featuretype_id);
 		}
 		catch (Exception $e) {
+			$ajaxResponse->setSuccess(false);
+			$ajaxResponse->setMessage(_mb("Could not read featuretype with ID ".$data->featuretype->featuretype_id));
+			$ajaxResponse->send();		
 		}
 
 
@@ -1116,13 +1124,15 @@
 
 
 		if ($featuretypeId) {
-			$featuretype = $wfs->findFeatureTypeById($featuretypeId);
+			$e = new mb_notice("Got following featuretype id from wms metadata editor client: ".$featuretypeId);
+			$featuretype = &$wfs->findFeatureTypeReferenceById($featuretypeId);
 			if (!is_null($featuretype)) {
 				
 				$columns = array(
 					"summary", 
 					"title",
 					"featuretype_keyword",
+					"inspire_download",
 					"featuretype_md_topic_category_id",
 					"featuretype_inspire_category_id",
 					"featuretype_custom_category_id"
@@ -1155,6 +1165,13 @@
 							$featuretype->$c = $value;
 						}
 					}
+					elseif ($c === "inspire_download") {
+						if ($value == "on") {
+							$featuretype->$c = intval('1');
+						} else {
+							$featuretype->$c = intval('0');
+						}
+					}
 					else {
 						if (!is_null($value)) {
 							$featuretype->$c = $value;



More information about the Mapbender_commits mailing list