[Mapbender-commits] r8805 - trunk/mapbender/http/geoportal

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Mar 26 00:53:50 PDT 2014


Author: armin11
Date: 2014-03-26 00:53:48 -0700 (Wed, 26 Mar 2014)
New Revision: 8805

Modified:
   trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php
Log:
Fix for exporting wms.inspire_annual_requests into monitoring csv

Modified: trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php	2014-03-26 07:39:51 UTC (rev 8804)
+++ trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php	2014-03-26 07:53:48 UTC (rev 8805)
@@ -245,7 +245,7 @@
 if ($outputFormat == 'monitoring' || $outputFormat == 'table') {
 $sql = <<<SQL
 
-select metadata_layer.title, metadata_layer.uuid, resource_id, resource_uuid, resource_type, inspire_actual_coverage, inspire_whole_area, service_id, inspire_download, wms_owner as service_owner, fkey_mb_group_id as service_group, wms_title as service_title, f_collect_inspire_cat_layer(resource_id) as inspire_cat from (select title,uuid ,resource_uuid, layer_id as resource_id, 'layer' as resource_type, fkey_wms_id as service_id, inspire_download, inspire_actual_coverage, inspire_whole_area from (select layer.layer_id, layer.fkey_wms_id, layer.uuid as resource_uuid, layer.inspire_download, layer_custom_category.fkey_custom_category_id from layer inner join layer_custom_category on layer.layer_id = layer_custom_category.fkey_layer_id where layer_custom_category.fkey_custom_category_id = $inspireCatId AND layer_searchable = 1 ORDER BY layer_id) as layer_inspire inner join (select metadata_id, uuid, title, inspire_actual_coverage, inspire_whole_area, fkey_layer_id from mb_metada
 ta inner join ows_relation_metadata on ows_relation_metadata.fkey_metadata_id = mb_metadata.metadata_id) as metadata_relation on metadata_relation.fkey_layer_id = layer_inspire.layer_id) as metadata_layer INNER JOIN wms ON metadata_layer.service_id = wms_id  
+select metadata_layer.title, metadata_layer.uuid, resource_id, resource_uuid, resource_type, inspire_actual_coverage, inspire_whole_area, service_id, inspire_download, wms_owner as service_owner, wms.inspire_annual_requests, fkey_mb_group_id as service_group, wms_title as service_title, f_collect_inspire_cat_layer(resource_id) as inspire_cat from (select title,uuid ,resource_uuid, layer_id as resource_id, 'layer' as resource_type, fkey_wms_id as service_id, inspire_download, inspire_actual_coverage, inspire_whole_area from (select layer.layer_id, layer.fkey_wms_id, layer.uuid as resource_uuid, layer.inspire_download, layer_custom_category.fkey_custom_category_id from layer inner join layer_custom_category on layer.layer_id = layer_custom_category.fkey_layer_id where layer_custom_category.fkey_custom_category_id = $inspireCatId AND layer_searchable = 1 ORDER BY layer_id) as layer_inspire inner join (select metadata_id, uuid, title, inspire_actual_coverage, inspire_whole_area,
  fkey_layer_id from mb_metadata inner join ows_relation_metadata on ows_relation_metadata.fkey_metadata_id = mb_metadata.metadata_id) as metadata_relation on metadata_relation.fkey_layer_id = layer_inspire.layer_id) as metadata_layer INNER JOIN wms ON metadata_layer.service_id = wms_id  
 
 
 SQL;
@@ -298,6 +298,7 @@
 	$sqlTable['service_owner'][] = $row['service_owner'];
 	$sqlTable['inspire_actual_coverage'][] = $row['inspire_actual_coverage'];
 	$sqlTable['inspire_whole_area'][] = $row['inspire_whole_area'];
+	$sqlTable['inspire_annual_requests'][] = $row['inspire_annual_requests'];
 	$sqlTable['inspire_cat'][] = replaceCategories($row['inspire_cat'], $inspireCategories);
 	$sqlTable['inspire_cat_monitoring'][] = replaceCategoriesList($row['inspire_cat']);
 	$sqlTable['inspire_download'][] = $row['inspire_download'];
@@ -457,7 +458,7 @@
 							//service conform
 							$inspireMonitoring['services'][$serviceIndex]->serviceConform = "[X]";
 							//requests per day
-							$inspireMonitoring['services'][$serviceIndex]->requestsPerDay = 0;
+							$inspireMonitoring['services'][$serviceIndex]->requestsPerDay = ceil((integer)$sqlTable['inspire_annual_requests'][$i] / 365);
 							//comment
 							$inspireMonitoring['services'][$serviceIndex]->report = "";
 							//report



More information about the Mapbender_commits mailing list