[Mapbender-commits] r10174 - in trunk/mapbender: http/classes http/php resources/locale/de_DE/LC_MESSAGES

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Jul 2 08:26:00 PDT 2019


Author: armin11
Date: 2019-07-02 08:26:00 -0700 (Tue, 02 Jul 2019)
New Revision: 10174

Modified:
   trunk/mapbender/http/classes/class_metadata.php
   trunk/mapbender/http/php/mod_getDownloadOptions.php
   trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
Log:
Add attributes for showing download service title and metadata when resolving coupled resources in catalogue search

Modified: trunk/mapbender/http/classes/class_metadata.php
===================================================================
--- trunk/mapbender/http/classes/class_metadata.php	2019-07-02 05:55:01 UTC (rev 10173)
+++ trunk/mapbender/http/classes/class_metadata.php	2019-07-02 15:26:00 UTC (rev 10174)
@@ -902,7 +902,8 @@
 				$this->wmsJSON->wms->srv[$j]->layer[0]->maxScale = $legendInfo['maxScale'];
 				//pull downloadOptions as json with function from other script: php/mod_getDownloadOptions.php
 				$downloadOptionsCs = str_replace("{","",str_replace("}","",str_replace("}{",",",$legendInfo['downloadOptions'])));
-				$downloadOptions = json_decode(getDownloadOptions(explode(',',$downloadOptionsCs)));
+				//$downloadOptions = json_decode(getDownloadOptions(explode(',',$downloadOptionsCs)));
+$downloadOptions = json_decode(getDownloadOptions(explode(',',$downloadOptionsCs), $this->protocol."://".$this->hostName."/mapbender/"));
 				$this->wmsJSON->wms->srv[$j]->layer[0]->downloadOptions = $downloadOptions;
 
 				if ($subLayers[$rootIndex]['layer_name'] == ''){
@@ -2048,7 +2049,8 @@
 			$servObject->layer[$countsublayer]->maxScale = $legendInfo['maxScale'];
 			$downloadOptionsCs = str_replace("{","",str_replace("}","",str_replace("}{",",",$legendInfo['downloadOptions'])));
 			//$e = new mb_exception("class_metadata.php: legendInfo[downloadOptions]: ".$legendInfo['downloadOptions']);
-			$downloadOptions = json_decode(getDownloadOptions(explode(',',$downloadOptionsCs)));
+			//$downloadOptions = json_decode(getDownloadOptions(explode(',',$downloadOptionsCs)));
+$downloadOptions = json_decode(getDownloadOptions(explode(',',$downloadOptionsCs), $this->protocol."://".$this->hostName."/mapbender/"));
 			//$e = new mb_exception("class_metadata.php: downloadOptions as string: ".json_encode($downloadOptions));
 			$servObject->layer[$countsublayer]->downloadOptions = $downloadOptions;
 			$servObject->layer[$countsublayer]->mdLink = $this->protocol."://".$this->hostName."/mapbender/php/mod_showMetadata.php?languageCode=".$this->languageCode."&resource=layer&layout=tabs&id=".$child['layer_id'];

Modified: trunk/mapbender/http/php/mod_getDownloadOptions.php
===================================================================
--- trunk/mapbender/http/php/mod_getDownloadOptions.php	2019-07-02 05:55:01 UTC (rev 10173)
+++ trunk/mapbender/http/php/mod_getDownloadOptions.php	2019-07-02 15:26:00 UTC (rev 10174)
@@ -99,7 +99,15 @@
 	$testMatch = NULL;
 }
 
-function getDownloadOptions($idList) {
+if (defined("MAPBENDER_PATH") && MAPBENDER_PATH != '') {
+	$mapbenderPath = MAPBENDER_PATH."/";
+} else {
+	$mapbenderPath = "http://www.geoportal.rlp.de/mapbender/";
+}
+$mapbenderPathArray = parse_url($mapbenderPath);
+$mapbenderServerUrl = $mapbenderPathArray['scheme']."://".$mapbenderPathArray['host'];
+
+function getDownloadOptions($idList, $webPath=false) {
 	//define query to pull all download options - actually only the inspire download services based on atom feeds
 	$sql = "select service_id, service_uuid, resource_id, resource_type, datalink, NULL as datalink_text, title,format from (
 select service_id, resource_id, service_uuid, resource_type, fkey_datalink_id as datalink, title, format from (select fkey_wms_id as service_id, layer_id as resource_id, 'layer' as resource_type, layer.uuid as service_uuid, metadata_relation.title, format from layer inner join (select metadata_id, title, format, uuid, fkey_layer_id from mb_metadata inner join ows_relation_metadata on ows_relation_metadata.fkey_metadata_id = mb_metadata.metadata_id) ";
@@ -163,6 +171,13 @@
 						$downloadOptions->{$idList[$i]}->option[$j]->serviceUuid = $row['service_uuid'];
 						$downloadOptions->{$idList[$i]}->option[$j]->featureType[0] = $row['resource_id'];
 						$downloadOptions->{$idList[$i]}->option[$j]->format = $row['format'];
+						//new 2019/07
+						$downloadOptions->{$idList[$i]}->option[$j]->serviceType = "download";
+						$downloadOptions->{$idList[$i]}->option[$j]->serviceSubType = "ATOM";
+						$downloadOptions->{$idList[$i]}->option[$j]->serviceTitle = _mb('INSPIRE Download Service (predefined ATOM) for dataset').": ".$row['title']." - "._mb("based on WFS datasource");
+						$downloadOptions->{$idList[$i]}->option[$j]->mdLink = $webPath."php/mod_inspireAtomFeedISOMetadata.php?outputFormat=iso19139&generateFrom=wfs&wfsid=".$row['service_id']."&id=".$idList[$i];
+						$downloadOptions->{$idList[$i]}->option[$j]->htmlLink = $webPath."php/mod_exportIso19139.php?url=".$urlencode($downloadOptions->{$idList[$i]}->option[$j]->mdLink);
+						$downloadOptions->{$idList[$i]}->option[$j]->accessUrl = $webPath."php/mod_inspireDownloadFeed.php?id=".$idList[$i]."&type=SERVICE&generateFrom=wfs&wfsid=".$row['service_id'];
 					}
 					$downloadOptions->{$idList[$i]}->title = $row['title'];
 					$downloadOptions->{$idList[$i]}->uuid = $idList[$i];
@@ -181,6 +196,13 @@
 					$downloadOptions->{$idList[$i]}->option[$j]->resourceId = $row['resource_id'];
 					$downloadOptions->{$idList[$i]}->option[$j]->format = $row['format'];
 					$downloadOptions->{$idList[$i]}->option[$j]->dataLink = $row['datalink'];
+					//new 2019/07
+					$downloadOptions->{$idList[$i]}->option[$j]->serviceType = "download";
+					$downloadOptions->{$idList[$i]}->option[$j]->serviceSubType = "ATOM";
+					$downloadOptions->{$idList[$i]}->option[$j]->serviceTitle = _mb('INSPIRE Download Service (predefined ATOM) for dataset').": ".$row['title']." - "._mb("based on WMS datasource");
+					$downloadOptions->{$idList[$i]}->option[$j]->mdLink = $webPath."php/mod_inspireAtomFeedISOMetadata.php?outputFormat=iso19139&generateFrom=wmslayer&layerid=".$row['resource_id']."&id=".$idList[$i];
+					$downloadOptions->{$idList[$i]}->option[$j]->htmlLink = $webPath."php/mod_exportIso19139.php?url=".urlencode($downloadOptions->{$idList[$i]}->option[$j]->mdLink);
+					$downloadOptions->{$idList[$i]}->option[$j]->accessUrl = $webPath."php/mod_inspireDownloadFeed.php?id=".$idList[$i]."&type=SERVICE&generateFrom=wmslayer&layerid=".$row['resource_id'];
 					$downloadOptions->{$idList[$i]}->title = $row['title'];
 					$downloadOptions->{$idList[$i]}->uuid = $idList[$i];
 				break;
@@ -194,6 +216,12 @@
 							$downloadOptions->{$idList[$i]}->option[$j]->link = $downloadLink->{"0"};
 							//check if 
 							$downloadOptions->{$idList[$i]}->option[$j]->format = $row['format'];
+							$downloadOptions->{$idList[$i]}->option[$j]->serviceType = "download";
+							$downloadOptions->{$idList[$i]}->option[$j]->serviceSubType = "ATOM";
+							$downloadOptions->{$idList[$i]}->option[$j]->serviceTitle = _mb('INSPIRE Download Service (predefined ATOM) for dataset').": ".$row['title']." - "._mb("based on links from metadata");
+							$downloadOptions->{$idList[$i]}->option[$j]->mdLink = $webPath."php/mod_inspireAtomFeedISOMetadata.php?outputFormat=iso19139&generateFrom=metadata&id=".$idList[$i];
+							$downloadOptions->{$idList[$i]}->option[$j]->htmlLink = $webPath."php/mod_exportIso19139.php?url=".urlencode($downloadOptions->{$idList[$i]}->option[$j]->mdLink);
+							$downloadOptions->{$idList[$i]}->option[$j]->accessUrl = $webPath."php/mod_inspireDownloadFeed.php?id=".$idList[$i]."&type=SERVICE&generateFrom=metadata";
 						}
 					}
 					$downloadOptions->{$idList[$i]}->title = $row['title'];
@@ -214,7 +242,8 @@
 	return $result;
 }
 
-$downloadOptions = getDownloadOptions($idList);
+$downloadOptions = getDownloadOptions($idList, $mapbenderPath);
+
 if ($downloadOptions != "null" && $outputFormat == "json") {
 	header('Content-Type: application/json; charset='.CHARSET);
 	echo $downloadOptions;

Modified: trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
===================================================================
--- trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2019-07-02 05:55:01 UTC (rev 10173)
+++ trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2019-07-02 15:26:00 UTC (rev 10174)
@@ -4302,3 +4302,16 @@
 msgid "click on single orange box generate download link below map (if seen)!"
 msgstr "Klick auf orange Box generiert Downloadlink unterhalb des Kartenbildes (wenn vorhanden)!"
 
+msgid "INSPIRE Download Service (predefined ATOM) for dataset"
+msgstr "INSPIRE Downloaddienst (predefined ATOM) für Datensatz"
+
+msgid "based on WFS datasource"
+msgstr "basierend auf WFS Datenquelle"
+
+msgid "based on WMS datasource"
+msgstr "basierend auf WMS Datenquelle"
+
+msgid "based on links from metadata"
+msgstr "basierend auf Verlinkungen in Metadaten"
+
+



More information about the Mapbender_commits mailing list