[Mapbender-commits] r9812 - in trunk/mapbender/http: classes php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 13 07:30:17 PST 2017


Author: armin11
Date: 2017-11-13 07:30:17 -0800 (Mon, 13 Nov 2017)
New Revision: 9812

Modified:
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/php/mod_dataISOMetadata.php
   trunk/mapbender/http/php/mod_layerISOMetadata.php
   trunk/mapbender/http/php/wms.php
Log:
New coupling for view services and datasets as demanded from inspire since march 2017 - see - http://inspire.ec.europa.eu/file/1705/download?token=iSTwpRWd&usg=AOvVaw18y1aTdkoMCBxpIz7tOOgu

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2017-11-13 13:20:26 UTC (rev 9811)
+++ trunk/mapbender/http/classes/class_iso19139.php	2017-11-13 15:30:17 UTC (rev 9812)
@@ -302,8 +302,19 @@
 			$this->datasetId = 'undefined';
 			$code = $iso19139Xml->xpath('//gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:MD_Identifier/gmd:code/gco:CharacterString');
 			if (isset($code[0]) && $code[0] != '') {
-				$this->datasetId = $code[0];
-				$this->datasetIdCodeSpace = "";	
+				//new implementation:
+				//http://inspire.ec.europa.eu/file/1705/download?token=iSTwpRWd&usg=AOvVaw18y1aTdkoMCBxpIz7tOOgu
+				//from 2017-03-02 - the MD_Identifier - see C.2.5 Unique resource identifier - it is separated with a slash - the codespace should be everything after the last slash 
+				//now try to check if a single slash is available and if the md_identifier is a url
+				$parsedUrl = parse_url($code[0]);
+				if (($parsedUrl['scheme'] == 'http' || $parsedUrl['scheme'] == 'https') && strpos($parsedUrl['path'],'/') !== false) {
+					$explodedUrl = explode('/', $code[0]);
+					$this->datasetId = $explodedUrl[count($explodedUrl) - 1];
+					$this->datasetIdCodeSpace = rtrim($code[0], $this->datasetId);	
+				} else {
+					$this->datasetId = $code[0];
+					$this->datasetIdCodeSpace = "";	
+				}
 			} else { //try to read code from RS_Identifier 		
 				$code = $iso19139Xml->xpath('//gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:code/gco:CharacterString');
 				$codeSpace = $iso19139Xml->xpath('//gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:citation/gmd:CI_Citation/gmd:identifier/gmd:RS_Identifier/gmd:codeSpace/gco:CharacterString');

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2017-11-13 13:20:26 UTC (rev 9811)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2017-11-13 15:30:17 UTC (rev 9812)
@@ -302,21 +302,26 @@
 		//constraints - after descriptive keywords
 		if (isset($tou) && $tou !== '' && $tou !== false) {
 			//count old resourceConstraints elements
-			$resourceConstraintsNodeList = $xpath->query('//gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints');
-			//load xml from constraint generator
-			$licenseDomObject = new DOMDocument();
-			$licenseDomObject->loadXML($tou);
-			$xpathLicense = new DOMXpath($licenseDomObject);
-			$licenseNodeList = $xpathLicense->query('/mb:constraints/gmd:resourceConstraints');
-			//insert new constraints before first old constraints node
-			for ($i = ($licenseNodeList->length)-1; $i >= 0; $i--) {
-				$resourceConstraintsNodeList->item(0)->parentNode->insertBefore($metadataDomObject->importNode($licenseNodeList->item($i), true), $resourceConstraintsNodeList->item(0));
+			$resourceConstraintsNodeList = $xpath->query('/gmd:MD_Metadata/gmd:identificationInfo/gmd:MD_DataIdentification/gmd:resourceConstraints');
+			$arrayResourceConstraintsNodeList = (array)$resourceConstraintsNodeList;
+			//TODO - if this is empty - create a new entry
+			if (!empty($arrayResourceConstraintsNodeList)) {
+				//$e = new mb_exception("list is not empty!");
+				//load xml from constraint generator
+				$licenseDomObject = new DOMDocument();
+				$licenseDomObject->loadXML($tou);
+				$xpathLicense = new DOMXpath($licenseDomObject);
+				$licenseNodeList = $xpathLicense->query('/mb:constraints/gmd:resourceConstraints');
+				//insert new constraints before first old constraints node
+				for ($i = ($licenseNodeList->length)-1; $i >= 0; $i--) {
+					$resourceConstraintsNodeList->item(0)->parentNode->insertBefore($metadataDomObject->importNode($licenseNodeList->item($i), true), $resourceConstraintsNodeList->item(0));
+				}
+				//delete all resourceConstraints from original xml document 
+				for ($i = 0; $i <  $resourceConstraintsNodeList->length; $i++) {
+    						$temp = $resourceConstraintsNodeList->item($i); //avoid calling a function twice
+    						$temp->parentNode->removeChild($temp);
+				}			
 			}
-			//delete all resourceConstraints from original xml document 
-			for ($i = 0; $i <  $resourceConstraintsNodeList->length; $i++) {
-    					$temp = $resourceConstraintsNodeList->item($i); //avoid calling a function twice
-    					$temp->parentNode->removeChild($temp);
-			}
 		}
 		//test http://localhost/mb_trunk/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=0da11651-aa61-d75a-446c-ea4ea073bc48
 	}
@@ -437,14 +442,14 @@
 	if (!isset($mapbenderMetadata['fkey_mb_group_id']) or is_null($mapbenderMetadata['fkey_mb_group_id']) or $mapbenderMetadata['fkey_mb_group_id'] == 0){
 		$e = new mb_notice("mod_dataISOMetadata.php: fkey_mb_group_id not found!");
 		//Get information about owning user of the relation mb_user_mb_group - alternatively the defined fkey_mb_group_id from the service must be used!
-		$sqlDep = "SELECT mb_group_name, mb_group_title, mb_group_id, mb_group_logo_path, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND c.mb_user_mb_group_type=2 LIMIT 1";
+		$sqlDep = "SELECT mb_group_name, mb_group_title, mb_group_id, mb_group_logo_path, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone, mb_group_homepage, mb_group_registry_url FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND c.mb_user_mb_group_type=2 LIMIT 1";
 		$vDep = array($mapbenderMetadata['wms_owner']);
 		$tDep = array('i');
 		$resDep = db_prep_query($sqlDep, $vDep, $tDep);
 		$departmentMetadata = db_fetch_array($resDep);
 	} else {
 		$e = new mb_notice("mod_dataISOMetadata.php: fkey_mb_group_id found!");
-		$sqlDep = "SELECT mb_group_name , mb_group_title, mb_group_id, mb_group_logo_path , mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
+		$sqlDep = "SELECT mb_group_name , mb_group_title, mb_group_id, mb_group_logo_path , mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone, mb_group_homepage, mb_group_registry_url FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
 		$vDep = array($mapbenderMetadata['fkey_mb_group_id']);
 		$tDep = array('i');
 		$resDep = db_prep_query($sqlDep, $vDep, $tDep);
@@ -761,6 +766,10 @@
 	#do the things for identification
 	$identificationInfo=$iso19139->createElement("gmd:identificationInfo");
 	$MD_DataIdentification=$iso19139->createElement("gmd:MD_DataIdentification");
+
+	$MD_DataIdentification->setAttribute("id", "spatial_dataset_".md5($mb_metadata['uuid']));
+
+
 	$citation=$iso19139->createElement("gmd:citation");
 	$CI_Citation=$iso19139->createElement("gmd:CI_Citation");
 
@@ -938,12 +947,37 @@
 
 	$code=$iso19139->createElement("gmd:code");
 	$code_cs=$iso19139->createElement("gco:CharacterString");
-	if (defined('METADATA_DEFAULT_CODESPACE')) {
-		$codeText=$iso19139->createTextNode(METADATA_DEFAULT_CODESPACE."#".$mb_metadata['uuid']); //in case of the mapbender addon!
+
+	if (isset($departmentMetadata['mb_group_registry_url']) && $departmentMetadata['mb_group_registry_url'] !== "") {
+		if (substr($departmentMetadata['mb_group_registry_url'], -1) !== '/') {
+			$uniqueResourceIdentifierCodespace = $departmentMetadata['mb_group_registry_url'].'/';	
+		} else {
+			$uniqueResourceIdentifierCodespace =  $departmentMetadata['mb_group_registry_url'];	
+		}
 	} else {
-		$codeText=$iso19139->createTextNode("http://www.mapbender.org"."#".$mb_metadata['uuid']); //in case of the mapbender addon!
+		if (isset($departmentMetadata['mb_group_homepage']) && $departmentMetadata['mb_group_homepage'] !== "") {
+			if (substr($departmentMetadata['mb_group_homepage'], -1) !== '/') {
+				$uniqueResourceIdentifierCodespace = $departmentMetadata['mb_group_homepage'].'/'.'registry/spatial/dataset/';	
+			} else {
+				$uniqueResourceIdentifierCodespace =  $departmentMetadata['mb_group_homepage'].'registry/spatial/dataset/';	
+			}
+		} else {
+			if (defined('METADATA_DEFAULT_CODESPACE')) {
+				if (substr($departmentMetadata['mb_group_homepage'], -1) !== '/') {
+					$uniqueResourceIdentifierCodespace = METADATA_DEFAULT_CODESPACE.'/'.'registry/spatial/dataset/';	
+				} else {
+					$uniqueResourceIdentifierCodespace =  METADATA_DEFAULT_CODESPACE.'registry/spatial/dataset/';	
+				}
+			} else {
+				$uniqueResourceIdentifierCodespace = "http://www.mapbender.org/registry/spatial/dataset/";
+			}
+		}
 	}
 
+$e = new mb_exception($uniqueResourceIdentifierCodespace);
+
+	$codeText=$iso19139->createTextNode($uniqueResourceIdentifierCodespace.$mb_metadata['uuid']);
+
 	$code_cs->appendChild($codeText);
 	$code->appendChild($code_cs);
 	$md_identifier->appendChild($code);

Modified: trunk/mapbender/http/php/mod_layerISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_layerISOMetadata.php	2017-11-13 13:20:26 UTC (rev 9811)
+++ trunk/mapbender/http/php/mod_layerISOMetadata.php	2017-11-13 15:30:17 UTC (rev 9812)
@@ -130,14 +130,14 @@
 	if (!isset($mapbenderMetadata['fkey_mb_group_id']) or is_null($mapbenderMetadata['fkey_mb_group_id']) or $mapbenderMetadata['fkey_mb_group_id'] == 0){
 		$e = new mb_notice("mod_layerISOMetadata.php: fkey_mb_group_id not found!");
 		//Get information about owning user of the relation mb_user_mb_group - alternatively the defined fkey_mb_group_id from the service must be used!
-		$sqlDep = "SELECT mb_group_name, mb_group_title, mb_group_id, mb_group_logo_path, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND c.mb_user_mb_group_type=2 LIMIT 1";
+		$sqlDep = "SELECT mb_group_name, mb_group_title, mb_group_id, mb_group_logo_path, mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone, mb_group_homepage, mb_group_registry_url FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND c.mb_user_mb_group_type=2 LIMIT 1";
 		$vDep = array($mapbenderMetadata['wms_owner']);
 		$tDep = array('i');
 		$resDep = db_prep_query($sqlDep, $vDep, $tDep);
 		$departmentMetadata = db_fetch_array($resDep);
 	} else {
 		$e = new mb_notice("mod_layerISOMetadata.php: fkey_mb_group_id found!");
-		$sqlDep = "SELECT mb_group_name , mb_group_title, mb_group_id, mb_group_logo_path , mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
+		$sqlDep = "SELECT mb_group_name , mb_group_title, mb_group_id, mb_group_logo_path , mb_group_address, mb_group_email, mb_group_postcode, mb_group_city, mb_group_voicetelephone, mb_group_facsimiletelephone, mb_group_homepage, mb_group_registry_url FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
 		$vDep = array($mapbenderMetadata['fkey_mb_group_id']);
 		$tDep = array('i');
 		$resDep = db_prep_query($sqlDep, $vDep, $tDep);
@@ -666,7 +666,7 @@
 	$i=0;
 	$sql = <<<SQL
 
-SELECT metadata_id, uuid, link, linktype, md_format, origin, datasetid FROM mb_metadata 
+SELECT metadata_id, uuid, link, linktype, md_format, origin, datasetid, datasetid_codespace FROM mb_metadata 
 INNER JOIN (SELECT * from ows_relation_metadata 
 WHERE fkey_layer_id = $recordId ) as relation ON 
 mb_metadata.metadata_id = relation.fkey_metadata_id WHERE mb_metadata.origin IN ('capabilities','external','metador')
@@ -746,35 +746,66 @@
 	/*INSPIRE demands a href for the metadata record!*/
 	/*TODO: Exchange HTTP_HOST with other baseurl*/
 	while ($row_metadata = db_fetch_array($res_metadataurl)) {
-			switch ($row_metadata['origin']) {
-				case 'capabilities':
-					$operatesOn=$iso19139->createElement("srv:operatesOn");
-					$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row_metadata['uuid']);
-					$operatesOn->setAttribute("uuidref", $row_metadata['datasetid']);
-					$SV_ServiceIdentification->appendChild($operatesOn);
-				break;
-				case 'metador':
-					$operatesOn=$iso19139->createElement("srv:operatesOn");
+		//$row_metadata['datasetid_codespace']
+		//check codespace for trailing slash - if not there - add it ;-)
+		//unique resource identifier
+		if (isset($row_metadata['datasetid_codespace']) && $row_metadata['datasetid_codespace'] != "") {
+			if (substr($row_metadata['datasetid_codespace'], -1) !== '/') {
+				$uniqueResourceIdentifierCodespace = $row_metadata['datasetid_codespace'].'/';	
+			} else {
+				$uniqueResourceIdentifierCodespace =  $row_metadata['datasetid_codespace'];	
+			}
+		} else {
+
+			if (isset($departmentMetadata['mb_group_registry_url']) && $departmentMetadata['mb_group_registry_url'] !== "") {
+				if (substr($departmentMetadata['mb_group_registry_url'], -1) !== '/') {
+					$uniqueResourceIdentifierCodespace = $departmentMetadata['mb_group_registry_url'].'/';	
+				} else {
+					$uniqueResourceIdentifierCodespace =  $departmentMetadata['mb_group_registry_url'];	
+				}
+			} else {
+				if (isset($departmentMetadata['mb_group_homepage']) && $departmentMetadata['mb_group_homepage'] !== "") {
+					if (substr($departmentMetadata['mb_group_homepage'], -1) !== '/') {
+						$uniqueResourceIdentifierCodespace = $departmentMetadata['mb_group_homepage'].'/'.'registry/spatial/dataset/';	
+					} else {
+						$uniqueResourceIdentifierCodespace =  $departmentMetadata['mb_group_homepage'].'registry/spatial/dataset/';	
+					}
+				} else {
 					if (defined('METADATA_DEFAULT_CODESPACE')) {
-						$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row_metadata['uuid']);
-						$operatesOn->setAttribute("uuidref", METADATA_DEFAULT_CODESPACE."#".$row_metadata['uuid']);
+						if (substr($departmentMetadata['mb_group_homepage'], -1) !== '/') {
+							$uniqueResourceIdentifierCodespace = METADATA_DEFAULT_CODESPACE.'/'.'registry/spatial/dataset/';	
+						} else {
+							$uniqueResourceIdentifierCodespace =  METADATA_DEFAULT_CODESPACE.'registry/spatial/dataset/';	
+						}
 					} else {
-						$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row_metadata['uuid']);
-						$operatesOn->setAttribute("uuidref", "http://www.mapbender.org#".$row_metadata['uuid']);
+						$uniqueResourceIdentifierCodespace = "http://www.mapbender.org/registry/spatial/dataset/";
 					}
-					
-					$SV_ServiceIdentification->appendChild($operatesOn);
-				break;
-				case 'external':
-					$operatesOn=$iso19139->createElement("srv:operatesOn");
-					$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row_metadata['uuid']);
-					$operatesOn->setAttribute("uuidref", $row_metadata['uuid']);
-					$SV_ServiceIdentification->appendChild($operatesOn);
-				break;
-				default:
-				break;
+				}
 			}
 		}
+		switch ($row_metadata['origin']) {
+			case 'capabilities':
+				$operatesOn=$iso19139->createElement("srv:operatesOn");
+				$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row_metadata['uuid']);
+				$operatesOn->setAttribute("uuidref", $uniqueResourceIdentifierCodespace.$row_metadata['datasetid']);
+				$SV_ServiceIdentification->appendChild($operatesOn);
+			break;
+			case 'metador':
+				$operatesOn=$iso19139->createElement("srv:operatesOn");
+				$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row_metadata['uuid'].'#spatial_dataset_'.md5($row_metadata['uuid']));
+				$operatesOn->setAttribute("uuidref", $uniqueResourceIdentifierCodespace.$row_metadata['uuid']);
+				$SV_ServiceIdentification->appendChild($operatesOn);
+			break;
+			case 'external':
+				$operatesOn=$iso19139->createElement("srv:operatesOn");
+				$operatesOn->setAttribute("xlink:href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row_metadata['uuid']);
+				$operatesOn->setAttribute("uuidref", $uniqueResourceIdentifierCodespace.$row_metadata['datasetid']);
+				$SV_ServiceIdentification->appendChild($operatesOn);
+			break;
+			default:
+			break;
+		}
+	}
 	
 /*
 	$serviceTypeVersion_cs->appendChild($serviceTypeVersionText);

Modified: trunk/mapbender/http/php/wms.php
===================================================================
--- trunk/mapbender/http/php/wms.php	2017-11-13 13:20:26 UTC (rev 9811)
+++ trunk/mapbender/http/php/wms.php	2017-11-13 15:30:17 UTC (rev 9812)
@@ -162,7 +162,7 @@
 if (!isset($wms_row['fkey_mb_group_id']) or is_null($wms_row['fkey_mb_group_id']) or $wms_row['fkey_mb_group_id'] == 0){
 	$e = new mb_notice("wms.php: fkey_mb_group_id not found!");
 	//Get information about owning user of the relation mb_user_mb_group - alternatively the defined fkey_mb_group_id from the service must be used!
-	$sqlDep = "SELECT mb_group_name as metadatapointofcontactorgname,mb_group_homepage as metadatapointofcontactorgurl, mb_group_title as metadatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metadatapointofcontactorglogo, mb_group_address as metadatapointofcontactorgaddress, mb_group_email as metadatapointofcontactorgemail, mb_group_postcode as metadatapointofcontactorgpostcode, mb_group_city as metadatapointofcontactorgcity, mb_group_voicetelephone as metadatapointofcontactorgtelephone, mb_group_facsimiletelephone as metadatapointofcontactorgfax FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND c.mb_user_mb_group_type=2 LIMIT 1";
+	$sqlDep = "SELECT mb_group_name as metadatapointofcontactorgname, mb_group_homepage as metadatapointofcontactorgurl, mb_group_registry_url as metadatapointofcontactregistryurl, mb_group_title as metadatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metadatapointofcontactorglogo, mb_group_address as metadatapointofcontactorgaddress, mb_group_email as metadatapointofcontactorgemail, mb_group_postcode as metadatapointofcontactorgpostcode, mb_group_city as metadatapointofcontactorgcity, mb_group_voicetelephone as metadatapointofcontactorgtelephone, mb_group_facsimiletelephone as metadatapointofcontactorgfax FROM mb_group AS a, mb_user AS b, mb_user_mb_group AS c WHERE b.mb_user_id = $1  AND b.mb_user_id = c.fkey_mb_user_id AND c.fkey_mb_group_id = a.mb_group_id AND c.mb_user_mb_group_type=2 LIMIT 1";
 	$vDep = array($wms_row['wms_owner']);
 	$tDep = array('i');
 	$resDep = db_prep_query($sqlDep, $vDep, $tDep);
@@ -172,7 +172,7 @@
 	$e = new mb_notice("wms.php: mb_group_logo_path: ".$metadataContactGroup['metadatapointofcontactorglogo']);
 } else {
 	$e = new mb_notice("wms.php: fkey_mb_group_id found!");
-	$sqlDep = "SELECT mb_group_name as metadatapointofcontactorgname, mb_group_homepage as metadatapointofcontactorgurl, mb_group_title as metadatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metadatapointofcontactorglogo, mb_group_address as metadatapointofcontactorgaddress, mb_group_email as metadatapointofcontactorgemail, mb_group_postcode as metadatapointofcontactorgpostcode, mb_group_city as metadatapointofcontactorgcity, mb_group_voicetelephone as metadatapointofcontactorgtelephone, mb_group_facsimiletelephone as metadatapointofcontactorgfax FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
+	$sqlDep = "SELECT mb_group_name as metadatapointofcontactorgname, mb_group_homepage as metadatapointofcontactorgurl, mb_group_registry_url as metadatapointofcontactregistryurl, mb_group_title as metadatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metadatapointofcontactorglogo, mb_group_address as metadatapointofcontactorgaddress, mb_group_email as metadatapointofcontactorgemail, mb_group_postcode as metadatapointofcontactorgpostcode, mb_group_city as metadatapointofcontactorgcity, mb_group_voicetelephone as metadatapointofcontactorgtelephone, mb_group_facsimiletelephone as metadatapointofcontactorgfax FROM mb_group WHERE mb_group_id = $1 LIMIT 1";
 	$vDep = array($wms_row['fkey_mb_group_id']);
 	$tDep = array('i');
 	$resDep = db_prep_query($sqlDep, $vDep, $tDep);
@@ -180,16 +180,22 @@
 }
 
 $AuthorityName = $metadataContactGroup["metadatapointofcontactorgname"];
-$AuthorityUrl = $metadataContactGroup["metadatapointofcontactorgurl"];
 
+//check for given urls
+if (isset($metadataContactGroup["metadatapointofcontactregistryurl"]) && $metadataContactGroup["metadatapointofcontactregistryurl"] !== "") {
+	$AuthorityUrl = $metadataContactGroup["metadatapointofcontactregistryurl"];
+} else {
+	$AuthorityUrl = $metadataContactGroup["metadatapointofcontactorgurl"];
+}
+
 if ($AuthorityName == '') {
 	$AuthorityName = "defaultauthority";
 }
 if ($AuthorityUrl == '') {
 	if (defined("METADATA_DEFAULT_CODESPACE") && METADATA_DEFAULT_CODESPACE != '') {
-		$AuthorityUrl = METADATA_DEFAULT_CODESPACE;
+		$AuthorityUrl = METADATA_DEFAULT_CODESPACE."/registry/spatial/dataset/";
 	} else {
-		$AuthorityUrl = "http://www.mapbender.org";
+		$AuthorityUrl = "http://www.mapbender.org"."/registry/spatial/dataset/";
 	}
 }
 
@@ -1182,12 +1188,15 @@
 		if ($row_metadata["datasetid"] == '' || !isset($row_metadata["datasetid"])) {
 			//this column is empty, if metador was used and the identifier for dataset id is equal to the identifier of the metadata fileidentifier. In this case we expand a standard codespace http://www.geoportal.rlp.de 
 			if (defined('METADATA_DEFAULT_CODESPACE')) {
-				$datasetId = METADATA_DEFAULT_CODESPACE."#".$row_metadata["uuid"];
+				//$datasetId = METADATA_DEFAULT_CODESPACE."#".$row_metadata["uuid"];
+				$datasetId = $row_metadata["uuid"];
 			} else {
 				if (defined("METADATA_DEFAULT_CODESPACE") && METADATA_DEFAULT_CODESPACE != '') {
-					$datasetId = METADATA_DEFAULT_CODESPACE."#".$row_metadata["uuid"];
+					//$datasetId = METADATA_DEFAULT_CODESPACE."#".$row_metadata["uuid"];
+					$datasetId = $row_metadata["uuid"];
 				} else {
-					$datasetId = "http://www.mapbender.org"."#".$row_metadata["uuid"];
+					//$datasetId = "http://www.mapbender.org"."#".$row_metadata["uuid"];
+					$datasetId = $row_metadata["uuid"];
 				}
 			}
 		} else {



More information about the Mapbender_commits mailing list