[Mapbender-commits] r8536 - in trunk/mapbender/http: classes img/osgeo_graphics/geosilk php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Fri Dec 28 03:46:21 PST 2012
Author: armin11
Date: 2012-12-28 03:46:21 -0800 (Fri, 28 Dec 2012)
New Revision: 8536
Added:
trunk/mapbender/http/img/osgeo_graphics/geosilk/link_download.png
Modified:
trunk/mapbender/http/classes/class_wms.php
trunk/mapbender/http/php/mod_exportISOMetadata.php
trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php
trunk/mapbender/http/php/mod_showMetadata.php
trunk/mapbender/http/php/mod_wmc2ol.php
Log:
Some bugfixes and export possibility for inspire downloadservice metadata as iso19139.
Modified: trunk/mapbender/http/classes/class_wms.php
===================================================================
--- trunk/mapbender/http/classes/class_wms.php 2012-12-19 11:31:12 UTC (rev 8535)
+++ trunk/mapbender/http/classes/class_wms.php 2012-12-28 11:46:21 UTC (rev 8536)
@@ -2537,16 +2537,16 @@
$sql .= "wms_userstyle = $11, ";
$sql .= "wms_remotewfs = $12, ";
$sql .= "wms_network_access = $13, ";
- $sql .= "wms_max_imagesize = $17, ";
- $sql .= "fkey_mb_group_id = $14, ";
- $sql .= "uuid = $15 ";
- $sql .= " WHERE wms_id = $16";
+ $sql .= "wms_max_imagesize = $16, ";
+ $sql .= "fkey_mb_group_id = $14 ";
+ #$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 ,$this->uuid ,$myWMS, $this->wms_max_imagesize);
- $t = array('s','s','s','s','s','s','s','i','s','s','s','s','i','i','s','i','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);
+ $t = array('s','s','s','s','s','s','s','i','s','s','s','s','i','i','i','i');
$res = db_prep_query($sql,$v,$t);
if(!$res){
@@ -2571,15 +2571,15 @@
$sql .= "contactfacsimiletelephone = $14, ";
$sql .= "contactelectronicmailaddress = $15, ";
$sql .= "wms_network_access = $16, ";
- $sql .= "wms_max_imagesize = $20, ";
- $sql .= "fkey_mb_group_id = $17, ";
- $sql .= "uuid = $18 ";
- $sql .= " WHERE wms_id = $19";
+ $sql .= "wms_max_imagesize = $19, ";
+ $sql .= "fkey_mb_group_id = $17 ";
+ #$sql .= "uuid = $18 ";
+ $sql .= " WHERE wms_id = $18";
$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 ,$this->uuid, $myWMS, $this->wms_max_imagesize);
- $t = array('s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','i','i','s','i','i');
+ $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');
$res = db_prep_query($sql,$v,$t);
if(!$res){
db_rollback();
Added: trunk/mapbender/http/img/osgeo_graphics/geosilk/link_download.png
===================================================================
(Binary files differ)
Property changes on: trunk/mapbender/http/img/osgeo_graphics/geosilk/link_download.png
___________________________________________________________________
Added: svn:mime-type
+ application/octet-stream
Modified: trunk/mapbender/http/php/mod_exportISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_exportISOMetadata.php 2012-12-19 11:31:12 UTC (rev 8535)
+++ trunk/mapbender/http/php/mod_exportISOMetadata.php 2012-12-28 11:46:21 UTC (rev 8536)
@@ -52,12 +52,17 @@
$generatorScript = '/mapbender/php/mod_layerISOMetadata.php?';
$generatorScriptMetadata = '/mapbender/php/mod_dataISOMetadata.php?';
+$generatorScriptDlsOption = '/mapbender/php/mod_getDownloadOptions.php?';
+$generatorScriptDls = '/mapbender/php/mod_inspireAtomFeedISOMetadata.php?';
$generatorBaseUrl = 'http://'.$_SERVER['HTTP_HOST'].$generatorScript;
$generatorBaseUrlMetadata = 'http://'.$_SERVER['HTTP_HOST'].$generatorScriptMetadata;
+$generatorBaseUrlDlsOption = 'http://'.$_SERVER['HTTP_HOST'].$generatorScriptDlsOption;
+$generatorBaseUrlDls = 'http://'.$_SERVER['HTTP_HOST'].$generatorScriptDls;
$countLayer = 0;
$countMetadataURL = 0;
+$countDls = 0;
echo date('Y-m-d - H:i:s', time())."<br>";
//remove files from METADATA_DIR!
if ($handle = opendir(METADATA_DIR)) {
@@ -119,10 +124,53 @@
fclose($h);
$countMetadataURL++;
}
+ //generate the downloadservice metadata files thru walking over the coupled dls for this metadata uuid!
+ //e.g. http://www.geoportal.rlp.de/mapbender/php/mod_inspireAtomFeedISOMetadata.php?Id=1487b57f-f087-d84a-3de3-e341312ecd6e&outputFormat=iso19139&generateFrom=wfs&wfsid=271
+ //get download options for specific metadata
+ $downloadOptionsConnector = new connector($generatorBaseUrlDlsOption."id=".$row_metadata["uuid"]);
+ $downloadOptions = json_decode($downloadOptionsConnector->file);
+ if ($downloadOptions != null) {
+ echo "Coupled DLS: <br>";
+ foreach ($downloadOptions->{$row_metadata["uuid"]}->option as $option) {
+ unset($dlsOption);
+ switch ($option->type) {
+ case "wmslayergetmap":
+ $generatorDlsUrl = $generatorBaseUrlDls."Id=".$row_metadata["uuid"]."&outputFormat=iso19139&generateFrom=wmslayer&layerid=".$option->resourceId;
+ $dlsOption = $option->type;
+ $dlsOptionId = $option->resourceId;
+ break;
+ case "wmslayerdataurl":
+ $generatorDlsUrl = $generatorBaseUrlDls."Id=".$row_metadata["uuid"]."&outputFormat=iso19139&generateFrom=dataurl&layerid=".$option->resourceId;
+ $dlsOption = $option->type;
+ $dlsOptionId = $option->resourceId;
+ break;
+ case "wfsrequest":
+ $generatorDlsUrl = $generatorBaseUrlDls."Id=".$row_metadata["uuid"]."&outputFormat=iso19139&generateFrom=wfs&wfsid=".$option->serviceId;
+ $dlsOption = $option->type;
+ $dlsOptionId = $option->serviceId;
+ break;
+ }
+ echo "<br>".$generatorDlsUrl."<br>";
+ //load the xml and store it to filesystem
+ if (isset($dlsOption) && $dlsOption != '') {
+ $generatorInterfaceObject = new connector($generatorDlsUrl);
+ $ISOFile = $generatorInterfaceObject->file;
+ if($h = fopen(METADATA_DIR."/mapbenderDlsMetadata_".$row_metadata["uuid"]."_".$dlsOption."_".$dlsOptionId."_iso19139.xml","w")){
+ if(!fwrite($h,$ISOFile)){
+ $e = new mb_exception("mod_exportISOMetadata.php: cannot write to file: ".METADATA_DIR."/mapbenderDlsMetadata_".$row_metadata["uuid"]."_".$dlsOption."_".$dlsOptionId."_iso19139.xml");
+ }
+ fclose($h);
+ $countDls++;
+ }
+ }
+ }
+ }
+
}
$countLayer++;
}
-echo "Number of generated Service Metadata Records (one for each layer): ".$countLayer."<br>";
+echo "Number of generated View Service Metadata Records (one for each layer): ".$countLayer."<br>";
echo "Number of generated Data Metadata Records (multiple for each layer): ".$countMetadataURL."<br>";
+echo "Number of generated Download Service Metadata Records (multiple for each metadataset): ".$countDls."<br>";
echo date('Y-m-d - H:i:s', time())."<br>";
Modified: trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php 2012-12-19 11:31:12 UTC (rev 8535)
+++ trunk/mapbender/http/php/mod_inspireAtomFeedISOMetadata.php 2012-12-28 11:46:21 UTC (rev 8536)
@@ -810,6 +810,16 @@
$descriptiveKeywords->appendChild($MD_Keywords);
$SV_ServiceIdentification->appendChild($descriptiveKeywords);
+ //a special keyword for all INSPIRE services in germany
+ $keyword=$iso19139->createElement("gmd:keyword");
+ $keyword_cs=$iso19139->createElement("gco:CharacterString");
+ $keywordText = $iso19139->createTextNode("inspireidentifiziert");
+ $keyword_cs->appendChild($keywordText);
+ $keyword->appendChild($keyword_cs);
+ $MD_Keywords->appendChild($keyword);
+ $descriptiveKeywords->appendChild($MD_Keywords);
+ $SV_ServiceIdentification->appendChild($descriptiveKeywords);
+
//Part B 3 INSPIRE Category
//do this only if an INSPIRE keyword (Annex I-III) is set - not applicable to services!
//Resource Constraints B 8
Modified: trunk/mapbender/http/php/mod_showMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_showMetadata.php 2012-12-19 11:31:12 UTC (rev 8535)
+++ trunk/mapbender/http/php/mod_showMetadata.php 2012-12-28 11:46:21 UTC (rev 8536)
@@ -202,6 +202,7 @@
$translation['showMap'] = "Karte anzeigen";
$translation['Download GML data from INSPIRE Download Service'] = "Download von GML-Daten über INSPIRE Downloaddienst";
$translation['Download raster data from INSPIRE Download Service'] = "Download von Rasterdaten über INSPIRE Downloaddienst";
+ $translation['Download linked data from INSPIRE Download Service'] = "Download von Daten über INSPIRE Downloaddienst (linked data)";
break;
case "en":
@@ -279,6 +280,7 @@
$translation['showMap'] = "Show map";
$translation['Download GML data from INSPIRE Download Service'] = "Download GML data from INSPIRE Download Service";
$translation['Download raster data from INSPIRE Download Service'] = "Download raster data from INSPIRE Download Service";
+ $translation['Download linked data from INSPIRE Download Service'] = "Download linked data from INSPIRE Download Service";
break;
case "fr":
$translation['overview'] = 'Vue générale';
@@ -355,6 +357,7 @@
$translation['showMap'] = "Ouvrir la carte";
$translation['Download GML data from INSPIRE Download Service'] = "Download von GML-Daten über INSPIRE Downloaddienst";
$translation['Download raster data from INSPIRE Download Service'] = "Download von Rasterdaten über INSPIRE Downloaddienst";
+ $translation['Download linked data from INSPIRE Download Service'] = "Download von Daten über INSPIRE Downloaddienst (linked data)";
break;
default: #to english
$translation['overview'] = 'Overview';
@@ -431,6 +434,7 @@
$translation['showMap'] = "Show map";
$translation['Download GML data from INSPIRE Download Service'] = "Download GML data from INSPIRE Download Service";
$translation['Download raster data from INSPIRE Download Service'] = "Download raster data from INSPIRE Download Service";
+ $translation['Download linked data from INSPIRE Download Service'] = "Download linked data from INSPIRE Download Service";
}
//Array with infos about the different elements which are shown in the tabs
@@ -1095,14 +1099,17 @@
if ($downloadOptions != null) {
foreach ($downloadOptions->{$row["uuid"]}->option as $option) {
- if ($option->type == "wmslayergetmap" || $option->type == "wmslayerdataurl") {
- //use rastersymbol
- $metadataList .= " <a href='../plugins/mb_downloadFeedClient.php?url=".urlencode("http://www.geoportal.rlp.de/mapbender/php/mod_inspireDownloadFeed.php?id=".$row["uuid"]."&type=SERVICE&generateFrom=wmslayer&layerid=".$option->resourceId)."'><img src='../img/osgeo_graphics/geosilk/raster_download.png' title='".$translation['Download raster data from INSPIRE Download Service']."'/></a>";
- } else {
- //use vectorsymbol
- $metadataList .= " <a href='../plugins/mb_downloadFeedClient.php?url=".urlencode("http://www.geoportal.rlp.de/mapbender/php/mod_inspireDownloadFeed.php?id=".$row["uuid"]."&type=SERVICE&generateFrom=wfs&wfsid=".$option->serviceId)."'><img src='../img/osgeo_graphics/geosilk/vector_download.png' title='".$translation['Download GML data from INSPIRE Download Service']."'/></a>";
- }
-
+ switch ($option->type) {
+ case "wmslayergetmap":
+ $metadataList .= " <a href='../plugins/mb_downloadFeedClient.php?url=".urlencode("http://www.geoportal.rlp.de/mapbender/php/mod_inspireDownloadFeed.php?id=".$row["uuid"]."&type=SERVICE&generateFrom=wmslayer&layerid=".$option->resourceId)."'><img src='../img/osgeo_graphics/geosilk/raster_download.png' title='".$translation['Download raster data from INSPIRE Download Service']."'/></a>";
+ break;
+ case "wmslayerdataurl":
+ $metadataList .= " <a href='../plugins/mb_downloadFeedClient.php?url=".urlencode("http://www.geoportal.rlp.de/mapbender/php/mod_inspireDownloadFeed.php?id=".$row["uuid"]."&type=SERVICE&generateFrom=dataurl&layerid=".$option->resourceId)."'><img src='../img/osgeo_graphics/geosilk/link_download.png' title='".$translation['Download linked data from INSPIRE Download Service']."'/></a>";
+ break;
+ case "wfsrequest":
+ $metadataList .= " <a href='../plugins/mb_downloadFeedClient.php?url=".urlencode("http://www.geoportal.rlp.de/mapbender/php/mod_inspireDownloadFeed.php?id=".$row["uuid"]."&type=SERVICE&generateFrom=wfs&wfsid=".$option->serviceId)."'><img src='../img/osgeo_graphics/geosilk/vector_download.png' title='".$translation['Download GML data from INSPIRE Download Service']."'/></a>";
+ break;
+ }
}
}
Modified: trunk/mapbender/http/php/mod_wmc2ol.php
===================================================================
--- trunk/mapbender/http/php/mod_wmc2ol.php 2012-12-19 11:31:12 UTC (rev 8535)
+++ trunk/mapbender/http/php/mod_wmc2ol.php 2012-12-28 11:46:21 UTC (rev 8536)
@@ -382,6 +382,9 @@
$layer_name=$xml->LayerList->Layer[$i]->Name;
$wms_id=dom_import_simplexml($extensions->wms_id)->nodeValue;
$layerNames = getLayerNames($wms_id);
+ if (isset($layerNames[(string)$layer_id]) && $layerNames[(string)$layer_id] != "") {
+ $layer_name = $layerNames[(string)$layer_id];
+ }
$has_permission=$admin->getLayerPermission($wms_id, $layer_name, $userId);
if ($has_permission || $layer_id==''){
$getMapUrl = $xml->LayerList->Layer[$i]->Server->OnlineResource->attributes('http://www.w3.org/1999/xlink')->href;
@@ -446,6 +449,9 @@
$layer_name=$xml->LayerList->Layer[$i]->Name;
$wms_id=dom_import_simplexml($extensions->wms_id)->nodeValue;
$layerNames = getLayerNames($wms_id);
+ if (isset($layerNames[(string)$layer_id]) && $layerNames[(string)$layer_id] != "") {
+ $layer_name = $layerNames[(string)$layer_id];
+ }
$has_permission=$admin->getLayerPermission($wms_id, $layer_name, $userId);
if (($xml->LayerList->Layer[$i]->attributes()->hidden=='0' && $has_permission && $extensions->layer_parent != '') ||
($layer_id=='' && $xml->LayerList->Layer[$i]->attributes()->hidden=='0')){
More information about the Mapbender_commits
mailing list