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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Aug 30 03:32:37 PDT 2019


Author: armin11
Date: 2019-08-30 03:32:37 -0700 (Fri, 30 Aug 2019)
New Revision: 10230

Modified:
   trunk/mapbender/http/classes/class_syncCkan.php
Log:
New option to export LinkedOpenData WFS 3.0 Proxy API to ckan based OpenData Portals

Modified: trunk/mapbender/http/classes/class_syncCkan.php
===================================================================
--- trunk/mapbender/http/classes/class_syncCkan.php	2019-08-30 09:44:45 UTC (rev 10229)
+++ trunk/mapbender/http/classes/class_syncCkan.php	2019-08-30 10:32:37 UTC (rev 10230)
@@ -1513,7 +1513,7 @@
                     $resourcesArray[$indexResourceArray]->name = "Download (INSPIRE)";//: ".$metadataObject->title;
                     $resourcesArray[$indexResourceArray]->id = $option->serviceUuid;
                     $resourcesArray[$indexResourceArray]->description = $metadataObject->title." - Download von verlinkten Daten über INSPIRE ATOM Feed";
-                    $resourcesArray[$indexResourceArray]->url = $this->mapbenderUrl."/plugins/mb_downloadFeedClient.php?url=".urlencode(str_replace("https://","http://",$this->mapbenderUrl)."/php/mod_inspireDownloadFeed.php?id=".$metadataUuid."&type=SERVICE&generateFrom=dataurl&layerid=".$option->resourceId);
+                    $resourcesArray[$indexResourceArray]->url = $this->mapbenderUrl."/plugins/mb_downloadFeedClient.php?url=".urlencode($this->mapbenderUrl."/php/mod_inspireDownloadFeed.php?id=".$metadataUuid."&type=SERVICE&generateFrom=dataurl&layerid=".$option->resourceId);
                     $resourcesArray[$indexResourceArray]->format = "Diverse"; 
                     //$resourcesArray[$indexResourceArray]->res_transparency_document_change_classification = "unaltered";
                     $indexResourceArray++;
@@ -1531,7 +1531,7 @@
                     $resourcesArray[$indexResourceArray]->name = "Download (INSPIRE)";//: ".$metadataObject->title;
                     $resourcesArray[$indexResourceArray]->id = $option->serviceUuid;
                     $resourcesArray[$indexResourceArray]->description = $metadataObject->title." - Download von Vektordaten (wfs-basiert) über INSPIRE ATOM Feed";
-                    $resourcesArray[$indexResourceArray]->url = $this->mapbenderUrl."/plugins/mb_downloadFeedClient.php?url=".urlencode(str_replace("https://","http://",$this->mapbenderUrl)."/php/mod_inspireDownloadFeed.php?id=".$metadataUuid."&type=SERVICE&generateFrom=wfs&wfsid=".$option->serviceId);
+                    $resourcesArray[$indexResourceArray]->url = $this->mapbenderUrl."/plugins/mb_downloadFeedClient.php?url=".urlencode($this->mapbenderUrl."/php/mod_inspireDownloadFeed.php?id=".$metadataUuid."&type=SERVICE&generateFrom=wfs&wfsid=".$option->serviceId);
                     $resourcesArray[$indexResourceArray]->format = "Diverse";
                     //$resourcesArray[$indexResourceArray]->res_transparency_document_change_classification = "unaltered";
                     $indexResourceArray++;
@@ -1544,12 +1544,53 @@
                     $viewJson->view_type = "webpage_view";
                     $viewArray[$indexViewArray]['json'] = json_encode($viewJson);
                     $indexViewArray++;
+		    //*******************************************************************************************************
+		    // add new linked open data proxy uri if wfs is classified open data!
+		    // 
+		    $sql = "SELECT * FROM (SELECT wfs_id, wfs_version FROM wfs INNER JOIN wfs_termsofuse ON wfs_id = fkey_wfs_id AND wfs_id = $1) AS wfs_tou INNER JOIN termsofuse ON fkey_termsofuse_id = termsofuse_id WHERE isopen = 1";
+    		    $v = array($option->serviceId);
+    		    $t = array($i);
+    		    $res = db_prep_query($sql, $v, $t);	
+		    $numberOfServices = 0;
+		    while($row = db_fetch_array($res)){
+        		$wfsId = $row['wfs_id'];
+			$wfsVersion = $row['wfs_version'];
+        		$numberOfServices++;
+    		    } 
+    		    if ($numberOfServices == 1 && $wfsVersion == "2.0.0") {
+			    $resourcesArray[$indexResourceArray]->name = "Linked Open Data API (WFS 3.0)";//: ".$metadataObject->title;
+		            $resourcesArray[$indexResourceArray]->id = $option->serviceUuid."_lod_wfs_api";
+		            $resourcesArray[$indexResourceArray]->description = $metadataObject->title." - Zugriff auf Daten über LinkedOpenData Rest API (WFS 3.0)";
+			    //ft id = $option->featureType[0] !
+			    $sql = "SELECT featuretype_name from wfs_featuretype WHERE featuretype_id = $1";
+    		    	    $v = array($option->featureType[0]);
+    		   	    $t = array($i);
+    		   	    $res = db_prep_query($sql, $v, $t);
+			    while($row = db_fetch_array($res)){
+        			$featureTypeName = $row['featuretype_name'];
+			    }
+		            $resourcesArray[$indexResourceArray]->url = $this->mapbenderUrl."/php/mod_linkedDataProxy.php?wfsid=".$option->serviceId."&collection=".$featureTypeName."&items=all");
+			    //example: https://www.geoportal.rlp.de/mapbender/php/mod_linkedDataProxy.php?wfsid=480&collection=ms%3Aakademie&items=all
+		            $resourcesArray[$indexResourceArray]->format = "REST";
+		            //$resourcesArray[$indexResourceArray]->res_transparency_document_change_classification = "unaltered";
+		            $indexResourceArray++;
+		            //views to generate
+		            //build whole json structure
+		            $viewJson->resource_id = $option->serviceUuid."_lod_wfs_api";
+		            //$viewJson->id = $option->serviceUuid."_view";
+		            $viewJson->title = "Linked Open Data Zugriff (HTML)";
+		            $viewJson->description = "Integrierter LinkedOpenData HTML Client - GeoPortal.rlp WFS 3.0 Proxy";
+		            $viewJson->view_type = "webpage_view";
+		            $viewArray[$indexViewArray]['json'] = json_encode($viewJson);
+		            $indexViewArray++;
+		    }	
+		    //*******************************************************************************************************
                     break;
                 case "downloadlink":
                     $resourcesArray[$indexResourceArray]->name = "Download (INSPIRE)";//: ".$metadataObject->title;
                     $resourcesArray[$indexResourceArray]->id = $metadataObject->uuid."_downloadlink"; //TODO - no uuid for service known in this case
                     $resourcesArray[$indexResourceArray]->description = $metadataObject->title." - Download von verlinkten Daten über INSPIRE ATOM Feed";
-                    $resourcesArray[$indexResourceArray]->url = $this->mapbenderUrl."/plugins/mb_downloadFeedClient.php?url=".urlencode(str_replace("https://","http://",$this->mapbenderUrl)."/php/mod_inspireDownloadFeed.php?id=".$metadataUuid."&type=SERVICE&generateFrom=metadata");
+                    $resourcesArray[$indexResourceArray]->url = $this->mapbenderUrl."/plugins/mb_downloadFeedClient.php?url=".urlencode($this->mapbenderUrl."/php/mod_inspireDownloadFeed.php?id=".$metadataUuid."&type=SERVICE&generateFrom=metadata");
                     $resourcesArray[$indexResourceArray]->format = "Diverse";
                     //$resourcesArray[$indexResourceArray]->res_transparency_document_change_classification = "unaltered";
                     $indexResourceArray++;



More information about the Mapbender_commits mailing list