[Mapbender-commits] r7916 - in branches/2.7: http/print http/print/classes resources/db/pgsql/UTF-8/update

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Thu Jul 7 09:28:16 EDT 2011


Author: verenadiewald
Date: 2011-07-07 06:28:16 -0700 (Thu, 07 Jul 2011)
New Revision: 7916

Modified:
   branches/2.7/http/print/classes/mbMapDecorator.php
   branches/2.7/http/print/classes/mbOverviewDecorator.php
   branches/2.7/http/print/classes/mbTemplatePdf.php
   branches/2.7/http/print/printFactory.php
   branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.1_to_2.7.2_pgsql_UTF-8.sql
Log:
http://trac.osgeo.org/mapbender/ticket/829

Modified: branches/2.7/http/print/classes/mbMapDecorator.php
===================================================================
--- branches/2.7/http/print/classes/mbMapDecorator.php	2011-07-07 12:41:22 UTC (rev 7915)
+++ branches/2.7/http/print/classes/mbMapDecorator.php	2011-07-07 13:28:16 UTC (rev 7916)
@@ -88,9 +88,12 @@
 			$m->set('height',(intval($height*$res)));
 			$m->set('bbox', $this->pdf->getMapExtent());
 			$array_urls[$i] = $m->url;
+
 		}
-		
-		if ($this->angle != 0) {
+
+                $this->pdf->logWmsRequests("maps", $array_urls);
+
+                if ($this->angle != 0) {
 			if (class_exists('weldMaps2PNG_rotate')) {
 				$i = new weldMaps2PNG_rotate(implode("___",$array_urls), $this->filename, $this->angle, false);
 			} else {

Modified: branches/2.7/http/print/classes/mbOverviewDecorator.php
===================================================================
--- branches/2.7/http/print/classes/mbOverviewDecorator.php	2011-07-07 12:41:22 UTC (rev 7915)
+++ branches/2.7/http/print/classes/mbOverviewDecorator.php	2011-07-07 13:28:16 UTC (rev 7916)
@@ -75,6 +75,9 @@
 			}
 		}
 		$array_urls = $newArray_urls;
+
+                $this->pdf->logWmsRequests("overview", $array_urls);
+
 		$myURL = new stripRequest($array_urls[0]);
 		$myURL->set('bbox', $this->pdf->getMapExtent());
 		if ($this->angle != 0) {

Modified: branches/2.7/http/print/classes/mbTemplatePdf.php
===================================================================
--- branches/2.7/http/print/classes/mbTemplatePdf.php	2011-07-07 12:41:22 UTC (rev 7915)
+++ branches/2.7/http/print/classes/mbTemplatePdf.php	2011-07-07 13:28:16 UTC (rev 7916)
@@ -7,6 +7,8 @@
 	/* it seems several decorators are going to need this information */
 	public $mapInfo = array();
         public $unlinkFiles = false;
+        public $logRequests = false;
+        public $logType = "file";
 
 	public function __construct($jsonConf) {
 		$this->confPdf = $jsonConf;
@@ -105,6 +107,13 @@
                unlink($filename);
             }
         }
+
+        public function logWmsRequests($requestType, $wmsRequest) {
+            if($this->logRequests && $this->logRequests == 'true') {
+                include_once (dirname(__FILE__)."/../../classes/class_log.php");
+        	$logMessage = new log("printPDF_".$requestType,$wmsRequest,"",$this->logType);
+	    }
+        }
 }
 
 

Modified: branches/2.7/http/print/printFactory.php
===================================================================
--- branches/2.7/http/print/printFactory.php	2011-07-07 12:41:22 UTC (rev 7915)
+++ branches/2.7/http/print/printFactory.php	2011-07-07 13:28:16 UTC (rev 7916)
@@ -18,7 +18,10 @@
 
 $pdf = $pf->create($_REQUEST["printPDF_template"]);
 
+//element vars of print
 $pdf->unlinkFiles = $unlink;
+$pdf->logRequests = $logRequests;
+$pdf->logType = $logType;
 
 $pdf->render();
 try {

Modified: branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.1_to_2.7.2_pgsql_UTF-8.sql
===================================================================
--- branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.1_to_2.7.2_pgsql_UTF-8.sql	2011-07-07 12:41:22 UTC (rev 7915)
+++ branches/2.7/resources/db/pgsql/UTF-8/update/update_2.7.1_to_2.7.2_pgsql_UTF-8.sql	2011-07-07 13:28:16 UTC (rev 7916)
@@ -70,3 +70,17 @@
 FROM gui_element WHERE gui_element.e_id = 'printPDF' AND gui_element.e_js_file = '../plugins/mb_print.php' AND gui_element.fkey_gui_id
 NOT IN (SELECT fkey_gui_id FROM gui_element_vars
 WHERE var_name = 'unlink' AND fkey_e_id = 'printPDF');
+
+-- new element var logRequests for gui element template printPDF
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
+SELECT gui_element.fkey_gui_id, 'printPDF', 'logRequests', 'false', 'log wms requests for debugging' ,'php_var'
+FROM gui_element WHERE gui_element.e_id = 'printPDF' AND gui_element.e_js_file = '../plugins/mb_print.php' AND gui_element.fkey_gui_id
+NOT IN (SELECT fkey_gui_id FROM gui_element_vars
+WHERE var_name = 'logRequests' AND fkey_e_id = 'printPDF');
+
+-- new element var logRequests for gui element template printPDF
+INSERT INTO gui_element_vars(fkey_gui_id, fkey_e_id, var_name, var_value, context, var_type)
+SELECT gui_element.fkey_gui_id, 'printPDF', 'logType', 'file', 'log mode can be set to file or db' ,'php_var'
+FROM gui_element WHERE gui_element.e_id = 'printPDF' AND gui_element.e_js_file = '../plugins/mb_print.php' AND gui_element.fkey_gui_id
+NOT IN (SELECT fkey_gui_id FROM gui_element_vars
+WHERE var_name = 'logType' AND fkey_e_id = 'printPDF');



More information about the Mapbender_commits mailing list