[Mapbender-commits] r2053 - branches/2.5/http/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Feb 1 10:25:17 EST 2008
Author: christoph
Date: 2008-02-01 10:25:17 -0500 (Fri, 01 Feb 2008)
New Revision: 2053
Modified:
branches/2.5/http/classes/class_wms.php
Log:
merged w/ SLD branch
Modified: branches/2.5/http/classes/class_wms.php
===================================================================
--- branches/2.5/http/classes/class_wms.php 2008-02-01 14:41:57 UTC (rev 2052)
+++ branches/2.5/http/classes/class_wms.php 2008-02-01 15:25:17 UTC (rev 2053)
@@ -59,10 +59,16 @@
var $data_format = array();
var $objLayer = array();
+ var $wms_supportsld;
+ var $wms_userlayer;
+ var $wms_userstyle;
+ var $wms_remotewfs;
+
var $gui_wms_mapformat;
var $gui_wms_featureinfoformat;
var $gui_wms_exceptionformat;
var $gui_wms_epsg;
+ var $gui_wms_sldurl;
var $default_epsg = 0;
var $overwrite = true;
@@ -94,8 +100,7 @@
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1);
xml_parser_set_option($parser,XML_OPTION_TARGET_ENCODING,CHARSET);
-// xml_parse_into_struct($parser,$this->wms_getcapabilities_doc,$values,$tags);
- xml_parse_into_struct($parser,$data,$values,$tags);
+ xml_parse_into_struct($parser,$this->wms_getcapabilities_doc,$values,$tags);
$code = xml_get_error_code($parser);
if ($code) {
@@ -341,7 +346,14 @@
$section = "";
}
}
-
+ /* sld section */
+ if(mb_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(mb_strtoupper($element[tag]) == "LAYER"){
$section = "layer";
@@ -599,7 +611,22 @@
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>";
@@ -614,6 +641,7 @@
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 "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>";
@@ -675,7 +703,8 @@
"'" . $this->gui_wms_featureinfoformat . "'," .
"'" . $this->gui_wms_exceptionformat . "'," .
"'" . $this->gui_wms_epsg ."'," .
- "'" . $this->gui_wms_visible ."" .
+ "'" . $this->gui_wms_visible ."'," .
+ "'" . $this->gui_wms_sldurl ."" .
"');";
echo $add_wms_string;
@@ -765,7 +794,8 @@
$this->gui_wms_featureinfoformat ."','".
$this->gui_wms_exceptionformat . "','".
$this->gui_wms_epsg ."','".
- $this->gui_wms_visible ."');\n");
+ $this->gui_wms_visible ."','".
+ $this->gui_wms_sldurl ."');\n");
for($i=0;$i<count($this->data_format);$i++){
if($parent){
@@ -849,15 +879,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_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();
@@ -1143,7 +1175,6 @@
$sql_insertKeyword .= "VALUES ($1)";
$v1 = array($k[$j]);
$t1 = array('s');
- echo $k[$j];
$res_insertKeyword = db_prep_query($sql_insertKeyword,$v1,$t1);
if(!$res_insertKeyword){
db_rollback();
@@ -1182,13 +1213,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){
@@ -1376,7 +1412,7 @@
while($row = db_fetch_array($res)){
unset($mySubmit);
$myGUI[$cnt] = $row["fkey_gui_id"];
-
+
$sql = "UPDATE gui_wms SET ";
$v = array();
$t = array();
@@ -1467,7 +1503,7 @@
function getCapabilitiesDoc() {
return $this->wms_getcapabilities_doc;
}
-
+
/**
* creatObjfromDB
*
@@ -1489,6 +1525,7 @@
$this->gui_wms_exceptionformat=$row["gui_wms_exceptionformat"];
$this->gui_wms_epsg=$row["gui_wms_epsg"];
$this->gui_wms_visible = $row["gui_wms_visible"];
+ $this->gui_wms_sldurl = $row["gui_wms_sldurl"];
$sql = "Select * from wms where wms_id = $1 ";
$v = array($wms_id);
@@ -1517,6 +1554,10 @@
}
$this->wms_getcapabilities_doc = $row2["wms_getcapabilities_doc"];
$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