[Mapbender-commits] r10222 - trunk/mapbender/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Aug 28 07:19:21 PDT 2019


Author: armin11
Date: 2019-08-28 07:19:21 -0700 (Wed, 28 Aug 2019)
New Revision: 10222

Modified:
   trunk/mapbender/http/classes/class_metadata.php
Log:
Fix for metadata search over internal searchInterface - find downloadlinks from metadata records which are available via inspire atom feeds

Modified: trunk/mapbender/http/classes/class_metadata.php
===================================================================
--- trunk/mapbender/http/classes/class_metadata.php	2019-08-27 08:48:16 UTC (rev 10221)
+++ trunk/mapbender/http/classes/class_metadata.php	2019-08-28 14:19:21 UTC (rev 10222)
@@ -756,10 +756,18 @@
 					$featuretypeCount++;
 				}
 				//check for atom feed entry
-				//$e = new mb_exception("uuid: ".$datasetMatrix[$i]['fileidentifier']);
 				if ($downloadOptionsArray[$datasetMatrix[$i]['fileidentifier']] != null) {
 					//$e = new mb_exception("element found for uuid: ".$datasetMatrix[$i]['fileidentifier']);
 					$this->datasetJSON->dataset->srv[$i]->coupledResources->inspireAtomFeeds = json_decode($downloadOptionsArray[$datasetMatrix[$i]['fileidentifier']]);
+				} else {
+					$downloadOptionsFromMetadata = json_decode(getDownloadOptions(array($datasetMatrix[$i]['fileidentifier']), $this->protocol."://".$this->hostName."/mapbender/"));
+					//try to load coupled atom feeds from mod_getDownloadOptions and add them to result list! (if no wms layer nor wfs featuretype is available)
+					//$this->datasetJSON->dataset->srv[$i]->coupledResources->inspireAtomFeeds = $downloadOptionsFromMetadata->{$datasetMatrix[$i]['fileidentifier']}->option;
+					foreach ($downloadOptionsFromMetadata->{$datasetMatrix[$i]['fileidentifier']}->option as $dlOption) {
+					    if ($dlOption->type == "downloadlink") {
+						$this->datasetJSON->dataset->srv[$i]->coupledResources->inspireAtomFeeds[] = $dlOption;
+					    }
+					}
 				}
 			}
 		}



More information about the Mapbender_commits mailing list