[Mapbender-commits] r9415 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Mar 1 00:32:00 PST 2016
Author: armin11
Date: 2016-03-01 00:32:00 -0800 (Tue, 01 Mar 2016)
New Revision: 9415
Modified:
trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php
Log:
Bugfix for generating ATOM Feed ISO metadata on the fly. If more than one option for download of data is defined use the first option that is available ;-)
Modified: trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php 2016-02-29 14:43:02 UTC (rev 9414)
+++ trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php 2016-03-01 08:32:00 UTC (rev 9415)
@@ -105,7 +105,7 @@
$testMatch = $_REQUEST["GENERATEFROM"];
if ($testMatch != 'wmslayer' && $testMatch != 'dataurl' && $testMatch != 'wfs' && $testMatch != 'metadata'){
//echo 'GENERATEFROM: <b>'.$testMatch.'</b> is not valid.<br/>';
- echo 'Parameter <b>GENERATEFROM</b> is not valid (dataurl,wfs,wmslayer).<br/>';
+ echo 'Parameter <b>GENERATEFROM</b> is not valid (dataurl, wfs, wmslayer, metadata).<br/>';
die();
}
$generateFrom = $testMatch;
@@ -163,16 +163,20 @@
wms.fkey_group_id,
wms.uuid,
dataset identifier*/
+ $foundOption = false;
foreach ($downloadOptions->{$recordId}->option as $option) {
if ($option->type == "wmslayerdataurl") {
$mapbenderMetadata['mdFileIdentifier'] = $recordId;
$mapbenderMetadata['serviceId'] = $option->serviceId;
$mapbenderMetadata['resourceId'] = $option->resourceId;
- } else {
- echo "<error>No option for downloading service via dataurl found in database</error>";
- die();
+ $foundOption = true;
+ break;
}
}
+ if ($foundOption == false) {
+ echo "<error>No option for downloading service via dataurl found in database</error>";
+ die();
+ }
//check if entries are filled
//read information from metadata table
$sql = <<<SQL
@@ -225,17 +229,21 @@
wms.fkey_group_id,
wms.uuid,
dataset identifier*/
+ $foundOption = false;
foreach ($downloadOptions->{$recordId}->option as $option) {
if ($option->type == "downloadlink") {
$mapbenderMetadata['mdFileIdentifier'] = $recordId;
//$mapbenderMetadata['serviceId'] = $option->serviceId;
//$mapbenderMetadata['resourceId'] = $option->resourceId;
$mapbenderMetadata['downloadLink'] = $option->link;
- } else {
- echo "<error>No option for downloading service from metadata found in database</error>";
- die();
+ $foundOption = true;
+ break;
}
}
+ if ($foundOption == false) {
+ echo "<error>No option for downloading service from metadata found in database</error>";
+ die();
+ }
//check if entries are filled
//read information from metadata table
//TODO!!!!
@@ -301,16 +309,20 @@
wms.fkey_group_id,
wms.uuid,
dataset identifier*/
+ $foundOption = false;
foreach ($downloadOptions->{$recordId}->option as $option) {
if ($option->type == "wmslayergetmap") {
$mapbenderMetadata['mdFileIdentifier'] = $recordId;
$mapbenderMetadata['serviceId'] = $option->serviceId;
$mapbenderMetadata['resourceId'] = $option->resourceId;
- } else {
- echo "<error>No option for downloading service via wmslayer found in database</error>";
- die();
+ $foundOption = true;
+ break;
}
}
+ if ($foundOption == false) {
+ echo "<error>No option for downloading service via wmslayer found in database</error>";
+ die();
+ }
//check if entries are filled
//read information from metadata table
$sql = <<<SQL
More information about the Mapbender_commits
mailing list