From c0022e3c1c5c2070e93cc9a56c50b7ae40111ced Mon Sep 17 00:00:00 2001 From: Arno Kaimbacher Date: Thu, 5 Mar 2020 13:40:09 +0100 Subject: [PATCH] =?UTF-8?q?-=20DatasetExtension.php=20save=20also=20Refere?= =?UTF-8?q?nce=20for=20datacite=20and=20dublin=5Fcore=20transformations=20?= =?UTF-8?q?-=20oai:datacite.xslt=20f=C3=BCr=20relatedIdentifiers=20-=20oai?= =?UTF-8?q?:=20dc:=20datasetxml2oai-pmh.xslt=20f=C3=BCr=20dc:relation=20-?= =?UTF-8?q?=20dataset.php=20correct=20hasEmbargoPassed()=20method?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Library/Xml/DatasetExtension.php | 7 ++++++- app/Models/Dataset.php | 3 ++- public/datasetxml2oai-pmh.xslt | 11 +++++++++++ public/prefixes/oai_datacite.xslt | 17 +++++++++++++++++ 4 files changed, 36 insertions(+), 2 deletions(-) diff --git a/app/Library/Xml/DatasetExtension.php b/app/Library/Xml/DatasetExtension.php index 40ab858..3f13033 100644 --- a/app/Library/Xml/DatasetExtension.php +++ b/app/Library/Xml/DatasetExtension.php @@ -6,9 +6,9 @@ use App\Models\Description; use App\Models\License; use App\Models\Person; use App\Models\File; -use App\Models\GeolocationBox; use App\Models\Coverage; use App\Models\Subject; +use App\Models\DatasetReference; /** * DatasetExtension short summary. @@ -65,6 +65,11 @@ trait DatasetExtension 'relation' => 'persons', 'fetch' => 'eager' ), + 'Reference' => array( + 'model' => DatasetReference::class, + 'relation' => 'references', + 'fetch' => 'eager' + ), 'Subject' => array( 'model' => Subject::class, 'relation' => 'subjects', diff --git a/app/Models/Dataset.php b/app/Models/Dataset.php index 7ed8f5c..3d741c5 100644 --- a/app/Models/Dataset.php +++ b/app/Models/Dataset.php @@ -306,7 +306,8 @@ class Dataset extends Model $embargoDate->minute = 59; $embargoDate->second = 59; - return ($embargoDate->gt($now) == true); + return ($embargoDate->lessThan($now)); + //return ($embargoDate->gt($now) == true); } public function getRemainingTimeAttribute() diff --git a/public/datasetxml2oai-pmh.xslt b/public/datasetxml2oai-pmh.xslt index 4e4fe75..f16dfbc 100644 --- a/public/datasetxml2oai-pmh.xslt +++ b/public/datasetxml2oai-pmh.xslt @@ -354,6 +354,8 @@ + + @@ -401,6 +403,7 @@ + @@ -435,6 +438,14 @@ + + + + + + + + diff --git a/public/prefixes/oai_datacite.xslt b/public/prefixes/oai_datacite.xslt index 769f7a1..58902bc 100644 --- a/public/prefixes/oai_datacite.xslt +++ b/public/prefixes/oai_datacite.xslt @@ -77,6 +77,11 @@ Dataset + + + + + @@ -195,6 +200,18 @@ + + + + + + + + + + + +