[Mapbender-commits] r7820 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue May 17 06:43:48 EDT 2011
Author: armin11
Date: 2011-05-17 03:43:48 -0700 (Tue, 17 May 2011)
New Revision: 7820
Modified:
trunk/mapbender/http/php/wms.php
Log:
Extension to show uploaded metadata
Modified: trunk/mapbender/http/php/wms.php
===================================================================
--- trunk/mapbender/http/php/wms.php 2011-05-17 10:04:08 UTC (rev 7819)
+++ trunk/mapbender/http/php/wms.php 2011-05-17 10:43:48 UTC (rev 7820)
@@ -1027,14 +1027,14 @@
SELECT metadata_id, uuid, link, linktype, md_format, origin FROM mb_metadata
INNER JOIN (SELECT * from ows_relation_metadata
WHERE fkey_layer_id = $subLayerId ) as relation ON
-mb_metadata.metadata_id = relation.fkey_metadata_id WHERE mb_metadata.origin IN ('capabilities','external','metador')
+mb_metadata.metadata_id = relation.fkey_metadata_id WHERE mb_metadata.origin IN ('capabilities','external','metador','upload')
SQL;
- $e = new mb_exception("layerid: ".$sub_layer_row['layer_id']);
+ $e = new mb_notice("layerid: ".$sub_layer_row['layer_id']);
$i = 0;
$res_metadata = db_query($sql);
- $e = new mb_exception("row size: ".count($row_metadata));
+ $e = new mb_notice("row size: ".count($row_metadata));
while ($row_metadata = db_fetch_array($res_metadata)) {
$e = new mb_exception("i: ".$i);
//push entries into xml structure
@@ -1067,6 +1067,20 @@
$onlineResource->setAttribute("xlink:href", $row_metadata['link']);
$onlineResource->setAttribute("xlink:href", $mapbenderMetadataUrlUrl.$row_metadata['uuid']);
break;
+ case 'upload':
+ $metadataUrl = $doc->createElement("MetadataURL");
+ $metadataUrl = $sub_layer->appendChild($metadataUrl);
+ $metadataUrl->setAttribute('type', 'ISO19115:2003');
+ $format = $doc->createElement("Format");
+ $format = $metadataUrl->appendChild($format);
+ $formatText = $doc->createTextNode("text/xml");
+ $formatText = $format->appendChild($formatText);
+ $onlineResource = $doc->createElement("OnlineResource");
+ $onlineResource = $metadataUrl->appendChild($onlineResource);
+ $onlineResource->setAttribute("xmlns:xlink", "http://www.w3.org/1999/xlink" );
+ $onlineResource->setAttribute("xlink:href", $row_metadata['link']);
+ $onlineResource->setAttribute("xlink:href", $mapbenderMetadataUrlUrl.$row_metadata['uuid']);
+ break;
case 'metador':
$metadataUrl = $doc->createElement("MetadataURL");
$metadataUrl = $sub_layer->appendChild($metadataUrl);
More information about the Mapbender_commits
mailing list