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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 24 05:47:31 EDT 2010


Author: armin11
Date: 2010-08-24 09:47:30 +0000 (Tue, 24 Aug 2010)
New Revision: 6799

Modified:
   trunk/mapbender/http/php/mod_callMetadata.php
   trunk/mapbender/http/php/mod_getServiceDisclaimer.php
   trunk/mapbender/http/php/tagCloud.php
Log:
Update mapbender metadataserver component

Modified: trunk/mapbender/http/php/mod_callMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_callMetadata.php	2010-08-24 09:44:38 UTC (rev 6798)
+++ trunk/mapbender/http/php/mod_callMetadata.php	2010-08-24 09:47:30 UTC (rev 6799)
@@ -13,8 +13,8 @@
 #http://www.geoportal.rlp.de/mapbender/php/mod_callMetadata.php?searchId=wa&searchText=e&outputFormat=json&languageCode=de&resultTarget=debug&searchResources=wms&maxResults=5&registratingDepartments=44,31&inspireThemes=11&isoCategories=5,10&searchBbox=7,48,9,51
 #http://www.geoportal.rlp.de/mapbender/php/mod_callMetadata.php?searchId=wa&searchText=e&outputFormat=json&languageCode=de&resultTarget=debug&searchResources=wms&maxResults=99&registratingDepartments=44,31,52&inspireThemes=11&isoCategories=5,10&searchBbox=7,48,9,51&regTimeBegin=2001-12-24&regTimeEnd=2020-10-10
 #http://www.geoportal.rlp.de/mapbender/php/mod_callMetadata.php?searchId=wa&outputFormat=json&languageCode=de&resultTarget=debug&searchResources=wms&maxResults=99&registratingDepartments=44,31,52&inspireThemes=11&isoCategories=5,10&searchBbox=7,48,9,51&regTimeBegin=2001-12-24&regTimeEnd=2020-10-10
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
-require_once(dirname(__FILE__)."/../../conf/geoportal.conf");
+require_once(dirname(__FILE__)."/../../core/globalSettings.php");
+require_once(dirname(__FILE__)."/../../conf/geoportal.conf");#???
 require_once(dirname(__FILE__)."/../classes/class_metadata_new.php");
 require_once(dirname(__FILE__)."/../classes/class_json.php");
 session_start();
@@ -55,10 +55,8 @@
 $searchURL = urldecode($searchURL);
 //control if some request variables are not set and set them explicit to NULL
 
-
 $checkForNullRequests = array("registratingDepartments","isoCategories","inspireThemes","customCategories","regTimeBegin","regTimeEnd","timeBegin","timeEnd","searchBbox","searchTypeBbox","searchResources","orderBy","hostName");
 
-
 for($i=0; $i < count($checkForNullRequests); $i++){
 	if (!$_REQUEST[$checkForNullRequests[$i]] or $_REQUEST[$checkForNullRequests[$i]] == 'false' or $_REQUEST[$checkForNullRequests[$i]] == 'undefined') {
 		$_REQUEST[$checkForNullRequests[$i]] = "";
@@ -66,10 +64,6 @@
 	}
 }
 
-
-
-
-
 //Read out request Parameter:
 if (isset($_REQUEST["searchId"]) & $_REQUEST["searchId"] != "") {
 	//gernerate md5 representation, cause the id is used as a filename later on! - no validation needed
@@ -214,7 +208,7 @@
 		echo 'searchTypeBbox: <b>'.$testMatch.'</b> is not valid.<br/>'; 
 		die(); 		
  	}
-	#$searchTypeBbox = $testMatch; //TODO activate this
+	$searchTypeBbox = $testMatch; //TODO activate this
 	$testMatch = NULL;
 }
 if (isset($_REQUEST["accessRestrictions"]) & $_REQUEST["accessRestrictions"] != "") {
@@ -271,7 +265,7 @@
  	} else {
 		$testArray = explode(',',$testMatch);
 		for($i=0; $i<count($testArray);$i++){
-			if (!($testArray[$i] == 'wms' or $testArray[$i] == 'wfs' or $testArray[$i] == 'wmc' or $testArray[$i] == 'georss')) {
+			if (!($testArray[$i] == 'wms' or $testArray[$i] == 'wfs' or $testArray[$i] == 'wmc' or $testArray[$i] == 'daData')) {
 			echo 'searchResources: <b>'.$testMatch.'</b>at least one of them does not exists!<br/>'; 
 			die();
 			}
@@ -359,8 +353,8 @@
 
 if ($resultTarget == 'file') {
 	if (!isset($searchResources) OR ($searchResources == "")) {
-		$searchResources = "wms,wfs";
-		$searchPages = "1,1";
+		$searchResources = "wms,wfs,wmc";
+		$searchPages = "1,1,1";
 	}
 
 }
@@ -542,7 +536,7 @@
 		#$resourceCategories[0]['wms'] = 'WMS';
 		#$resourceCategories[1]['wfs'] = 'WFS';
 		#$resourceCategories[2]['wmc'] = 'WMC';
-		#$resourceCategories[3]['georss'] = 'GeoRSS';
+		#$resourceCategories[3]['georss'] = 'directAccessData';
 		
 
 switch($languageCode){
@@ -557,9 +551,9 @@
 		$classificationElements[7]['name2show'] = 'Registrierung/Aktualisierung bis:';
 
 		$resourceCategories['wms'] = 'Darstellungsdienste';
-		$resourceCategories['wfs'] = 'Such- und Downloaddienste';
+		$resourceCategories['wfs'] = 'Such- und Download- und Erfassungsmodule';
 		$resourceCategories['wmc'] = 'Kartenzusammenstellungen';
-		$resourceCategories['georss'] = 'Geokodierte Newsfeeds';
+		$resourceCategories['georss'] = 'KML/Newsfeeds';
 
 		$orderByTitle['header'] = 'Sortierung nach:';
 		$orderByTitle['id'] = 'ID';
@@ -582,7 +576,7 @@
 		$resourceCategories['wms'] = 'Viewingservices';
 		$resourceCategories['wfs'] = 'Search- and Downloadservices';
 		$resourceCategories['wmc'] = 'Combined Maps';
-		$resourceCategories['georss'] = 'Geocodet Newsfeeds';
+		$resourceCategories['georss'] = 'KML/Newsfeeds';
 
 		$orderByTitle['header'] = 'Sort by:';
 		$orderByTitle['id'] = 'ID';
@@ -604,7 +598,7 @@
 		$resourceCategories['wms'] = 'Viewingservices';
 		$resourceCategories['wfs'] = 'Search- and Downloadservices';
 		$resourceCategories['wmc'] = 'Combined Maps';
-		$resourceCategories['georss'] = 'Geocodet Newsfeeds';
+		$resourceCategories['georss'] = 'KML/Newsfeeds';
 
 		$orderByTitle['header'] = 'Sort by:';
 		$orderByTitle['id'] = 'identification';
@@ -626,7 +620,7 @@
 		$resourceCategories['wms'] = 'Darstellungsdienste';
 		$resourceCategories['wfs'] = 'Such- und Downloaddienste';
 		$resourceCategories['wmc'] = 'Kartenzusammenstellungen';
-		$resourceCategories['georss'] = 'Geokodierte Newsfeeds';
+		$resourceCategories['georss'] = 'KML/Newsfeeds';
 
 		$orderByTitle['header'] = 'Sortierung nach:';
 		$orderByTitle['id'] = 'ID';
@@ -931,4 +925,4 @@
 //searchid_georss_cat.json - doesn't exists till now
 //searchid_filter.json
 
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/php/mod_getServiceDisclaimer.php
===================================================================
--- trunk/mapbender/http/php/mod_getServiceDisclaimer.php	2010-08-24 09:44:38 UTC (rev 6798)
+++ trunk/mapbender/http/php/mod_getServiceDisclaimer.php	2010-08-24 09:47:30 UTC (rev 6799)
@@ -2,7 +2,7 @@
 //http://www.geoportal.rlp.de/mapbender/php/mod_getServiceDisclaimer.php?type=wms&id=1501
 //include relevant scripts
 //
-require_once(dirname(__FILE__)."/../../conf/mapbender.conf");
+require_once(dirname(__FILE__)."/../../core/globalSettings.php");
 require_once(dirname(__FILE__)."/../classes/class_json.php");
 require_once(dirname(__FILE__)."/../classes/class_administration.php"); //TODO: include some class which can do the db connects
 
@@ -228,4 +228,4 @@
 echo "No information for disclaimer available!";
 }
 
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/php/tagCloud.php
===================================================================
--- trunk/mapbender/http/php/tagCloud.php	2010-08-24 09:44:38 UTC (rev 6798)
+++ trunk/mapbender/http/php/tagCloud.php	2010-08-24 09:47:30 UTC (rev 6799)
@@ -1,6 +1,6 @@
 <?php
-session_start();
-include(dirname(__FILE__)."/../../conf/mapbender.conf");
+#session_start();
+require_once(dirname(__FILE__)."/../../core/globalSettings.php");
 require_once(dirname(__FILE__)."/../classes/class_json.php");
 #include(dirname(__FILE__)."/../php/mb_validateSession.php");
 $con = db_connect(DBSERVER,OWNER,PW);
@@ -10,7 +10,7 @@
 $maxFontSize = 40;
 $maxObjects = 10;
 $outputFormat = 'html';
-
+$hostName = $_SERVER['HTTP_HOST'];
 //read out information from database:
 
 if (isset($_REQUEST["type"]) & $_REQUEST["type"] != "") {
@@ -70,6 +70,17 @@
 	$testMatch = NULL;
 }
 
+//
+if (isset($_REQUEST["hostName"]) & $_REQUEST["hostName"] != "") {
+	//validate to some hosts
+	$testMatch = $_REQUEST["hostName"];	
+ 	if (!($testMatch == 'www.geoportal.rlp' or $testMatch == 'www.geoportal.rlp.de' or  $testMatch == 'www.gdi-rp-dienste3.rlp.de' or  $testMatch == '10.7.101.151')){ 
+		echo 'hostName: <b>'.$testMatch.'</b> is not a valid server of gdi-rp.<br/>'; 
+		die(); 		
+ 	}
+	$hostName = $testMatch;
+	$testMatch = NULL;
+}
 
 
 
@@ -120,10 +131,10 @@
 		$maxWeight = (integer)$row['sum'];
 	} 
 	if ($type == 'topicCategories') {
-		$tags[$i] = array('weight'  =>$row['sum'], 'tagname' =>$row[$showName], 'url'=>'http://'.$_SERVER['HTTP_HOST'].$pathToSearchScript.urlencode('searchText=e&resultTarget=file&outputFormat=json&isoCategories='.$row['md_topic_category_id'].'&languageCode='.$languageCode));
+		$tags[$i] = array('weight'  =>$row['sum'], 'tagname' =>$row[$showName], 'url'=>'http://'.$hostName.$pathToSearchScript.urlencode('searchText=e&resultTarget=file&outputFormat=json&isoCategories='.$row['md_topic_category_id'].'&languageCode='.$languageCode));
 	}
 	if ($type == 'keywords') {
-		$tags[$i] = array('weight'  =>$row['sum'], 'tagname' =>$row[$showName], 'url'=>'http://'.$_SERVER['HTTP_HOST'].$pathToSearchScript.urlencode('searchText='.$row[$showName].'&resultTarget=file&outputFormat=json&languageCode='.$languageCode));
+		$tags[$i] = array('weight'  =>$row['sum'], 'tagname' =>$row[$showName], 'url'=>'http://'.$hostName.$pathToSearchScript.urlencode('searchText='.$row[$showName].'&resultTarget=file&outputFormat=json&languageCode='.$languageCode));
 	}
 
 	$i++;
@@ -175,6 +186,7 @@
 		'maxObjects' => $maxObjects,
 		'tags' => array()
 	);
+	shuffle($tags);
 	for($i=0; $i<count($tags);$i++){
     		$tagCloudJSON->tagCloud->tags[$i]->title = $tags[$i]['tagname'];
 		$tagCloudJSON->tagCloud->tags[$i]->url = $tags[$i]['url'];
@@ -223,4 +235,4 @@
 
 
 
-?>
\ No newline at end of file
+?>



More information about the Mapbender_commits mailing list