[Mapbender-commits] r8777 - in trunk/mapbender/http: geoportal javascripts php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Feb 14 03:04:41 PST 2014


Author: armin11
Date: 2014-02-14 03:04:41 -0800 (Fri, 14 Feb 2014)
New Revision: 8777

Modified:
   trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php
   trunk/mapbender/http/javascripts/mod_featureInfo.php
   trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php
   trunk/mapbender/http/php/mod_inspireDownloadFeed.php
Log:
Some bugfixes for monitoring table

Modified: trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php	2014-02-12 10:13:14 UTC (rev 8776)
+++ trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php	2014-02-14 11:04:41 UTC (rev 8777)
@@ -368,9 +368,8 @@
 		$serviceIndex = 0;	
 		$orgaIndex = 0;
 		$alreadyBuildDls = array();
-		$alreadBuildVs = array();
 		$alreadyReadOrgas = array();
-		$alreadBuildVs = array();
+		$alreadyBuildVs = array();
 		$currentUuid = "";
 		$inspireMonitoring = array(
 			"datasets" => array(),
@@ -499,11 +498,11 @@
 								//How to generate UUIDs for INSPIRE Download Service Metadata records (not really needed for INSPIRE!!! See DB Metadaten)
 								//12-4-4-4-8
 								//dataurl
-								//WMS uuid (12-4), Type (4) - 0001, MD uuid (4-8)
+								//LAYER uuid (12-4), Type (4) - 0001, MD uuid (4-8)
 								//wfs
 								//WFS uuid (12-4), MD uuid (4-4-8)
 								//wmsgetmap
-								//WMS uuid (12-4), Type (4) - 0002, MD uuid (4-8)
+								//LAYER uuid (12-4), Type (4) - 0002, MD uuid (4-8)
 								//
 								if (isset($sqlTable['service_uuid'][$i]) &&  $sqlTable['service_uuid'][$i] != '' ) {									//TODO - don't use service uuids from table but from options!
 									//TODO - what to do if metadata id is no uuid?????
@@ -521,6 +520,7 @@
 									}
 									$servicePart = explode('-',$option->serviceUuid);
 									//$mdPart = explode('-',$mdUuid);
+									
 									switch ($option->type) {
 										case "wmslayergetmap":
 											$dlsFileIdentifier = $servicePart[0]."-".$servicePart[1]."-"."0002"."-".$mdPart[3]."-".$mdPart[4];
@@ -534,10 +534,20 @@
 											$dlsFileIdentifier = $servicePart[0]."-".$servicePart[1]."-".$mdPart[2]."-".$mdPart[3]."-".$mdPart[4];
 											$capUrl = $mapbenderUrl."/php/mod_inspireDownloadFeed.php?id=".$sqlTable['uuid'][$i]."&type=SERVICE&generateFrom=wfs&wfsid=".$option->serviceId;
 										break;
+										case "downloadlink":
+											$linkPart = md5($option->link);
+											$dlsFileIdentifier =  $mdPart[0]."-".$mdPart[1]."-".$mdPart[2]."-".substr($linkPart, -12, 4)."-".substr($linkPart, -8, 8);
+											$capUrl = $mapbenderUrl."/php/mod_inspireDownloadFeed.php?id=".$sqlTable['uuid'][$i]."&type=SERVICE&generateFrom=metadata&id=".$mdUuid;
+										break;
+
+
 									}
 								
 								} else {
-									$dlsFileIdentifier = "no id found - please check if services have uuids or generate new ones!";
+									//generate dummy uuid - is not good!
+									$uuid = new Uuid();
+									$dlsFileIdentifier = $uuid;
+									$dlsFileIdentifier = "00000000-0000-0000-000000000000";
 								}
 								if (!in_array($dlsFileIdentifier,$alreadyBuildDls)) {
 								//generate the rest of the service element

Modified: trunk/mapbender/http/javascripts/mod_featureInfo.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_featureInfo.php	2014-02-12 10:13:14 UTC (rev 8776)
+++ trunk/mapbender/http/javascripts/mod_featureInfo.php	2014-02-14 11:04:41 UTC (rev 8777)
@@ -36,6 +36,9 @@
 	var featureInfoLayerPreselect = false;
 if(typeof(featureInfoDrawClick)==='undefined')
 	var featureInfoDrawClick = false;
+if(typeof(featureInfoCircleColor)==='undefined')
+	var featureInfoCircleColor = '#ff0000';
+
 var mod_featureInfo_elName = "<?php echo $e_id;?>";
 var mod_featureInfo_frameName = "";
 var mod_featureInfo_target = "<?php echo $e_target[0]; ?>";
@@ -46,10 +49,10 @@
 var mod_featureInfo_img_over = new Image(); mod_featureInfo_img_over.src = "<?php  echo preg_replace("/_off/","_over",$e_src);  ?>";
 
 if (featureInfoDrawClick) {
-	var standingHighlight = null;
+	var standingHighlightFeatureInfo = null;
 	Mapbender.events.afterMapRequest.register( function(){
-		if(standingHighlight){
-			standingHighlight.paint();
+		if(standingHighlightFeatureInfo){
+			standingHighlightFeatureInfo.paint();
 		}
 	});
 }
@@ -125,12 +128,12 @@
 	var point = mod_featureInfo_mapObj.getMousePosition(e);
 	if (featureInfoDrawClick) {
 		var map = Mapbender.modules[options.target];
-		if(standingHighlight !== null){ 
-			standingHighlight.clean();
+		if(standingHighlightFeatureInfo !== null){ 
+			standingHighlightFeatureInfo.clean();
 		}else{
-			standingHighlight = new Highlight(
+			standingHighlightFeatureInfo = new Highlight(
 				[options.target],
-				"standingHighlight", 
+				"standingHighlightFeatureInfo", 
 				{"position":"absolute", "top":"0px", "left":"0px", "z-index":100}, 
 				2);
 		}
@@ -143,8 +146,8 @@
 			coordinates:[realWorldPoint.x,realWorldPoint.y,null]
 		},Mapbender.modules[options.target].getSRS())
 		var m = ga.get(-1,-1);
-		standingHighlight.add(m, "#ff0000");
-		standingHighlight.paint();
+		standingHighlightFeatureInfo.add(m, featureInfoCircleColor);
+		standingHighlightFeatureInfo.paint();
 		map.setMapRequest();
 	}
 	eventBeforeFeatureInfo.trigger({"fName":mod_featureInfo_target});
@@ -172,9 +175,9 @@
 				for(var i=0;i<urls.length;i++){
 					if (urls[i].inBbox) {
 						if (urls[i].legendurl !== "empty" ) {
-							featureInfoList += "<tr><td><a style='text-decoration:  underline' href='"+urls[i].request+"' target='_blank'>"+urls[i].title+"</a></td><td><img src='"+urls[i].legendurl+"' alt='<?php echo _mb("No legend available");?>!'/></td></tr>";
+							featureInfoList += "<tr><td valign='top'><a style='text-decoration:  underline' href='"+urls[i].request+"' target='_blank'>"+urls[i].title+"</a></td><td><img src='"+urls[i].legendurl+"' alt='<?php echo _mb("No legend available");?>!'/></td></tr>";
 						} else {
-							featureInfoList += "<tr><td><a style='text-decoration:  underline' href='"+urls[i].request+"' target='_blank'>"+urls[i].title+"</a></td><td><img src='' alt='<?php echo _mb("No legend available");?>!'/></td></tr>";
+							featureInfoList += "<tr><td valign='top'><a style='text-decoration:  underline' href='"+urls[i].request+"' target='_blank'>"+urls[i].title+"</a></td><td><img src='' alt='<?php echo _mb("No legend available");?>!'/></td></tr>";
 						}
 					}
 				}
@@ -182,9 +185,9 @@
 				for(var i=urls.length-1; i>=0; i--){
 					if (urls[i].inBbox) {
 						if (urls[i].legendurl !== "empty" ) {
-							featureInfoList += "<tr><td><a style='text-decoration:  underline' href='"+urls[i].request+"' target='_blank'>"+urls[i].title+"</a></td><td><img src='"+urls[i].legendurl+"' alt='<?php echo _mb("No legend available");?>!'/></td></tr>";
+							featureInfoList += "<tr><td valign='top'><a style='text-decoration:  underline' href='"+urls[i].request+"' target='_blank'>"+urls[i].title+"</a></td><td><img src='"+urls[i].legendurl+"' alt='<?php echo _mb("No legend available");?>!'/></td></tr>";
 						} else {
-							featureInfoList += "<tr><td><a style='text-decoration:  underline' href='"+urls[i].request+"' target='_blank'>"+urls[i].title+"</a></td><td><img src='' alt='<?php echo _mb("No legend available");?>!'/></td></tr>";
+							featureInfoList += "<tr><td valign='top'><a style='text-decoration:  underline' href='"+urls[i].request+"' target='_blank'>"+urls[i].title+"</a></td><td><img src='' alt='<?php echo _mb("No legend available");?>!'/></td></tr>";
 						}
 					}
 				}
@@ -193,15 +196,15 @@
 			$("<div id='featureInfo_preselect'></div>").dialog({
 				bgiframe: true,
 				autoOpen: true,
-				modal: true,
+				modal: false,
 				title: '<?php echo _mb("Please choose a requestable Layer");?>',
 				width:parseInt(featureInfoPopupWidth, 10),
 				height:parseInt(featureInfoPopupHeight, 10),
 				position:dialogPosition,
 				buttons: {
 					"Close": function(){
-						if(standingHighlight !== null){ 
-							standingHighlight.clean();
+						if(standingHighlightFeatureInfo !== null){ 
+							standingHighlightFeatureInfo.clean();
 						}
 						$(this).dialog('close').remove();
 					}

Modified: trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php	2014-02-12 10:13:14 UTC (rev 8776)
+++ trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php	2014-02-14 11:04:41 UTC (rev 8777)
@@ -170,12 +170,13 @@
 		$mapbenderMetadata['mdOrigin'] = $mbMetadata['origin'];
 		//read information for layer/layer_epsg/wms/layer classification - 'inspireidentifiziert'?
 		$sql = <<<SQL
-			select * from (select layer.layer_id, layer.layer_minscale, layer.layer_maxscale, wms.wms_timestamp, wms.wms_owner, wms.fkey_mb_group_id, wms.contactorganization, wms.uuid, wms.contactelectronicmailaddress, wms.wms_timestamp_create, wms.fees, wms.accessconstraints from layer inner join wms on layer.fkey_wms_id = wms.wms_id where layer.layer_id = $1) as wms_layer, layer_epsg where wms_layer.layer_id = layer_epsg.fkey_layer_id and layer_epsg.epsg = 'EPSG:4326';
+			select * from (select layer.layer_id, layer.layer_minscale, layer.layer_maxscale, wms.wms_timestamp, wms.wms_owner, wms.fkey_mb_group_id, wms.contactorganization, layer.uuid, wms.contactelectronicmailaddress, wms.wms_timestamp_create, wms.fees, wms.accessconstraints from layer inner join wms on layer.fkey_wms_id = wms.wms_id where layer.layer_id = $1) as wms_layer, layer_epsg where wms_layer.layer_id = layer_epsg.fkey_layer_id and layer_epsg.epsg = 'EPSG:4326';
 SQL;
 		$v = array((integer)$mapbenderMetadata['resourceId']);
 		$t = array('i');
 		$res = db_prep_query($sql,$v,$t);
 		$mbMetadata = db_fetch_array($res);
+		//use layer.uuid because dataurl is defined at layer_level
 		$mapbenderMetadata['serviceUuid'] = $mbMetadata['uuid'];
 		$mapbenderMetadata['serviceTimestamp'] = $mbMetadata['wms_timestamp'];
 		$mapbenderMetadata['serviceTimestampCreate'] = $mbMetadata['wms_timestamp_create'];
@@ -308,7 +309,7 @@
 
 		//read information for layer/layer_epsg/wms/layer classification - 'inspireidentifiziert'?
 		$sql = <<<SQL
-			select * from (select layer.layer_id, layer.layer_minscale, layer.layer_maxscale, wms.wms_timestamp, wms.wms_owner, wms.fkey_mb_group_id, wms.contactorganization, wms.uuid, wms.contactelectronicmailaddress, wms.wms_timestamp_create, wms.fees, wms.accessconstraints  from layer inner join wms on layer.fkey_wms_id = wms.wms_id where layer.layer_id = $1) as wms_layer, layer_epsg where wms_layer.layer_id = layer_epsg.fkey_layer_id and layer_epsg.epsg = 'EPSG:4326';
+			select * from (select layer.layer_id, layer.layer_minscale, layer.layer_maxscale, wms.wms_timestamp, wms.wms_owner, wms.fkey_mb_group_id, wms.contactorganization, layer.uuid, wms.contactelectronicmailaddress, wms.wms_timestamp_create, wms.fees, wms.accessconstraints  from layer inner join wms on layer.fkey_wms_id = wms.wms_id where layer.layer_id = $1) as wms_layer, layer_epsg where wms_layer.layer_id = layer_epsg.fkey_layer_id and layer_epsg.epsg = 'EPSG:4326';
 SQL;
 		$v = array((integer)$mapbenderMetadata['resourceId']);
 		$t = array('i');
@@ -480,7 +481,7 @@
 	//How to generate UUIDs for INSPIRE Download Service Metadata records (not really needed for INSPIRE!!! See DB Metadata)
 	//12-4-4-4-8
 	//dataurl
-	//WMS uuid (12-4), Type (4) - 0001, MD uuid (4-8)
+	//LAYER uuid (12-4), Type (4) - 0001, MD uuid (4-8)
 	//wfs
 	//WFS uuid (12-4), MD uuid (4-4-8)
 	//wmsgetmap
@@ -490,6 +491,7 @@
 
 	if (isset($mapbenderMetadata['serviceUuid']) && $mapbenderMetadata['serviceUuid'] != '' ) {
 		$servicePart = explode('-',$mapbenderMetadata['serviceUuid']);
+		//in case of wmslayer and dataurl use layer_uuid - cause the same metadata record may be coupled with more than one layer of a service 
 		$mdPart = explode('-',$recordId);
 		switch ($generateFrom) {
 			case "wmslayer":

Modified: trunk/mapbender/http/php/mod_inspireDownloadFeed.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireDownloadFeed.php	2014-02-12 10:13:14 UTC (rev 8776)
+++ trunk/mapbender/http/php/mod_inspireDownloadFeed.php	2014-02-14 11:04:41 UTC (rev 8777)
@@ -327,6 +327,9 @@
 				case "wfs":
 					$mimetype = "application/gml+xml";
 				break;
+				case "metadata":
+					$mimetype = $formatsMimetype[$mapbenderMetadata[$m]->format];
+				break;
 	}
 	//check correct headers
 	foreach (apache_request_headers() as $name => $value) {



More information about the Mapbender_commits mailing list