[Mapbender-commits] r10251 - trunk/mapbender/http/php
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Mon Sep 16 04:52:46 PDT 2019
Author: armin11
Date: 2019-09-16 04:52:46 -0700 (Mon, 16 Sep 2019)
New Revision: 10251
Modified:
trunk/mapbender/http/php/mod_getCoupledResourcesForDataset.php
Log:
Fix for csw getrecordbyid request - get full profile
Modified: trunk/mapbender/http/php/mod_getCoupledResourcesForDataset.php
===================================================================
--- trunk/mapbender/http/php/mod_getCoupledResourcesForDataset.php 2019-09-13 11:58:04 UTC (rev 10250)
+++ trunk/mapbender/http/php/mod_getCoupledResourcesForDataset.php 2019-09-16 11:52:46 UTC (rev 10251)
@@ -209,8 +209,11 @@
//$e = new mb_exception("parse csw capabilities!");
//parse url
$urlArray = parse_url($url);
- $urlWithoutRequest = $urlArray['scheme']."://".$urlArray['host'].":".$urlArray['port']."/".$urlArray['path'];
- $csw->createCatObjFromXML($urlWithoutRequest."?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetCapabilities");
+ $urlWithoutRequest = $urlArray['scheme']."://".$urlArray['host'].$urlArray['path'];
+ $cswCapUrl = $urlWithoutRequest."?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetCapabilities";
+
+ $csw->createCatObjFromXML($cswCapUrl);
+
$cswClient = new cswClient();
//$e = new mb_exception("php/mod_getCoupledResourcesForDataset.php: datasetid from getrecordbyid: ".$mbMetadata->datasetId);
$operation = "getrecordsresolvecoupling";
@@ -237,6 +240,7 @@
$fileIdentifier = $cswClient->operationResult->xpath('/csw:GetRecordsResponse/csw:SearchResults/gmd:MD_Metadata['.$k.']/gmd:fileIdentifier/gco:CharacterString');
$fileIdentifier = (string)$fileIdentifier[0];
+//$e = new mb_exception("service fileidentifier: ".$fileIdentifier);
//service date
$mdDateStamp = $cswClient->operationResult->xpath('/csw:GetRecordsResponse/csw:SearchResults/gmd:MD_Metadata['.$k.']/gmd:identificationInfo/srv:SV_ServiceIdentification/gmd:date/gmd:CI_Date/gmd:date/gco:Date');
$mdDateStamp = (string)$mdDateStamp[0];
@@ -278,8 +282,8 @@
$serviceMetadata->service[$k]->serviceType = $mdServiceType;
$serviceMetadata->service[$k]->serviceTitle = $mdTitle;
$serviceMetadata->service[$k]->serviceDate = $mdDateStamp;
- $serviceMetadata->service[$k]->mdLink = $urlWithoutRequest."?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecordById&outputSchema=".urlencode('http://www.isotc211.org/2005/gmd')."&id=".$fileIdentifier;
- $serviceMetadata->service[$k]->htmlLink = $scheme.'://'.$hostName.str_replace(basename($_SERVER['SCRIPT_NAME']), "mod_exportIso19139.php", $_SERVER['PHP_SELF'])."?url=".urlencode($urlWithoutRequest."?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecordById&outputSchema=".urlencode('http://www.isotc211.org/2005/gmd')."&id=".$fileIdentifier);
+ $serviceMetadata->service[$k]->mdLink = $urlWithoutRequest."?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecordById&ElementSetName=full&outputSchema=".urlencode('http://www.isotc211.org/2005/gmd')."&id=".$fileIdentifier;
+ $serviceMetadata->service[$k]->htmlLink = $scheme.'://'.$hostName.str_replace(basename($_SERVER['SCRIPT_NAME']), "mod_exportIso19139.php", $_SERVER['PHP_SELF'])."?url=".urlencode($urlWithoutRequest."?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecordById&ElementSetName=full&outputSchema=".urlencode('http://www.isotc211.org/2005/gmd')."&id=".$fileIdentifier);
if (is_array($mdAccessUrl)) {
$mdAccessUrl = $mdAccessUrl[0];
}
@@ -310,6 +314,9 @@
}
}
$serviceMetadata->service = array_values($serviceMetadata->service);
+ $serviceMetadata->fileIdentifier = (string)$mbMetadata->fileIdentifier;
+ $serviceMetadata->resourceResponsibleParty = (string)$mbMetadata->resourceResponsibleParty;
+ $serviceMetadata->resourceContactEmail = (string)$mbMetadata->resourceContactEmail;
$resultObj['message'] = "Coupling resolved successfully!";
$resultObj['success'] = true;
$serviceMetadata->genTime = microtime_float() - $starttime;
More information about the Mapbender_commits
mailing list