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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Oct 12 10:25:33 EDT 2010


Author: armin11
Date: 2010-10-12 07:25:33 -0700 (Tue, 12 Oct 2010)
New Revision: 7041

Modified:
   trunk/mapbender/http/php/mod_showMetadata.php
Log:
some adoptions for show wmc metadata

Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php	2010-10-12 09:19:53 UTC (rev 7040)
+++ trunk/mapbender/http/php/mod_showMetadata.php	2010-10-12 14:25:33 UTC (rev 7041)
@@ -31,7 +31,7 @@
 if (isset($_REQUEST["resource"]) & $_REQUEST["resource"] != "") {
 	//validate to csv integer list
 	$testMatch = $_REQUEST["resource"];
-	if (!($testMatch == 'wms' or $testMatch == 'layer' or $testMatch == 'wfs' or $testMatch == 'featuretype' or $testMatch == 'wfs-conf')){ 
+	if (!($testMatch == 'wms' or $testMatch == 'layer' or $testMatch == 'wfs' or $testMatch == 'featuretype' or $testMatch == 'wfs-conf'  or $testMatch == 'wmc')){ 
 		echo 'resource: <b>'.$testMatch.'</b> is not valid.<br/>'; 
 		die(); 		
  	}
@@ -155,6 +155,7 @@
 		$translation['statusChanged'] = 'Beschreibung hat sich geändert - Aktualisierung nötig';
 		$translation['statusProblem'] = 'Problem bei letzter Kontrolle';
 		$translation['contactTelephone'] = 'Telefon';
+		$translation['wmc'] = 'Web Map Context Dokument';
 		break;
 	case "en":
 		$translation['overview'] = 'Overview';
@@ -208,6 +209,7 @@
 		$translation['statusChanged'] = 'Description changed - update necessary';
 		$translation['statusProblem'] = 'Problem at last control';
 		$translation['contactTelephone'] = 'Telephon';
+		$translation['wmc'] = 'Web Map Context document';
 		break;
 	default: #to english
 		$translation['overview'] = 'Overview';
@@ -261,6 +263,7 @@
 		$translation['statusChanged'] = 'Description changed - update necessary';
 		$translation['statusProblem'] = 'Problem at last control';
 		$translation['contactTelephone'] = 'Telephon';
+		$translation['wmc'] = 'Web Map Context document';
 }
 
 //Array with infos about the different elements which are shown in the tabs
@@ -325,8 +328,17 @@
 		die(); 	
 		break;
 	case "wmc":
-		echo 'Not yet implemented!'; 
-		die(); 	
+		$wmcId = $id;
+		$sql = "SELECT ";
+		$sql .= "mb_user_wmc.wmc_serial_id as contentid, mb_user_wmc.wmc_title as contenttitle, mb_user_wmc.abstract as contentabstract, mb_user_wmc.minx,mb_user_wmc.miny,mb_user_wmc.maxx,mb_user_wmc.maxy,mb_user_wmc.srs, ";
+		$sql .= "mb_user.mb_user_position_name as contactposition, mb_user.mb_user_organisation_name as contactorganization, (mb_user.mb_user_street || ' ' || mb_user.mb_user_housenumber)  as address, mb_user.mb_user_city as city, mb_user_wmc.wmc_timestamp as timestamp, mb_user_wmc.fkey_user_id as owner,";
+		$sql .= "mb_user.mb_user_country as stateorprovince, mb_user.mb_user_postal_code as postcode, mb_user.mb_user_phone as contactvoicetelephone, mb_user.mb_user_phone1 as contactfacsimiletelephone, ";
+		$sql .= "mb_user.mb_user_email as contactelectronicmailaddress ";
+		$sql .= "FROM mb_user_wmc, mb_user WHERE mb_user_wmc.wmc_serial_id = $1 AND mb_user_wmc.fkey_user_id = mb_user.mb_user_id LIMIT 1";
+		$v = array($wmcId);
+		$t = array('i');
+		$serviceType = 'wmc';
+		$resourceSymbol = "<img src='../img/osgeo_graphics/Mapset.png' alt='".$translation['wmc']." - Bild' title='".$translation['wmc']."'> - ".$translation['wmc'];
 		break;
 }
 //read resource information from database
@@ -374,7 +386,7 @@
 //$e = new mb_exception("mod_showMetadata: fkey_mb_group_id from wms or wfs table: ".$resourceMetadata['fkey_mb_group_id']);
 if (!isset($resourceMetadata['fkey_mb_group_id']) or isnull($resourceMetadata['fkey_mb_group_id'])){
 	$e = new mb_notice("mod_showMetadata: fkey_mb_group_id not found!");
-	//Get information about owning user of the relation mb_user_mb_group - alternativly the defined fkey_mb_group_id from the service must be used!
+	//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 metdatapointofcontactorgname, mb_group_title as metdatapointofcontactorgtitle, mb_group_id, mb_group_logo_path  as metdatapointofcontactorglogo, mb_group_address as metdatapointofcontactorgaddress, mb_group_email as metdatapointofcontactorgemail, mb_group_postcode as metdatapointofcontactorgpostcode, mb_group_city as metdatapointofcontactorgcity, mb_group_voicetelephone as metdatapointofcontactorgtelephone, mb_group_facsimiletelephone as metdatapointofcontactorgfax 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 b.mb_user_department = a.mb_group_description LIMIT 1";
 	$vDep = array($resourceMetadata['owner']);
 	$tDep = array('i');
@@ -410,7 +422,9 @@
 	}*/
 	
 }
-
+if ($resource == 'wmc') {
+	$resourceMetadata['preview'] = "<img src = '".PREVIEW_DIR."/".$rowP['wmc_preview_filename']."'>";
+}
 //db select for service quality
 if ($resource == 'wms' or $resource == 'layer') {
 	$sql = "SELECT availability, last_status FROM mb_wms_availability WHERE fkey_wms_id = $1";
@@ -439,7 +453,13 @@
 	}
 	$j = 0;
 }
-
+if ($resource == 'wmc') {
+		$contentBboxes[$j]['epsg'] = $resourceMetadata['srs'];
+		$contentBboxes[$j]['minx'] = $resourceMetadata['minx'];
+		$contentBboxes[$j]['miny'] = $resourceMetadata['miny'];
+		$contentBboxes[$j]['maxx'] = $resourceMetadata['maxx'];
+		$contentBboxes[$j]['maxy'] = $resourceMetadata['maxy'];
+}
 //generate HTML frame
 
 //Give out page
@@ -558,13 +578,14 @@
 if ($resource == 'layer' & $resourceMetadata['contentpos'] == 0) {
 	$resourceSymbol = "<img src='../img/osgeo_graphics/geosilk/server_map.png' alt='".$translation['wms']." - Bild' title='".$translation['wms']."'> - ".$translation['wms'];
 }
+
 $html .= $t_a.$translation['kindOfResource'].$t_b.$resourceSymbol.$t_c;
 
 //identification information:
 $html .= $t_a.$translation['contentId'].$t_b.$resourceMetadata['contentid'].$t_c;
 $html .= $t_a.$translation['serviceId'].$t_b."<a href='".$self."?resource=".$serviceType."&id=".$serviceId."&layout=".$layout."&languageCode=".$languageCode."'>".$serviceId."</a>".$t_c;
 
-if (($resource == 'wms' or $resource == 'layer') and isset($resourceMetadata['preview'])) {
+if (($resource == 'wms' or $resource == 'layer' or $resource == 'wmc' ) and isset($resourceMetadata['preview'])) {
 	$html .= $t_a.$translation['preview'].$t_b.$resourceMetadata['preview'];
 	if (isset($resourceMetadata['legend'])) {
 		$html .= $resourceMetadata['legend'];



More information about the Mapbender_commits mailing list