[Mapbender-commits] r1358 - branches/mapbender_sld/http/classes

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri May 25 04:02:32 EDT 2007


Author: mschulz
Date: 2007-05-25 04:02:32 -0400 (Fri, 25 May 2007)
New Revision: 1358

Modified:
   branches/mapbender_sld/http/classes/class_wms.php
Log:
added sld related parsing and db insert/update methods

Modified: branches/mapbender_sld/http/classes/class_wms.php
===================================================================
--- branches/mapbender_sld/http/classes/class_wms.php	2007-05-25 07:44:37 UTC (rev 1357)
+++ branches/mapbender_sld/http/classes/class_wms.php	2007-05-25 08:02:32 UTC (rev 1358)
@@ -335,6 +335,14 @@
 				$section = "";
 			}         
 	      }
+	      
+			/* sld section */	      
+			if(strtoupper($element[tag]) == "USERDEFINEDSYMBOLIZATION" && $element[type] == "complete"){
+				$this->wms_supportsld = $element[attributes]["SupportSLD"];
+				$this->wms_userlayer = $element[attributes]["UserLayer"];
+				$this->wms_userstyle = $element[attributes]["UserStyle"];
+				$this->wms_remotewfs = $element[attributes]["RemoteWFS"];
+			}
 	      
 			/*layer section*/				
 			if(strtoupper($element[tag]) == "LAYER"){
@@ -587,8 +595,23 @@
 		}
 		for($i=0; $i<count($this->objLayer); $i++){
 				$this->objLayer[$i]->layer_pos=$i;
+		}
+		
+		/* fill sld variables when empty */
+		if($this->wms_supportsld == ""){
+				$this->wms_supportsld = 0;
+		}
+		if($this->wms_userlayer == ""){
+				$this->wms_userlayer = 0;
+		}
+		if($this->wms_userstyle == ""){
+				$this->wms_userstyle = 0;
+		}
+		if($this->wms_remotewfs == ""){
+				$this->wms_remotewfs = 0;
 		}
-	  }
+	  }
+	  
 	function displayWMS(){
 		echo "<br>id: " . $this->wms_id . " <br>";
 		echo "version: " . $this->wms_version . " <br>";
@@ -602,7 +625,8 @@
 		echo "gui_wms_exceptionformat: " . $this->gui_wms_exceptionformat . " <br>";	
 		echo "gui_wms_epsg: " . $this->gui_wms_epsg . " <br>";
 		echo "wms_srs: " . $this->objLayer[0]->wms_srs1 . " <br>";		
-		echo "gui_wms_visible: " . $this->gui_wms_visible . " <br>";
+		echo "gui_wms_visible: " . $this->gui_wms_visible . " <br>";
+		echo "support_sld: " . $this->wms_supportsld . " <br>";
 		
 		for($i=0; $i<count($this->data_type);$i++){
 			echo $this->data_type[$i]. " -> ".$this->data_format[$i]. "<br>";
@@ -836,15 +860,17 @@
 		$sql.= "wms_getfeatureinfo, wms_getlegendurl, wms_getcapabilities_doc, wms_upload_url, fees, ";
 		$sql .= "accessconstraints, contactperson, contactposition, contactorganization, address, city, ";
 		$sql .= "stateorprovince, postcode, country, contactvoicetelephone, contactfacsimiletelephone, contactelectronicmailaddress, ";
-		$sql .= "wms_owner,wms_timestamp) ";
-		$sql .= "VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24)";
+		$sql .= "wms_owner,wms_timestamp, ";
+		$sql .= "wms_supportsld, wms_userlayer, wms_userstyle, wms_remotewfs) ";
+		$sql .= "VALUES($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18,$19,$20,$21,$22,$23,$24,$25,$26,$27,$28)";
 		$v = array($this->wms_version,$this->wms_title,$this->wms_abstract,$this->wms_getcapabilities,
 			$this->wms_getmap,$this->wms_getfeatureinfo,$this->wms_getlegendurl,$this->wms_getcapabilities_doc,
 			$this->wms_upload_url,$this->fees,$this->accessconstraints,$this->contactperson,$this->contactposition,
 			$this->contactorganization,$this->address,$this->city,$this->stateorprovince,$this->postcode,$this->country,
 			$this->contactvoicetelephone,$this->contactfacsimiletelephone,$this->contactelectronicmailaddress,
-			$_SESSION['mb_user_id'],strtotime("now"));
-		$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i');
+			$_SESSION['mb_user_id'],strtotime("now"),
+			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs );
+		$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i','s','s','s','s');
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
 			db_rollback();
@@ -1148,13 +1174,18 @@
 		$sql .= "wms_getcapabilities_doc = $6 ,";
 		$sql .= "wms_upload_url = $7,  ";
 		$sql .= "wms_owner = $8, ";
-		$sql .= "wms_timestamp = $9 ";
-		$sql .= " WHERE wms_id = $10";
+		$sql .= "wms_timestamp = $9, ";
+		$sql .= "wms_supportsld = $10, ";
+		$sql .= "wms_userlayer = $11, ";
+		$sql .= "wms_userstyle = $12, ";
+		$sql .= "wms_remotewfs = $13 ";
+		$sql .= " WHERE wms_id = $14";
 	
 		$v = array($this->wms_version,$this->wms_getcapabilities,
 			$this->wms_getmap,$this->wms_getfeatureinfo,$this->wms_getlegendurl,
-			$this->wms_getcapabilities_doc,$this->wms_upload_url,$_SESSION["mb_user_id"],strtotime("now"),$myWMS);
-		$t = array('s','s','s','s','s','s','s','i','i','i');
+			$this->wms_getcapabilities_doc,$this->wms_upload_url,$_SESSION["mb_user_id"],strtotime("now"),
+			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs,$myWMS);
+		$t = array('s','s','s','s','s','s','s','i','i','s','s','s','s','i');
 	
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
@@ -1458,7 +1489,11 @@
 				}			
 				$this->wms_getcapabilities_doc = $row2["wms_getcapabilities_doc"];
 				$this->wms_getlegendurl = $row2["wms_getlegendurl"];
-				$this->wms_filter = $row2["wms_filter"];
+				$this->wms_filter = $row2["wms_filter"];				
+				$this->wms_supportsld = $row2["wms_supportsld"];
+				$this->wms_userlayer = $row2["wms_userlayer"];
+				$this->wms_userstyle = $row2["wms_userstyle"];
+				$this->wms_remotewfs = $row2["wms_remotewfs"];
 				$count_wms++;
 			}
 	



More information about the Mapbender_commits mailing list