[Mapbender-commits] r9900 - in trunk/mapbender/http: classes php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Wed Apr 18 07:15:00 PDT 2018
Author: armin11
Date: 2018-04-18 07:15:00 -0700 (Wed, 18 Apr 2018)
New Revision: 9900
Modified:
trunk/mapbender/http/classes/class_owsConstraints.php
trunk/mapbender/http/php/mod_showMetadata.php
Log:
Show license metadata for wfs ressources
Modified: trunk/mapbender/http/classes/class_owsConstraints.php
===================================================================
--- trunk/mapbender/http/classes/class_owsConstraints.php 2018-04-18 13:29:07 UTC (rev 9899)
+++ trunk/mapbender/http/classes/class_owsConstraints.php 2018-04-18 14:15:00 UTC (rev 9900)
@@ -124,10 +124,19 @@
$htmlHeader['logInformation'] = _mb('The access on this service is logged <b>user-related</b> by the provider. The logging is done to support automated settlement based on a contract ');
$htmlHeader['logInformation'] .= _mb('or to fulfill legal standards.<br><b>If you do not agree on this - please don\'t use this service!</b><br>');
$htmlHeader['logInformation'] .= _mb('If you have further questions, please contact the provider under ');
+
$htmlHeader['priceInformation'][0] = _mb('The provider have defined a charge of <b>');
$htmlHeader['priceInformation'][1] = _mb(' (euro)cent per megapixel</b> ');
$htmlHeader['priceInformation'][2] = _mb(' for retrieved picture data. The retrieving of a typical map with a standardized resolution of 600x400 px will cost <b>');
+
+ $htmlHeader['priceWfsInformation'][1] = _mb(' (euro)cent </b> ');
+ $htmlHeader['priceWfsInformation'][2] = _mb(' for each retrieved feature. The download of 1000 features will cost <b>');
+
$htmlHeader['priceInformation'][3] = _mb(' euro</b>. For information about possible discounts please contact ');
+
+
+
+
$htmlHeader['noInformation'] = _mb('No informations about terms of use are available!');
Mapbender::session()->set("mb_lang",$this->languageCode);
@@ -138,7 +147,7 @@
$sql .= " (wms_termsofuse.fkey_termsofuse_id=termsofuse.termsofuse_id) where wms.wms_id = $1";
}
if ($this->type == "wfs") {
- $sql = "SELECT wfs_id, wfs_id as resource_id, accessconstraints, fees, wfs_network_access, wfs_license_source_note as source_note, termsofuse.name,";
+ $sql = "SELECT wfs_id, wfs_id as resource_id, accessconstraints, fees, wfs_network_access, wfs_proxylog, wfs_pricevolume, wfs_license_source_note as source_note, termsofuse.name,";
$sql .= " termsofuse.termsofuse_id ,termsofuse.symbollink, termsofuse.description,termsofuse.descriptionlink, termsofuse.isopen, source_required from wfs LEFT OUTER JOIN";
$sql .= " wfs_termsofuse ON (wfs.wfs_id = wfs_termsofuse.fkey_wfs_id) LEFT OUTER JOIN termsofuse ON";
$sql .= " (wfs_termsofuse.fkey_termsofuse_id=termsofuse.termsofuse_id) where wfs.wfs_id = $1";
@@ -211,7 +220,7 @@
$accessConstraints .= $this->display_text($row['accessconstraints']);
$html .= $t_a.$htmlHeader['accessConstraintsHeader'].$t_b.$accessConstraints.$t_c;
}
- if (isset($row['termsofuse_id']) or (strtoupper($row['fees']) != "NONE" & (str_replace(" ", "", $row['fees']) != "")) or ($this->type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) ) {
+ if (isset($row['termsofuse_id']) or (strtoupper($row['fees']) != "NONE" & (str_replace(" ", "", $row['fees']) != "")) or ($this->type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) or ($this->type == "wfs" & isset($row['wfs_pricevolume']) & $row['wfs_pricevolume'] != 0)) {
$feesPart = $t_a.$htmlHeader['feesHeader'].$t_b;
if (isset($row['termsofuse_id'])) {
$fees = $htmlHeader['licences'];
@@ -240,6 +249,14 @@
} else {
$feesPart .= $t_c;
}
+ if ($this->type == "wfs" & isset($row['wfs_pricevolume']) & $row['wfs_pricevolume'] != 0) {
+ $priceExample = (integer)$row['wfs_pricevolume']*1000/100;
+ $priceInformation = $htmlHeader['priceInformation'][0].(integer)$row['wfs_pricevolume'];
+ $priceInformation .= $htmlHeader['priceWfsInformation'][1].$htmlHeader['priceWfsInformation'][2].$priceExample.$htmlHeader['priceInformation'][3]." <a href=\"mailto:".$rowOwner['mb_user_email']."\">".$rowOwner['mb_user_email']."</a><br>";
+ $feesPart .= "<br>".$priceInformation.$t_c;
+ } else {
+ $feesPart .= $t_c;
+ }
}
$html .= $feesPart.$tableEnd;
if ($this->returnDirect) {
@@ -269,7 +286,7 @@
$accessConstraints .= "<h2>".$htmlHeader['accessConstraintsHeader']."</h2>".$this->display_text($row['accessconstraints']);
$html .= $accessConstraints."<br>";
}
- if (isset($row['termsofuse_id']) or (strtoupper($row['fees']) != "NONE" & (str_replace(" ", "", $row['fees']) != "")) or ($this->type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) ) {
+ if (isset($row['termsofuse_id']) or (strtoupper($row['fees']) != "NONE" & (str_replace(" ", "", $row['fees']) != "")) or ($this->type == "wms" & isset($row['wms_pricevolume']) & $row['wms_pricevolume'] != 0) or ($this->type == "wfs" & isset($row['wfs_pricevolume']) & $row['wfs_pricevolume'] != 0)) {
$fees .= "<h2>".$htmlHeader['feesHeader']."</h2>";
if (isset($row['termsofuse_id'])) {
$fees .= $htmlHeader['licences'];
@@ -293,6 +310,14 @@
$priceInformation .= $htmlHeader['priceInformation'][1].$htmlHeader['priceInformation'][2].$priceExample.$htmlHeader['priceInformation'][3]." <a href=\"mailto:".$rowOwner['mb_user_email']."\">".$rowOwner['mb_user_email']."</a><br>";
$fees .= $priceInformation."<br>";
}
+ if ($this->type == "wfs" & isset($row['wfs_pricevolume']) & $row['wfs_pricevolume'] != 0) {
+ $priceExample = (integer)$row['wfs_pricevolume']*1000/100;
+ $priceInformation = $htmlHeader['priceInformation'][0].(integer)$row['wfs_pricevolume'];
+ $priceInformation .= $htmlHeader['priceWfsInformation'][1].$htmlHeader['priceWfsInformation'][2].$priceExample.$htmlHeader['priceInformation'][3]." <a href=\"mailto:".$rowOwner['mb_user_email']."\">".$rowOwner['mb_user_email']."</a><br>";
+ $feesPart .= "<br>".$priceInformation.$t_c;
+ } else {
+ $feesPart .= $t_c;
+ }
$html .= $fees."<br>";
}
if ($this->outputFormat != "iso19139") {
Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php 2018-04-18 13:29:07 UTC (rev 9899)
+++ trunk/mapbender/http/php/mod_showMetadata.php 2018-04-18 14:15:00 UTC (rev 9900)
@@ -1321,6 +1321,18 @@
}
$tou = $constraints->getDisclaimer();
}
+if ($resource == 'wfs' or $resource == 'featuretype' or $resource == 'wfs-conf') {
+ $constraints = new OwsConstraints();
+ $constraints->languageCode = $languageCode;
+ $constraints->asTable = true;
+ $constraints->id = $resourceMetadata['serviceid'];
+ $constraints->type = "wfs";
+ $constraints->returnDirect = false;
+ if (!$result['success']) {
+ echo $result['message'];
+ }
+ $tou = $constraints->getDisclaimer();
+}
if ($resource == 'wmc' ) {
$e = new mb_notice("mod_showMetadata: wmcid for disclaimer: ".$resourceMetadata['contentid']);
$touWmcConnector = new connector($mapbenderProtocol."localhost".$_SERVER['SCRIPT_NAME']."/../mod_getWmcDisclaimer.php?&id=".$resourceMetadata['contentid']."&languageCode=".$languageCode."&hostName=".$hostName);
More information about the Mapbender_commits
mailing list