[Mapbender-commits] r8785 - in trunk/mapbender: http/classes http/geoportal http/javascripts http/php lib resources/db/pgsql/UTF-8/update tools
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Feb 28 03:51:22 PST 2014
Author: armin11
Date: 2014-02-28 03:51:21 -0800 (Fri, 28 Feb 2014)
New Revision: 8785
Modified:
trunk/mapbender/http/classes/class_ows.php
trunk/mapbender/http/classes/class_ows_factory.php
trunk/mapbender/http/classes/class_universal_wfs_factory.php
trunk/mapbender/http/classes/class_universal_wms_factory.php
trunk/mapbender/http/classes/class_wfs.php
trunk/mapbender/http/classes/class_wfsToDb.php
trunk/mapbender/http/classes/class_wfs_1_0_factory.php
trunk/mapbender/http/classes/class_wfs_1_1_factory.php
trunk/mapbender/http/classes/class_wfs_2_0_factory.php
trunk/mapbender/http/classes/class_wfs_factory.php
trunk/mapbender/http/classes/class_wmc_factory.php
trunk/mapbender/http/classes/class_wms.php
trunk/mapbender/http/classes/class_wms_1_1_1_factory.php
trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php
trunk/mapbender/http/javascripts/initWmcObj.php
trunk/mapbender/http/javascripts/mod_wfsGazetteerEditor_client.php
trunk/mapbender/http/javascripts/mod_wfsGazetteerEditor_server.php
trunk/mapbender/http/php/mod_loadWFSCapabilities.php
trunk/mapbender/http/php/mod_loadwfs.php
trunk/mapbender/http/php/mod_loadwms.php
trunk/mapbender/http/php/mod_wfs_server.php
trunk/mapbender/lib/class_GetApi.php
trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
trunk/mapbender/tools/mod_runScheduler.php
Log:
New option to load wfs which is authenticated via http_auth (basic or digest), bugfixes
Modified: trunk/mapbender/http/classes/class_ows.php
===================================================================
--- trunk/mapbender/http/classes/class_ows.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_ows.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -45,8 +45,8 @@
var $electronicMailAddress;
var $country;
var $termsofuse;
+ var $auth = false; //array 'auth_type', 'auth_username', 'auth_password', default false
-
/**
* Removes the namespace from a tag name.
*
@@ -107,8 +107,12 @@
}
final protected function get ($url) {
- $connection = new connector($url);
- $e = new mb_notice("OWS REQUEST: " . $url);
+ if (!$this->auth) {
+ $connection = new connector($url);
+ } else {
+ $connection = new connector($url, $this->auth);
+ }
+ //$e = new mb_notice("OWS REQUEST: " . $url);
$data = $connection->file;
if (!$data) {
$e = new mb_exception("OWS request returned no result: " . $url);
@@ -122,16 +126,19 @@
$connection->set("httpType", "post");
$connection->set("httpContentType", "xml");
$connection->set("httpPostData", $postData);
-
- $e = new mb_notice("OWS REQUEST: " . $url . "\n\n" . $postData);
+ //$e = new mb_notice("OWS REQUEST: " . $url . "\n\n" . $postData);
$data = $connection->load($url);
+ if (!$this->auth) {
+ $data = $connection->load($url);
+ } else {
+ $data = $connection->load($url, $this->auth);
+ }
if (!$data) {
$e = new mb_exception("OWS request returned no result: " . $url . "\n" . $postData);
return null;
}
return $data;
}
-
-
+
}
?>
Modified: trunk/mapbender/http/classes/class_ows_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_ows_factory.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_ows_factory.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -31,7 +31,7 @@
* @return Ows
* @param $xml String
*/
- abstract public function createFromXml ($xml);
+ abstract public function createFromXml ($xml, $auth=false);
/**
* Creates an OWS from the Mapbender database.
@@ -100,8 +100,12 @@
* @return String
* @param $url String
*/
- final protected function get ($url) {
- $x = new connector($url);
+ final protected function get ($url, $auth=false) {
+ if (!$auth) {
+ $x = new connector($url);
+ } else {
+ $x = new connector($url, $auth);
+ }
$xml = $x->file;
if(!$xml){
throw new Exception("Unable to open document: " . $url);
@@ -117,13 +121,16 @@
* @return String
* @param $url String
*/
- final protected function post ($url, $postData) {
+ final protected function post ($url, $postData, $auth=false) {
$x = new connector();
$x->set("httpType", "post");
$x->set("httpPostData", $postData);
$x->set("httpContentType", "XML");
-
- $xml = $x->load($url);
+ if (!$auth) {
+ $xml = $x->load($url);
+ } else {
+ $xml = $x->load($url, $auth);
+ }
if(!$xml){
throw new Exception("Unable to open document: " . $url);
return null;
@@ -136,24 +143,41 @@
* which is retrieved from a URL.
*
* @return Ows
- * @param $url String
+ * @param $url String, $auth authentication info hash
*/
- final public function createFromUrl ($url) {
- try {
- $xml = $this->get($url);
+ final public function createFromUrl ($url, $auth=false) {
+ if (!$auth) {
+ try {
+ $xml = $this->get($url);
- $myOws = $this->createFromXml($xml);
- if ($myOws != null) {
- $myOws->uploadUrl = $url;
- return $myOws;
- }
+ $myOws = $this->createFromXml($xml);
+ if ($myOws != null) {
+ $myOws->uploadUrl = $url;
+ return $myOws;
+ }
+ return null;
+ }
+ catch (Exception $e) {
+ new mb_exception($e);
+ return null;
+ }
return null;
- }
- catch (Exception $e) {
- new mb_exception($e);
+ } else {
+ try {
+ $xml = $this->get($url, $auth);
+ $myOws = $this->createFromXml($xml, $auth);
+ if ($myOws != null) {
+ $myOws->uploadUrl = $url;
+ return $myOws;
+ }
+ return null;
+ }
+ catch (Exception $e) {
+ new mb_exception($e);
+ return null;
+ }
return null;
}
- return null;
}
}
-?>
\ No newline at end of file
+?>
Modified: trunk/mapbender/http/classes/class_universal_wfs_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_universal_wfs_factory.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_universal_wfs_factory.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -59,12 +59,11 @@
* the capabilities document up-front.
*
* @return Wfs
- * @param $xml String
+ * @param $xml String, $auth - optional array with authentication info, default false
*/
- public function createFromXml ($xml) {
+ public function createFromXml ($xml, $auth=false) {
try {
$version = $this->getVersionFromXml($xml);
-
switch ($version) {
case "1.0.0":
$factory = new Wfs_1_0_Factory();
@@ -79,7 +78,7 @@
throw new Exception("Unknown WFS version " . $version);
break;
}
- return $factory->createFromXml($xml);
+ return $factory->createFromXml($xml, $auth);
}
catch (Exception $e) {
new mb_exception($e);
Modified: trunk/mapbender/http/classes/class_universal_wms_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_universal_wms_factory.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_universal_wms_factory.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -51,7 +51,7 @@
* @return Wms
* @param $xml String
*/
- public function createFromXml ($xml) {
+ public function createFromXml ($xml, $auth=false) {
try {
$version = $this->getVersionFromXml($xml);
@@ -63,7 +63,7 @@
throw new Exception("Unknown WMS version " . $version);
break;
}
- return $factory->createFromXml($xml);
+ return $factory->createFromXml($xml, $auth);
}
catch (Exception $e) {
new mb_exception($e);
@@ -138,4 +138,4 @@
}
}
}
-?>
\ No newline at end of file
+?>
Modified: trunk/mapbender/http/classes/class_wfs.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_wfs.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -102,7 +102,8 @@
if ($filter != null) {
$url .= "&filter=" . urlencode($filter);
}
- return $this->get($url);
+ $e = new mb_notice("class_wfs.php: getFeatureGet: ".$url);
+ return $this->get($url); //from class_ows!
}
protected function getFeaturePost ($featureTypeName, $filter, $destSrs, $storedQueryId, $storedQueryParams, $maxFeatures) {
@@ -179,19 +180,20 @@
}
$postData .= "</wfs:GetFeature>";
+ $e = new mb_notice("class_wfs.php: getFeaturePost: ".$postData);
if ($filter == null) {
if ($maxFeatures != null) {
- $e = new mb_exception("maxfeatures: ".$maxFeatures);
+ $e = new mb_notice("maxfeatures: ".$maxFeatures);
return $this->getFeatureGet($featureTypeName, null, $maxFeatures);
} else {
- $e = new mb_exception("maxfeatures: ".$maxFeatures);
+ $e = new mb_notice("maxfeatures: ".$maxFeatures);
return $this->getFeatureGet($featureTypeName, null, null);
}
} else {
if (is_int($maxFeatures)) {
- return $this->post($this->getFeature."&MAXFEATURES=".$maxFeatures, $postData);
+ return $this->post($this->getFeature."&MAXFEATURES=".$maxFeatures, $postData); //from class_ows!
} else {
- return $this->post($this->getFeature, $postData);
+ return $this->post($this->getFeature, $postData); //from class_ows!
}
}
}
@@ -264,7 +266,7 @@
}
$postData = $this->wrapTransaction($featureType, $requestData);
- return $this->post($this->transaction, $postData);
+ return $this->post($this->transaction, $postData); //from class_ows!
}
protected function transactionInsert ($feature, $featureType, $authWfsConfElement, $gml, $geomColumnName) {
Modified: trunk/mapbender/http/classes/class_wfsToDb.php
===================================================================
--- trunk/mapbender/http/classes/class_wfsToDb.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_wfsToDb.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -58,9 +58,13 @@
$sql .= "city , deliverypoint , administrativearea , ";
$sql .= "postalcode , voice , facsimile , ";
$sql .= "electronicmailaddress , country , ";
- $sql .= "wfs_owner, wfs_timestamp, wfs_timestamp_create, uuid) ";
- $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)";
-
+ $sql .= "wfs_owner, wfs_timestamp, wfs_timestamp_create, uuid, wfs_username, wfs_password, wfs_auth_type) ";
+ $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, $29, $30)";
+ if (!($aWfs->auth)) {
+ $aWfs->auth['username'] = "";
+ $aWfs->auth['password'] = "";
+ $aWfs->auth['auth_type'] = "";
+ }
$v = array(
$aWfs->getVersion(),
$aWfs->name,
@@ -88,10 +92,13 @@
Mapbender::session()->get("mb_user_id"),
strtotime("now"),
strtotime("now"),
- $uuid
+ $uuid,
+ $aWfs->auth['username'],
+ $aWfs->auth['password'],
+ $aWfs->auth['auth_type']
);
- $t = array('s', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 'i', 'i','i','s');
+ $t = array('s', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 's', 'i', 'i','i','s','s','s','s');
$res = db_prep_query($sql, $v, $t);
@@ -159,7 +166,11 @@
if (!isset($aWfs->wfs_network_access) || ($aWfs->wfs_network_access == '')) {
$aWfs->wfs_network_access = intval('0');
}
-
+ if (!($aWfs->auth)) {
+ $aWfs->auth['username'] = "";
+ $aWfs->auth['password'] = "";
+ $aWfs->auth['auth_type'] = "";
+ }
$admin = new administration();
db_begin();
@@ -172,7 +183,7 @@
$sql .= "city = $16, deliverypoint = $17, administrativearea = $18, ";
$sql .= "postalcode = $19, voice = $20, facsimile = $21, ";
$sql .= "electronicmailaddress = $22, country = $23, ";
- $sql .= "wfs_timestamp = $24, wfs_network_access = $25, fkey_mb_group_id = $26, wfs_max_features = $28, inspire_annual_requests = $29 ";
+ $sql .= "wfs_timestamp = $24, wfs_network_access = $25, fkey_mb_group_id = $26, wfs_max_features = $28, inspire_annual_requests = $29, wfs_username = $30, wfs_password = $31, wfs_auth_type = $32";
$sql .= "WHERE wfs_id = $27";
$v = array(
@@ -204,10 +215,13 @@
$aWfs->fkey_mb_group_id,
$aWfs->id,
$aWfs->wfs_max_features,
- $aWfs->inspire_annual_requests
+ $aWfs->inspire_annual_requests,
+ $aWfs->auth['username'],
+ $aWfs->auth['password'],
+ $aWfs->auth['auth_type'],
);
- $t = array('s', 's', 's', 's', 's', 's', 's', 's' ,'s' ,'s' ,'s' ,'s','s' ,'s','s','s','s','s','s','s','s','s','s','i','i','i','i','i','i');
+ $t = array('s', 's', 's', 's', 's', 's', 's', 's' ,'s' ,'s' ,'s' ,'s','s' ,'s','s','s','s','s','s','s','s','s','s','i','i','i','i','i','i','s','s','s');
$e = new mb_notice("class_wfsToDb.php: UPDATING WFS " . $aWfs->id);
$res = db_prep_query($sql, $v, $t);
if (!$res) {
@@ -409,7 +423,7 @@
*/
public static function delete ($aWfs) {
//first delete coupled metadata, cause there is no contraints in the database to do so
- $e = new mb_exception("Deleting MetadataURLs for wfs with id :".$aWfs->id);
+ $e = new mb_notice("Deleting MetadataURLs for wfs with id :".$aWfs->id);
//WfsToDb::deleteFeatureTypeMetadataUrls($aWfs->id); //Not needed any more, cause the relations are deleted thru class_iso19139.php
//then delete wfs itself
$sql = "DELETE FROM wfs WHERE wfs_id = $1";
@@ -1075,7 +1089,7 @@
}
}
// insert feature type MetadataURL
- $e = new mb_exception("Number of metadataurls for featuretype ".$aWfsFeatureType->id." : ".count($aWfsFeatureType->metadataUrlArray));
+ $e = new mb_notice("Number of metadataurls for featuretype ".$aWfsFeatureType->id." : ".count($aWfsFeatureType->metadataUrlArray));
for ($i = 0; $i < count($aWfsFeatureType->metadataUrlArray); $i++) {
$metadataUrl = $aWfsFeatureType->metadataUrlArray[$i];
if (!WfsToDb::insertFeatureTypeMetadataUrl($aWfsFeatureType->id, $metadataUrl)) {
Modified: trunk/mapbender/http/classes/class_wfs_1_0_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_0_factory.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_wfs_1_0_factory.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -36,12 +36,15 @@
$aWfs->getConjunctionCharacter($aWfs->describeFeatureType) .
"&SERVICE=WFS&VERSION=" . $aWfs->getVersion() .
"&REQUEST=DescribeFeatureType&TYPENAME=" . $featureTypeName;
-
- $xml = $this->get($url);
+ if (isset($aWfs->auth)) {
+ $xml = $this->get($url, $aWfs->auth);
+ } else {
+ $xml = $this->get($url);
+ }
return $this->createFeatureTypeFromXml ($xml, $aWfs,$featureTypeName);
}
- protected function createFeatureTypeFromXml ($xml, $myWfs,$featureTypeName) {
+ protected function createFeatureTypeFromXml ($xml, $myWfs, $featureTypeName) {
$newFeatureType = new WfsFeatureType($myWfs);
$doc = new DOMDocument();
@@ -121,16 +124,18 @@
* @return Wfs_1_0
* @param $xml String
*/
- public function createFromXml ($xml) {
+ public function createFromXml ($xml, $auth=false) {
try {
-
$myWfs = new Wfs_1_0();
-
//new for parsing with simple xml:
$admin = new administration();
$myWfs->getCapabilitiesDoc = $admin->char_encode($xml);
$myWfs->id = $this->createId();
-
+ //check for authentication
+ if (!$auth) {
+ $e = new mb_notice("class_wfs_1_0_factory.php - createFromXml - no athentication info given!");
+ }
+ $myWfs->auth = $auth; //always!
try {
$xml = str_replace('xlink:href', 'xlinkhref', $xml);
#http://forums.devshed.com/php-development-5/simplexml-namespace-attributes-problem-452278.html
Modified: trunk/mapbender/http/classes/class_wfs_1_1_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_1_factory.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_wfs_1_1_factory.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -71,8 +71,11 @@
$url = $aWfs->describeFeatureType .
$aWfs->getConjunctionCharacter($aWfs->describeFeatureType) .
implode("&", $paramArray);
- $e = new mb_exception($url);
- $xml = $this->get($url);
+
+ if (!($aWfs->auth)) {
+ $e = new mb_notice("class_wfs_1_1_factory.php - createFeatureTypeFromUrlGet: authentication for wfs not given");
+ }
+ $xml = $this->get($url, $aWfs->auth);
//parse result to see if it is a real featuretype description
return $this->createFeatureTypeFromXml ($xml, $aWfs, $featureTypeName);
@@ -86,10 +89,9 @@
*/
protected function createFeatureTypeFromXml ($xml, $myWfs, $featureTypeName) {
$newFeatureType = new WfsFeatureType($myWfs);
- //$e = new mb_exception($xml);
$doc = new DOMDocument();
$doc->loadXML($xml);
- $e = new mb_exception("class_wfs_1_1_factory.php: Got following FeatureType XML: ".$xml);
+ $e = new mb_notice("class_wfs_1_1_factory.php: Got following FeatureType XML: ".$xml);
$xpath = new DOMXpath($doc);
$xpath->registerNamespace("xs","http://www.w3.org/2001/XMLSchema");
@@ -164,17 +166,18 @@
* @return Wfs_1_1
* @param $xml String
*/
- public function createFromXml ($xml) {
+ public function createFromXml ($xml, $auth=false) {
try {
-
$myWfs = new Wfs_1_1();
-
$admin = new administration();
$myWfs->getCapabilitiesDoc = $admin->char_encode($xml);
$myWfs->id = $this->createId();
-
+ //check for authentication
+ if (!$auth) {
+ $e = new mb_notice("class_wfs_1_1_factory.php - createFromXml - no authentication info given!");
+ }
+ $myWfs->auth = $auth; //always!
$featuretype_crsArray = array();//new for wfs 1.1.0
-
try {
$xml = str_replace('xlink:href', 'xlinkhref', $xml);
#http://forums.devshed.com/php-development-5/simplexml-namespace-attributes-problem-452278.html
@@ -259,7 +262,7 @@
$myWfs->getCapabilities = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Operation[@name="GetCapabilities"]/ows:DCP/ows:HTTP/ows:Get/@xlinkhref');
$myWfs->getCapabilities = html_entity_decode($myWfs->getCapabilities[0]);
- $e = new mb_exception($myWfs->getCapabilities);#get
+ $e = new mb_notice($myWfs->getCapabilities);#get
$myWfs->describeFeatureType = $wfs11Cap->xpath('/wfs:WFS_Capabilities/ows:OperationsMetadata/ows:Operation[@name="DescribeFeatureType"]/ows:DCP/ows:HTTP/ows:Get/@xlinkhref');
$myWfs->describeFeatureType = html_entity_decode($myWfs->describeFeatureType[0]);#get
Modified: trunk/mapbender/http/classes/class_wfs_2_0_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_2_0_factory.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_wfs_2_0_factory.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -48,8 +48,11 @@
}
$postData .= "><TypeName>" . $featureTypeName . "</TypeName>" .
"</DescribeFeatureType>";
-
- $xml = $this->post($aWfs->describeFeatureType, $postData);
+ if (isset($aWfs->auth)) {
+ $xml = $this->post($aWfs->describeFeatureType, $postData, $aWfs->auth);
+ } else {
+ $xml = $this->post($aWfs->describeFeatureType, $postData);
+ }
return $this->createFeatureTypeFromXml ($xml, $aWfs, $featureTypeName);
}
@@ -73,7 +76,7 @@
$aWfs->getConjunctionCharacter($aWfs->describeFeatureType) .
implode("&", $paramArray);
- $xml = $this->get($url);
+ $xml = $this->get($url, $aWfs->auth);
//parse result to see if it is a real featuretype description
return $this->createFeatureTypeFromXml ($xml, $aWfs, $featureTypeName);
@@ -90,7 +93,7 @@
$aWfs->getConjunctionCharacter($listStoredQueries) .
implode("&", $paramArray);
- $xml = $this->get($url);
+ $xml = $this->get($url, $aWfs->auth);
#$e = new mb_notice("class_wfs_2_0_factory.php: Got following StoredQuery XML: ".$xml);
@@ -284,17 +287,17 @@
* @return Wfs_2_0
* @param $xml String
*/
- public function createFromXml ($xml) {
+ public function createFromXml ($xml, $auth=false) {
try {
-
$myWfs = new Wfs_2_0();
-
$admin = new administration();
$myWfs->getCapabilitiesDoc = $admin->char_encode($xml);
$myWfs->id = $this->createId();
-
+ if (!$auth) {
+ $e = new mb_notice("class_wfs_2_0_factory.php - createFromXml - no athentication info given!");
+ }
+ $myWfs->auth = $auth; //always!
$featuretype_crsArray = array();
-
try {
$xml = str_replace('xlink:href', 'xlinkhref', $xml);
#http://forums.devshed.com/php-development-5/simplexml-namespace-attributes-problem-452278.html
Modified: trunk/mapbender/http/classes/class_wfs_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_factory.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_wfs_factory.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -113,6 +113,14 @@
$aWfs->inspire_annual_requests = db_result($res, $cnt, "inspire_annual_requests");
$aWfs->fkey_mb_group_id = db_result($res, $cnt, "fkey_mb_group_id");
$aWfs->uuid = db_result($res, $cnt, "uuid");
+ if(db_result($res, $cnt, "wfs_username") != '' && db_result($res, $cnt, "wfs_auth_type") !='' && db_result($res, $cnt, "wfs_password") !=''){
+ $e = new mb_notice("class_wfs_factory.php - createFromDb: wfs has all 3 auth strings not empty!");
+ $aWfs->auth['username'] = db_result($res, $cnt, "wfs_username");
+ $aWfs->auth['password'] = db_result($res, $cnt, "wfs_password");
+ $aWfs->auth['auth_type'] = db_result($res, $cnt, "wfs_auth_type");
+ } else {
+ $aWfs->auth = false;
+ }
// Featuretypes
$sql_fe = "SELECT * FROM wfs_featuretype WHERE fkey_wfs_id = $1 ORDER BY featuretype_id";
$v = array($aWfs->id);
Modified: trunk/mapbender/http/classes/class_wmc_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wmc_factory.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_wmc_factory.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -24,10 +24,10 @@
* @return wmc
* @param $xml String
*/
- public function createFromXml ($xml) {
+ public function createFromXml ($xml, $auth=false) {
try {
$wmc = new wmc();
- $wmc->createFromXml($xml);
+ $wmc->createFromXml($xml, $auth);
}
catch (Exception $e) {
throw new Exception("Could not create WMC from XML.");
Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_wms.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -527,7 +527,6 @@
$res = db_query($sql);
while ($row = db_fetch_array($res)){
$inspireCatHash[$row['inspire_category_code_en']] = (integer)$row['inspire_category_id'];
- //$e = new mb_exception("inspireCatHash: ".$row['inspire_category_code_en'] ." : ". $row['inspire_category_id'] );
}
//custom
//keywords - as text i custom category - special keywords of geoportal instance defined as keys!
@@ -535,8 +534,7 @@
$sql = "SELECT custom_category_id, custom_category_key FROM custom_category";
$res = db_query($sql);
while ($row = db_fetch_array($res)){
- $customCatHash[$row['custom_category_key']] = (integer)$row['custom_category_id'];
- //$e = new mb_exception("customCatHash: ".$row['custom_category_key'] ." : ". $row['custom_category_id'] );
+ $customCatHash[$row['custom_category_key']] = (integer)$row['custom_category_id'];
}
$data = $x->file;
if ($data=='401') {
@@ -1086,10 +1084,10 @@
$returnObject['message'] = _mb("WMS has double layer names and could therefor not be loaded!");
return $returnObject;
}
-
+
if(!$this->wms_title || $this->wms_title == "" || !$this->wms_getmap || $this->wms_getmap == ""){
$this->wms_status = false;
- $this->optimizeWMS();
+ //$this->optimizeWMS();
$e = new mb_exception("class_wms: createObjFromXML: WMS " . $url . " could not be loaded.");
$returnObject['success'] = false;
$returnObject['message'] = _mb("WMS could not be loaded!");
@@ -1163,8 +1161,9 @@
#some default
$this->gui_wms_visible = 1;
$this->gui_wms_opacity = 100;
- /*if the rootlayer has no epsg...*/
- if($this->objLayer[0]->layer_epsg[0]["epsg"] == ""){
+ /*if the rootlayer has no epsg...read them from following layer TODO what if this layer have also no SRS?*/
+ $testVar = $this->objLayer[0]->layer_epsg[0]["epsg"];
+ if($this->objLayer[0]->layer_epsg[0]["epsg"] == "" || empty($testVar)){
$this->objLayer[0]->layer_epsg = $this->objLayer[1]->layer_epsg;
for($i=0;$i<count($this->objLayer[0]->layer_epsg);$i++){
for($j=1; $j<count($this->objLayer); $j++){
@@ -2651,7 +2650,6 @@
$this->wms_network_access = $row["wms_network_access"];
$this->wms_max_imagesize = $row["wms_max_imagesize"];
$this->inspire_annual_requests = $row["inspire_annual_requests"];
- //$e = new mb_exception("class_wms.php: wms_network_access from database: ".$this->wms_network_access);
}
//if network access is either stored in database nor given thru object, set it too a default value 0
if (!isset($this->wms_network_access) || ($this->wms_network_access == '')) {
@@ -2848,7 +2846,6 @@
if($i>0){$sql .= ',';}
$sql .= "$".$c;
array_push($v,$this->objLayer[$i]->layer_name);
- #$e = new mb_exception("class_wms: old layer name added for read: ".$this->objLayer[$i]->layer_name);
array_push($t,'s');
$c++;
}
@@ -2896,7 +2893,6 @@
if($i>0){$sql .= ',';}
$sql .= "$".$c;
array_push($v,$this->objLayer[$i]->layer_name);
- #$e = new mb_exception("class_wms: old layer name added for delete: ".$this->objLayer[$i]->layer_name);
array_push($t,'s');
$c++;
}
@@ -3406,7 +3402,6 @@
else{
if($row2["legendurl"]!=''){
$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["legendurl"]=$row2["legendurl"];
- #$e = new mb_exception("legendurl = ".$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["legendurl"]);
}
}
$this->objLayer[$layer_cnt]->layer_style[$count_layer_style]["legendurlformat"]=$row2["legendurlformat"];
@@ -3485,7 +3480,6 @@
$this->gui_wms_opacity = 100;
//the following things are not given without a special gui!!!!!
$this->gui_wms_epsg=$row["gui_wms_epsg"];
- //$e = new mb_exception("gui_wms_epsg: ".$this->gui_wms_epsg); --this is not there if update of metadata is made! Problem when updateing metadata with metadata editor
$this->gui_wms_sldurl = $row["gui_wms_sldurl"];
if($this->wms_version == "1.0.0"){
Modified: trunk/mapbender/http/classes/class_wms_1_1_1_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wms_1_1_1_factory.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/classes/class_wms_1_1_1_factory.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -24,7 +24,7 @@
* @return Wms
* @param $xml String
*/
- public function createFromXml ($xml) {
+ public function createFromXml ($xml, $auth=false) {
}
public function createFromDb ($id) {
Modified: trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/geoportal/mod_pullInspireMonitoring.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -247,13 +247,15 @@
select metadata_layer.title, metadata_layer.uuid, resource_id, resource_uuid, resource_type, inspire_actual_coverage, inspire_whole_area, service_id, inspire_download, wms_owner as service_owner, fkey_mb_group_id as service_group, wms_title as service_title, f_collect_inspire_cat_layer(resource_id) as inspire_cat from (select title,uuid ,resource_uuid, layer_id as resource_id, 'layer' as resource_type, fkey_wms_id as service_id, inspire_download, inspire_actual_coverage, inspire_whole_area from (select layer.layer_id, layer.fkey_wms_id, layer.uuid as resource_uuid, layer.inspire_download, layer_custom_category.fkey_custom_category_id from layer inner join layer_custom_category on layer.layer_id = layer_custom_category.fkey_layer_id where layer_custom_category.fkey_custom_category_id = $inspireCatId AND layer_searchable = 1 ORDER BY layer_id) as layer_inspire inner join (select metadata_id, uuid, title, inspire_actual_coverage, inspire_whole_area, fkey_layer_id from mb_metada
ta inner join ows_relation_metadata on ows_relation_metadata.fkey_metadata_id = mb_metadata.metadata_id) as metadata_relation on metadata_relation.fkey_layer_id = layer_inspire.layer_id) as metadata_layer INNER JOIN wms ON metadata_layer.service_id = wms_id
+
+SQL;
+/*
union
select metadata_featuretype.title, metadata_featuretype.uuid, resource_id, resource_uuid, resource_type,inspire_actual_coverage, inspire_whole_area, service_id, inspire_download, wfs_owner as service_owner, fkey_mb_group_id as service_group, wfs_title as service_title, f_collect_inspire_cat_wfs_featuretype(resource_id) as inspire_cat from (select title, uuid, resource_uuid, featuretype_id as resource_id, 'wfs_featuretype' as resource_type, fkey_wfs_id as service_id, inspire_download, inspire_actual_coverage, inspire_whole_area from (select wfs_featuretype.featuretype_id ,wfs_featuretype.fkey_wfs_id, wfs_featuretype.inspire_download, wfs_featuretype.uuid as resource_uuid from wfs_featuretype) as featuretype_inspire inner join (select metadata_id, uuid, title, fkey_featuretype_id, inspire_actual_coverage, inspire_whole_area from mb_metadata inner join ows_relation_metadata on ows_relation_metadata.fkey_metadata_id = mb_metadata.metadata_id) as metadata_relation on metadata_re
lation.fkey_featuretype_id = featuretype_inspire.featuretype_id) as metadata_featuretype INNER JOIN wfs ON metadata_featuretype.service_id = wfs_id
order by uuid
-SQL;
-
+*/
} else {
@@ -265,15 +267,17 @@
select metadata_featuretype.title, wfs.uuid as service_uuid, wfs_title || ':' || featuretype_title as inspire_service_title, metadata_featuretype.uuid, metadata_featuretype.datasetid, metadata_featuretype.datasetid_codespace, resource_id, resource_uuid, resource_type, service_id, inspire_download, wfs_owner as service_owner, fkey_mb_group_id as service_group, wfs_title as service_title, f_collect_inspire_cat_wfs_featuretype(resource_id) as inspire_cat from (select title, uuid, datasetid, datasetid_codespace, featuretype_id as resource_id, 'wfs_featuretype' as resource_type, resource_uuid, fkey_wfs_id as service_id, inspire_download, featuretype_title from (select wfs_featuretype.featuretype_id , wfs_featuretype.featuretype_title, wfs_featuretype.fkey_wfs_id, wfs_featuretype.inspire_download, wfs_featuretype.uuid as resource_uuid from wfs_featuretype inner join wfs_featuretype_custom_category on wfs_featuretype.featuretype_id = wfs_featuretype_custom_category.fkey_featuretyp
e_id where wfs_featuretype_custom_category.fkey_custom_category_id = $inspireCatId AND featuretype_searchable = 1 ORDER BY featuretype_id) as featuretype_inspire inner join (select metadata_id, datasetid, datasetid_codespace, uuid, title, fkey_featuretype_id from mb_metadata inner join ows_relation_metadata on ows_relation_metadata.fkey_metadata_id = mb_metadata.metadata_id) as metadata_relation on metadata_relation.fkey_featuretype_id = featuretype_inspire.featuretype_id) as metadata_featuretype INNER JOIN wfs ON metadata_featuretype.service_id = wfs_id
-union
-select title, null as service_uuid, null as inspire_service_title, uuid, datasetid, datasetid_codespace, metadata_id as resource_id, null as resource_uuid, null as resource_type, null as service_id, null as inspire_download, fkey_mb_user_id as service_owner, null as service_group, null as service_title, f_collect_inspire_cat_dataset(metadata_id) as inspire_cat from mb_metadata inner join mb_metadata_custom_category on mb_metadata.metadata_id = mb_metadata_custom_category.fkey_metadata_id where mb_metadata_custom_category.fkey_custom_category_id = $inspireCatId
) as foo $sWhere $sOrder $sLimit
SQL;
+/*
+union
+select title, null as service_uuid, null as inspire_service_title, uuid, datasetid, datasetid_codespace, metadata_id as resource_id, null as resource_uuid, null as resource_type, null as service_id, null as inspire_download, fkey_mb_user_id as service_owner, null as service_group, null as service_title, f_collect_inspire_cat_dataset(metadata_id) as inspire_cat from mb_metadata inner join mb_metadata_custom_category on mb_metadata.metadata_id = mb_metadata_custom_category.fkey_metadata_id where mb_metadata_custom_category.fkey_custom_category_id = $inspireCatId
+*/
}
$startTime = microtime();
//get all service / owner / fkey_group information for the list of services
Modified: trunk/mapbender/http/javascripts/initWmcObj.php
===================================================================
--- trunk/mapbender/http/javascripts/initWmcObj.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/javascripts/initWmcObj.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -335,10 +335,8 @@
//KML
//
$inputKmlArray = $getApi->getKml();
-$e = new mb_exception("initWmcObj.php: check KML API");
if($inputKmlArray){
$wmc->generalExtensionArray['KML'] = $inputKmlArray;
- $e = new mb_exception("initWmcObj.php: found KML");
}
//TODO test following
//workaround to have a fully merged WMC for loading
Modified: trunk/mapbender/http/javascripts/mod_wfsGazetteerEditor_client.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfsGazetteerEditor_client.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/javascripts/mod_wfsGazetteerEditor_client.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -634,11 +634,22 @@
var submit_attr = document.getElementById("attrPanel_Submit");
var epsgCode = parent.mb_mapObj[ind].getSRS().toUpperCase();
- var epsgCodeSplit = epsgCode.split(":");
+ var epsgString = parent.mb_mapObj[ind].getSRS();
+ //check for "http://www.opengis.net/gml/srs/epsg.xml#4326"
+ if (epsgString.search("http://www.opengis.net/gml/srs/epsg.xml") !== -1) {
+ var epsgCodeSplit = epsgCode.split("#");
+ } else {
+ var epsgCodeSplit = epsgCode.split(":");
+ }
var epsgString = epsgCodeSplit[1];
- var ftSrs = global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
- var ftSrsSplit = ftSrs.split(":");
+ var ftSrs = global_wfsConfObj[global_selectedWfsConfId].featuretype_srs;
+ //check for "http://www.opengis.net/gml/srs/epsg.xml#4326"
+ if (ftSrs.search("http://www.opengis.net/gml/srs/epsg.xml") !== -1) {
+ var ftSrsSplit = ftSrs.split("#");
+ } else {
+ var ftSrsSplit = ftSrs.split(":");
+ }
if(ftSrsSplit.length > 2) {
if(ftSrsSplit.length == 6) {
Modified: trunk/mapbender/http/javascripts/mod_wfsGazetteerEditor_server.php
===================================================================
--- trunk/mapbender/http/javascripts/mod_wfsGazetteerEditor_server.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/javascripts/mod_wfsGazetteerEditor_server.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -169,9 +169,9 @@
$myWfsFactory = new UniversalWfsFactory();
$myWfs = $myWfsFactory->createFromDb($wfsId);
$data = $myWfs->getFeature($typename, $filter,$destSrs, $storedQueryId, $storedQueryParams, null);
+ //$e = new mb_exception($filter);
+ $e = new mb_exception($data);
- #new mb_exception($data);
-
if ($data === null) die('{}');
if (defined("WFS_RESPONSE_SIZE_LIMIT") && WFS_RESPONSE_SIZE_LIMIT < strlen($data)) {
@@ -214,13 +214,14 @@
$myWfsFactory = new UniversalWfsFactory();
$myWfs = $myWfsFactory->createFromDb($wfsId);
$data = $myWfs->getFeature($wfsFeatureTypeName, null, $destSrs, null, null, 20);
+ $e = new mb_exception($data);
if ($data === null) die('{}');
if (defined("WFS_RESPONSE_SIZE_LIMIT") && WFS_RESPONSE_SIZE_LIMIT < strlen($data)) {
die("Too many results, please restrict your search.");
}
$gmlFactory = new UniversalGmlFactory();
- //TODO: The follwoning code is not nice but more stable - exchange it later with the code below!
+ //TODO: The following code is not nice but more stable - exchange it later with the code below!
$parser = xml_parser_create();
xml_parser_set_option($parser,XML_OPTION_CASE_FOLDING,0);
xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1);
Modified: trunk/mapbender/http/php/mod_loadWFSCapabilities.php
===================================================================
--- trunk/mapbender/http/php/mod_loadWFSCapabilities.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/php/mod_loadWFSCapabilities.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -164,8 +164,19 @@
if (isset($xml_file)){
echo"<input type='text' name='xml_file' size='50' value='".$xml_file."'>";
}else{
- echo"<input type='text' name='xml_file' size='50' value='http://'>";
+ echo"<input type='text' name='xml_file' size='50' value='http://'><br>";
}
+//show fields for authentication - only possible if curl is used as connector!
+if (CONNECTION == 'curl') {
+ echo"HTTP Authentication:<br>";
+ echo"<input type='radio' name='auth_type' checked='checked' value='none'>None<br>";
+ echo"<input type='radio' name='auth_type' value='digest'>Digest<br>";
+ echo"<input type='radio' name='auth_type' value='basic'>Basic<br>";
+ echo"Username<br>";
+ echo"<input type='text' name='username' size='50' value=''><br>";
+ echo"Password:<br>";
+ echo"<input type='text' name='password' size='50' value=''><br>";
+}
echo"<input type='button' name='loadCap' value='Load' onClick='validate(\"guiList\")'>";
echo "</form>";
?>
Modified: trunk/mapbender/http/php/mod_loadwfs.php
===================================================================
--- trunk/mapbender/http/php/mod_loadwfs.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/php/mod_loadwfs.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -24,25 +24,56 @@
echo "file: ".$_REQUEST["xml_file"];
echo "<br>-------------------------------<br>";
-
$guiList = mb_validateInput($_REQUEST["guiList"]);
$url = mb_validateInput($_REQUEST["xml_file"]);
-
$myWfsFactory = new UniversalWfsFactory();
-$myWfs = $myWfsFactory->createFromUrl($url);
-
-if (is_null($myWfs)) {
- echo "WFS could not be uploaded.";
- die;
+if ($_REQUEST["auth_type"] == 'basic' || $_REQUEST["auth_type"] == 'digest') {
+ $auth = array();
+ $auth['username'] = $_REQUEST["username"];
+ $auth['password'] = $_REQUEST["password"];
+ $auth['auth_type'] = $_REQUEST["auth_type"];
}
+if (isset($auth)) {
+ echo "auth set";
+ echo $auth['username']."<br>";
+ echo $auth['password']."<br>";
+ echo $auth['auth_type']."<br>";
+ $myWfs = $myWfsFactory->createFromUrl($url, $auth);
+ //store the authentication information in the object
+ $myWfs->auth = $auth;
+ if (isset($myWfs->auth)) {
+ $e = new mb_exception("ows auth set");
+ }
+ //TODO
+ //$myWfs = $myWfsFactory->createFromUrl($url,$auth);
+ /*$result = $mywms->createObjFromXML($xml, $auth);
+ if ($result['success']) {
+ $mywms->writeObjInDB($gui_id, $auth);
+ } else {
+ echo $result['message'];
+ die();
+ }*/
+} else {
+ $myWfs = $myWfsFactory->createFromUrl($url);
+ if (is_null($myWfs)) {
+ echo "WFS could not be uploaded.";
+ die;
+ }
+ /*$result = $mywms->createObjFromXML($xml);
+ if ($result['success']) {
+ $mywms->writeObjInDB($gui_id);
+ } else {
+ echo $result['message'];
+ die();
+ }*/
+}
+$e = new mb_exception($myWfs->auth['username']);
$myWfs->insertOrUpdate();
-
// link WFS to GUIs in $guiList
$guiArray = explode(",", $guiList);
foreach ($guiArray as $appName) {
$currentApp = new gui($appName);
$currentApp->addWfs($myWfs);
}
-
echo $myWfs;
?>
Modified: trunk/mapbender/http/php/mod_loadwms.php
===================================================================
--- trunk/mapbender/http/php/mod_loadwms.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/php/mod_loadwms.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -21,19 +21,16 @@
require_once(dirname(__FILE__) . "/../classes/class_wms.php");
if(isset($_REQUEST["wms_id"]) == false) {
- echo "file: ".$_REQUEST["xml_file"];
- $gui_id = $_REQUEST["guiList"];
- $xml = $_REQUEST["xml_file"];
-
- if ($_REQUEST["auth_type"] == 'basic'
- || $_REQUEST["auth_type"] == 'digest') {
-
+ echo "file: ".$_REQUEST["xml_file"];
+ $gui_id = $_REQUEST["guiList"];
+ $xml = $_REQUEST["xml_file"];
+ if ($_REQUEST["auth_type"] == 'basic' || $_REQUEST["auth_type"] == 'digest') {
$auth = array();
- $auth['username'] = $_REQUEST["username"];
- $auth['password'] = $_REQUEST["password"];
- $auth['auth_type'] = $_REQUEST["auth_type"];
- }
- $mywms = new wms();
+ $auth['username'] = $_REQUEST["username"];
+ $auth['password'] = $_REQUEST["password"];
+ $auth['auth_type'] = $_REQUEST["auth_type"];
+ }
+ $mywms = new wms();
if(empty($_POST['twitter_news'])) {
$mywms->twitterNews = false;
}
@@ -48,8 +45,7 @@
echo $result['message'];
die();
}
- }
- else {
+ } else {
$result = $mywms->createObjFromXML($xml);
if ($result['success']) {
$mywms->writeObjInDB($gui_id);
@@ -58,11 +54,9 @@
die();
}
}
-
$mywms->displayWMS();
$wms_id = $mywms->wms_id;
-}
-else {
+} else {
$wms_id = $_REQUEST["wms_id"];
}
require_once(dirname(__FILE__)."/../php/mod_editWMS_Metadata.php");
Modified: trunk/mapbender/http/php/mod_wfs_server.php
===================================================================
--- trunk/mapbender/http/php/mod_wfs_server.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/http/php/mod_wfs_server.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -236,6 +236,7 @@
$url = $obj->url;
$wfsFactory = new UniversalWfsFactory();
$myWfs = $wfsFactory->createFromUrl($url);
+ //TODO Problem: How to handle authenticated wfs - the old object should be pulled to get the auth information
if (!MD_OVERWRITE) {
$myWfs->overwrite = false;
}
Modified: trunk/mapbender/lib/class_GetApi.php
===================================================================
--- trunk/mapbender/lib/class_GetApi.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/lib/class_GetApi.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -291,7 +291,6 @@
return is_array($input) ? $input : array($input);
}
private function normalizeKmlInput($input){
- $e = new mb_exception("normalizeKmlInput");
return is_array($input) ? $input : array($input);
}
}
Modified: trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
===================================================================
--- trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2014-02-28 11:51:21 UTC (rev 8785)
@@ -254,5 +254,28 @@
ALTER TABLE search_wfs_view
OWNER TO postgres;
+-- Column: wfs_username
+-- ALTER TABLE wfs DROP COLUMN wfs_username;
+ALTER TABLE wfs ADD COLUMN wfs_username character varying(255);
+ALTER TABLE wfs ALTER COLUMN wfs_username SET DEFAULT ''::character varying;
+
+-- Column: wfs_password
+
+-- ALTER TABLE wfs DROP COLUMN wfs_password;
+
+ALTER TABLE wfs ADD COLUMN wfs_password character varying(255);
+ALTER TABLE wfs ALTER COLUMN wfs_password SET DEFAULT ''::character varying;
+
+-- Column: wfs_auth_type
+
+-- ALTER TABLE wfs DROP COLUMN wfs_auth_type;
+
+ALTER TABLE wfs ADD COLUMN wfs_auth_type character varying(255);
+ALTER TABLE wfs ALTER COLUMN wfs_auth_type SET DEFAULT ''::character varying;
+
+UPDATE wfs SET wfs_username = '' WHERE wfs_username IS NULL;
+UPDATE wfs SET wfs_password = '' WHERE wfs_password IS NULL;
+UPDATE wfs SET wfs_auth_type = '' WHERE wfs_auth_type IS NULL;
+
Modified: trunk/mapbender/tools/mod_runScheduler.php
===================================================================
--- trunk/mapbender/tools/mod_runScheduler.php 2014-02-20 07:23:30 UTC (rev 8784)
+++ trunk/mapbender/tools/mod_runScheduler.php 2014-02-28 11:51:21 UTC (rev 8785)
@@ -70,15 +70,30 @@
for ($i=0; $i<count($wmsToUpdate); $i++) {
//create new wms object
$updateWms = new wms();
- $createObjFromXml = $updateWms->createObjFromXML($wmsToUpdate[$i]['wms_upload_url']);
+ try {
+ $createObjFromXml = $updateWms->createObjFromXML($wmsToUpdate[$i]['wms_upload_url']);
+ }
+ catch(Exception $e) {
+ throw $e;
+ $errorMsg = "Error when creatingObjFromXML from wms_upload_url";
+ continue;
+ }
$updateWms->owner = $wmsToUpdate[$i]['wms_owner'];
if(!$createObjFromXml['success']) {
//$errorMsg = "Error while creating object from GetCapabilities XML";
- $errorMsg =$createObjFromXml['message'];
+ $errorMsg = $createObjFromXml['message'];
+ echo "Error while creating object from GetCapabilities XML";
+ continue;
}
//check scheduler_searchable attribute for layer searchable in class_wms.php
- $updateWms->optimizeWMS($wmsToUpdate[$i]['scheduler_searchable']);
-
+ try {
+ $updateWms->optimizeWMS($wmsToUpdate[$i]['scheduler_searchable']);
+ }
+ catch(Exception $e) {
+ throw $e;
+ $errorMsg = "Error when optimizeWMS";
+ continue;
+ }
//check overwrite attribute
if (!$wmsToUpdate[$i]['scheduler_overwrite']) {
echo "overwrite md = false\n";
@@ -104,10 +119,18 @@
echo "publish = false\n";
}
echo "Start update of ".$wmsToUpdate[$i]['wms_id']."\n";
- $updateObjInDb = $updateWms->updateObjInDB($wmsToUpdate[$i]['wms_id']);
-
+ try {
+ $updateObjInDb = $updateWms->updateObjInDB($wmsToUpdate[$i]['wms_id']);
+ }
+ catch(Exception $e) {
+ throw $e;
+ $errorMsg = "Error when updateObjInDB(".$wmsToUpdate[$i]['wms_id'].")";
+ continue;
+ }
if(!$updateObjInDb) {
- $errorMsg = "Error while updating wms object in database";
+ $errorMsg = "Error while updating wms object in database";
+ echo "Error while updating wms object in database";
+ continue;
}
if($wmsToUpdate[$i]['scheduler_mail']) {
More information about the Mapbender_commits
mailing list