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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Jan 17 11:15:05 EST 2011


Author: armin11
Date: 2011-01-17 08:15:05 -0800 (Mon, 17 Jan 2011)
New Revision: 7443

Added:
   trunk/mapbender/http/php/mod_showCapDiff.php
Modified:
   trunk/mapbender/http/php/mod_showMetadata.php
Log:
Bugfixes for geoportal.rlp

Added: trunk/mapbender/http/php/mod_showCapDiff.php
===================================================================
--- trunk/mapbender/http/php/mod_showCapDiff.php	                        (rev 0)
+++ trunk/mapbender/http/php/mod_showCapDiff.php	2011-01-17 16:15:05 UTC (rev 7443)
@@ -0,0 +1,44 @@
+<?php
+# $Id: mod_showCapDiff.php 3342 2008-12-16 12:31:26Z mschulz $
+# http://www.mapbender.org/index.php/Monitor_Capabilities
+# 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.
+
+require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../classes/class_administration.php");
+require_once(dirname(__FILE__)."/../classes/class_mb_exception.php");
+$wms_id = intval($_REQUEST["wmsid"]);
+if (isset($wms_id)){
+	if (!is_int($wms_id)) {
+		echo 'Error: wms_id is no integer<br>';
+		die();
+	}
+	} else {
+		echo 'Error: wms_id not requested<br>';
+	die();
+}
+$sql = "SELECT cap_diff FROM mb_wms_availability WHERE fkey_wms_id = $1";
+$v = array($wms_id);
+$t = array('i');
+$res = db_prep_query($sql,$v,$t);
+
+$cap_diff_row = db_fetch_row($res);
+$html = urldecode($cap_diff_row[0]);
+
+echo $html;
+
+
+?>

Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php	2011-01-14 13:23:50 UTC (rev 7442)
+++ trunk/mapbender/http/php/mod_showMetadata.php	2011-01-17 16:15:05 UTC (rev 7443)
@@ -106,8 +106,12 @@
 		$translation['metadata'] = 'Metadaten';
 		$translation['kindOfResource'] = 'Art der Ressource';
 		$translation['wms'] = 'Kartendienst';
+		$translation['wfs'] = 'Datendienst';
 		$translation['layer'] = 'Kartenebene';
+		$translation['featuretype'] = 'Objektart';
+		$translation['geomtype'] = 'Geometrietyp';
 		$translation['contentId'] = 'Resourcenidentifikator';
+		$translation['contentName'] = 'Name der Ressouce';
 		$translation['serviceId'] = 'Informationen zum Dienst';
 		$translation['preview'] = 'Voransicht';
 		$translation['extent'] = 'Ausdehnung';
@@ -138,6 +142,7 @@
 		$translation['wgs84BboxGraphic'] = 'Kartenübersicht';
 		$translation['mapbenderCapabilities'] = 'Geoportal Capabilities';
 		$translation['originalCapabilities'] = 'Original Capabilities';
+		$translation['describeFeaturetype'] = 'Link zum Datenschema';
 		$translation['kml'] = 'KML';
 		$translation['inspireMetadata'] = 'INSPIRE Service Metadaten';
 		$translation['showInspireMetadata'] = 'Metadatendatei';
@@ -164,8 +169,12 @@
 		$translation['metadata'] = 'Metadata';
 		$translation['kindOfResource'] = 'Kind of resource';
 		$translation['wms'] = 'Map Service';
+		$translation['wfs'] = 'Data Service';
 		$translation['layer'] = 'Map Layer';
+		$translation['featuretype'] = 'Featuretype';
+		$translation['geomtype'] = 'Type of geometry';
 		$translation['contentId'] = 'Resourceidentifier';
+		$translation['contentName'] = 'Name of the resource';
 		$translation['serviceId'] = 'Information about the service';
 		$translation['preview'] = 'Preview';
 		$translation['extent'] = 'Extent';
@@ -196,6 +205,7 @@
 		$translation['wgs84BboxGraphic'] = 'Map View';
 		$translation['mapbenderCapabilities'] = 'Geoportal Capabilities';
 		$translation['originalCapabilities'] = 'Original Capabilities';
+		$translation['describeFeaturetype'] = 'Dataschema';
 		$translation['kml'] = 'KML';
 		$translation['inspireMetadata'] = 'INSPIRE Service Metadata';
 		$translation['showInspireMetadata'] = 'Metadatendatei';
@@ -222,8 +232,12 @@
 		$translation['metadata'] = 'Metadata';
 		$translation['kindOfResource'] = 'Kind of resource';
 		$translation['wms'] = 'Map Service';
+		$translation['wfs'] = 'Data Service';
 		$translation['layer'] = 'Map Layer';
+		$translation['featuretype'] = 'Featuretype';
+		$translation['geomtype'] = 'Type of geometry';
 		$translation['contentId'] = 'Resourceidentifier';
+		$translation['contentName'] = 'Name of the resource';
 		$translation['serviceId'] = 'Information about the service';
 		$translation['preview'] = 'Preview';
 		$translation['extent'] = 'Extent';
@@ -254,6 +268,7 @@
 		$translation['wgs84BboxGraphic'] = 'Map View';
 		$translation['mapbenderCapabilities'] = 'Geoportal Capabilities';
 		$translation['originalCapabilities'] = 'Original Capabilities';
+		$translation['describeFeaturetype'] = 'Dataschema';
 		$translation['kml'] = 'KML';
 		$translation['inspireMetadata'] = 'INSPIRE Service Metadata';
 		$translation['showInspireMetadata'] = 'Metadatendatei';
@@ -305,7 +320,7 @@
 	case "layer":
 		$layerId = $id;
 		$sql = "SELECT ";
-		$sql .= "layer.layer_id as contentid, layer.layer_title as contenttitle, layer.layer_abstract as contentabstract, layer.layer_pos as contentpos, layer.layer_parent as contentparent, ";
+		$sql .= "layer.layer_id as contentid, layer.layer_title as contenttitle, layer.layer_abstract as contentabstract, layer.layer_pos as contentpos, layer.layer_parent as contentparent,layer.layer_name as contentname, ";
 		$sql .= "layer.layer_minscale as contentminscale, layer.layer_maxscale as contentmaxscale, layer.layer_queryable,";
 		$sql .= "wms.wms_title as servicetitle, wms.wms_abstract as serviceabstract, wms.wms_id as serviceid, wms.fees, wms.accessconstraints, wms.contactperson,  wms.wms_getcapabilities,";
 		$sql .= "wms.contactposition, wms.contactorganization, wms.address, wms.city, wms_timestamp as timestamp, wms_owner as owner, wms.wms_owsproxy as owsproxy, wms.fkey_mb_group_id,";
@@ -318,14 +333,32 @@
 		$resourceSymbol = "<img src='../img/osgeo_graphics/Layer.png' alt='".$translation['layer']." - Bild' title='".$translation['layer']."'> - ".$translation['layer'];
 		break;
 	case "wfs":
-		echo 'Not yet implemented!'; 
+		$wfsId = $id;
+		$sql = "SELECT ";
+		$sql .= "wfs.wfs_title as servicetitle, wfs.wfs_abstract as serviceabstract, wfs.wfs_id as serviceid,  wfs.wfs_id as contentid,wfs.fees, wfs.accessconstraints, wfs.individualname as contactperson, wfs.wfs_getcapabilities,";
+		$sql .= "wfs.positionname as contactposition, wfs.providername as contactorganization, wfs.deliverypoint as address, wfs.city, wfs_timestamp as timestamp, wfs_owner as owner, wfs.wfs_owsproxy as owsproxy, wfs.fkey_mb_group_id,";
+		$sql .= "wfs.administrativearea as stateorprovince, wfs.postalcode as postcode, wfs.voice as contactvoicetelephone, wfs.facsimile as contactfacsimiletelephone, ";
+		$sql .= "wfs.electronicmailaddress as contactelectronicmailaddress, wfs.country ";
+		$sql .= "FROM wfs WHERE wfs_id = $1";
+		$v = array($wfsId);
+		$t = array('i');
+		$resourceSymbol = "<img src='../img/osgeo_graphics/geosilk/server_vector.png' alt='".$translation['wfs']." - Bild' title='".$translation['wfs']."'> - ".$translation['wfs'];
 		$serviceType = 'wfs';
-		die(); 	
 		break;
 	case "featuretype":
-		echo 'Not yet implemented!'; 
+		$featuretypeId = $id;
+		$sql = "SELECT ";
+		$sql .= "wfs_featuretype.featuretype_id as contentid, wfs_featuretype.featuretype_title as contenttitle, wfs_featuretype.featuretype_abstract as contentabstract, wfs_featuretype.featuretype_name as contentname,wfs_featuretype.featuretype_srs, ";
+		$sql .= "wfs.wfs_title as servicetitle, wfs.wfs_abstract as serviceabstract, wfs.wfs_id as serviceid, wfs.fees, wfs.accessconstraints, wfs.individualname as contactperson, wfs.wfs_getcapabilities, wfs.wfs_describefeaturetype, ";
+		$sql .= "wfs.positionname as contactposition, wfs.providername as contactorganization, wfs.deliverypoint as address, wfs.city, wfs_timestamp as timestamp, wfs_owner as owner, wfs.wfs_owsproxy as owsproxy, wfs.fkey_mb_group_id,";
+		$sql .= "wfs.administrativearea as stateorprovince, wfs.postalcode as postcode, wfs.voice as contactvoicetelephone, wfs.facsimile as contactfacsimiletelephone, ";
+		$sql .= "wfs.electronicmailaddress as contactelectronicmailaddress, wfs.country ";
+		$sql .= "FROM wfs_featuretype, wfs WHERE wfs_featuretype.featuretype_id = $1 AND wfs_featuretype.fkey_wfs_id = wfs.wfs_id LIMIT 1";
+		$v = array($featuretypeId);
+		$t = array('i');
 		$serviceType = 'wfs';
-		die(); 	
+		$resourceSymbol = "<img src='../img/osgeo_graphics/geosilk/vector.png' alt='".$translation['featuretype']." - Bild' title='".$translation['featuretype']."'> - ".$translation['featuretype'];
+		$serviceType = 'wfs';	
 		break;
 	case "wfs-conf":
 		echo 'Not yet implemented!'; 
@@ -347,12 +380,17 @@
 		break;
 }
 //read resource information from database
+//$e = new mb_exception("mod_showMetadata: sql: ".$sql);
 $res = db_prep_query($sql,$v,$t);
+
 $resourceMetadata = db_fetch_array($res);
+
+
 if (!isset($resourceMetadata['contentid']) or ($resourceMetadata['contentid'] == '')) {
 		echo 'No result for the requested id found in the registry!'; 
 		die(); 	
 }
+
 if($resourceMetadata['owsproxy']!='') {
 	$resourceSecured = true;
 }
@@ -407,7 +445,18 @@
 	$resDep = db_prep_query($sqlDep, $vDep, $tDep);
 	$metadataContactGroup = db_fetch_array($resDep);
 }
+//Get Geometry Type if featuretype info was requested
+if ($resource == 'featuretype') {
+	$getTypeSql = "SELECT element_id, element_type from wfs_element WHERE fkey_featuretype_id = $1 AND element_type LIKE '%PropertyType';";
+	$vgetType = array($resourceMetadata['contentid']);
+	$tgetType = array('i');
+	$resGetType = db_prep_query($getTypeSql,$vgetType,$tgetType);
+	$featuretypeElements = db_fetch_array($resGetType);
+	$resourceMetadata['featuretype_geomType'] = $featuretypeElements['element_type'];
+}
 
+
+
 $e = new mb_exception("mod_showMetadata: mb_group_name: ".$metadataContactGroup['mb_group_name']);
 //db select for layer previews
 if ($resource == 'wms' or $resource == 'layer') {
@@ -576,7 +625,11 @@
 }
 $html .= '<p>';
 $html .= $tableBegin;
-$html .= $t_a.$translation['resourceTitle'].$t_b."<em>".displayText($resourceMetadata['contenttitle'])."</em>".$t_c;
+if ($resourceMetadata['contenttitle'] !='') {
+	$html .= $t_a.$translation['resourceTitle'].$t_b."<em>".displayText($resourceMetadata['contenttitle'])."</em>".$t_c;
+} else {
+	$html .= $t_a.$translation['resourceTitle'].$t_b."<em>".displayText($resourceMetadata['servicetitle'])."</em>".$t_c;
+}
 
 //decide if a root layer have been found - then the type will be a server
 #$html .= "<br>".$resourceMetadata['contentpos']."<br>";
@@ -590,6 +643,12 @@
 //identification information:
 $html .= $t_a.$translation['contentId'].$t_b.$resourceMetadata['contentid'].$t_c;
 
+if (isset($resourceMetadata['contentname']) && ($resourceMetadata['contentname'] != '')) {
+	$html .= $t_a.$translation['contentName'].$t_b.$resourceMetadata['contentname'].$t_c;
+}
+
+
+
 if ($resource != 'wmc') {
 	$html .= $t_a.$translation['serviceId'].$t_b."<a href='".$self."?resource=".$serviceType."&id=".$serviceId."&layout=".$layout."&languageCode=".$languageCode."'>".$serviceId."</a>".$t_c;
 }
@@ -610,7 +669,11 @@
 	$html .= $t_a.$translation['contactOrganization'].$t_b."<img src='".$metadataContactGroup['metdatapointofcontactorglogo']."'  height='30'>";
 }
 $html .= displayText($metadataContactGroup['metadatacontactorganization']).$t_c;
-$html .= $t_a.$translation['resourceAbstract'].$t_b.displayText($resourceMetadata['contentabstract']).$t_c;
+if ($resourceMetadata['contentabstract'] != '') {
+	$html .= $t_a.$translation['resourceAbstract'].$t_b.displayText($resourceMetadata['contentabstract']).$t_c;
+} else {
+	$html .= $t_a.$translation['resourceAbstract'].$t_b.displayText($resourceMetadata['serviceabstract']).$t_c;
+}
 
 $user = new User();
 //
@@ -673,7 +736,7 @@
 	}
 }
 $epsgString = '';
-if ($resource != 'wmc') {
+if (($resource == 'wms') || ($resource == 'layer')) {
 	for ($j = 0; $j < count($contentBboxes); $j++) {
 		$epsgString .= $contentBboxes[$j]['epsg']." ";
 		if ($contentBboxes[$j]['epsg'] == 'EPSG:4326') {
@@ -684,6 +747,17 @@
 	}
 $html .= $t_a.$translation['crs'].$t_b.$epsgString.$t_c;
 }
+
+if (($resource == 'featuretype') ) {
+	$epsgString .= $resourceMetadata['featuretype_srs'];
+	$html .= $t_a.$translation['crs'].$t_b.$epsgString.$t_c;
+}
+
+
+
+
+
+
 if ($resource == 'wmc') {
 	$epsgString .= $resourceMetadata['contentcrs']." ";
 	if ($resourceMetadata['contentcrs'] == 'EPSG:4326') {
@@ -735,7 +809,16 @@
 		$html .= $t_a.$translation['minscale'].$t_b. "1 : ".$resourceMetadata['contentmaxscale'].$t_c;	
 	}
 }
+if (isset($resourceMetadata['wfs_describefeaturetype']) && ($resourceMetadata['wfs_describefeaturetype'] != '')) {
+	$html .= $t_a.$translation['describeFeaturetype'].$t_b."<a href='".$resourceMetadata['wfs_describefeaturetype']."REQUEST=DescribeFeaturetype&typename=".$resourceMetadata['contentname']."' >Link</a>".$t_c;
+}
 
+
+
+if (isset($resourceMetadata['featuretype_geomType']) && ($resourceMetadata['featuretype_geomType'] != '')) {
+	$html .= $t_a.$translation['geomtype'].$t_b.$resourceMetadata['featuretype_geomType'].$t_c;
+}
+
 $html .= $tableEnd;
 $html .= '</p>';
 $html .= '</div>';



More information about the Mapbender_commits mailing list