[Mapbender-commits] r10289 - in trunk/mapbender/http: classes php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Oct 18 04:57:22 PDT 2019


Author: armin11
Date: 2019-10-18 04:57:22 -0700 (Fri, 18 Oct 2019)
New Revision: 10289

Modified:
   trunk/mapbender/http/classes/class_metadata.php
   trunk/mapbender/http/php/mod_dataISOMetadata.php
Log:
Fix for generating application-metadata access urls

Modified: trunk/mapbender/http/classes/class_metadata.php
===================================================================
--- trunk/mapbender/http/classes/class_metadata.php	2019-10-18 11:19:45 UTC (rev 10288)
+++ trunk/mapbender/http/classes/class_metadata.php	2019-10-18 11:57:22 UTC (rev 10289)
@@ -861,7 +861,11 @@
 				$applicationMatrix[$i][$notNullElement] = false;
 			    }
 			}
+if (($applicationMatrix[$i]['fkey_gui_id'] != false && $applicationMatrix[$i]['fkey_mapviewer_id'] != false) || ($applicationMatrix[$i]['fkey_wmc_serial_id'] != false && $applicationMatrix[$i]['fkey_mapviewer_id'] != false)) {
 $accessUrl = $admin->getMapviewerInvokeUrl($applicationMatrix[$i]['fkey_mapviewer_id'], $applicationMatrix[$i]['fkey_gui_id'], $applicationMatrix[$i]['fkey_wmc_serial_id']);
+} else {
+$accessUrl = $applicationMatrix[$i]['link'];
+}
 $previewUrl = $admin->getMetadataPreviewUrl($applicationMatrix[$i]['metadata_id']);
 $this->applicationJSON->application->srv[$i]->accessURL = $accessUrl;
 			$this->applicationJSON->application->srv[$i]->previewURL = $previewUrl;

Modified: trunk/mapbender/http/php/mod_dataISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_dataISOMetadata.php	2019-10-18 11:19:45 UTC (rev 10288)
+++ trunk/mapbender/http/php/mod_dataISOMetadata.php	2019-10-18 11:57:22 UTC (rev 10289)
@@ -1648,7 +1648,11 @@
 	$downloadUrls = json_decode($mb_metadata['datalinks']);
 	$downloadUrl = $downloadUrls->downloadLinks[0]->{0};
 	if ($mb_metadata['type'] == 'application') {
-	    $applicationUrl = $admin->getMapviewerInvokeUrl($mb_metadata['fkey_mapviewer_id'], $mb_metadata['fkey_gui_id'], $mb_metadata['fkey_wmc_serial_id']);
+	    if ( ((isset($mb_metadata['fkey_gui_id']) && $mb_metadata['fkey_gui_id'] != '') && isset($mb_metadata['fkey_mapviewer_id'])) || ((isset($mb_metadata['fkey_wmc_serial_id']) && $mb_metadata['fkey_wmc_serial_id'] != '') && isset($mb_metadata['fkey_mapviewer_id'])) ) {
+	        $applicationUrl = $admin->getMapviewerInvokeUrl($mb_metadata['fkey_mapviewer_id'], $mb_metadata['fkey_gui_id'], $mb_metadata['fkey_wmc_serial_id']);
+	    } else {
+                $applicationUrl = $mb_metadata['link'];
+	    }
             $gmd_URLText=$iso19139->createTextNode($applicationUrl);
 	} else {
 	    if ($downloadUrl == "" || !isset($downloadUrl)) {



More information about the Mapbender_commits mailing list