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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Feb 23 03:23:17 PST 2016


Author: armin11
Date: 2016-02-23 03:23:16 -0800 (Tue, 23 Feb 2016)
New Revision: 9406

Added:
   trunk/mapbender/http/php/mod_exportIso19139.php
Modified:
   trunk/mapbender/http/php/mod_showMetadata.php
Log:
New script to allow export of external iso19139 files into different formats

Added: trunk/mapbender/http/php/mod_exportIso19139.php
===================================================================
--- trunk/mapbender/http/php/mod_exportIso19139.php	                        (rev 0)
+++ trunk/mapbender/http/php/mod_exportIso19139.php	2016-02-23 11:23:16 UTC (rev 9406)
@@ -0,0 +1,38 @@
+<?php
+//http://localhost/mb_trunk/php/mod_exportIso19139ToHtml.php?url=http%3A%2F%2Fwww.geoportal.rlp.de%2Fmetadata%2Fdtk5.xml
+# License:
+# Copyright (c) 2009, Open Source Geospatial Foundation
+# This program is dual licensed under the GNU General Public License 
+# and Simplified BSD license.  
+# http://svn.osgeo.org/mapbender/trunk/mapbender/license/license.txt
+require_once dirname(__FILE__) . "/../../core/globalSettings.php";
+require_once dirname(__FILE__) . "/../classes/class_iso19139.php";
+//show html from a given url
+$url = urldecode($_REQUEST['url']);
+$outputFormat = 'html';
+if (isset($_REQUEST["outputFormat"]) & $_REQUEST["outputFormat"] != "") {
+	//validate to de, en, fr
+	$testMatch = $_REQUEST["outputFormat"];	
+ 	if (!($testMatch == 'html' or $testMatch == 'rdf')){ 
+		//echo 'languageCode: <b>'.$testMatch.'</b> is not valid.<br/>'; 
+		echo 'Parameter <b>outputFormat</b> is not valid (html,rdf).<br/>'; 
+		die(); 		
+ 	}
+	$outputFormat = $testMatch;
+	$testMatch = NULL;
+}
+$mbMetadata = new Iso19139();
+$mbMetadata->readFromUrl($url);
+switch ($outputFormat) {
+	case "html":
+		$html = $mbMetadata->transformToHtml('tabs','de');
+		header("Content-type: text/html; charset=UTF-8");
+		echo $html;
+	break;
+	case "rdf":
+		$rdf =  $mbMetadata->transformToRdf();
+		header("Content-type: text/xml; charset=UTF-8");
+		echo $rdf;
+	break;
+}
+?>

Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php	2016-02-23 08:55:19 UTC (rev 9405)
+++ trunk/mapbender/http/php/mod_showMetadata.php	2016-02-23 11:23:16 UTC (rev 9406)
@@ -1125,7 +1125,7 @@
 			$mapbenderUrl = "http://www.geoportal.rlp.de/mapbender";
 		}
 		//$metadataList .= "<a href='../php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row["uuid"]."'>".$row["uuid"]."</a> <a href='../php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row["uuid"]."&validate=true'>".$translation['validate']."</a>";
-		$metadataList .= "<a href='../php/mod_iso19139ToHtml.php?url=".urlencode($mapbenderUrl."/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row["uuid"])."'>".$row["uuid"]."</a> <a href='../php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row["uuid"]."&validate=true'>".$translation['validate']."</a>"." <a href='../php/mod_dataISOMetadata.php?outputFormat=rdf&id=".$row["uuid"]."&CN=false'><img style='border: none;' src='../img/rdf_w3c_icon.48.gif' title='".$translation['inspireMetadata']." - RDF/XML (BETA)"."' style='width:34px;height:34px' alt='' /></a>";
+		$metadataList .= "<a href='../php/mod_exportIso19139.php?url=".urlencode($mapbenderUrl."/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row["uuid"])."'>".$row["uuid"]."</a> <a href='../php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$row["uuid"]."&validate=true'>".$translation['validate']."</a>"." <a href='../php/mod_dataISOMetadata.php?outputFormat=rdf&id=".$row["uuid"]."&CN=false'><img style='border: none;' src='../img/rdf_w3c_icon.48.gif' title='".$translation['inspireMetadata']." - RDF/XML (BETA)"."' style='width:34px;height:34px' alt='' /></a>";
 		
 		if ($downloadOptions != null) {
 			foreach ($downloadOptions->{$row["uuid"]}->option as $option) {



More information about the Mapbender_commits mailing list