From c4d74ca631b3e19c20a6b7a6ca61912b5161dba1 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Fri, 5 Aug 2022 10:34:49 +0200 Subject: [PATCH] - small xslt improvements for oai interface - allo cors for OAI interface for all ip addresses inside RequestController.php --- app/Http/Controllers/Oai/RequestController.php | 4 +++- app/Library/Xml/DatasetExtension.php | 2 +- public/datasetxml2oai-pmh.xslt | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/app/Http/Controllers/Oai/RequestController.php b/app/Http/Controllers/Oai/RequestController.php index 418684f..759a980 100644 --- a/app/Http/Controllers/Oai/RequestController.php +++ b/app/Http/Controllers/Oai/RequestController.php @@ -106,7 +106,9 @@ class RequestController extends Controller //$xml = $this->doc->asXML(); return response($xml) //->view('rss', array('rss'=>$this->rss)) ->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) diff --git a/app/Library/Xml/DatasetExtension.php b/app/Library/Xml/DatasetExtension.php index c8c3f80..22ca685 100644 --- a/app/Library/Xml/DatasetExtension.php +++ b/app/Library/Xml/DatasetExtension.php @@ -304,7 +304,7 @@ trait DatasetExtension } else { $rows = $select->whereHas('dataset', function ($q) use ($datasetId) { $q->where('id', $datasetId); - })->get(); + })->orderBy('id')->get(); } foreach ($rows as $row) { diff --git a/public/datasetxml2oai-pmh.xslt b/public/datasetxml2oai-pmh.xslt index 61bcf09..34c3573 100644 --- a/public/datasetxml2oai-pmh.xslt +++ b/public/datasetxml2oai-pmh.xslt @@ -398,10 +398,10 @@