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

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Mon Nov 23 02:41:01 PST 2015


Author: armin11
Date: 2015-11-23 02:41:01 -0800 (Mon, 23 Nov 2015)
New Revision: 9305

Modified:
   trunk/mapbender/http/classes/class_wmc.php
Log:
Option to handle new column uuid for wmc

Modified: trunk/mapbender/http/classes/class_wmc.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc.php	2015-11-23 10:39:59 UTC (rev 9304)
+++ trunk/mapbender/http/classes/class_wmc.php	2015-11-23 10:41:01 UTC (rev 9305)
@@ -27,6 +27,7 @@
 require_once(dirname(__FILE__) . "/../classes/class_administration.php");
 require_once(dirname(__FILE__) . "/../classes/class_wmcToXml.php");
 require_once(dirname(__FILE__) . "/../classes/class_user.php");
+require_once(dirname(__FILE__) . "/../classes/class_Uuid.php");
 
 /**
  * Implementation of a Web Map Context Document, WMC 1.1.0
@@ -94,9 +95,10 @@
 	var $userId;
 	var $timestamp;
 	var $public;
-    var $local_data_public = 0;
-    var $has_local_data = 0;
-    var $local_data_size = '0';
+        var $local_data_public = 0;
+        var $has_local_data = 0;
+        var $local_data_size = '0';
+	var $uuid; 
 
 	// set during parsing
 	var $wmc_version;
@@ -134,6 +136,8 @@
 	public function __construct () {
 		$this->userId = Mapbender::session()->get("mb_user_id");
 		$this->timestamp = time();
+		$this->uuid = new Uuid();
+
 	}
 
 	// ---------------------------------------------------------------------------
@@ -160,7 +164,7 @@
 			return false;
 		}
 		$this->createObjFromWMC_xml($doc);
-		$sql = "SELECT wmc_timestamp, wmc_title, wmc_public, srs, minx, miny, maxx, maxy, wmc_has_local_data, wmc_local_data_size, wmc_local_data_public " .
+		$sql = "SELECT wmc_timestamp, wmc_title, wmc_public, srs, minx, miny, maxx, maxy, wmc_has_local_data, wmc_local_data_size, wmc_local_data_public, uuid " .
 			"FROM mb_user_wmc WHERE wmc_serial_id = $1 AND (fkey_user_id = $2 OR wmc_public = 1)";
 		$v = array($wmcId, Mapbender::session()->get("mb_user_id"));
 		$t = array("i", "i");
@@ -180,6 +184,7 @@
             $this->local_data_public = $row[10];
             $this->local_data_size = $row[9];
             $this->has_local_data = $row[8];
+	    $this->uuid = $row[11];
 			return true;
 		}
 		return false;
@@ -877,12 +882,12 @@
 
 					$sql = "INSERT INTO mb_user_wmc (" .
 						"wmc_id, fkey_user_id, wmc, wmc_title, wmc_public, wmc_timestamp, wmc_timestamp_create, " .
-						"abstract, srs, minx, miny, maxx, maxy, wmc_serial_id, wmc_has_local_data, wmc_local_data_public, wmc_local_data_size".
-						") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17);";
+						"abstract, srs, minx, miny, maxx, maxy, wmc_serial_id, wmc_has_local_data, wmc_local_data_public, wmc_local_data_size, uuid".
+						") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18);";
 					$v = array(time(), $this->userId, $this->xml, administration::convertOutgoingString($this->wmc_title), $this->isPublic()?1:0,time(),time(),
                     $this->wmc_abstract, $this->wmc_srs, $this->wmc_extent->minx,  $this->wmc_extent->miny, $this->wmc_extent->maxx, $this->wmc_extent->maxy, $wmc_DB_ID_new,
-                    $this->has_local_data, $this->local_data_public, $this->local_data_size);
-					$t = array("s", "i", "s", "s", "i", "s","s", "s","s","i","i","i", "i", "i", "i", "i", "s");
+                    $this->has_local_data, $this->local_data_public, $this->local_data_size, $this->uuid);
+					$t = array("s", "i", "s", "s", "i", "s","s", "s","s","i","i","i", "i", "i", "i", "i", "s", "s");
 					$res = db_prep_query($sql, $v, $t);
 
 					//$sql = "SELECT max(wmc_serial_id) AS i FROM mb_user_wmc";
@@ -900,13 +905,13 @@
 
 				$sql = "INSERT INTO mb_user_wmc (" .
 					"wmc_id, fkey_user_id, wmc, wmc_title, wmc_public, wmc_timestamp, wmc_timestamp_create, " .
-					"abstract, srs, minx, miny, maxx, maxy, wmc_serial_id, wmc_has_local_data, wmc_local_data_public, wmc_local_data_size".
-					") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17);";
+					"abstract, srs, minx, miny, maxx, maxy, wmc_serial_id, wmc_has_local_data, wmc_local_data_public, wmc_local_data_size, uuid".
+					") VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18);";
 				//$e = new mb_exception($sql);
 				$v = array(time(), $this->userId, $this->xml, administration::convertOutgoingString($this->wmc_title), $this->isPublic()?1:0, time(),time(),
                 $this->wmc_abstract, $this->wmc_srs, $this->wmc_extent->minx,  $this->wmc_extent->miny, $this->wmc_extent->maxx, $this->wmc_extent->maxy, $wmc_DB_ID_new,
-                $this->has_local_data, $this->local_data_public, $this->local_data_size);
-				$t = array("s", "i", "s", "s", "i", "s","s", "s","s","i","i","i", "i", "i", "i", "i", "s");
+                $this->has_local_data, $this->local_data_public, $this->local_data_size, $this->uuid);
+				$t = array("s", "i", "s", "s", "i", "s","s", "s","s","i","i","i", "i", "i", "i", "i", "s", "s");
 				$res = db_prep_query($sql, $v, $t);
 
 



More information about the Mapbender_commits mailing list