[Mapbender-commits] r8462 - in trunk/mapbender: conf http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Aug 20 06:41:19 PDT 2012
Author: armin11
Date: 2012-08-20 06:41:19 -0700 (Mon, 20 Aug 2012)
New Revision: 8462
Modified:
trunk/mapbender/conf/mapbender.conf-dist
trunk/mapbender/http/php/mod_inspireDownloadFeed.php
Log:
Bugfixes
Modified: trunk/mapbender/conf/mapbender.conf-dist
===================================================================
--- trunk/mapbender/conf/mapbender.conf-dist 2012-08-20 10:35:12 UTC (rev 8461)
+++ trunk/mapbender/conf/mapbender.conf-dist 2012-08-20 13:41:19 UTC (rev 8462)
@@ -44,6 +44,11 @@
$login = LOGIN;
# --------------------------------------------
+# URL to mapbender installation - maybe different from LOGIN path!
+# --------------------------------------------
+define("MAPBENDER_PATH", "http://".$_SERVER['HTTP_HOST']."/mapbender");
+
+# --------------------------------------------
# MAXLOGIN - this parameter is not in use anymore, but still needed for compatibility
# --------------------------------------------
define("MAXLOGIN", 3);
Modified: trunk/mapbender/http/php/mod_inspireDownloadFeed.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireDownloadFeed.php 2012-08-20 10:35:12 UTC (rev 8461)
+++ trunk/mapbender/http/php/mod_inspireDownloadFeed.php 2012-08-20 13:41:19 UTC (rev 8462)
@@ -31,6 +31,7 @@
db_select_db(DB,$con);
$admin = new administration();
+$mapbenderPath = MAPBENDER_PATH."/";
$imageResolution = 300;
@@ -168,7 +169,7 @@
// -
function generateFeed($feedDoc, $recordId, $generateFrom) {
- global $admin, $type, $imageResolution, $maxImageSize, $maxFeatureCount, $mapbenderMetadata, $indexMapbenderMetadata, $layerId, $wfsId;
+ global $admin, $type, $imageResolution, $maxImageSize, $maxFeatureCount, $mapbenderMetadata, $indexMapbenderMetadata, $layerId, $wfsId, $mapbenderPath;
switch ($generateFrom) {
case "dataurl":
@@ -393,9 +394,9 @@
//<link href="http://xyz.org/metadata" rel="describedby" type="application/vnd.iso.19139+xml"/>
$feedLink = $feedDoc->createElement("link");
if ($type == 'SERVICE') {
- $feedLink->setAttribute("href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataLinkDownloadISOMetadata.php?Id=".$recordId."&outputFormat=iso19139");
+ $feedLink->setAttribute("href", $mapbenderPath."php/mod_dataLinkDownloadISOMetadata.php?Id=".$recordId."&outputFormat=iso19139");
} else { //DATASET
- $feedLink->setAttribute("href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?id=".$mapbenderMetadata[$m]->metadata_uuid."&outputFormat=iso19139");
+ $feedLink->setAttribute("href", $mapbenderPath."php/mod_dataISOMetadata.php?id=".$mapbenderMetadata[$m]->metadata_uuid."&outputFormat=iso19139");
}
$feedLink->setAttribute("rel", "describedby");
$feedLink->setAttribute("rel", "application/vnd.iso.19139+xml");
@@ -405,9 +406,9 @@
//self reference - 5.1.4 / 5.2
if ($type == 'SERVICE') {
- $selfReference = "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_inspireDownloadFeed.php?ID=".$recordId."&type=SERVICE&generatefrom=".$generateFrom;
+ $selfReference = $mapbenderPath."php/mod_inspireDownloadFeed.php?ID=".$recordId."&type=SERVICE&generatefrom=".$generateFrom;
} else { //DATASET
- $selfReference = "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_inspireDownloadFeed.php?ID=".$recordId."&type=DATASET&generatefrom=".$generateFrom;
+ $selfReference = $mapbenderPath."php/mod_inspireDownloadFeed.php?ID=".$recordId."&type=DATASET&generatefrom=".$generateFrom;
switch($generateFrom) {
case "wmslayer":
$selfReference .= "&layerid=".$mapbenderMetadata[$m]->layer_id;
@@ -430,7 +431,7 @@
//opensearch descriptionlink 5.1.5
if ($type == 'SERVICE') {
$feedLink = $feedDoc->createElement("link");
- $feedLink->setAttribute("href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mb_datalinkOpensearchDescription.php?ID=".$recordId);
+ $feedLink->setAttribute("href", $mapbenderPath."php/mb_datalinkOpensearchDescription.php?ID=".$recordId);
$feedLink->setAttribute("rel", "search");
$feedLink->setAttribute("type", "application/opensearchdescription+xml");
//$feedLink->setAttribute("hreflang", "de");
@@ -440,7 +441,7 @@
//description of datatypes - if given??? What todo when there is no description available - some html page have to be referenced?
$feedLink = $feedDoc->createElement("link");
- $feedLink->setAttribute("href", "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_showMetadata.php?languageCode=de&resource=layer&layout=tabs&id=".$recordId); //TODO show metadata in form of html content - switch for each type
+ $feedLink->setAttribute("href", $mapbenderPath."php/mod_showMetadata.php?languageCode=de&resource=layer&layout=tabs&id=".$recordId); //TODO show metadata in form of html content - switch for each type
$feedLink->setAttribute("rel", "describedby");
$feedLink->setAttribute("type", "text/html");
$feedLink->setAttribute("hreflang", "de");
@@ -792,7 +793,7 @@
//<link rel="alternate" href="http://xyz.org/data/abc/waternetwork_WGS84.shp" type="application/x-shp" hreflang="en" title="Water Network encoded as a ShapeFile in WGS84geographic coordinates (http://www.opengis.net/def/crs/OGC/1.3/CRS84)"/>
- $datasetFeedLink = "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_inspireDownloadFeed.php?id=".$recordId."&type=DATASET&generatefrom=".$mapbenderMetadata[$i]->origin;
+ $datasetFeedLink = $mapbenderPath."php/mod_inspireDownloadFeed.php?id=".$recordId."&type=DATASET&generatefrom=".$mapbenderMetadata[$i]->origin;
switch($mapbenderMetadata[$i]->origin) {
case "wmslayer":
$datasetFeedLink .= "&layerid=".$mapbenderMetadata[$i]->layer_id;
@@ -816,7 +817,7 @@
$feedEntry->appendChild($feedEntryIdNamespace);
- $metadataLink = "http://".$_SERVER['HTTP_HOST']."/mapbender/php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$mapbenderMetadata[$m]->metadata_uuid;
+ $metadataLink = $mapbenderPath."php/mod_dataISOMetadata.php?outputFormat=iso19139&id=".$mapbenderMetadata[$m]->metadata_uuid;
$feedEntryMetadataLink = $feedDoc->createElement("link");
$feedEntryMetadataLink->setAttribute("href",$metadataLink);
$feedEntryMetadataLink->setAttribute("rel", "describedby");
More information about the Mapbender_commits
mailing list