- composer updates

- Formatierungsfehler bei Coverage im XML-Output von dc:coverage wurde behoben
- DataCite: AlternateIdentifier zeigt nun die Landing Page zum Datensatz an
- statt "Datum der Freischaltung" wird nun "Embargo-Ende" auf der Landing Page angezeigt
- Projekte werden nun bei der OAI-ListSets-Abfrage angezeigt siehe: https://repository.geologie.ac.at/oai?verb=ListSets
- Abstand vor dem Titel in den Suchergebnissen
This commit is contained in:
Arno Kaimbacher 2020-05-18 19:36:31 +02:00
parent 7b69477712
commit 35e71a13c3
7 changed files with 76 additions and 22 deletions

View File

@ -4,6 +4,7 @@ namespace App\Http\Controllers\Oai;
use App\Exceptions\OaiModelException;
use App\Http\Controllers\Controller;
use App\Models\Dataset;
use App\Models\Project;
use App\Models\Oai\Configuration as OaiModelConfiguration;
use App\Models\Oai\OaiModelError;
use App\Models\Oai\ResumptionTokens;
@ -118,6 +119,7 @@ class RequestController extends Controller
// set OAI base url
$uri = explode('?', $_SERVER['REQUEST_URI'], 2);
$this->proc->setParameter('', 'baseURL', url('/') . $uri[0]);
$this->proc->setParameter('', 'repURL', url('/'));
// $resumptionPath = $this->configuration->getResumptionTokenPath();
@ -298,12 +300,13 @@ class RequestController extends Controller
//$oaiSets = new Oai_Model_Sets();
$sets = array(
'bibliography:true' => 'Set for bibliographic entries',
'bibliography:false' => 'Set for non-bibliographic entries',
// 'bibliography:true' => 'Set for bibliographic entries',
// 'bibliography:false' => 'Set for non-bibliographic entries',
);
$sets = array_merge(
$sets,
$this->getSetsForDocumentTypes()
$this->getSetsForDocumentTypes(),
$this->getSetsForProjects(),
);
//$sets = $this->getSetsForDocumentTypes();
@ -387,12 +390,21 @@ class RequestController extends Controller
$finder->whereIn('server_state', $this->deliveringDocumentStates);
if (array_key_exists('set', $oaiRequest)) {
$setarray = explode(':', $oaiRequest['set']);
if ($setarray[0] == 'data-type') {
if (count($setarray) === 2 and !empty($setarray[1])) {
$finder->where('type', $setarray[1]);
}
} elseif ($setarray[0] == 'project') {
if (count($setarray) === 2 and !empty($setarray[1])) {
// $finder->where('type', $setarray[1]);
$finder->whereHas('project', function ($q) use ($setarray) {
$q->where('label', $setarray[1]);
});
}
}
}
$totalIds = $finder->count();
$reldocIds = $finder->pluck('id')->toArray();
}
@ -522,6 +534,31 @@ class RequestController extends Controller
return $xmlModel->getDomDocument()->getElementsByTagName('Rdr_Dataset')->item(0);
}
/**
* Returns oai sets for projects.
* @return array
*/
private function getSetsForProjects()
{
$setSpecPattern = self::SET_SPEC_PATTERN;
$sets = array();
$projects = Project::pluck('name', 'label')->toArray();
foreach ($projects as $doctype => $row) {
if (0 == preg_match("/^$setSpecPattern$/", $doctype)) {
$msg = "Invalid SetSpec (doctype='" . $doctype . "')."
. " Allowed characters are [$setSpecPattern].";
Log::error("OAI-PMH: $msg");
continue;
}
$setSpec = 'project:' . $doctype;
// $count = $row['count'];
$sets[$setSpec] = "Set for project '$doctype'";
}
return $sets;
}
/**
* Returns oai sets for document types.
* @return array
@ -576,7 +613,7 @@ class RequestController extends Controller
$identify = $sxe->addChild('Identify');
$identify->addChild('repositoryName', "Data Research Repository");
$identify->addChild('baseURL', "http://tethys.geologie.ac.at/");
$identify->addChild('baseURL', "https://tethys.at/");
$identify->addChild('protocolVersion', '2.0');
$identify->addChild('adminEmail', 'repository@geologie.ac.at');
//$identify->addChild('earliestDatestamp', '2017-04-07');

View File

@ -14,7 +14,7 @@
"davejamesmiller/laravel-breadcrumbs": "5.x",
"felixkiss/uniquewith-validator": "^3.1",
"fideloper/proxy": "^4.0",
"laravel/framework": "^6.0",
"laravel/framework": "^6.2",
"laravel/tinker": "^1.0",
"laravelcollective/html": "^6.1",
"mcamara/laravel-localization": "^1.3",

22
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "7b170cd659a0ccd3c23b01d9b459f749",
"content-hash": "413b881be459667c601f26e12d21c034",
"packages": [
{
"name": "arifhp86/laravel-clear-expired-cache-file",
@ -1030,16 +1030,16 @@
},
{
"name": "laravelcollective/html",
"version": "v6.1.0",
"version": "v6.1.1",
"source": {
"type": "git",
"url": "https://github.com/LaravelCollective/html.git",
"reference": "64f2268bf41bf02b3a9dd3c30f102e934d721664"
"reference": "895115187e6fca81350a0b1152b5804f52a8ac28"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/LaravelCollective/html/zipball/64f2268bf41bf02b3a9dd3c30f102e934d721664",
"reference": "64f2268bf41bf02b3a9dd3c30f102e934d721664",
"url": "https://api.github.com/repos/LaravelCollective/html/zipball/895115187e6fca81350a0b1152b5804f52a8ac28",
"reference": "895115187e6fca81350a0b1152b5804f52a8ac28",
"shasum": ""
},
"require": {
@ -1094,7 +1094,7 @@
],
"description": "HTML and Form Builders for the Laravel Framework",
"homepage": "https://laravelcollective.com",
"time": "2020-03-02T16:41:28+00:00"
"time": "2020-05-17T20:19:55+00:00"
},
{
"name": "league/commonmark",
@ -1198,16 +1198,16 @@
},
{
"name": "league/flysystem",
"version": "1.0.68",
"version": "1.0.69",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "3e4198372276ec99ac3409a21d7c9d1ced9026e4"
"reference": "7106f78428a344bc4f643c233a94e48795f10967"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3e4198372276ec99ac3409a21d7c9d1ced9026e4",
"reference": "3e4198372276ec99ac3409a21d7c9d1ced9026e4",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/7106f78428a344bc4f643c233a94e48795f10967",
"reference": "7106f78428a344bc4f643c233a94e48795f10967",
"shasum": ""
},
"require": {
@ -1284,7 +1284,7 @@
"type": "other"
}
],
"time": "2020-05-12T20:33:44+00:00"
"time": "2020-05-18T15:13:39+00:00"
},
{
"name": "mcamara/laravel-localization",

View File

@ -65,6 +65,7 @@ section.search {
.record-elem .h4, .record-elem h4 {
font-size: 16px;
letter-spacing: .05em;
margin-top: 8px;
}
.record-detail h1, .record-detail p,
.record-elem h4,

View File

@ -38,6 +38,7 @@
<xsl:param name="oai_error_code" />
<xsl:param name="oai_error_message" />
<xsl:param name="baseURL" />
<xsl:param name="repURL" />
@ -394,7 +395,7 @@
)" />
<xsl:value-of select="$geolocation" />
<xsl:text>&#xA;</xsl:text>
<!-- <xsl:text>&#xA;</xsl:text> -->
<xsl:if test="@ElevationMin != '' and @ElevationMax != ''">
<xsl:value-of select="concat(' * ELEVATION MIN: ', @ElevationMin, ' * ELEVATION MAX: ', @ElevationMax)" />
</xsl:if>
@ -402,7 +403,7 @@
<xsl:value-of select="concat(' * ELEVATION ABSOLUT: ', @ElevationAbsolut)" />
</xsl:if>
<xsl:text>&#xA;</xsl:text>
<!-- <xsl:text>&#xA;</xsl:text> -->
<xsl:if test="@DepthMin != '' and @DepthMax != ''">
<xsl:value-of select="concat(' * DEPTH MIN: ', @DepthMin, ' * DEPTH MAX: ', @DepthMax)" />
</xsl:if>
@ -410,7 +411,7 @@
<xsl:value-of select="concat(' * DEPTH ABSOLUT: ', @DepthAbsolut)" />
</xsl:if>
<xsl:text>&#xA;</xsl:text>
<!-- <xsl:text>&#xA;</xsl:text> -->
<xsl:if test="@TimeMin != '' and @TimeMax != ''">
<xsl:value-of select="concat(' * TIME MIN: ', @TimeMin, ' * TIME MAX: ', @TimeMax)" />
</xsl:if>

View File

@ -82,6 +82,11 @@
<xsl:text>Dataset</xsl:text>
<!-- <xsl:value-of select="@Type" /> -->
</resourceType>
<alternateIdentifiers>
<xsl:call-template name="AlternateIdentifier"/>
</alternateIdentifiers>
<xsl:if test="Reference">
<relatedIdentifiers>
<xsl:apply-templates select="Reference" mode="oai_datacite" />
@ -237,6 +242,17 @@
</subject>
</xsl:template>
<xsl:template name="AlternateIdentifier" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<alternateIdentifier >
<xsl:attribute name="alternateIdentifierType">
<xsl:text>url</xsl:text>
</xsl:attribute>
<xsl:variable name="identifier" select="concat($repURL, '/dataset/', @Id)" />
<xsl:value-of select="$identifier" />
</alternateIdentifier >
</xsl:template>
<xsl:template match="Reference" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<relatedIdentifier>
@ -269,7 +285,6 @@
</contributor>
</xsl:template>
<xsl:template match="PersonAuthor" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4">
<creator>

View File

@ -113,10 +113,10 @@
<p class="dataset__abstract">Size: {{ $dataset->files()->count() }} </p>
@if($dataset->embargo_date != null)
<p class="dataset__abstract">Datum der Freischaltung:
<p class="dataset__abstract">Embargo-Ende:
{{ $dataset->embargo_date->toDateString() }}</p>
{{-- @else
<p class="dataset__abstract">Datum der Freischaltung: - </p> --}}
<p class="dataset__abstract">Embargo-Ende: - </p> --}}
@endif
@if($dataset->hasEmbargoPassed() == true)