[Mapbender-commits] r7629 - in trunk/mapbender: http/classes http/plugins resources/locale/de_DE/LC_MESSAGES

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Sat Feb 19 05:01:17 EST 2011


Author: armin11
Date: 2011-02-19 02:01:17 -0800 (Sat, 19 Feb 2011)
New Revision: 7629

Modified:
   trunk/mapbender/http/classes/class_weldMaps2JPEG.php
   trunk/mapbender/http/plugins/mb_metadata_wmcPreview.php
   trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
Log:
Fix problems with firewalls who dismiss urls when trying to save previews for wmc

Modified: trunk/mapbender/http/classes/class_weldMaps2JPEG.php
===================================================================
--- trunk/mapbender/http/classes/class_weldMaps2JPEG.php	2011-02-19 09:26:43 UTC (rev 7628)
+++ trunk/mapbender/http/classes/class_weldMaps2JPEG.php	2011-02-19 10:01:17 UTC (rev 7629)
@@ -34,8 +34,12 @@
 			$e = new mb_exception("weldMaps2JPEG: no maprequests delivered");
 		}
 		$url = explode("___", $urls);
-                
-		$obj1 = new stripRequest($url[0]);
+		for($i=0; $i<count($url); $i++){
+                	if ($url[$i] != false) {
+				$obj1 = new stripRequest($url[$i]);
+		  	break;
+			}
+		}
 		$width = $obj1->get("width");
 		$height = $obj1->get("height");
 		

Modified: trunk/mapbender/http/plugins/mb_metadata_wmcPreview.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wmcPreview.php	2011-02-19 09:26:43 UTC (rev 7628)
+++ trunk/mapbender/http/plugins/mb_metadata_wmcPreview.php	2011-02-19 10:01:17 UTC (rev 7629)
@@ -23,24 +23,43 @@
 }
 
 switch ($ajaxResponse->getMethod()) {
-	case "saveWmcPreview":			
+	case "saveWmcPreview":
+		//check if all urls have been send - sometimes only false is send - then delete this entry!
+		//loop
+		$mapUrlsNew = array();
+		$problemUrls = array();
+		for($i=0; $i<count($mapUrls); $i++){
+			if ($mapUrls[$i] != false) {
+				$mapUrlsNew[] = $mapUrls[$i];
+			} else {
+				$problemUrls[] = $i;
+			}
+		}
+		$listOfProblemUrls = implode($problemUrls,",");
+		$mapUrls = $mapUrlsNew;			
 		$img = new weldMaps2JPEG(implode("___",$mapUrls), PREVIEW_DIR."/".$wmcId."_wmc_preview.jpg");
 		if(!$img) {
 			$ajaxResponse->setSuccess(false);
-			$ajaxResponse->setMessage('Preview could not be created');
+			$ajaxResponse->setMessage(_mb('Preview could not be created'));
 			$ajaxResponse->send();
 		} 
 		else {
-			$ajaxResponse->setSuccess(true);
-			$ajaxResponse->setMessage('Preview saved');
-			$ajaxResponse->send();
+			if (count($problemUrls) > 0) {
+				$ajaxResponse->setSuccess(true);
+				$ajaxResponse->setMessage(_mb('Preview saved'));
+				$ajaxResponse->send();
+			} else {
+				$ajaxResponse->setSuccess(true);
+				$ajaxResponse->setMessage(_mb('Preview saved - but following service urls are not included cause the firewall prevent this!').": ".$listOfProblemUrls);
+				$ajaxResponse->send();
+			}
 		}
 
 		break;
 
 	default:
 		$ajaxResponse->setSuccess(false);
-		$ajaxResponse->setMessage("invalid method");
+		$ajaxResponse->setMessage(_mb("invalid method"));
 }
 $ajaxResponse->send();
 ?>

Modified: trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po
===================================================================
--- trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2011-02-19 09:26:43 UTC (rev 7628)
+++ trunk/mapbender/resources/locale/de_DE/LC_MESSAGES/Mapbender.po	2011-02-19 10:01:17 UTC (rev 7629)
@@ -2301,3 +2301,14 @@
 msgid "The selected service is already activated in your application and will not be included again:"
 msgstr "Der folgende Dienst befindet sich bereits unter 'Aktive Dienste', und wird nicht erneut hinzugefügt:"
 
+#:../
+msgid "Preview saved"
+msgstr "Vorschau gespeichert"
+
+msgid "Preview saved - but following service urls are not included cause the firewall prevent this!"
+msgstr "Vorschau gespeichert - aber folgende Dienste fehlen, weil die Firewall sie rausschmeißt!"
+
+msgid "Preview could not be created"
+msgstr "Vorschau konnte nicht gespeichert werden"
+
+



More information about the Mapbender_commits mailing list