[Mapbender-commits] r8185 - trunk/mapbender/http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Oct 18 07:03:43 EDT 2011


Author: armin11
Date: 2011-10-18 04:03:43 -0700 (Tue, 18 Oct 2011)
New Revision: 8185

Modified:
   trunk/mapbender/http/php/mod_layerISOMetadata.php
Log:
Adoption to fullfil INSPIRE demands for iso19139 service metadata records.

Modified: trunk/mapbender/http/php/mod_layerISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_layerISOMetadata.php	2011-10-17 14:04:27 UTC (rev 8184)
+++ trunk/mapbender/http/php/mod_layerISOMetadata.php	2011-10-18 11:03:43 UTC (rev 8185)
@@ -1,25 +1,25 @@
 <?php
-#http://www.geoportal.rlp.de/mapbender/php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=24356
-# $Id: mod_layerISOMetadata.php 235
-# http://www.mapbender.org/index.php/Inspire_Metadata_Editor
-# Copyright (C) 2002 CCGIS 
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+//http://www.geoportal.rlp.de/mapbender/php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=24356
+// $Id: mod_layerISOMetadata.php 235
+// http://www.mapbender.org/index.php/Inspire_Metadata_Editor
+// Copyright (C) 2002 CCGIS 
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// 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 conformant ISO19139 service metadata record for a wms layer which is registrated in the mapbender database. It works as a webservice
-//The record will be fulfill the demands of the INSPIRE metadata regulation from 03.12.2008
+//The record will be fulfill the demands of the INSPIRE metadata regulation from 03.12.2008 and the iso19139
 require_once(dirname(__FILE__) . "/../../core/globalSettings.php");
 require_once(dirname(__FILE__) . "/../classes/class_connector.php");
 require_once(dirname(__FILE__) . "/../classes/class_administration.php");
@@ -156,7 +156,7 @@
 	//generate language part B 10.3 (if available) of the inspire metadata regulation
 	$language = $iso19139->createElement("gmd:language");
 	$languagecode = $iso19139->createElement("gmd:LanguageCode");
-	$languagecode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#LanguageCode");
+	$languagecode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//LanguageCode");
 	if (isset($mapbenderMetadata['metadata_language'])) {
 		$languageText = $iso19139->createTextNode($mapbenderMetadata['metadata_language']);
 		$languagecode->setAttribute("codeListValue", $mapbenderMetadata['metadata_language']);
@@ -168,18 +168,19 @@
 	$languagecode->appendChild($languageText);
 	$language ->appendChild($languagecode);
 	$language = $MD_Metadata->appendChild($language);
-	//generate Characterset - first it should be utf8 ;-)
+
+	//generate characterset part - first it should be utf8 ;-)
 	$characterSet = $iso19139->createElement("gmd:characterSet");
 	$characterSetCode = $iso19139->createElement("gmd:MD_CharacterSetCode");
-	$characterSetCode->setAttribute("codeList", "./resources/codeList.xml#MD_CharacterSetCode");
+	$characterSetCode->setAttribute("codeList", "http://www.loc.gov/standards/iso639-2");
 	$characterSetCode->setAttribute("codeListValue", "utf8");
 	$characterSet->appendChild($characterSetCode);
 	$characterSet = $MD_Metadata->appendChild($characterSet);
 
-	#generate MD_Scope part B 1.3 (if available)
+	//generate MD_Scope part B 1.3 (if available)
 	$hierarchyLevel = $iso19139->createElement("gmd:hierarchyLevel");
 	$scopecode = $iso19139->createElement("gmd:MD_ScopeCode");
-	$scopecode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_ScopeCode");
+	$scopecode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//MD_ScopeCode");
 	if (isset($mapbenderMetadata['hierarchy_level'])) {
 		$scopecode->setAttribute("codeListValue", $mapbenderMetadata['hierarchy_level']);//if such a metadata exists in the mapbender metadata view
 		$scopeText = $iso19139->createTextNode($mapbenderMetadata['hierarchy_level']);
@@ -192,7 +193,15 @@
 	$hierarchyLevel->appendChild($scopecode);
 	$hierarchyLevel=$MD_Metadata->appendChild($hierarchyLevel);
 
-	#Part B 10.1 responsible party for the resource
+	//iso19139 demands a hierachyLevelName object
+	$hierarchyLevelName = $iso19139->createElement("gmd:hierarchyLevelName");
+	$hierarchyLevelNameString = $iso19139->createElement("gco:CharacterString");
+	$hierarchyLevelNameText = $iso19139->createTextNode('Darstellungsdienst');
+	$hierarchyLevelName->appendChild($hierarchyLevelNameString);
+	$hierarchyLevelNameString->appendChild($hierarchyLevelNameText);
+	$hierarchyLevelName=$MD_Metadata->appendChild($hierarchyLevelName);
+
+	//Part B 10.1 responsible party for the resource
 	$contact=$iso19139->createElement("gmd:contact");
 	$CI_ResponsibleParty=$iso19139->createElement("gmd:CI_ResponsibleParty");
 	$organisationName=$iso19139->createElement("gmd:organisationName");
@@ -220,11 +229,11 @@
 	}
 	$role=$iso19139->createElement("gmd:role");
 	$CI_RoleCode=$iso19139->createElement("gmd:CI_RoleCode");
-	$CI_RoleCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_RoleCode");
+	$CI_RoleCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//CI_RoleCode");
 	$CI_RoleCode->setAttribute("codeListValue", "pointOfContact");
 	$CI_RoleCodeText=$iso19139->createTextNode("pointOfContact");
 
-	#create xml tree
+	//create xml tree
 	$organisationName_cs->appendChild($organisationNameText);
 	$organisationName->appendChild($organisationName_cs);
 	$CI_ResponsibleParty->appendChild($organisationName);
@@ -241,7 +250,7 @@
 	$contact->appendChild($CI_ResponsibleParty);
 	$MD_Metadata->appendChild($contact);
 
-	#generate dateStamp part B 10.2 (if available)
+	//generate dateStamp part B 10.2 (if available)
 	$dateStamp = $iso19139->createElement("gmd:dateStamp");
 	$mddate = $iso19139->createElement("gco:Date");
 	if (isset($mapbenderMetadata['wms_timestamp'])) {
@@ -254,7 +263,7 @@
 	$dateStamp->appendChild($mddate);
 	$dateStamp=$MD_Metadata->appendChild($dateStamp);
 
-	//standard definition - everytime the same
+	//standard definition - for wms everytime the same ;-)
 	$metadataStandardName = $iso19139->createElement("gmd:metadataStandardName");
 	$metadataStandardVersion = $iso19139->createElement("gmd:metadataStandardVersion");
 	$metadataStandardNameText = $iso19139->createElement("gco:CharacterString");
@@ -272,11 +281,12 @@
 	//create nodes
 	$identificationInfo=$iso19139->createElement("gmd:identificationInfo");
 	$SV_ServiceIdentification=$iso19139->createElement("srv:SV_ServiceIdentification");
-	//TODO: add attribut
+	//TODO: add attribut if really needed
 	//$SV_ServiceIdentification->setAttribute("id", "dataId");
 	$citation=$iso19139->createElement("gmd:citation");
 	$CI_Citation=$iso19139->createElement("gmd:CI_Citation");
-	#create nodes for things which are defined - howto do the multiplicities? Ask Martin!
+
+	//create nodes for things which are defined - howto do the multiplicities? Ask Martin!
 	//Create Resource title element B 1.1
 	$title=$iso19139->createElement("gmd:title");
 	$title_cs=$iso19139->createElement("gco:CharacterString");
@@ -290,8 +300,8 @@
 	$title->appendChild($title_cs);
 	$CI_Citation->appendChild($title);
 
-	#Create date elements B5.2-5.4
-	#Do things for B 5.2 date of publication
+	//Create date elements B5.2-5.4 - format will be only a date - no dateTime given
+	//Do things for B 5.2 date of publication
 	if (isset($mapbenderMetadata['wms_timestamp_create'])) {
 		$date1=$iso19139->createElement("gmd:date");
 		$CI_Date=$iso19139->createElement("gmd:CI_Date");
@@ -299,7 +309,7 @@
 		$gcoDate=$iso19139->createElement("gco:Date");
 		$dateType=$iso19139->createElement("gmd:dateType");
 		$dateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
-		$dateTypeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
+		$dateTypeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//CI_DateTypeCode");
 		$dateTypeCode->setAttribute("codeListValue", "publication");
 		$dateTypeCodeText=$iso19139->createTextNode('publication');
 		$dateText= $iso19139->createTextNode(date('Y-m-d',$mapbenderMetadata['wms_timestamp_create']));
@@ -312,7 +322,7 @@
 		$date1->appendChild($CI_Date);
 		$CI_Citation->appendChild($date1);
 	}
-	#Do things for B 5.3 date of revision
+	//Do things for B 5.3 date of revision
 	if (isset($mapbenderMetadata['wms_timestamp'])) {
 		$date1=$iso19139->createElement("gmd:date");
 		$CI_Date=$iso19139->createElement("gmd:CI_Date");
@@ -320,7 +330,7 @@
 		$gcoDate=$iso19139->createElement("gco:Date");
 		$dateType=$iso19139->createElement("gmd:dateType");
 		$dateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
-		$dateTypeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
+		$dateTypeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//CI_DateTypeCode");
 		$dateTypeCode->setAttribute("codeListValue", "revision");
 		$dateTypeCodeText=$iso19139->createTextNode('revision');
 		$dateText= $iso19139->createTextNode(date('Y-m-d',$mapbenderMetadata['wms_timestamp']));
@@ -333,7 +343,7 @@
 		$date1->appendChild($CI_Date);
 		$CI_Citation->appendChild($date1);
 	}
-	#Do things for B 5.4 date of creation
+	//Do things for B 5.4 date of creation
 	if (isset($mapbenderMetadata['wms_timestamp_creation'])) {
 		$date1=$iso19139->createElement("gmd:date");
 		$CI_Date=$iso19139->createElement("gmd:CI_Date");
@@ -341,7 +351,7 @@
 		$gcoDate=$iso19139->createElement("gco:Date");
 		$dateType=$iso19139->createElement("gmd:dateType");
 		$dateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
-		$dateTypeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
+		$dateTypeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//CI_DateTypeCode");
 		$dateTypeCode->setAttribute("codeListValue", "creation");
 		$dateTypeCodeText=$iso19139->createTextNode('creation');
 		$dateText= $iso19139->createTextNode(date('Y-m-d',$mapbenderMetadata['wms_timestamp_creation']));
@@ -357,7 +367,7 @@
 	$citation->appendChild($CI_Citation);
 	$SV_ServiceIdentification->appendChild($citation);
 
-	#Create part for abstract B 1.2
+	//Create part for abstract B 1.2
 	$abstract=$iso19139->createElement("gmd:abstract");
 	$abstract_cs=$iso19139->createElement("gco:CharacterString");
 	if (isset($mapbenderMetadata['wms_abstract'])) {
@@ -370,8 +380,8 @@
 	$abstract->appendChild($abstract_cs);
 	$SV_ServiceIdentification->appendChild($abstract);
 
-	#Create part for point of contact for service identification
-	#Define relevant objects
+	//Create part for point of contact for service identification
+	//Define relevant objects
 	$pointOfContact=$iso19139->createElement("gmd:pointOfContact");
 	$CI_ResponsibleParty=$iso19139->createElement("gmd:CI_ResponsibleParty");
 	$organisationName=$iso19139->createElement("gmd:organisationName");
@@ -384,7 +394,7 @@
 	$email_cs=$iso19139->createElement("gco:CharacterString");
 	$role=$iso19139->createElement("gmd:role");
 	$CI_RoleCode=$iso19139->createElement("gmd:CI_RoleCode");
-	$CI_RoleCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_RoleCode");
+	$CI_RoleCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//CI_RoleCode");
 	$CI_RoleCode->setAttribute("codeListValue", "publisher");
 	if (isset($mapbenderMetadata['contactorganization'])) {
 		$resOrgaText = $iso19139->createTextNode($mapbenderMetadata['contactorganization']);
@@ -421,7 +431,8 @@
 	$t = array('i');
 	$res = db_prep_query($sql,$v,$t);
 	$row = db_fetch_array($res);
-	#old version 
+
+	//old version 
 /*	if (isset($row['layer_map_preview_filename']) & $row['layer_map_preview_filename'] != '') {
 		$graphicOverview=$iso19139->createElement("gmd:graphicOverview");
 		$MD_BrowseGraphic=$iso19139->createElement("gmd:MD_BrowseGraphic");
@@ -435,7 +446,7 @@
 		$SV_ServiceIdentification->appendChild($graphicOverview);
 	}
 */	
-	#version of bavaria
+	//use the example version of bavaria
 	if (file_exists(PREVIEW_DIR."/".$mapbenderMetadata['layer_id']."_layer_map_preview.jpg")) {	//TODO
 		$graphicOverview=$iso19139->createElement("gmd:graphicOverview");
 		$MD_BrowseGraphic=$iso19139->createElement("gmd:MD_BrowseGraphic");
@@ -460,8 +471,6 @@
 		$fileType_cs->appendChild($fileType_text);
 		$fileType->appendChild($fileType_cs);
 
-
-
 		$MD_BrowseGraphic->appendChild($fileName);
 
 		$MD_BrowseGraphic->appendChild($fileDescription);
@@ -471,8 +480,7 @@
 		$SV_ServiceIdentification->appendChild($graphicOverview);
 	}
 	
-	/*example: 
-	
+	/*example 3: 
 	<gmd:graphicOverview>
   		<gmd:MD_BrowseGraphic>
    			 <gmd:fileName>
@@ -481,7 +489,6 @@
   		</gmd:MD_BrowseGraphic>
 	</gmd:graphicOverview>*/
 	
-
 	//generate keyword part - for services the inspire themes are not applicable!!!
 	//read keywords for resource out of the database:
 	$sql = "SELECT keyword.keyword FROM keyword, layer_keyword WHERE layer_keyword.fkey_layer_id=$1 AND layer_keyword.fkey_keyword_id=keyword.keyword_id";
@@ -525,9 +532,9 @@
 	$descriptiveKeywords->appendChild($MD_Keywords);
 	$SV_ServiceIdentification->appendChild($descriptiveKeywords);
 
-	#Part B 3 INSPIRE Category
-	#do this only if an INSPIRE keyword (Annex I-III) is set
-	#Resource Constraints B 8
+	//Part B 3 INSPIRE Category
+	//do this only if an INSPIRE keyword (Annex I-III) is set
+	//Resource Constraints B 8
 	$resourceConstraints=$iso19139->createElement("gmd:resourceConstraints");
 	$MD_LegalConstraints=$iso19139->createElement("gmd:MD_Constraints");
 	$useLimitation=$iso19139->createElement("gmd:useLimitation");
@@ -550,7 +557,7 @@
 	$MD_LegalConstraints=$iso19139->createElement("gmd:MD_LegalConstraints");
 	$accessConstraints=$iso19139->createElement("gmd:accessConstraints");
 	$MD_RestrictionCode=$iso19139->createElement("gmd:MD_RestrictionCode");
-	$MD_RestrictionCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_RetrictionCode");
+	$MD_RestrictionCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//MD_RetrictionCode");
 	$MD_RestrictionCode->setAttribute("codeListValue", "otherRestrictions");
 	$MD_RestrictionCodeText=$iso19139->createTextNode("otherRestrictions");
 	$otherConstraints=$iso19139->createElement("gmd:otherConstraints");
@@ -572,7 +579,8 @@
 	$resourceConstraints->appendChild($MD_LegalConstraints);
 		
 	$SV_ServiceIdentification->appendChild($resourceConstraints);
-/* example
+
+	/* example
 	<srv:serviceType>
     		<gco:LocalName>view</gco:LocalName>
 	</srv:serviceType>*/
@@ -592,7 +600,7 @@
 	$serviceTypeVersion->appendChild($serviceTypeVersion_cs);
 	$SV_ServiceIdentification->appendChild($serviceTypeVersion);
 
-	#Geographical Extent
+	//Geographical Extent
 	$bbox = array();
 	//initialize if no extent is defined in the database
 	$bbox[0] = -180;
@@ -672,10 +680,9 @@
 </srv:couplingType>
 <srv:couplingType gco:nilReason="missing"/>
 <srv:containsOperations gco:nilReason="missing"/>
-<srv:operatesOn xlink:href="http://image2000.jrc.it#image2000_1_nl2_multi"/>*/
+<srv:operatesOn xlink:href="http://image2000.jrc.it//image2000_1_nl2_multi"/>*/
 	
-	
-	#to the things which have to be done for integrating the service into a client like portalu ... they have defined another location to put the GetCap URL than INSPIRE does it
+	//to the things which have to be done for integrating the service into a client like portalu ... they have defined another location to put the GetCap URL than INSPIRE does it
 
 	$containsOperation=$iso19139->createElement("srv:containsOperations");
 	$SV_OperationMetadata=$iso19139->createElement("srv:SV_OperationMetadata");
@@ -688,7 +695,7 @@
 	$operationName_cs->appendChild($operationNameText);
 	$operationName->appendChild($operationName_cs);
 
-//srv DCP **************************************
+	//srv DCP **************************************
 	$DCP=$iso19139->createElement("srv:DCP");
 	$DCPList=$iso19139->createElement("srv:DCPList");
 	$DCPList->setAttribute("codeList", "DCPList");
@@ -696,19 +703,20 @@
 
 	$DCP->appendChild($DCPList);
 	
-//connectPoint **********************************
+	//connectPoint **********************************
 	$connectPoint=$iso19139->createElement("srv:connectPoint");
 	
 	$CI_OnlineResource=$iso19139->createElement("gmd:CI_OnlineResource");
 
 	$gmd_linkage=$iso19139->createElement("gmd:linkage");
 	$gmd_URL=$iso19139->createElement("gmd:URL");
+
 	//Check if anonymous user has rights to access this layer - if not ? which resource should be advertised? TODO
 	if ($hasPermission) {
-		$gmd_URLText=$iso19139->createTextNode("http://".$_SERVER['HTTP_HOST']."/mapbender/php/wms.php?inspire=1&layer_id=".$mapbenderMetadata['layer_id']."");
+		$gmd_URLText=$iso19139->createTextNode("http://".$_SERVER['HTTP_HOST']."/mapbender/php/wms.php?inspire=1&layer_id=".$mapbenderMetadata['layer_id']."&REQUEST=GetCapabilities&SERVICE=WMS");
 	}
 	else {
-		$gmd_URLText=$iso19139->createTextNode("https://".$_SERVER['HTTP_HOST']."/http_auth/".$mapbenderMetadata['layer_id']."?");
+		$gmd_URLText=$iso19139->createTextNode("https://".$_SERVER['HTTP_HOST']."/http_auth/".$mapbenderMetadata['layer_id']."?REQUEST=GetCapabilities&SERVICE=WMS");
 	}
 	$gmd_URL->appendChild($gmd_URLText);
 	$gmd_linkage->appendChild($gmd_URL);
@@ -724,7 +732,7 @@
 	$SV_ServiceIdentification->appendChild($containsOperation);
 
 	//fill in operatesOn fields with datasetid if given
-	/*<srv:operatesOn xlink:href="http://image2000.jrc.it#image2000_1_nl2_multi"/>*/
+	/*INSPIRE example: <srv:operatesOn xlink:href="http://image2000.jrc.it//image2000_1_nl2_multi"/>*/
 	while ($row_metadata = db_fetch_array($res_metadataurl)) {
 			switch ($row_metadata['origin']) {
 				case 'capabilities':
@@ -759,7 +767,7 @@
 */
 	$identificationInfo->appendChild($SV_ServiceIdentification);
 
-	//distributionInfo
+	//distributionInfo - is demanded from iso19139
 	$gmd_distributionInfo=$iso19139->createElement("gmd:distributionInfo");
 	$MD_Distribution=$iso19139->createElement("gmd:MD_Distribution");
 	$gmd_distributionFormat=$iso19139->createElement("gmd:distributionFormat");
@@ -779,17 +787,17 @@
 
 	//Check if anonymous user has rights to access this layer - if not ? which resource should be advertised? TODO
 	if ($hasPermission) {
-		$gmd_URLText=$iso19139->createTextNode("http://".$_SERVER['HTTP_HOST']."/mapbender/php/wms.php?inspire=1&layer_id=".$mapbenderMetadata['layer_id']."");
+		$gmd_URLText=$iso19139->createTextNode("http://".$_SERVER['HTTP_HOST']."/mapbender/php/wms.php?inspire=1&layer_id=".$mapbenderMetadata['layer_id']."&REQUEST=GetCapabilities&SERVICE=WMS");
 	}
 	else {
-		$gmd_URLText=$iso19139->createTextNode("https://".$_SERVER['HTTP_HOST']."/http_auth/".$mapbenderMetadata['layer_id']."?");
+		$gmd_URLText=$iso19139->createTextNode("https://".$_SERVER['HTTP_HOST']."/http_auth/".$mapbenderMetadata['layer_id']."?REQUEST=GetCapabilities&SERVICE=WMS");
 	}
 	$gmd_URL->appendChild($gmd_URLText);
 	$gmd_linkage->appendChild($gmd_URL);
 	$CI_OnlineResource->appendChild($gmd_linkage);
 
 	//append things which geonetwork needs to invoke service/layer or what else? - Here the name of the layer and the protocol seems to be needed?
-	//a problem will occur, if the link to get map is not the same as the link to get caps? So how can we handle this? It seems to very silly! 
+	//a problem will occur, if the link to get map is not the same as the link to get caps? So how can we handle this? It seems to be very silly! 
 	$gmdProtocol = $iso19139->createElement("gmd:protocol");
 	$gmdProtocol_cs = $iso19139->createElement("gco:CharacterString");
 	$gmdProtocolText = $iso19139->createTextNode("OGC:WMS-1.1.1-http-get-map");//for ever 'OGC:WMS-1.1.1-http-get-map'
@@ -824,6 +832,7 @@
 	$MD_Distribution->appendChild($gmd_distributionFormat);
 	$MD_Distribution->appendChild($gmd_transferOptions);
 	$gmd_distributionInfo->appendChild($MD_Distribution);
+
 	//dataQualityInfo
 	$gmd_dataQualityInfo=$iso19139->createElement("gmd:dataQualityInfo");
 	$DQ_DataQuality=$iso19139->createElement("gmd:DQ_DataQuality");
@@ -832,7 +841,7 @@
 	$gmd_level=$iso19139->createElement("gmd:level");
 	$MD_ScopeCode=$iso19139->createElement("gmd:MD_ScopeCode");
 	$MD_ScopeCodeText=$iso19139->createTextNode("service");
-	$MD_ScopeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#MD_RetrictionCode");
+	$MD_ScopeCode->setAttribute("codeList", "http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//MD_ScopeCode");
 	$MD_ScopeCode->setAttribute("codeListValue", "service");
 	$MD_ScopeCode->appendChild($MD_ScopeCodeText);
 	$gmd_level->appendChild($MD_ScopeCode);
@@ -859,7 +868,7 @@
 	
 	$gmd_dateType=$iso19139->createElement("gmd:dateType");
 	$CI_DateTypeCode=$iso19139->createElement("gmd:CI_DateTypeCode");
-	$CI_DateTypeCode->setAttribute("codeList","http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml#CI_DateTypeCode");
+	$CI_DateTypeCode->setAttribute("codeList","http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/resources/Codelist/ML_gmxCodelists.xml//CI_DateTypeCode");
 	$CI_DateTypeCode->setAttribute("codeListValue","publication");
 	$CI_DateTypeCodeText=$iso19139->createTextNode("publication");
 	
@@ -910,15 +919,16 @@
 		echo $xml;
 		die();
 	}
+
 	//function to validate against the inspire validation service
 	function validateInspireMetadata($iso19139Doc, $recordId){
 		$validatorUrl = 'http://www.inspire-geoportal.eu/INSPIREValidatorService/resources/validation/inspire';
-		#$validatorUrl2 = 'http://localhost/mapbender/x_geoportal/log_requests.php';
+		//$validatorUrl2 = 'http://localhost/mapbender/x_geoportal/log_requests.php';
 		//send inspire xml to validator and push the result to requesting user
 		$validatorInterfaceObject = new connector();
 		$validatorInterfaceObject->set('httpType','POST');
-		#$validatorInterfaceObject->set('httpContentType','application/xml');
-		$validatorInterfaceObject->set('httpContentType','multipart/form-data'); # maybe given automatically
+		//$validatorInterfaceObject->set('httpContentType','application/xml');
+		$validatorInterfaceObject->set('httpContentType','multipart/form-data'); // maybe given automatically
 		$xml = fillISO19139($iso19139Doc, $recordId);
 		//first test with data from ram - doesn't function 
 		$fields = array(
@@ -935,18 +945,18 @@
 		}
 		//send file as post like described under http://www.tecbrat.com/?itemid=13&catid=1
 		$fields['dataFile']='@'.TMPDIR.'/'.$fileId.'iso19139_validate_tmp.xml';
-		#if we give a string with parameters
-		#foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } 
-		#rtrim($fields_string,'&');
-		#$postData = $fields_string;
+		//if we give a string with parameters
+		//foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; } 
+		//rtrim($fields_string,'&');
+		//$postData = $fields_string;
 		$postData = $fields;
-		#$e = new mb_exception("mod_layerISOMetadata: postData: ".$postData['dataFile']);
+		//$e = new mb_exception("mod_layerISOMetadata: postData: ".$postData['dataFile']);
 		//number of post fields:
 		//curl_setopt($ch,CURLOPT_POST,count($fields));
 		$validatorInterfaceObject->set('httpPostFieldsNumber',count($postData));
 		$validatorInterfaceObject->set('curlSendCustomHeaders',false);
 		//$validatorInterfaceObject->set('httpPostData', $postData);
-		$validatorInterfaceObject->set('httpPostData', $postData); #give an array
+		$validatorInterfaceObject->set('httpPostData', $postData); //give an array
 		$validatorInterfaceObject->load($validatorUrl);
 		header("Content-type: text/html; charset=UTF-8");
 		echo $validatorInterfaceObject->file;
@@ -1000,7 +1010,7 @@
 }
 
 
-//do the things which had to be done ;-)
+//do all the other things which had to be done ;-)
 if ($_REQUEST['VALIDATE'] == "true"){
 	validateInspireMetadata($iso19139Doc, $recordId);
 } else {



More information about the Mapbender_commits mailing list