[Mapbender-commits] r7766 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Apr 12 11:14:39 EDT 2011
Author: armin11
Date: 2011-04-12 08:14:39 -0700 (Tue, 12 Apr 2011)
New Revision: 7766
Modified:
trunk/mapbender/http/php/mod_layerISOMetadata.php
trunk/mapbender/http/php/mod_showMetadata.php
trunk/mapbender/http/php/wms.php
Log:
Adoptions for fulfill the Implementation Requirement 6 of the INSPIRE View Service Guidance Paper V3.0.
Modified: trunk/mapbender/http/php/mod_layerISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_layerISOMetadata.php 2011-04-12 12:30:43 UTC (rev 7765)
+++ trunk/mapbender/http/php/mod_layerISOMetadata.php 2011-04-12 15:14:39 UTC (rev 7766)
@@ -691,7 +691,7 @@
$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?layer_id=".$mapbenderMetadata['layer_id']."");
+ $gmd_URLText=$iso19139->createTextNode("http://".$_SERVER['HTTP_HOST']."/mapbender/php/wms.php?inspire=1&layer_id=".$mapbenderMetadata['layer_id']."");
}
else {
$gmd_URLText=$iso19139->createTextNode("https://".$_SERVER['HTTP_HOST']."/http_auth/".$mapbenderMetadata['layer_id']."?");
@@ -734,7 +734,7 @@
$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?layer_id=".$mapbenderMetadata['layer_id']."");
+ $gmd_URLText=$iso19139->createTextNode("http://".$_SERVER['HTTP_HOST']."/mapbender/php/wms.php?inspire=1&layer_id=".$mapbenderMetadata['layer_id']."");
}
else {
$gmd_URLText=$iso19139->createTextNode("https://".$_SERVER['HTTP_HOST']."/http_auth/".$mapbenderMetadata['layer_id']."?");
Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php 2011-04-12 12:30:43 UTC (rev 7765)
+++ trunk/mapbender/http/php/mod_showMetadata.php 2011-04-12 15:14:39 UTC (rev 7766)
@@ -171,6 +171,7 @@
$translation['inspireMetadata'] = 'INSPIRE Service Metadaten';
$translation['showInspireMetadata'] = 'Metadatendatei';
$translation['securedCapabilities'] = 'Secured Capabilities URL';
+ $translation['inspireCapabilities'] = 'INSPIRE Capabilities URL';
$translation['capabilities'] = 'Link zum Capabilities Dokument';
$translation['inspireMetadataValidation'] = 'Validierung gegen INSPIRE Geoportal';
$translation['showInspireMetadataValidation'] = 'Validierung starten';
@@ -230,6 +231,7 @@
$translation['wgs84BboxGraphic'] = 'Map View';
$translation['mapbenderCapabilities'] = 'Geoportal Capabilities';
$translation['originalCapabilities'] = 'Original Capabilities';
+ $translation['inspireCapabilities'] = 'INSPIRE Capabilities URL';
$translation['describeFeaturetype'] = 'Dataschema';
$translation['kml'] = 'KML';
$translation['inspireMetadata'] = 'INSPIRE Service Metadata';
@@ -299,6 +301,7 @@
$translation['inspireMetadata'] = 'INSPIRE Service Metadata';
$translation['showInspireMetadata'] = 'Metadatendatei';
$translation['securedCapabilities'] = 'Secured Capabilities URL';
+ $translation['inspireCapabilities'] = 'INSPIRE Capabilities URL';
$translation['capabilities'] = 'Link zum Capabilities Dokument';
$translation['inspireMetadataValidation'] = 'Validation against INSPIRE Geoportal';
$translation['showInspireMetadataValidation'] = 'Start Validation';
@@ -992,6 +995,7 @@
if ($resource == 'wms' or $resource == 'layer'){
$html .= $t_a.$translation['mapbenderCapabilities'].$t_b."<a href = '../php/wms.php?layer_id=".$layerId."&PHPSESSID=".session_id()."&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS' target=_blank>".$translation['capabilities']."</a>".$t_c;
$html .= $t_a.$translation['originalCapabilities'].$t_b."<a href = '".$resourceMetadata['wms_getcapabilities']."&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS' target=_blank>".$translation['capabilities']."</a>".$t_c;
+ $html .= $t_a.$translation['inspireCapabilities'].$t_b."<a href = '../php/wms.php?layer_id=".$layerId."&PHPSESSID=".session_id()."&INSPIRE=1&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS' target=_blank>".$translation['capabilities']."</a>".$t_c;
$html .= $t_a.$translation['inspireMetadata'].$t_b."<a href='../php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=". $layerId."' target=_blank ><img style='border: none;' src='../img/inspire_tr_36.png' title='".$translation['inspireMetadata']."' style='width:34px;height:34px' alt='' /></a>".$t_c;
$html .= $t_a.$translation['inspireMetadataValidation'].$t_b."<a href='../php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=".$layerId."&validate=true' target=_blank title='".$translation['inspireMetadataValidation']."'>".$translation['showInspireMetadataValidation']."</a>".$t_c;
Modified: trunk/mapbender/http/php/wms.php
===================================================================
--- trunk/mapbender/http/php/wms.php 2011-04-12 12:30:43 UTC (rev 7765)
+++ trunk/mapbender/http/php/wms.php 2011-04-12 15:14:39 UTC (rev 7766)
@@ -1,6 +1,6 @@
<?php
-# $Id: mb_listGUIs.php 11 2006-07-31 16:22:36Z rothstein $
-# http://www.mapbender.org/index.php/mb_listGUIs.php
+# $Id: wms.php
+# http://www.mapbender.org/index.php/wms.php
# Copyright (C) 2002 CCGIS
#
# This program is free software; you can redistribute it and/or modify
@@ -33,14 +33,22 @@
$service = strtoupper($_GET["SERVICE"]);
$layerId = $_GET["LAYER_ID"];
$updateSequence = intval($_GET["UPDATESEQUENCE"]);
+$inspire = $_GET["INSPIRE"];
+if (isset($inspire) && $inspire === 1 ) {
+ $inspire = true;
+}
+
$mapbenderMetadaUrl = $_SERVER['HTTP_HOST']."/mapbender/php/mod_showMetadata.php?resource=layer&id=";
+$inspireServiceMetadataUrl = $_SERVER['HTTP_HOST']."/mapbender/php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=";
+//http://www.geoportal.rlp.de/mapbender/php/mod_layerISOMetadata.php?SERVICE=WMS&outputFormat=iso19139&Id=24615
if (isset($_SERVER["HTTPS"])){
$urlPrefix = "https://";
} else {
$urlPrefix = "http://";
}
$mapbenderMetadataUrl = $urlPrefix.$mapbenderMetadataUrl;
+$inspireServiceMetadataUrl = $urlPrefix.$inspireServiceMetadataUrl;
$con = db_connect(DBSERVER,OWNER,PW);
db_select_db(DB,$con);
@@ -182,6 +190,10 @@
#Creating the "WMT_MS_Capabilities" node
$wmt_ms_capabilities = $doc->createElement("WMT_MS_Capabilities");
$wmt_ms_capabilities->setAttribute("updateSequence", $wms_row["wms_timestamp"]);
+if ($inspire){
+ $wmt_ms_capabilities->setAttribute("xmlns:inspire_common", "http://inspire.ec.europa.eu/schemas/inspire/1.0");
+ $wmt_ms_capabilities->setAttribute("xmlns:inspire_vs", "http://inspire.ec.europa.eu/schemas/inspire_vs/1.0");
+}
$wmt_ms_capabilities = $doc->appendChild($wmt_ms_capabilities);
$wmt_ms_capabilities->setAttribute('version', '1.1.1');
@@ -395,7 +407,7 @@
}
-#Creatig the "Capability" node
+#Creating the "Capability" node
$capability = $doc->createElement("Capability");
$capability = $wmt_ms_capabilities->appendChild($capability);
@@ -601,8 +613,62 @@
$formatText = $doc->createTextNode($wms_format_row['data_format']);
$formatText = $format->appendChild($formatText);
}
-
################################################################
+#INSPIRE
+if ($inspire) {
+ #generating the vendor specific node
+ $vendorSpecificCapabilities = $doc->createElement("VendorSpecificCapabilities");
+ $vendorSpecificCapabilities = $capability->appendChild($vendorSpecificCapabilities);
+ #generate inspire_vs:ExtendedCapabilities node
+ $inspire_vs_ExtendedCapabilities = $doc->createElement("inspire_vs:ExtendedCapabilities");
+ $inspire_vs_ExtendedCapabilities->setAttribute("xmlns:inspire_common", "http://inspire.ec.europa.eu/schemas/common/1.0");
+ $inspire_vs_ExtendedCapabilities = $vendorSpecificCapabilities->appendChild($inspire_vs_ExtendedCapabilities);
+ #generate inspire_vs: node
+ #$inspire_vs_ExtendedCapabilities = $doc->createElement("inspire_vs:ExtendedCapabilities");
+ #$inspire_vs_ExtendedCapabilities = $vendorSpecificCapabilities->appendChild($inspire_vs_ExtendedCapabilities);
+ #MetadataUrl to inspire service metadata
+ $inspire_common_MetadataUrl = $doc->createElement("inspire_common:MetadataUrl");
+ $inspire_common_MetadataUrl = $inspire_vs_ExtendedCapabilities->appendChild($inspire_common_MetadataUrl);
+ #URL
+ $inspire_common_URL = $doc->createElement("inspire_common:URL");
+ $inspire_common_URLText = $doc->createTextNode($inspireServiceMetadataUrl.$layerId);
+ $inspire_common_URL->appendChild($inspire_common_URLText);
+ $inspire_common_URL = $inspire_common_MetadataUrl->appendChild($inspire_common_URL);
+ #MediaType
+ $inspire_common_MediaType = $doc->createElement("inspire_common:MediaType");
+ $inspire_common_MediaTypeText = $doc->createTextNode('application/vnd.iso.19139+xml');#from http://inspire.ec.europa.eu/schemas/inspire_vs/1.0/examples/WMS_Image2000GetCapabilities_InspireSchema.xml
+ $inspire_common_MediaType->appendChild($inspire_common_MediaTypeText);
+ $inspire_common_MediaType = $inspire_common_MetadataUrl->appendChild($inspire_common_MediaType);
+ #Language Part
+ #SupportedLanguages
+ $inspire_common_SupportedLanguages = $doc->createElement("inspire_common:SupportedLanguages");
+ $inspire_common_SupportedLanguages = $inspire_vs_ExtendedCapabilities->appendChild($inspire_common_SupportedLanguages);
+ #DefaultLanguage
+ $inspire_common_DefaultLanguage = $doc->createElement("inspire_common:DefaultLanguage");
+ $inspire_common_DefaultLanguage = $inspire_common_SupportedLanguages->appendChild($inspire_common_DefaultLanguage);
+ #Language
+ $inspire_common_Language = $doc->createElement("inspire_common:Language");
+ $inspire_common_LanguageText = $doc->createTextNode('ger');
+ $inspire_common_Language->appendChild($inspire_common_LanguageText);
+ $inspire_common_Language = $inspire_common_DefaultLanguage->appendChild($inspire_common_Language);
+ #SupportedLanguage
+ $inspire_common_SupportedLanguage = $doc->createElement("inspire_common:SupportedLanguage");
+ $inspire_common_SupportedLanguage = $inspire_common_SupportedLanguages->appendChild($inspire_common_SupportedLanguage);
+ #Language
+ $inspire_common_Language = $doc->createElement("inspire_common:Language");
+ $inspire_common_LanguageText = $doc->createTextNode('ger');
+ $inspire_common_Language->appendChild($inspire_common_LanguageText);
+ $inspire_common_Language = $inspire_common_SupportedLanguage->appendChild($inspire_common_Language);
+ #ResponseLanguage
+ $inspire_common_ResponseLanguage = $doc->createElement("inspire_common:ResponseLanguage");
+ $inspire_common_ResponseLanguage = $inspire_vs_ExtendedCapabilities->appendChild($inspire_common_ResponseLanguage);
+ #Language
+ $inspire_common_Language = $doc->createElement("inspire_common:Language");
+ $inspire_common_LanguageText = $doc->createTextNode('ger');
+ $inspire_common_Language->appendChild($inspire_common_LanguageText);
+ $inspire_common_Language = $inspire_common_ResponseLanguage->appendChild($inspire_common_Language);
+}
+################################################################
#Querying layer table
$layer_sql = "SELECT * FROM layer WHERE layer.fkey_wms_id = $1 AND layer.layer_parent = ''";
$v = array($wms_row['wms_id']);
More information about the Mapbender_commits
mailing list