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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Apr 10 05:05:25 PDT 2013


Author: armin11
Date: 2013-04-10 05:05:24 -0700 (Wed, 10 Apr 2013)
New Revision: 8598

Modified:
   trunk/mapbender/http/php/mod_dataISOMetadata.php
Log:
Forgot some other validation

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2013-04-10 11:56:40 UTC (rev 8597)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2013-04-10 12:05:24 UTC (rev 8598)
@@ -102,7 +102,8 @@
 		//generate the xml on the fly - there is no need to store it as xml in the database
 		//do the things which had to be done ;-)
 		if ($_REQUEST['VALIDATE'] == "true"){
-			validateInspireMetadata($iso19139Doc, $recordId); //calls fillISO19139 to!
+			$xml = fillISO19139($iso19139Doc, $recordId);
+			validateInspire($xml); //calls fillISO19139 to!
 		} else {
 			pushISO19139($iso19139Doc, $recordId); //throw it out!
 		}
@@ -1421,51 +1422,8 @@
 	return $iso19139->saveXML();
 }
 
-	//function to validate against the inspire validation service
-	function validateInspireMetadata($iso19139Doc, $recordId){
-		$validatorUrl = 'http://inspire-geoportal.ec.europa.eu/INSPIREValidatorService/resources/validation/inspire';
-		#$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
-		$xml = fillISO19139($iso19139Doc, $recordId);
-		//first test with data from ram - doesn't function 
-		$fields = array(
-			'dataFile'=>urlencode($xml)
-			);
-		//generate file identifier:
-		$fileId = guid();
-		//generate temporary file under tmp
-		 if($h = fopen(TMPDIR."/".$fileId."iso19139_validate_tmp.xml","w")){
-			if(!fwrite($h,$xml)){
-				$e = new mb_exception("mod_layerISOMetadata: cannot write to file: ".TMPDIR."iso19139_validate_tmp.xml");
-			}
-		fclose($h);
-		}
-		//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;
-		$postData = $fields;
-		#$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->load($validatorUrl);
-		header("Content-type: text/html; charset=UTF-8");
-		echo $validatorInterfaceObject->file;
-		//delete file in tmp 
-		//TODO - this normally done by a cronjob
-		die();
-	}
 
+
 function getEpsgByLayerId ($layer_id) { // from merge_layer.php
 	$epsg_list = "";
 	$sql = "SELECT DISTINCT epsg FROM layer_epsg WHERE fkey_layer_id = $1";
@@ -1477,6 +1435,7 @@
 	}
 	return trim($epsg_list);
 }
+
 function getEpsgArrayByLayerId ($layer_id) { // from merge_layer.php
 	//$epsg_list = "";
 	$epsg_array=array();



More information about the Mapbender_commits mailing list