From 19e2d7ea9567f0b6aa41b089d7710755efb3cb67 Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Mon, 25 May 2020 16:56:20 +0200 Subject: [PATCH] - map 'id' of dataset to 'publish_id' --- app/Http/Controllers/Frontend/SitelinkController.php | 2 +- app/Http/Controllers/Oai/RequestController.php | 10 ++++++---- composer.lock | 10 +++++----- public/datasetxml2oai-pmh.xslt | 2 +- public/prefixes/oai_datacite.xslt | 6 +++--- resources/views/frontend/dataset/show.blade.php | 2 +- resources/views/frontend/sitelink/index.blade.php | 2 +- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/app/Http/Controllers/Frontend/SitelinkController.php b/app/Http/Controllers/Frontend/SitelinkController.php index 43ffb91..bf64b47 100644 --- a/app/Http/Controllers/Frontend/SitelinkController.php +++ b/app/Http/Controllers/Frontend/SitelinkController.php @@ -50,7 +50,7 @@ class SitelinkController extends Controller ->whereYear('server_date_published', '>=', $from) ->whereYear('server_date_published', '<', $until); - $documents = $select + $documents = $select->orderBy('publish_id', 'asc') ->get(); //$this->years = Dataset::select(DB::raw('YEAR(server_date_modified) as server_date_modified')) diff --git a/app/Http/Controllers/Oai/RequestController.php b/app/Http/Controllers/Oai/RequestController.php index 4e518ff..03fe76b 100644 --- a/app/Http/Controllers/Oai/RequestController.php +++ b/app/Http/Controllers/Oai/RequestController.php @@ -187,7 +187,8 @@ class RequestController extends Controller $dataset = null; try { //$dataset = new Opus_Document($docId); - $dataset = Dataset::findOrFail($dataId); + //$dataset = Dataset::findOrFail($publishId); + $dataset = Dataset::where('publish_id', '=', $dataId)->firstOrFail(); } catch (ModelNotFoundException $ex) { throw new OaiModelException( 'The value of the identifier argument is unknown or illegal in this repository.', @@ -406,7 +407,7 @@ class RequestController extends Controller } $totalIds = $finder->count(); - $reldocIds = $finder->pluck('id')->toArray(); + $reldocIds = $finder->orderBy('publish_id')->pluck('publish_id')->toArray(); } // handling of document ids @@ -414,7 +415,8 @@ class RequestController extends Controller $workIds = array_splice($restIds, 0, $maxRecords); //foreach ($datasets as $dataset) foreach ($workIds as $dataId) { - $dataset = Dataset::findOrFail($dataId); + //$dataset = Dataset::findOrFail($dataId); + $dataset = Dataset::where('publish_id', '=', $dataId)->firstOrFail(); $this->createXmlRecord($dataset); } @@ -463,7 +465,7 @@ class RequestController extends Controller //$node = $this->xml->createElement('Rdr_Dataset'); $domNode = $this->getDatasetXmlDomNode($dataset); // add frontdoor url - $this->addLandingPageAttribute($domNode, $dataset->id); + $this->addLandingPageAttribute($domNode, $dataset->publish_id); // add access rights to element //$this->_addAccessRights($domNode, $dataset); diff --git a/composer.lock b/composer.lock index cfcfb04..e30261f 100755 --- a/composer.lock +++ b/composer.lock @@ -1577,16 +1577,16 @@ }, { "name": "opis/closure", - "version": "3.5.2", + "version": "3.5.3", "source": { "type": "git", "url": "https://github.com/opis/closure.git", - "reference": "2e3299cea6f485ca64d19c540f46d7896c512ace" + "reference": "cac47092144043d5d676e2e7cf8d0d2f83fc89ca" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/opis/closure/zipball/2e3299cea6f485ca64d19c540f46d7896c512ace", - "reference": "2e3299cea6f485ca64d19c540f46d7896c512ace", + "url": "https://api.github.com/repos/opis/closure/zipball/cac47092144043d5d676e2e7cf8d0d2f83fc89ca", + "reference": "cac47092144043d5d676e2e7cf8d0d2f83fc89ca", "shasum": "" }, "require": { @@ -1634,7 +1634,7 @@ "serialization", "serialize" ], - "time": "2020-05-21T20:09:36+00:00" + "time": "2020-05-25T09:32:45+00:00" }, { "name": "paragonie/random_compat", diff --git a/public/datasetxml2oai-pmh.xslt b/public/datasetxml2oai-pmh.xslt index d2ba5d5..ee65f64 100644 --- a/public/datasetxml2oai-pmh.xslt +++ b/public/datasetxml2oai-pmh.xslt @@ -264,7 +264,7 @@ oai: : - + diff --git a/public/prefixes/oai_datacite.xslt b/public/prefixes/oai_datacite.xslt index 7198db4..4857f1b 100644 --- a/public/prefixes/oai_datacite.xslt +++ b/public/prefixes/oai_datacite.xslt @@ -47,7 +47,7 @@ oai: : - + @@ -248,8 +248,8 @@ url - - + + diff --git a/resources/views/frontend/dataset/show.blade.php b/resources/views/frontend/dataset/show.blade.php index 3715f6b..683ddef 100644 --- a/resources/views/frontend/dataset/show.blade.php +++ b/resources/views/frontend/dataset/show.blade.php @@ -151,7 +151,7 @@