[Mapbender-commits] r9416 - in trunk/mapbender/http: classes plugins

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Fri Mar 4 00:36:12 PST 2016


Author: armin11
Date: 2016-03-04 00:36:12 -0800 (Fri, 04 Mar 2016)
New Revision: 9416

Modified:
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/classes/class_wfsToDb.php
   trunk/mapbender/http/classes/class_wfs_1_1.php
   trunk/mapbender/http/classes/class_wfs_factory.php
   trunk/mapbender/http/classes/class_wms.php
   trunk/mapbender/http/plugins/mb_metadata_addon.php
   trunk/mapbender/http/plugins/mb_metadata_edit.php
   trunk/mapbender/http/plugins/mb_metadata_server.php
   trunk/mapbender/http/plugins/mb_metadata_wfs_edit.php
   trunk/mapbender/http/plugins/mb_metadata_wfs_server.php
Log:
Option to handle a license source note at wms, wfs and metadata level. Enhancement as demanded for the german sdi. Has no effect on standard behaviour.

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/classes/class_iso19139.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -1031,6 +1031,7 @@
 			//$e = new mb_exception($this->downloadLinks[0]);
 			//$this->linkAlreadyInDB = false;
 			//$this->fileIdentifierAlreadyInDB = false;
+			$this->licenseSourceNote = $row['md_license_source_note'];
 			//get relations from other tables:
 			//get categories and keywords
 			//get isoCategories

Modified: trunk/mapbender/http/classes/class_wfsToDb.php
===================================================================
--- trunk/mapbender/http/classes/class_wfsToDb.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/classes/class_wfsToDb.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -185,7 +185,7 @@
 			$aWfs->auth['password'] = "";
 			$aWfs->auth['auth_type'] = "";
 		}
-		$e = new mb_exception("awfs_username: ".$aWfs->auth['username']);
+		//$e = new mb_exception("awfs_username: ".$aWfs->auth['username']);
 		$admin = new administration();
 		db_begin();
 	
@@ -193,7 +193,7 @@
 		$sql = "UPDATE wfs SET wfs_version = $1, wfs_name = $2, wfs_getcapabilities = $3, wfs_getcapabilities_doc = $4, ";
 		$sql .= "wfs_upload_url = $5, wfs_describefeaturetype = $6, wfs_getfeature = $7, ";
 		$sql .= "wfs_transaction = $8, wfs_timestamp = $9, wfs_network_access = $10, fkey_mb_group_id = $11, ";
-		$sql .=  "wfs_max_features = $12, inspire_annual_requests = $13, wfs_username = $14, wfs_password = $15, wfs_auth_type = $16 ";
+		$sql .=  "wfs_max_features = $12, inspire_annual_requests = $13, wfs_username = $14, wfs_password = $15, wfs_auth_type = $16, wfs_license_source_note = $18";
 		$sql .= "WHERE wfs_id = $17";
 	
 		$v = array(
@@ -213,10 +213,11 @@
 				$aWfs->auth['username'],
 				$aWfs->auth['password'],
 				$aWfs->auth['auth_type'],
-				$aWfs->id
+				$aWfs->id,
+				$aWfs->wfs_license_source_note
 		);
 			
-		$t = array('s','s','s','s','s','s','s','s','s','i','i','i','i','s','s','s','i');
+		$t = array('s','s','s','s','s','s','s','s','s','i','i','i','i','s','s','s','i','s');
 		$e = new mb_notice("class_wfsToDb.php: UPDATING WFS " . $aWfs->id);
 		$res = db_prep_query($sql, $v, $t);
 		if (!$res) {
@@ -245,7 +246,8 @@
 			$sql .= "country = $15, ";
 			$sql .= "wfs_network_access = $16, ";
 			$sql .= "wfs_max_features = $17, ";
-			$sql .= "fkey_mb_group_id = $18 ";
+			$sql .= "fkey_mb_group_id = $18, ";
+			$sql .= "wfs_license_source_note = $20 ";
 			$sql .= " WHERE wfs_id = $19";
 			$v = array($aWfs->title,
 					$aWfs->summary,
@@ -265,8 +267,10 @@
 					$aWfs->wfs_network_access,
 					$aWfs->wfs_max_features,
 					$aWfs->fkey_mb_group_id,
-					$aWfs->id);
-			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i','i','i');
+					$aWfs->id,
+					$aWfs->wfs_license_source_note
+				);
+			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i','i','i','s');
 			$res = db_prep_query($sql,$v,$t);
 			if(!$res){
 				db_rollback();

Modified: trunk/mapbender/http/classes/class_wfs_1_1.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_1_1.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/classes/class_wfs_1_1.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -106,4 +106,4 @@
 	}
 	
 }
-?>
\ No newline at end of file
+?>

Modified: trunk/mapbender/http/classes/class_wfs_factory.php
===================================================================
--- trunk/mapbender/http/classes/class_wfs_factory.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/classes/class_wfs_factory.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -112,6 +112,7 @@
 			$aWfs->wfs_max_features = db_result($res, $cnt, "wfs_max_features");
 			$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->wfs_license_source_note = db_result($res, $cnt, "wfs_license_source_note");
 			$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!");

Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/classes/class_wms.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -31,7 +31,9 @@
 	var $wms_timestamp;
 	var $wms_timestamp_create;
 	var $wms_srs = array();
+	//extended information
 	var $wms_termsofuse;
+	var $wms_license_source_note;
 	  
 	var $fees;
 	var $accessconstraints;
@@ -1754,8 +1756,8 @@
 		$sql .= "accessconstraints, contactperson, contactposition, contactorganization, address, city, ";
 		$sql .= "stateorprovince, postcode, country, contactvoicetelephone, contactfacsimiletelephone, contactelectronicmailaddress, ";
 		$sql .= "wms_owner,wms_timestamp,wms_timestamp_create,wms_username,wms_password,wms_auth_type,";
-		$sql .= "wms_supportsld, wms_userlayer, wms_userstyle, wms_remotewfs, uuid, inspire_annual_requests) ";
-		$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,$31,$32,$33,$34)";
+		$sql .= "wms_supportsld, wms_userlayer, wms_userstyle, wms_remotewfs, uuid, inspire_annual_requests, wms_license_source_note) ";
+		$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,$31,$32,$33,$34,$35)";
 		$v = array(
 			$this->wms_version,
 			$this->wms_title,
@@ -1790,11 +1792,12 @@
 			$this->wms_userstyle,
 			$this->wms_remotewfs,
 			$uuid,
-			$this->inspire_annual_requests
+			$this->inspire_annual_requests,
+			$this->wms_license_source_note
 		);
 		$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','i','s','s','s','s','s','s','s','s','i'
+			's','s','s','s','s','s','i','i','i','s','s','s','s','s','s','s','s','i','s'
 		);
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
@@ -2664,7 +2667,7 @@
 		//they don't come from the capabilities!
 		if (!$updateMetadataOnly) {
 			//read network_access from database
-			$sql = "SELECT wms_network_access, fkey_mb_group_id, wms_max_imagesize, inspire_annual_requests from wms WHERE wms_id = $1 ";
+			$sql = "SELECT wms_network_access, fkey_mb_group_id, wms_max_imagesize, inspire_annual_requests, wms_license_source_note from wms WHERE wms_id = $1 ";
 			$v = array($myWMS);
 			$t = array('i');
 			$res = db_prep_query($sql,$v,$t);
@@ -2672,6 +2675,7 @@
 			$this->wms_network_access = $row["wms_network_access"];
 			$this->wms_max_imagesize = $row["wms_max_imagesize"];
 			$this->inspire_annual_requests = $row["inspire_annual_requests"];
+			$this->wms_license_source_note = $row["wms_license_source_note"];
 			$this->fkey_mb_group_id = $row["fkey_mb_group_id"];
 		}
 		//if network access is either stored in database nor given thru object, set it too a default value 0
@@ -2706,15 +2710,16 @@
         	$sql .= "wms_auth_type = $17, "; 
  		$sql .= "wms_username = $18, "; 
  		$sql .= "wms_password = $19, ";
-		$sql .= "inspire_annual_requests = $20 ";
+		$sql .= "inspire_annual_requests = $20, ";
+		$sql .= "wms_license_source_note = $21 ";
 		//$sql .= "uuid = $15 ";
 		$sql .= " WHERE wms_id = $15";
 	
 		$v = array($this->wms_version,$this->wms_getcapabilities,
 			$this->wms_getmap,$this->wms_getfeatureinfo,$this->wms_getlegendurl,
 			$admin->char_encode($this->wms_getcapabilities_doc),$this->wms_upload_url,strtotime("now"),
-			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs,$this->wms_network_access, $this->fkey_mb_group_id ,$myWMS, $this->wms_max_imagesize, $authType, $username, $password, $this->inspire_annual_requests);
-		$t = array('s','s','s','s','s','s','s','i','s','s','s','s','i','i','i','i','s','s','s','i');
+			$this->wms_supportsld,$this->wms_userlayer,$this->wms_userstyle,$this->wms_remotewfs,$this->wms_network_access, $this->fkey_mb_group_id ,$myWMS, $this->wms_max_imagesize, $authType, $username, $password, $this->inspire_annual_requests,$this->wms_license_source_note);
+		$t = array('s','s','s','s','s','s','s','i','s','s','s','s','i','i','i','i','s','s','s','i','s');
 			
 		$res = db_prep_query($sql,$v,$t);
 		if(!$res){
@@ -2740,6 +2745,7 @@
 			$sql .= "contactelectronicmailaddress = $15, ";
 			$sql .= "wms_network_access = $16, ";
 			$sql .= "wms_max_imagesize = $19, ";
+			$sql .= "wms_license_source_note = $20, ";
 			//$sql .= "inspire_annual_requests = $20, ";
 			$sql .= "fkey_mb_group_id = $17 ";
 			#$sql .= "uuid = $18 ";
@@ -2747,8 +2753,8 @@
 			$v = array($this->wms_title,$this->wms_abstract,$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,$this->wms_network_access, $this->fkey_mb_group_id , $myWMS, $this->wms_max_imagesize);
-			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i','i','i');
+				$this->contactfacsimiletelephone,$this->contactelectronicmailaddress,$this->wms_network_access, $this->fkey_mb_group_id , $myWMS, $this->wms_max_imagesize, $this->wms_license_source_note);
+			$t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i','i','i','s');
 			$res = db_prep_query($sql,$v,$t);
 			if(!$res){
 				db_rollback();	

Modified: trunk/mapbender/http/plugins/mb_metadata_addon.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_addon.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/plugins/mb_metadata_addon.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -291,6 +291,12 @@
 	<p>
 	<img id="licence_symbol_md"> <a id='licence_descriptionlink_md' target='_blank'><a/> <img id="open_symbol_md">
 	</p>
+	<p>
+		<label for="md_license_source_note"><?php echo _mb("Source note if license require it");?>:</label>
+      		<input name="md_license_source_note" id="md_license_source_note" type="text"/>
+		<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Source note that should be mentioned if such an information is required by the license.");?>'}" src="../img/questionmark.png" alt="" />
+	</p>
+	<p>
 	</div>
 	</div><!--accordion-->
 	</div><!--demo-->

Modified: trunk/mapbender/http/plugins/mb_metadata_edit.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_edit.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/plugins/mb_metadata_edit.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -62,6 +62,11 @@
 	<img id="licence_symbol"> <a id='licence_descriptionlink' target='_blank'><a/> <img id="open_symbol">
 	</p>
 	<p>
+		<label for="wms_license_source_note"><?php echo _mb("Source note if license require it (Registry)");?>:</label>
+      		<input name="wms_license_source_note" id="wms_license_source_note" type="text"/>
+		<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Source note that should be mentioned if such an information is required by the license.");?>'}" src="../img/questionmark.png" alt="" />
+	</p>
+	<p>
 		<label for="wms_network_access"><?php echo _mb("Restricted Network Access (Registry)");?>:</label>
       		<input name="wms_network_access" id="wms_network_access" type="checkbox"/>
 	</p>

Modified: trunk/mapbender/http/plugins/mb_metadata_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_server.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/plugins/mb_metadata_server.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -231,7 +231,8 @@
 			"wms_network_access",
 			"wms_max_imagesize",
 			"fkey_mb_group_id",
-			"inspire_annual_requests"
+			"inspire_annual_requests",
+			"wms_license_source_note"
 		);
 
 		$resultObj = array();
@@ -566,7 +567,8 @@
 			"wms_network_access",
 			"wms_max_imagesize",
 			"fkey_mb_group_id",
-			"inspire_annual_requests"
+			"inspire_annual_requests",
+			"wms_license_source_note"
 		);
 		foreach ($columns as $c) {
 			if ($c == 'wms_termsofuse' && $data->wms->$c == "0") {
@@ -853,6 +855,7 @@
 			if ($resultObj["md_termsofuse"] == null || !isset($resultObj["md_termsofuse"])) {
 				$resultObj["md_termsofuse"] == '0';
 			}
+			$resultObj["md_license_source_note"] = $mbMetadata->licenseSourceNote;
 			//categories and keywords
 			$resultObj["md_md_topic_category_id"] = $mbMetadata->isoCategories;
 			$resultObj["md_custom_category_id"] = $mbMetadata->customCategories;
@@ -1002,6 +1005,9 @@
 			} else {
 				$mbMetadata->termsOfUseRef = null;
 			}
+			if (isset($data->md_license_source_note)) {
+				$mbMetadata->licenseSourceNote = $data->md_license_source_note;
+			}
 			//try to update metadata object (only mb_metadata)
 			$res = $mbMetadata->updateMetadataById($metadataId);
 			if (!$res) {

Modified: trunk/mapbender/http/plugins/mb_metadata_wfs_edit.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wfs_edit.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/plugins/mb_metadata_wfs_edit.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -61,6 +61,11 @@
 	<img id="licence_symbol"> <a id='licence_descriptionlink' target='_blank'><a/> <img id="open_symbol">
 	</p>
 	<p>
+		<label for="wfs_license_source_note"><?php echo _mb("Source note if license require it (Registry)");?>:</label>
+      		<input name="wfs_license_source_note" id="wfs_license_source_note" type="text"/>
+		<img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Source note that should be mentioned if such an information is required by the license.");?>'}" src="../img/questionmark.png" alt="" />
+	</p>
+	<p>
 	  	<label for="wfs_network_access"><?php echo _mb("Restricted Network Access (Registry)");?>:</label>
       		<input name="wfs_network_access" id="wfs_network_access" type="checkbox"/>
 	</p>

Modified: trunk/mapbender/http/plugins/mb_metadata_wfs_server.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_wfs_server.php	2016-03-01 08:32:00 UTC (rev 9415)
+++ trunk/mapbender/http/plugins/mb_metadata_wfs_server.php	2016-03-04 08:36:12 UTC (rev 9416)
@@ -72,7 +72,7 @@
 individualname, positionname, providername, voice, 
 facsimile, deliverypoint, city, 
 administrativearea, postalcode, country, electronicmailaddress,
-wfs_timestamp, wfs_timestamp_create, wfs_network_access, fkey_mb_group_id, wfs_max_features, inspire_annual_requests  
+wfs_timestamp, wfs_timestamp_create, wfs_network_access, fkey_mb_group_id, wfs_max_features, inspire_annual_requests, wfs_license_source_note  
 FROM wfs WHERE wfs_id = $wfsId;
 SQL;
 		$res = db_query($sql);
@@ -100,6 +100,7 @@
 		$resultObj['wfs_max_features'] = $row['wfs_max_features'];
 		$resultObj['fkey_mb_group_id'] = $row['fkey_mb_group_id'];
 		$resultObj['inspire_annual_requests'] = $row['inspire_annual_requests'];
+		$resultObj['wfs_license_source_note'] = $row['wfs_license_source_note'];
 		$keywordSql = <<<SQL
 SELECT DISTINCT keyword FROM keyword, wfs_featuretype_keyword 
 WHERE keyword_id = fkey_keyword_id AND fkey_featuretype_id IN (
@@ -434,7 +435,8 @@
 			"wfs_max_features",
 			"fkey_mb_group_id",
 			"inspire_annual_requests",
-			"uuid"
+			"uuid",
+			"wfs_license_source_note"
 		);
 		foreach ($columns as $c) {
 			if ($c == 'wfs_termsofuse' && $data->wfs->$c == "0") {



More information about the Mapbender_commits mailing list