[Mapbender-commits] r8756 - in trunk/mapbender: conf http/geoportal http/php http/plugins resources/db resources/db/pgsql/UTF-8/update
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Jan 3 04:46:10 PST 2014
Author: armin11
Date: 2014-01-03 04:46:10 -0800 (Fri, 03 Jan 2014)
New Revision: 8756
Modified:
trunk/mapbender/conf/mobilemap.conf-dist
trunk/mapbender/http/geoportal/jquery.dataTables.geoportal.css
trunk/mapbender/http/geoportal/mod_readCSWResults.php
trunk/mapbender/http/geoportal/mod_showInspireMonitoring.php
trunk/mapbender/http/php/mod_showMetadata.php
trunk/mapbender/http/plugins/mb_metadata_addon.php
trunk/mapbender/resources/db/materialize_wms_view.sql
trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql
Log:
Some enhancements and bugfixes
Modified: trunk/mapbender/conf/mobilemap.conf-dist
===================================================================
--- trunk/mapbender/conf/mobilemap.conf-dist 2013-12-18 11:43:33 UTC (rev 8755)
+++ trunk/mapbender/conf/mobilemap.conf-dist 2014-01-03 12:46:10 UTC (rev 8756)
@@ -545,7 +545,7 @@
buffer:0,
isBaseLayer:true,
transitionEffect:'resize',
- resolutions: [529.16666666670005270134,396.87500000000000000000,264.58333333330000414207,132.29166666669999585793,66.14583333330000414207,39.68750000000000000000,26.45833333330000058936,13.22916666669999941064,6.61458333329999970118,3.96875000000000000000,2.64583333330000014527,2.11666666670000003236,1.32291666670000007677,0.79375000000000000000,0.26458333330000001204,0.13229166670000001016],
+ resolutions: [705.5551745557614,529.166380916821,352.7775872778807,176.38879363894034,88.19439681947017,52.916638091682096,35.27775872778806,17.63887936389403,8.819439681947015,5.291663809168209,3.527775872778806,2.8222206982230453,1.763887936389403,1.058332761833642,0.35277758727788067,0.17638879363894033],
units: projUnits,
projection: mapProj,
sphericalMercator: false
Modified: trunk/mapbender/http/geoportal/jquery.dataTables.geoportal.css
===================================================================
--- trunk/mapbender/http/geoportal/jquery.dataTables.geoportal.css 2013-12-18 11:43:33 UTC (rev 8755)
+++ trunk/mapbender/http/geoportal/jquery.dataTables.geoportal.css 2014-01-03 12:46:10 UTC (rev 8756)
@@ -5,7 +5,7 @@
table.dataTable {
margin: 0 auto;
clear: both;
- width: 100%;
+ width: 80%;
font-size:1em;
font-family:Arial,Helvetica,"Sans Serif" !important;
}
Modified: trunk/mapbender/http/geoportal/mod_readCSWResults.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_readCSWResults.php 2013-12-18 11:43:33 UTC (rev 8755)
+++ trunk/mapbender/http/geoportal/mod_readCSWResults.php 2014-01-03 12:46:10 UTC (rev 8756)
@@ -1,4 +1,3 @@
-
<?php
//
require_once(dirname(__FILE__)."/../../core/globalSettings.php");
@@ -7,8 +6,6 @@
//Script to read Results from CSW 2.0.2 Interfaces from mapbender geoportal
//example requests:
//GetRecords with textfilter
-
-
/*gp_csw
CREATE TABLE gp_csw (
@@ -27,8 +24,8 @@
select param_value from cat_op_conf where fk_cat_id=2 and param_type='getrecords';
select param_value from cat_op_conf where fk_cat_id=2 and param_type='getrecordsbyid';*/
-//$resdir = TMPDIR;
-$resdir = "/data/mapbender/http/tmp/";
+$resdir = TMPDIR;
+//$resdir = "/data/mapbender/http/tmp/";
$con = db_connect(DBSERVER,OWNER,PW);
db_select_db(DB,$con);
@@ -46,36 +43,39 @@
#if it came from cli, use output to tmp folder - > typo3 would find it and will show it in template, there should be an identifier from the gaz.php script which controls the different search moduls
#if it came as http request it should generate its own html window
#Maybe problematic: if requested from command-line, how would mapbender get the content? Should be tested.
+#check if requested as cli
+if(isset($_REQUEST["type"]) && $_REQUEST["type"]=="rss") {
+ $outputRss = true;
+} else {
+ $outputRss = false;
+}
-
-#check if requested as cli
if (isset($argv[0])&isset($argv[1])){
- echo "\nthe script was invoked from commandline\n";
+ if (!$outputRss) echo "\nthe script was invoked from commandline\n";
$from_cli=true;
#do something with the searchstring if needed
#from cli no pagenumber will be given. Therefor everytime page number 1 will be requested
$request_p = 1;
$_REQUEST["q"] = $argv[2];//.$argv[3];//$searchPortaluFilter = $argv[3];
$cli_id = $argv[1];
- echo "\nID: ".$argv[1]."\n";
- echo "\nSearchstring: ".$argv[2]."\n";
- }
- else
- {
- echo "<html><body>";
- echo "\n<br>no commandline args set!\n<br>";
+ if (!$outputRss) echo "\nID: ".$argv[1]."\n";
+ if (!$outputRss) echo "\nSearchstring: ".$argv[2]."\n";
+} else {
+ if (!$outputRss) echo "<html><body>";
+ if (!$outputRss) echo "\n<br>no commandline args set!\n<br>";
$from_cli=false;
- }
+}
#When script was not invoked from cli it should have been invoked per http - check the params
if (!$from_cli){
#***Validation of GET Parameters
+
#handle errors
//make html frame
if(!isset($_REQUEST["q"]) ) {
- echo "No search string found! Please send a query!<br>";
+ if (!$outputRss) echo "No search string found! Please send a query!<br>";
die();
- }
+ }
if(!isset($_REQUEST["p"]) ) {
$request_p = 1;
}
@@ -85,16 +85,21 @@
}
if(!isset($_REQUEST["request_id"]) or $_REQUEST["request_id"]=='') {
- echo "<br> request_id is not set <br>";
+
+ if (!$outputRss) echo "<br> request_id is not set <br>";
+
$requeststring="&request_id=from_http";
$cli_id="from_http";
}
else
{
- echo "<br>request_id is set<br>";
+
+ if (!$outputRss) echo "<br>request_id is set<br>";
+
$cli_id=$_REQUEST["request_id"];
}
- echo "<br>Search string: <b>".$_REQUEST["q"]."</b> will be send<br>";
+ if (!$outputRss) echo "<br>Search string: <b>".$_REQUEST["q"]."</b> will be send<br>";
+
}
//convert the the opensearch filter to ogc filter encoding
@@ -210,7 +215,7 @@
while($row_csw = db_fetch_array($res_csw)){
$csw_list[$cnt_csw]['id'] = $row_csw["csw_id"];
$csw_list[$cnt_csw]['name'] = $row_csw["csw_name"];
- echo "csw_name=".$row_csw["csw_name"];
+ if (!$outputRss) echo "csw_name=".$row_csw["csw_name"];
$csw_list[$cnt_csw]['hierachylevel'] = $row_csw["hierachylevel"];
$csw_list[$cnt_csw]['fkey_cat_id'] = $row_csw["fkey_cat_id"];
//echo "<br>CAT ID from DB: ".$row_csw["fkey_cat_id"]."<br>";
@@ -264,7 +269,7 @@
//debug output
if (!$from_cli) {
- echo "<br>Count of registrated OpenSearch Interfaces: ".count($csw_list)."<br>";
+ if (!$outputRss) echo "<br>Count of registrated OpenSearch Interfaces: ".count($csw_list)."<br>";
}
#get command_line args
@@ -293,8 +298,8 @@
#if ($from_cli) {
#write out xml 'is really no xml!' with opensearch-catalogs
if ($from_cli) {
-echo "\nFolder to write to: ".$resdir."\n";
-echo "\nFile to open: ".$resdir."/".$cli_id."_os.xml\n";
+if (!$outputRss) echo "\nFolder to write to: ".$resdir."\n";
+if (!$outputRss) echo "\nFile to open: ".$resdir."/".$cli_id."_os.xml\n";
}
if($os_catalogs_file_handle = fopen($resdir."/".$cli_id."_os.xml","w")){
fwrite($os_catalogs_file_handle,"<interfaces>\n");
@@ -310,7 +315,7 @@
else
{
if ($from_cli) {
- echo "\nCouldn't open file!\n";
+ if (!$outputRss) echo "\nCouldn't open file!\n";
}
}
#}
@@ -319,12 +324,19 @@
#***loop for things to do for each registrated search interface - only if the search should be done in all interfaces!
#use only one catalogue if a further page is requested
$start_cat=0;
+
$end_cat=count($csw_list);
-$cat=$_REQUEST["cat"];
+
+$e = new mb_exception($end_cat);
+
+$cat = $_REQUEST["cat"];
+$e = new mb_exception($cat);
+
if (isset($cat)){
-$start_cat=(int)$cat;
-$end_cat=(int)$cat+1;
+ $start_cat=(int)$cat;
+ $end_cat=(int)$cat+1;
}
+
for ($i_si = $start_cat; $i_si < $end_cat ; $i_si++) {
//$i_si = 0;
//echo "<br>".$csw_list[$i_si]['getrecordsurl']."<br>";
@@ -433,9 +445,9 @@
$getRecords .= ' </csw:Query>';
$getRecords .= '</csw:GetRecords>';
-//echo "<br>REQUEST for results<br>".htmlentities($getRecords)."<br>";
-$e = new mb_notice($getRecords);
-//for CSW define POST REQUEST for getrecords
+ //echo "<br>REQUEST for results<br>".htmlentities($getRecords)."<br>";
+ $e = new mb_notice($getRecords);
+ //for CSW define POST REQUEST for getrecords
$cswInterfaceObject = new connector();
$cswInterfaceObject->set('httpType','POST');
$postData = $getRecords;
@@ -447,8 +459,7 @@
$cswInterfaceObject->set('httpContentType','text/xml');
//extent url when needed
$openSearchUrlSearch[$i_si] = $openSearchUrl[$i_si];
- echo "<br><br>".$openSearchUrlSearch[$i_si]."<br>";
-
+ if (!$outputRss) echo "<br><br>".$openSearchUrlSearch[$i_si]."<br>";
//echo $openSearchUrl[$i_si]."<br>";
$cswInterfaceObject->load($openSearchUrl[$i_si]);
#echo "<br>Results: ".htmlentities($cswInterfaceObject->file)."<br><br>";
@@ -459,7 +470,7 @@
//$url=$openSearchUrlSearch[$i_si]."q=".$queryText.$csw_list[$i_si] ['standardfilter']."&h=".$csw_list[$i_si] ['h']."&p=".$request_p;
$url = $openSearchUrl[$i_si];
if (!$from_cli) {
- echo "<br> url: ".$url."<br>";
+ if (!$outputRss) echo "<br> url: ".$url."<br>";
}
else
{
@@ -472,7 +483,7 @@
// $e = new mb_exception('external xml : '.$openSearchResult);
//}
- $e = new mb_notice('external xml : '.$openSearchResult);
+ $e = new mb_exception('external xml : '.$openSearchResult);
#parse result to simplexml
$openSearchXml = new SimpleXMLElement($openSearchResult);
//$openSearchXml = ($openSearchResult);
@@ -501,19 +512,19 @@
#do a html output for showing results of the different opensearch catalogues
//if (!$from_cli) {
- echo "<b>".$n_results."</b> Ergebnisse in Katalog <b>".$csw_list[$i_si] ['name']."</b><br><br>";
+ if (!$outputRss) echo "<b>".$n_results."</b> Ergebnisse in Katalog <b>".$csw_list[$i_si] ['name']."</b><br><br>";
#show Pagenumbers
if ((int)$request_p>1) {
- echo "<a href=\"mod_readCSWResults.php?q=".$_REQUEST['q']."&p=".(string)((int)$request_p-1)."&cat=".$i_si.$requeststring."\"> Vorige Seite </a> ";
+ if (!$outputRss) echo "<a href=\"mod_readCSWResults.php?q=".$_REQUEST['q']."&p=".(string)((int)$request_p-1)."&cat=".$i_si.$requeststring."\"> Vorige Seite </a> ";
}
- echo "Seite: <b>".$request_p."</b> von <b>".$number_of_pages."</b>";
+ if (!$outputRss) echo "Seite: <b>".$request_p."</b> von <b>".$number_of_pages."</b>";
if ((int)$request_p < (int)$number_of_pages) {
- echo " <a href=\"mod_readCSWResults.php?q=".$_REQUEST['q']."&p=".(string)((int)$request_p+1)."&cat=".$i_si.$requeststring."\"> Nächste Seite </a>";
+ if (!$outputRss) echo " <a href=\"mod_readCSWResults.php?q=".$_REQUEST['q']."&p=".(string)((int)$request_p+1)."&cat=".$i_si.$requeststring."\"> Nächste Seite </a>";
}
- echo "<br><br>";
+ if (!$outputRss) echo "<br><br>";
//}
//else
//{
@@ -521,6 +532,70 @@
//}
$from_cli=true; //- do this everytime
+
+if ($_REQUEST['type'] == "rss") {
+ //initialize new rss document
+ $rssDoc = new DOMDocument('1.0');
+ $rssDoc->encoding = 'UTF-8';
+ $rssDoc->preserveWhiteSpace = false;
+ $rssDoc->formatOutput = true;
+ /*<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/">
+ <channel>
+ <title>WMS servers</title>
+ <link>http://www.geopole.org/wms/search?search=wald&type=rss</link>
+ <description>Geopole WMS search results for "wald"</description>
+ <opensearch:totalResults>25</opensearch:totalResults>
+ <opensearch:Query role="request" searchTerms="wald" />
+ </channel>*/
+
+ $rssElement = $rssDoc->createElement("rss");
+ $rssElement->setAttribute("version", "2.0");
+ $rssElement->setAttribute("xmlns:dc", "http://purl.org/dc/elements/1.1/");
+ $rssElement->setAttribute("xmlns:opensearch", "http://a9.com/-/spec/opensearch/1.1/");
+ $channel = $rssDoc->createElement("channel");
+
+ $title = $rssDoc->createElement("title");
+ $titleText = $rssDoc->createTextNode("Service Search in CSW Catalogue: ".$csw_list[$i_si] ['name']);
+ $title->appendChild($titleText);
+ $channel->appendChild($title);
+
+ $link = $rssDoc->createElement("link");
+ $linkText = $rssDoc->createTextNode("http://www.geoportal.rlp.de");
+ $link->appendChild($linkText);
+ $channel->appendChild($link);
+
+ $description = $rssDoc->createElement("description");
+ $descriptionText = $rssDoc->createTextNode("Extract service metadata from CSW. Show only first ".$csw_list[$i_si] ['h']." from total ".$n_results." results! Please refine your search.");
+ $description->appendChild($descriptionText);
+ $channel->appendChild($description);
+
+
+ $openSearchTotalResults = $rssDoc->createElement("opensearch:totalResults");
+ $openSearchTotalResultsText = $rssDoc->createTextNode($n_results);
+ $openSearchTotalResults->appendChild($openSearchTotalResultsText);
+ $channel->appendChild($openSearchTotalResults);
+
+ /*$openSearchQuery = $rssDoc->createElement("opensearch:Query");
+ $openSearchQueryText = $rssDoc->createTextNode($query);
+ $openSearchQuery->appendChild($openSearchQueryText);
+ $channel->appendChild($openSearchQuery);*/
+
+ $openSearchQuery = $rssDoc->createElement("opensearch:Query");
+ $openSearchQuery->setAttribute("role", "request");
+ $openSearchQuery->setAttribute("searchTerms", $q);
+ $channel->appendChild($openSearchQuery);
+
+ $rssElement->appendChild($channel);
+
+ //header("Content-type: text/xml; charset=UTF-8");
+ //$xml = $rssDoc->saveXML();
+ //$xml = trim($xml,"\n");
+ //remove newline from xml
+ //echo $xml;
+ //die();
+
+
+}
if ($from_cli) { #do these things if the request was done from the commandline - it is done by the central search function
#generate the output for each page! Like: xyz_os1_1_10.xml = this means: searchid_os#catalogid_#page_#totalpages.xml
#open the specific file for writing
@@ -590,7 +665,7 @@
$abstract = $openSearchXml->xpath('/csw:GetRecordsResponse/csw:SearchResults/gmd:MD_Metadata['.$index.']/gmd:identificationInfo/*/gmd:abstract/gco:CharacterString');
$accessUrl = $openSearchXml->xpath('/csw:GetRecordsResponse/csw:SearchResults/gmd:MD_Metadata['.$index.']/gmd:distributionInfo/gmd:MD_Distribution/gmd:transferOptions/gmd:MD_DigitalTransferOptions/gmd:onLine/gmd:CI_OnlineResource/gmd:linkage/gmd:URL');
- echo "<br>General first accessUrl: ".$accessUrl[0]."<br>";
+ if (!$outputRss) echo "<br>General first accessUrl: ".$accessUrl[0]."<br>";
@@ -664,9 +739,9 @@
$isViewService = false;
$accessUrl = $accessUrl[0];
$typeOfServiceUpper = strtoupper($typeOfService);
- echo "<br>accessUrl: ".$accessUrl."<br>";
- echo "<br>typeOfService:*".$typeOfServiceUpper."*<br>";
- echo "<br>typeOfRecord:*".$typeOfRecord."*<br>";
+ if (!$outputRss) echo "<br>accessUrl: ".$accessUrl."<br>";
+ if (!$outputRss) echo "<br>typeOfService:*".$typeOfServiceUpper."*<br>";
+ if (!$outputRss) echo "<br>typeOfRecord:*".$typeOfRecord."*<br>";
$title = $title[0];
$graphicURL = $graphicURL[0];
@@ -680,7 +755,7 @@
//check for view service type
if ($typeOfServiceUpper == 'WMS' || $typeOfServiceUpper == 'VIEW' || strpos($typeOfServiceUpper,'WMS') !== false) {
$isViewService = true;
- echo "view service identified<br>";
+ if (!$outputRss) echo "view service identified<br>";
}
//check if service is view or wms and correct it for wms 1.1.1 caabilities request
if ($typeOfRecord == 'service' && $isViewService) {
@@ -690,7 +765,7 @@
$accessUrl = '';
}
} else {
- echo "<b>no</b> view service identified<br>";
+ if (!$outputRss) echo "<b>no</b> view service identified<br>";
$isViewService = false;
}
//give dummy if orgaName not given
@@ -705,24 +780,46 @@
}
$abstractShort = substr($abstract,0,250)."...";
//echo "<br>Resultlist:<br>";
- echo "<br><span>";
+ if (!$outputRss) echo "<br><span>";
if (isset($graphicURL) && $graphicURL != '') {
- echo "<img src='".$graphicURL."' width='100' height='100'/>";
+ if (!$outputRss) echo "<img src='".$graphicURL."' width='100' height='100'/>";
}
- echo "<a href = '".$openSearchWrapperDetail."?cat_id=".$csw_list[$i_si] ['id']."&uuid=".$uuid."&mdtype=html'>".$title."</a><br>";
- echo $dateStamp." - ".$orgaName."<br>";
+ if (!$outputRss) echo "<a href = '".$openSearchWrapperDetail."?cat_id=".$csw_list[$i_si] ['id']."&uuid=".$uuid."&mdtype=html'>".$title."</a><br>";
+ if (!$outputRss) echo $dateStamp." - ".$orgaName."<br>";
if (isset($bbox) && $bbox != '') {
- echo $bbox."<br>";
+ if (!$outputRss) echo $bbox."<br>";
}
- echo $abstractShort."</span>";
+ if (!$outputRss) echo $abstractShort."</span>";
//check for isViewService to allow integration into Viewer by link TODO
if (isset($accessUrl) && $accessUrl != '') {
if ($isViewService) {
- echo "<br><span><a href ='".$accessUrl."'>Capabilities</a><br><br></span>";
+ if (!$outputRss) echo "<br><span><a href ='".$accessUrl."'>Capabilities</a><br><br></span>";
} else {
- echo "<br><span><a href ='".$accessUrl."'>Link</a><br><br></span>";
+ if (!$outputRss) echo "<br><span><a href ='".$accessUrl."'>Link</a><br><br></span>";
}
}
+ //write xml tags for rss feed
+ if ($outputRss) {
+ $e = new mb_exception("fill item: ".$title);
+ $item = $rssDoc->createElement("item");
+
+ $titleItem = $rssDoc->createElement("title");
+ $titleItemText = $rssDoc->createTextNode($title);
+ $titleItem->appendChild($titleItemText);
+ $item->appendChild($titleItem);
+
+ $link = $rssDoc->createElement("link");
+ $linkText = $rssDoc->createTextNode($accessUrl);
+ $link->appendChild($linkText);
+ $item->appendChild($link);
+
+ $description = $rssDoc->createElement("description");
+ $descriptionText = $rssDoc->createTextNode($abstract);
+ $description->appendChild($descriptionText);
+ $item->appendChild($description);
+
+ $rssElement->appendChild($item);
+ }
//output to file in tmp folder:
if (isset($uuid) && $uuid != ''){
#Do result XML output to file
@@ -794,10 +891,17 @@
}
fwrite($os_catalogs_file_handle,"</resultlist>\n");
fclose($os_catalogs_file_handle);
+ if($outputRss) {
+ $rssDoc->appendChild($rssElement);
+ header("Content-type: text/xml; charset=UTF-8");
+ $xml = $rssDoc->saveXML();
+ echo $xml;
+ die();
+ }
}
}
}
- echo "</body></html>";
+ if (!$outputRss) echo "</body></html>";
function correctWmsUrl($wms_url) {
//check if last sign is ? or & or none of them
Modified: trunk/mapbender/http/geoportal/mod_showInspireMonitoring.php
===================================================================
--- trunk/mapbender/http/geoportal/mod_showInspireMonitoring.php 2013-12-18 11:43:33 UTC (rev 8755)
+++ trunk/mapbender/http/geoportal/mod_showInspireMonitoring.php 2014-01-03 12:46:10 UTC (rev 8756)
@@ -49,6 +49,7 @@
$translation['wmslayergetmap'] = 'Download über WMS Aufrufe';
$translation['wmslayerdataurl'] = 'Download über direkten Link';
$translation['wfsrequest'] = 'Download über WFS 1.1.0';
+ $translation['downloadlink'] = 'Download über Link aus Metadatensatz';
$translation['inspireViewServices'] = 'INSPIRE Darstellungsdienste';
$translation['inspireDownloadServices'] = 'INSPIRE Downloaddienste';
break;
@@ -62,6 +63,7 @@
$translation['# of Download Services'] = '# of Download Services';
$translation['wmslayergetmap'] = 'Download über WMS Aufrufe';
$translation['wmslayerdataurl'] = 'Download über direkten Link';
+ $translation['downloadlink'] = 'Download über Link aus Metadatensatz';
$translation['wfsrequest'] = 'Download über WFS 1.1.0';
$translation['inspireViewServices'] = 'INSPIRE Darstellungsdienste';
$translation['inspireDownloadServices'] = 'INSPIRE Downloaddienste';
@@ -76,6 +78,7 @@
$translation['# of Download Services'] = '# of Download Services';
$translation['wmslayergetmap'] = 'Download über WMS Aufrufe';
$translation['wmslayerdataurl'] = 'Download über direkten Link';
+ $translation['downloadlink'] = 'Download über Link aus Metadatensatz';
$translation['wfsrequest'] = 'Download über WFS 1.1.0';
$translation['inspireViewServices'] = 'INSPIRE Darstellungsdienste';
$translation['inspireDownloadServices'] = 'INSPIRE Downloaddienste';
@@ -91,6 +94,7 @@
$translation['wmslayergetmap'] = 'Download über WMS Aufrufe';
$translation['wmslayerdataurl'] = 'Download über direkten Link';
$translation['wfsrequest'] = 'Download über WFS 1.1.0';
+ $translation['downloadlink'] = 'Download über Link aus Metadatensatz';
$translation['inspireViewServices'] = 'INSPIRE Darstellungsdienste';
$translation['inspireDownloadServices'] = 'INSPIRE Downloaddienste';
}
@@ -146,6 +150,10 @@
$html .= "$('#dls').append('<li>".$translation['wfsrequest']."</li>');";
$html .= "$('#dls').append('<a href=\"../plugins/mb_downloadFeedClient.php?url='+urlencode('http://www.geoportal.rlp.de/mapbender/php/mod_inspireDownloadFeed.php?id='+uuid+'&type=SERVICE&generateFrom=wfs&wfsid='+value.serviceId)+'\" target=\"_blank\"><img src=\"../img/osgeo_graphics/geosilk/vector_download.png\" title=\"".$translation['Title']."\"/></a><br>');";
$html .= "break;";
+$html .= "case 'downloadlink':";
+$html .= "$('#dls').append('<li>".$translation['downloadlink']."</li>');";
+$html .= "$('#dls').append('<a href=\"../plugins/mb_downloadFeedClient.php?url='+urlencode('http://www.geoportal.rlp.de/mapbender/php/mod_inspireDownloadFeed.php?id='+uuid+'&type=SERVICE&generateFrom=metadata')+'\" target=\"_blank\"><img src=\"../img/osgeo_graphics/geosilk/link_download.png\" title=\"".$translation['Title']."\"/></a><br>');";
+$html .= "break;";
$html .= "default:";
$html .= "}";//end switch
$html .= "})";//end for each
@@ -171,11 +179,11 @@
$html .= "addViewServiceDetails(layerId,aData,i);";
$html .= "}";
$html .= "}";
-$html .= "if (aData['numberDownloadServices'] > 0) {";
+//$html .= "if (aData['numberDownloadServices'] > 0) {";
//get json data for download options from ajax request
$html .= "addDownloadServiceDetails(aData)";
+//$html .= "}";
$html .= "}";
-$html .= "}";
//function for open details of current row
$html .= "function fnFormatDetails ( oTable, nTr ) {";
$html .= "var aData = oTable.fnGetData( nTr );";
@@ -187,10 +195,10 @@
$html .= "if (undefined != aData['viewServices']) {";
$html .= "sOut += '<tr id=\"vs\"><td>".$translation['inspireViewServices']."</td><td></td></tr>';";
$html .= "}";
-$html .= "if (aData['numberDownloadServices'] > 0) {";
+//$html .= "if (aData['numberDownloadServices'] > 0) {";
//get json data for download options from ajax request
$html .= "sOut += '<tr id=\"dls\"><td>".$translation['inspireDownloadServices']."</td><td></td></tr>';";
-$html .= "}";
+//$html .= "}";
$html .= "sOut += '</table>';";
$html .= "return sOut;";
$html .= "}";
Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php 2013-12-18 11:43:33 UTC (rev 8755)
+++ trunk/mapbender/http/php/mod_showMetadata.php 2014-01-03 12:46:10 UTC (rev 8756)
@@ -916,7 +916,7 @@
if ($layerAccessibility && WRAPPER_PATH != '' && ($resource == 'layer' or $resource == 'wms' )) {
- $showMapUrl = $mapbenderBaseUrl.WRAPPER_PATH."?LAYER[zoom]=1&LAYER[id]=".$resourceMetadata['contentid'];
+ $showMapUrl = $mapbenderBaseUrl.WRAPPER_PATH."?LAYER[zoom]=1&LAYER[id]=".$resourceMetadata['contentid']."&LAYER[visible]=0&LAYER[queryable]=0";
//$html .= $t_a.$translation['addLayerToMap'].$t_b."<a href='".$showMapUrl."' target='_blank'><img src='../img/osgeo_graphics/layer-wms-add.png'></a>".$t_c;
$html .= $t_a."<button onclick='window.open(\"".$showMapUrl."\",
\"windowname1\",
Modified: trunk/mapbender/http/plugins/mb_metadata_addon.php
===================================================================
--- trunk/mapbender/http/plugins/mb_metadata_addon.php 2013-12-18 11:43:33 UTC (rev 8755)
+++ trunk/mapbender/http/plugins/mb_metadata_addon.php 2014-01-03 12:46:10 UTC (rev 8756)
@@ -196,16 +196,8 @@
</fieldset>
<fieldset id="spatialres">
<legend><?php echo _mb("Spatial resolution");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Spatial resolution refers to the level of detail of the data set. It shall be expressed as a set of zero to many resolution distances (typically for gridded data and imagery-derived products) or equivalent scales (typically for maps or map-derived products). An equivalent scale is generally expressed as an integer value expressing the scale denominator. A resolution distance shall be expressed as a numerical value associated with a unit of length.");?>'}" src="../img/questionmark.png" alt="" /></legend>
- <label for="groundDistance">
- <input class="required radioRes" name="spatial_res_type" id="groundDistance" type="radio"/ value="groundDistance" checked="checked">
- <?php echo _mb("Ground distance in [m]");?>
- </label>
- <label for="scaleDenominator">
- <input class="required radioRes" name="spatial_res_type" id="scaleDenominator" type="radio"/ value="scaleDenominator">
- <?php echo _mb("Scale denominator [1:X]");?>
- </label>
- <!--<label for="spatial_res_type" class="error"><?php echo _mb("Please set the resolution type!");?>-->
- </label>
+ <input class="required radioRes" name="spatial_res_type" id="spatial_res_type" type="radio"/ value="groundDistance" checked="checked"><?php echo _mb("Ground distance in [m]");?><br>
+ <input class="required radioRes" name="spatial_res_type" id="spatial_res_type" type="radio"/ value="scaleDenominator"><?php echo _mb("Scale denominator [1:X]");?><br>
<label><?php echo _mb("Value of resolution");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Value of spatial resolution in [m] or scale denominator");?>'}" src="../img/questionmark.png" alt="" /></label>
<input class="required" name="spatial_res_value" id="spatial_res_value"/>
</fieldset>
@@ -247,10 +239,11 @@
<label for="downloadlink">
<?php echo _mb("Download link to dataset");?>
</label>
-
- <input class="" name="downloadlink" id="downloadlink"/>
- <?php echo _mb("Enable INSPIRE DLS");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Activating this checkbox will enable the generation of an INSPIRE DLS based on ATOM feed for the given link!");?>'}" src="../img/questionmark.png" alt="" />
- <input name="inspire_download" id="inspire_download" type="checkbox"/>
+ <input class="" name="downloadlink" id="downloadlink"/><br>
+ <p>
+ <?php echo _mb("Enable INSPIRE DLS");?><img class="help-dialog" title="<?php echo _mb("Help");?>" help="{text:'<?php echo _mb("Activating this checkbox will enable the generation of an INSPIRE DLS based on ATOM feed for the given link!");?>'}" src="../img/questionmark.png" alt="" />
+ <input name="inspire_download" id="inspire_download" type="checkbox"/>
+ </p>
</fieldset>
</div>
<div id="tabs-7">
Modified: trunk/mapbender/resources/db/materialize_wms_view.sql
===================================================================
--- trunk/mapbender/resources/db/materialize_wms_view.sql 2013-12-18 11:43:33 UTC (rev 8755)
+++ trunk/mapbender/resources/db/materialize_wms_view.sql 2014-01-03 12:46:10 UTC (rev 8756)
@@ -68,3 +68,18 @@
(wms_timestamp);
--vacuum analyze;
--VACUUM ANALYZE wms_search_table;
+
+DROP TABLE wms_list_tmp;
+select * into wms_list_tmp from wms_list_view;
+DROP TABLE wms_list;
+ALTER TABLE wms_list_tmp RENAME TO wms_list;
+
+-- Index: idx_wms_list_wms_id
+-- DROP INDEX idx_wms_list_wms_id;
+CREATE INDEX idx_wms_list_wms_id
+ ON wms_list
+ USING btree
+ (wms_id);
+
+
+
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 2013-12-18 11:43:33 UTC (rev 8755)
+++ trunk/mapbender/resources/db/pgsql/UTF-8/update/update_2.7.4_to_2.8_pgsql_UTF-8.sql 2014-01-03 12:46:10 UTC (rev 8756)
@@ -155,3 +155,45 @@
UPDATE mb_metadata SET inspire_download = 0 WHERE inspire_download IS NULL;
alter table layer_style alter column legendurl type text;
+
+-- Function: f_wms_searchable_layers(integer)
+
+-- DROP FUNCTION f_wms_searchable_layers(integer);
+
+CREATE OR REPLACE FUNCTION f_wms_searchable_layers(integer)
+ RETURNS integer AS
+$BODY$
+DECLARE
+
+ i_wms_id ALIAS FOR $1;
+ n_count INTEGER;
+
+BEGIN
+
+n_count := count(layer_id) from layer where fkey_wms_id = i_wms_id and layer_searchable = 1;
+
+RETURN n_count;
+END;
+$BODY$
+ LANGUAGE plpgsql VOLATILE COST 100;
+ALTER FUNCTION f_wms_searchable_layers(integer)
+ OWNER TO postgres;
+
+-- View: wms_list_view
+-- DROP VIEW wms_list_view;
+
+CREATE OR REPLACE VIEW wms_list_view AS
+
+SELECT DISTINCT btrim(wms_group.wms_title::text) AS wms_title, replace(replace(replace(replace(replace(replace(replace(upper(btrim(wms_group.wms_title::text)), 'Ä'::text, 'A'::text), 'Ö'::text, 'O'::text), 'Ü'::text, 'U'::text), 'ä'::text, 'A'::text), 'ö'::text, 'O'::text), 'ü'::text, 'U'::text), 'ß'::text, 'SS'::text) AS wms_title_upper, wms_group.wms_abstract, wms_group.wms_id, wms_group.mb_group_name, replace(replace(replace(replace(replace(replace(replace(upper(btrim(wms_group.mb_group_name::text)), 'Ä'::text, 'A'::text), 'Ö'::text, 'O'::text), 'Ü'::text, 'U'::text), 'ä'::text, 'A'::text), 'ö'::text, 'O'::text), 'ü'::text, 'U'::text), 'ß'::text, 'SS'::text) AS mb_group_name_upper, wms_group.layer_id
+ FROM ( SELECT wms.wms_id, wms.wms_title, wms.wms_abstract, user_dep.fkey_mb_group_id AS wms_department, user_dep.mb_group_name, user_dep.mb_group_logo_path, layer.layer_id
+ FROM ( SELECT registrating_groups.fkey_mb_user_id, mb_group.mb_group_id AS fkey_mb_group_id, mb_group.mb_group_name, mb_group.mb_group_title, mb_group.mb_group_country, mb_group.mb_group_stateorprovince, mb_group.mb_group_logo_path
+ FROM registrating_groups, mb_group
+ WHERE registrating_groups.fkey_mb_group_id = mb_group.mb_group_id) user_dep, wms, layer
+ WHERE wms.wms_owner = user_dep.fkey_mb_user_id AND wms.wms_id = layer.fkey_wms_id AND layer.layer_pos = 0 AND f_wms_searchable_layers(layer.fkey_wms_id) <> 0) wms_group
+ WHERE wms_group.wms_title IS NOT NULL
+ ORDER BY btrim(wms_group.wms_title::text), replace(replace(replace(replace(replace(replace(replace(upper(btrim(wms_group.wms_title::text)), 'Ä'::text, 'A'::text), 'Ö'::text, 'O'::text), 'Ü'::text, 'U'::text), 'ä'::text, 'A'::text), 'ö'::text, 'O'::text), 'ü'::text, 'U'::text), 'ß'::text, 'SS'::text), wms_group.wms_abstract, wms_group.wms_id, wms_group.mb_group_name, replace(replace(replace(replace(replace(replace(replace(upper(btrim(wms_group.mb_group_name::text)), 'Ä'::text, 'A'::text), 'Ö'::text, 'O'::text), 'Ü'::text, 'U'::text), 'ä'::text, 'A'::text), 'ö'::text, 'O'::text), 'ü'::text, 'U'::text), 'ß'::text, 'SS'::text), wms_group.layer_id;
+
+
+ALTER TABLE wms_list_view
+ OWNER TO postgres;
+
More information about the Mapbender_commits
mailing list