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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Tue Aug 22 02:49:06 PDT 2017


Author: armin11
Date: 2017-08-22 02:49:06 -0700 (Tue, 22 Aug 2017)
New Revision: 9769

Modified:
   trunk/mapbender/http/classes/class_syncCkan.php
Log:
Fix for external csw to ckan export handler - define default dcat category envi for environmental data

Modified: trunk/mapbender/http/classes/class_syncCkan.php
===================================================================
--- trunk/mapbender/http/classes/class_syncCkan.php	2017-08-22 08:37:00 UTC (rev 9768)
+++ trunk/mapbender/http/classes/class_syncCkan.php	2017-08-22 09:49:06 UTC (rev 9769)
@@ -459,6 +459,7 @@
                         // only list http://localhost:5000/api/3/action/package_list?q=owner_org:81476cf5-6c52-4e99-8b9f-6150d63fcb32	
                         //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!!!
+			//TODO: test what wents wrong, if fkey_mb_group_id is set in mapbender 
                         if ($organization['is_primary_group']) {
                             $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);
@@ -829,6 +830,8 @@
 		$ckanPackage->owner_org = $ckan_orga_ident;
 		$ckanPackage->state = "active";
 		$ckanPackage->private = false;
+		//TODO - define one central category from dcat-ap for environmental data
+		$ckanPackage->dcat_ap_eu_data_theme = "ENVI";
         	//convert bbox - if available to geojson
 		//TODO - use key of ckan category from conf!
 		$ckanCategoryFilter = explode(":",$ckanCategoryFilter);
@@ -890,7 +893,7 @@
 	//all or only those which have standardized licenses?
 	//$sql = "SELECT *, f_get_coupled_resources(metadata_id) from mb_metadata LEFT JOIN md_termsofuse ON mb_metadata.metadata_id = md_termsofuse.fkey_metadata_id WHERE mb_metadata.uuid = $1";
 	//$sql = "SELECT * , st_asgeojson(the_geom) as geojson from mb_metadata JOIN md_termsofuse ON mb_metadata.metadata_id = md_termsofuse.fkey_metadata_id JOIN termsofuse ON md_termsofuse.fkey_termsofuse_id = termsofuse.termsofuse_id WHERE mb_metadata.uuid = $1 AND export2csw IS true";
-	$sql = "SELECT * , st_asgeojson(the_geom) as geojson from mb_metadata LEFT OUTER JOIN md_termsofuse ON mb_metadata.metadata_id = md_termsofuse.fkey_metadata_id LEFT OUTER JOIN termsofuse ON md_termsofuse.fkey_termsofuse_id = termsofuse.termsofuse_id WHERE mb_metadata.uuid = $1 AND export2csw IS true";
+	$sql = "SELECT * , st_asgeojson(the_geom) as geojson from mb_metadata LEFT OUTER JOIN md_termsofuse ON mb_metadata.metadata_id = md_termsofuse.fkey_metadata_id LEFT OUTER JOIN termsofuse ON md_termsofuse.fkey_termsofuse_id = termsofuse.termsofuse_id WHERE mb_metadata.uuid = $1 AND export2csw IS true";#7aeacc93-6b0d-da7f-1f86-80eea9e188b2
 	$v = array($uuid);
 	$t = array('s');
 	$res = db_prep_query($sql, $v, $t);



More information about the Mapbender_commits mailing list