- map 'id' of dataset to 'publish_id'

This commit is contained in:
Arno Kaimbacher 2020-05-25 16:56:20 +02:00
parent d7cc8d74de
commit 19e2d7ea95
7 changed files with 18 additions and 16 deletions

View File

@ -50,7 +50,7 @@ class SitelinkController extends Controller
->whereYear('server_date_published', '>=', $from) ->whereYear('server_date_published', '>=', $from)
->whereYear('server_date_published', '<', $until); ->whereYear('server_date_published', '<', $until);
$documents = $select $documents = $select->orderBy('publish_id', 'asc')
->get(); ->get();
//$this->years = Dataset::select(DB::raw('YEAR(server_date_modified) as server_date_modified')) //$this->years = Dataset::select(DB::raw('YEAR(server_date_modified) as server_date_modified'))

View File

@ -187,7 +187,8 @@ class RequestController extends Controller
$dataset = null; $dataset = null;
try { try {
//$dataset = new Opus_Document($docId); //$dataset = new Opus_Document($docId);
$dataset = Dataset::findOrFail($dataId); //$dataset = Dataset::findOrFail($publishId);
$dataset = Dataset::where('publish_id', '=', $dataId)->firstOrFail();
} catch (ModelNotFoundException $ex) { } catch (ModelNotFoundException $ex) {
throw new OaiModelException( throw new OaiModelException(
'The value of the identifier argument is unknown or illegal in this repository.', 'The value of the identifier argument is unknown or illegal in this repository.',
@ -406,7 +407,7 @@ class RequestController extends Controller
} }
$totalIds = $finder->count(); $totalIds = $finder->count();
$reldocIds = $finder->pluck('id')->toArray(); $reldocIds = $finder->orderBy('publish_id')->pluck('publish_id')->toArray();
} }
// handling of document ids // handling of document ids
@ -414,7 +415,8 @@ class RequestController extends Controller
$workIds = array_splice($restIds, 0, $maxRecords); $workIds = array_splice($restIds, 0, $maxRecords);
//foreach ($datasets as $dataset) //foreach ($datasets as $dataset)
foreach ($workIds as $dataId) { foreach ($workIds as $dataId) {
$dataset = Dataset::findOrFail($dataId); //$dataset = Dataset::findOrFail($dataId);
$dataset = Dataset::where('publish_id', '=', $dataId)->firstOrFail();
$this->createXmlRecord($dataset); $this->createXmlRecord($dataset);
} }
@ -463,7 +465,7 @@ class RequestController extends Controller
//$node = $this->xml->createElement('Rdr_Dataset'); //$node = $this->xml->createElement('Rdr_Dataset');
$domNode = $this->getDatasetXmlDomNode($dataset); $domNode = $this->getDatasetXmlDomNode($dataset);
// add frontdoor url // add frontdoor url
$this->addLandingPageAttribute($domNode, $dataset->id); $this->addLandingPageAttribute($domNode, $dataset->publish_id);
// add access rights to element // add access rights to element
//$this->_addAccessRights($domNode, $dataset); //$this->_addAccessRights($domNode, $dataset);

10
composer.lock generated
View File

@ -1577,16 +1577,16 @@
}, },
{ {
"name": "opis/closure", "name": "opis/closure",
"version": "3.5.2", "version": "3.5.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/opis/closure.git", "url": "https://github.com/opis/closure.git",
"reference": "2e3299cea6f485ca64d19c540f46d7896c512ace" "reference": "cac47092144043d5d676e2e7cf8d0d2f83fc89ca"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/opis/closure/zipball/2e3299cea6f485ca64d19c540f46d7896c512ace", "url": "https://api.github.com/repos/opis/closure/zipball/cac47092144043d5d676e2e7cf8d0d2f83fc89ca",
"reference": "2e3299cea6f485ca64d19c540f46d7896c512ace", "reference": "cac47092144043d5d676e2e7cf8d0d2f83fc89ca",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@ -1634,7 +1634,7 @@
"serialization", "serialization",
"serialize" "serialize"
], ],
"time": "2020-05-21T20:09:36+00:00" "time": "2020-05-25T09:32:45+00:00"
}, },
{ {
"name": "paragonie/random_compat", "name": "paragonie/random_compat",

View File

@ -264,7 +264,7 @@
<xsl:text>oai:</xsl:text> <xsl:text>oai:</xsl:text>
<xsl:value-of select="$repIdentifier" /> <xsl:value-of select="$repIdentifier" />
<xsl:text>:</xsl:text> <xsl:text>:</xsl:text>
<xsl:value-of select="@Id" /> <xsl:value-of select="@PublishId" />
</identifier> </identifier>
<datestamp> <datestamp>
<xsl:choose> <xsl:choose>

View File

@ -47,7 +47,7 @@
<xsl:text>oai:</xsl:text> <xsl:text>oai:</xsl:text>
<xsl:value-of select="$repIdentifier" /> <xsl:value-of select="$repIdentifier" />
<xsl:text>:</xsl:text> <xsl:text>:</xsl:text>
<xsl:value-of select="@Id" /> <xsl:value-of select="@PublishId" />
</identifier> </identifier>
<!--<datacite:creator>--> <!--<datacite:creator>-->
<creators> <creators>
@ -248,8 +248,8 @@
<xsl:attribute name="alternateIdentifierType"> <xsl:attribute name="alternateIdentifierType">
<xsl:text>url</xsl:text> <xsl:text>url</xsl:text>
</xsl:attribute> </xsl:attribute>
<xsl:variable name="identifier" select="concat($repURL, '/dataset/', @Id)" /> <!-- <xsl:variable name="identifier" select="concat($repURL, '/dataset/', @Id)" /> -->
<xsl:value-of select="$identifier" /> <xsl:value-of select="@landingpage"/>
</alternateIdentifier > </alternateIdentifier >
</xsl:template> </xsl:template>

View File

@ -151,7 +151,7 @@
<div class="tab-pane content-technical-metadata" id="three"> <div class="tab-pane content-technical-metadata" id="three">
<p class="dataset__abstract">Persistenter Identifikator: <p class="dataset__abstract">Persistenter Identifikator:
{{ "https://www.tethys.at/dataset/" . $dataset->id }}</p> {{ "https://www.tethys.at/dataset/" . $dataset->publish_id }}</p>
<p class="dataset__abstract">Status: {{ $dataset->server_state }}</p> <p class="dataset__abstract">Status: {{ $dataset->server_state }}</p>
<p class="dataset__abstract">Eingestellt von: {{ $dataset->user->login }}</p> <p class="dataset__abstract">Eingestellt von: {{ $dataset->user->login }}</p>
<p class="dataset__abstract">Erstellt am: {{ $dataset->created_at->toDateString() }}</p> <p class="dataset__abstract">Erstellt am: {{ $dataset->created_at->toDateString() }}</p>

View File

@ -23,7 +23,7 @@
<div class="post"> <div class="post">
<header class="post-header"> <header class="post-header">
<h2 class="post-title"> <h2 class="post-title">
<a href="{{ URL::route('frontend.dataset.show',['id' =>$document->id]) }}"><?= $document->type; $document->id; ?> <a href="{{ URL::route('frontend.dataset.show',['id' =>$document->publish_id]) }}"><?= $document->type; $document->publish_id; ?>
</a> </a>
</h2> </h2>
</header> </header>