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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 22 00:06:45 PDT 2017


Author: armin11
Date: 2017-08-22 00:06:44 -0700 (Tue, 22 Aug 2017)
New Revision: 9766

Modified:
   trunk/mapbender/http/classes/class_syncCkan.php
Log:
Fix for ckan metadata export handler

Modified: trunk/mapbender/http/classes/class_syncCkan.php
===================================================================
--- trunk/mapbender/http/classes/class_syncCkan.php	2017-08-21 15:29:03 UTC (rev 9765)
+++ trunk/mapbender/http/classes/class_syncCkan.php	2017-08-22 07:06:44 UTC (rev 9766)
@@ -460,11 +460,11 @@
                         //pull all relevant information from mapbender database - first pull the resources which are owned by the corresponding group!
                         //only use metadata for which real licenses are defined !!!!!! - what should be done with the other metadata?- DO a left join!!!
                         if ($organization['is_primary_group']) {
-                            $sql = "SELECT *, f_get_coupled_resources(metadata_id) from mb_metadata JOIN md_termsofuse ON mb_metadata.metadata_id = md_termsofuse.fkey_metadata_id WHERE fkey_mb_user_id = $1 AND (fkey_mb_group_id is null OR fkey_mb_group_id = 0) AND export2csw IS true";
+                            $sql = "SELECT *, f_get_coupled_resources(metadata_id) from mb_metadata LEFT OUTER JOIN md_termsofuse ON mb_metadata.metadata_id = md_termsofuse.fkey_metadata_id WHERE fkey_mb_user_id = $1 AND (fkey_mb_group_id is null OR fkey_mb_group_id = 0) AND export2csw IS true";
                             $v = array($this->mapbenderUserId);
                             $t = array('i');
                         } else {
-                            $sql = "SELECT *, f_get_coupled_resources(metadata_id) from mb_metadata JOIN md_termsofuse ON mb_metadata.metadata_id = md_termsofuse.fkey_metadata_id WHERE fkey_mb_group_id = $1 AND export2csw IS true";
+                            $sql = "SELECT *, f_get_coupled_resources(metadata_id) from mb_metadata LEFT OUTER JOIN md_termsofuse ON mb_metadata.metadata_id = md_termsofuse.fkey_metadata_id WHERE fkey_mb_group_id = $1 AND export2csw IS true";
                             $v = array($organization['id']);
                             $t = array('i');
                         }
@@ -945,7 +945,22 @@
 	$indexResourceArray = 0;
 	$indexViewArray = 0;
 	//add html preview for metadata
-	
+	$resourcesArray[$indexResourceArray]->name = "Geo-Metadaten";// für ".$row['layer_title'];
+	$resourcesArray[$indexResourceArray]->id = $metadataUuid."_iso19139";
+	$resourcesArray[$indexResourceArray]->description = $ckanPackage->title." - Anzeige der originären Metadaten";
+	$resourcesArray[$indexResourceArray]->url = $mapbenderUrl."/php/mod_exportIso19139.php?url=http%3A%2F%2Fwww.geoportal.rlp.de%2Fmapbender%2Fphp%2Fmod_dataISOMetadata.php%3FoutputFormat%3Diso19139%26id%3D".$metadataUuid;
+	$resourcesArray[$indexResourceArray]->format = "HTML";
+	$indexResourceArray++;
+	//views to generate
+	$viewArray[$indexViewArray]['view_type'] = "webpage_view";
+	$viewArray[$indexViewArray]['resource_id'] = $metadataUuid."_iso19139";
+	//build whole json structure
+	$viewJson->resource_id = $metadataUuid."_iso19139";
+	$viewJson->title = "Metadaten HTML";
+	$viewJson->description = "Geo-Metadaten HTML";
+	$viewJson->view_type = "webpage_view";
+	$viewArray[$indexViewArray]['json'] = json_encode($viewJson);
+	$indexViewArray++;
 	if (count($layerArray) > 0) {
 	    //select relevant layer information
 	    $sql = "SELECT layer_id, layer_title, uuid from layer WHERE layer_id IN (".implode(",", $layerArray).")";
@@ -974,7 +989,7 @@
 	            //generate "Kartenviewer extern" resource
 	            $resourcesArray[$indexResourceArray]->name = "GeoPortal.rlp";//: ".$row['layer_title'];
 	            $resourcesArray[$indexResourceArray]->id = $row['uuid']."_geoportalrlp";
-	            $resourcesArray[$indexResourceArray]->description = "Ebene: ".$row['layer_title']." - Anzeige im GeoPortal.rlp.";
+	            $resourcesArray[$indexResourceArray]->description = "Ebene: ".$row['layer_title']." - Anzeige im GeoPortal.rlp";
 	            $resourcesArray[$indexResourceArray]->url = $mapbenderUrl."/../portal/karten.html?LAYER[zoom]=1&LAYER[id]=".$row['layer_id'];
 	            $resourcesArray[$indexResourceArray]->format = "Webanwendung";				
 	            $indexResourceArray++;
@@ -985,24 +1000,6 @@
 	            $resourcesArray[$indexResourceArray]->url = $mapbenderUrl."/php/wms.php?layer_id=".$row['layer_id']."&REQUEST=GetCapabilities&VERSION=1.1.1&SERVICE=WMS";
 	            $resourcesArray[$indexResourceArray]->format = "WMS";
 	            $indexResourceArray++;
-	            //generate html metadata 
-	            $resourcesArray[$indexResourceArray]->name = "Geo-Metadaten";// für ".$row['layer_title'];
-	            $resourcesArray[$indexResourceArray]->id = $metadataUuid."_iso19139";
-	            $resourcesArray[$indexResourceArray]->description = $row['layer_title']." - Anzeige der originären Metadaten";
-	            $resourcesArray[$indexResourceArray]->url = $mapbenderUrl."/php/mod_exportIso19139.php?url=http%3A%2F%2Fwww.geoportal.rlp.de%2Fmapbender%2Fphp%2Fmod_dataISOMetadata.php%3FoutputFormat%3Diso19139%26id%3D".$metadataUuid;
-	            $resourcesArray[$indexResourceArray]->format = "HTML";
-	            $indexResourceArray++;
-//views to generate
-	            $viewArray[$indexViewArray]['view_type'] = "webpage_view";
-	            $viewArray[$indexViewArray]['resource_id'] = $metadataUuid."_iso19139";
-	            //build whole json structure
-	            $viewJson->resource_id = $metadataUuid."_iso19139";
-	            //$viewJson->id = $row['uuid']."_geoportalrlp_mobile_view";
-	            $viewJson->title = "Metadaten HTML";
-	            $viewJson->description = "Geo-Metadaten HTML";
-	            $viewJson->view_type = "webpage_view";
-	            $viewArray[$indexViewArray]['json'] = json_encode($viewJson);
-	            $indexViewArray++;
 	        }
 	    }
         }
@@ -1021,7 +1018,7 @@
                     $resourcesArray[$indexResourceArray]->id = $option->serviceUuid;
                     $resourcesArray[$indexResourceArray]->description = "Download von Rasterdaten über INSPIRE ATOM Feed: ".$metadataObject->title;
                     $resourcesArray[$indexResourceArray]->url = $mapbenderUrl."/plugins/mb_downloadFeedClient.php?url=".urlencode($mapbenderUrl."/php/mod_inspireDownloadFeed.php?id=".$metadataUuid."&type=SERVICE&generateFrom=wmslayer&layerid=".$option->resourceId);
-                    $resourcesArray[$indexResourceArray]->format = "Diverse";
+                    $resourcesArray[$indexResourceArray]->format = "ATOM Viewer";
 		    //$resourcesArray[$indexResourceArray]->res_transparency_document_change_classification = "unaltered";
                     $indexResourceArray++;
                     //views to generate



More information about the Mapbender_commits mailing list