- small xslt improvements for oai interface

- allo cors for OAI interface for all ip addresses inside RequestController.php
This commit is contained in:
Arno Kaimbacher 2022-08-05 10:34:49 +02:00
parent a53a996f85
commit c4d74ca631
3 changed files with 8 additions and 6 deletions

View File

@ -106,7 +106,9 @@ class RequestController extends Controller
//$xml = $this->doc->asXML(); //$xml = $this->doc->asXML();
return response($xml) //->view('rss', array('rss'=>$this->rss)) return response($xml) //->view('rss', array('rss'=>$this->rss))
->header('Content-Type', 'application/xml') ->header('Content-Type', 'application/xml')
->header('charset', 'utf-8'); ->header('charset', 'utf-8')
->header('Access-Control-Allow-Origin', '*')
->header('Access-Control-Allow-Methods', 'GET');
} }
private function __handleRequest(array $oaiRequest) private function __handleRequest(array $oaiRequest)

View File

@ -304,7 +304,7 @@ trait DatasetExtension
} else { } else {
$rows = $select->whereHas('dataset', function ($q) use ($datasetId) { $rows = $select->whereHas('dataset', function ($q) use ($datasetId) {
$q->where('id', $datasetId); $q->where('id', $datasetId);
})->get(); })->orderBy('id')->get();
} }
foreach ($rows as $row) { foreach ($rows as $row) {

View File

@ -398,10 +398,10 @@
<xsl:template match="Coverage" mode="oai_dc"> <xsl:template match="Coverage" mode="oai_dc">
<dc:coverage> <dc:coverage>
<xsl:variable name="geolocation" select="concat( <xsl:variable name="geolocation" select="concat(
'SOUTH-BOUND LATITUDE: ', @XMin, 'SOUTH-BOUND LATITUDE: ', @YMin,
' * WEST-BOUND LONGITUDE: ', @YMin, ' * WEST-BOUND LONGITUDE: ', @XMin,
' * NORTH-BOUND LATITUDE: ', @XMax, ' * NORTH-BOUND LATITUDE: ', @YMax,
' * EAST-BOUND LONGITUDE: ', @YMax ' * EAST-BOUND LONGITUDE: ', @XMax
)" /> )" />
<xsl:value-of select="$geolocation" /> <xsl:value-of select="$geolocation" />