feature bugs oai

This commit is contained in:
Arno Kaimbacher 2022-02-04 17:07:30 +01:00
parent 526b48b06e
commit 46a68e5418
4 changed files with 67 additions and 42 deletions

View File

@ -34,12 +34,12 @@ trait DatasetExtension
), ),
'TitleAbstract' => array( 'TitleAbstract' => array(
'model' => Description::class, 'model' => Description::class,
'options' => array('type' => ['Abstract']), 'options' => array('type' => ['Abstract', 'Translated']),
'fetch' => 'eager' 'fetch' => 'eager'
), ),
'TitleAbstractAdditional' => array( 'TitleAbstractAdditional' => array(
'model' => Description::class, 'model' => Description::class,
'options' => array('type' => ['Translated', 'Methods', 'Technical_info', 'Series_information', 'Other']), 'options' => array('type' => ['Methods', 'Technical_info', 'Series_information', 'Other']),
'fetch' => 'eager' 'fetch' => 'eager'
), ),
'Licence' => array( 'Licence' => array(

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" <xsl:stylesheet version="1.0"
xmlns="http://www.openarchives.org/OAI/2.0/" xmlns="http://www.openarchives.org/OAI/2.0/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/"
xmlns:php="http://php.net/xsl"> xmlns:php="http://php.net/xsl">
<!--<xsl:param name="urnResolverUrl" />--> <!--<xsl:param name="urnResolverUrl" />-->
@ -17,7 +17,7 @@
<xsl:output method="xml" indent="yes" encoding="utf-8" /> <xsl:output method="xml" indent="yes" encoding="utf-8" />
<xsl:param name="responseDate" /> <xsl:param name="responseDate" />
<xsl:param name="unixTimestamp" /> <xsl:param name="unixTimestamp" />
<xsl:param name="email" /> <xsl:param name="email" />
<xsl:param name="earliestDatestamp" /> <xsl:param name="earliestDatestamp" />
<xsl:param name="setPubType" /> <xsl:param name="setPubType" />
@ -53,7 +53,7 @@
<xsl:text>type="text/xsl" href="xsl/oai2_style.xslt"</xsl:text> <xsl:text>type="text/xsl" href="xsl/oai2_style.xslt"</xsl:text>
</xsl:processing-instruction> </xsl:processing-instruction>
<OAI-PMH xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <OAI-PMH xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.openarchives.org/OAI/2.0/" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd"> xmlns="http://www.openarchives.org/OAI/2.0/" xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/ http://www.openarchives.org/OAI/2.0/OAI-PMH.xsd">
<responseDate> <responseDate>
<xsl:value-of select="$responseDate" /> <xsl:value-of select="$responseDate" />
@ -381,9 +381,9 @@
<!-- dc:language --> <!-- dc:language -->
<xsl:apply-templates select="@Language" mode="oai_dc" /> <xsl:apply-templates select="@Language" mode="oai_dc" />
<!-- dc:relation --> <!-- dc:relation -->
<xsl:if test="Identifier"> <xsl:if test="Identifier">
<xsl:apply-templates select="Identifier" mode="oai_dc" /> <xsl:apply-templates select="Identifier" mode="oai_dc" />
</xsl:if> </xsl:if>
<xsl:apply-templates select="Reference" mode="oai_dc" /> <xsl:apply-templates select="Reference" mode="oai_dc" />
<!-- dc:coverage --> <!-- dc:coverage -->
<xsl:apply-templates select="Coverage" mode="oai_dc" /> <xsl:apply-templates select="Coverage" mode="oai_dc" />
@ -434,7 +434,7 @@
<xsl:template match="TitleMain" mode="oai_dc"> <xsl:template match="TitleMain" mode="oai_dc">
<dc:title> <dc:title>
<xsl:attribute name="xml:lang"> <xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" /> <xsl:value-of select="@Language" />
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="@Value"/> <xsl:value-of select="@Value"/>
@ -443,7 +443,7 @@
<xsl:template match="TitleAdditional" mode="oai_dc"> <xsl:template match="TitleAdditional" mode="oai_dc">
<dc:title> <dc:title>
<xsl:attribute name="xml:lang"> <xsl:attribute name="xml:lang">
<xsl:value-of select="@Language" /> <xsl:value-of select="@Language" />
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="@Value"/> <xsl:value-of select="@Value"/>
@ -540,14 +540,14 @@
</xsl:template> </xsl:template>
<xsl:template match="EmbargoDate" mode="oai_dc"> <xsl:template match="EmbargoDate" mode="oai_dc">
<xsl:if test="$unixTimestamp &lt; ./@UnixTimestamp" > <xsl:if test="$unixTimestamp &lt; ./@UnixTimestamp">
<dc:date> <dc:date>
<xsl:text>info:eu-repo/date/embargoEnd/</xsl:text> <xsl:text>info:eu-repo/date/embargoEnd/</xsl:text>
<xsl:value-of select="./@Year"/> <xsl:value-of select="./@Year"/>
- <xsl:value-of select="format-number(./@Month,'00')"/> - <xsl:value-of select="format-number(./@Month,'00')"/>
- <xsl:value-of select="format-number(./@Day,'00')"/> - <xsl:value-of select="format-number(./@Day,'00')"/>
</dc:date> </dc:date>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
@ -564,23 +564,30 @@
<xsl:template match="File/@MimeType" mode="oai_dc"> <xsl:template match="File/@MimeType" mode="oai_dc">
<dc:format> <dc:format>
<xsl:value-of select="." /> <xsl:choose>
<xsl:when test=". = 'application/x-sqlite3'">
<xsl:text>application/geopackage+sqlite3</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="." />
</xsl:otherwise>
</xsl:choose>
</dc:format> </dc:format>
</xsl:template> </xsl:template>
<!-- <xsl:template match="File" mode="oai_dc"> <!-- <xsl:template match="File" mode="oai_dc">
<dc:identifier> <dc:identifier>
<xsl:value-of select="@PathName" /> <xsl:value-of select="@PathName" />
<xsl:value-of select="concat($downloadLink, @Id)" /> <xsl:value-of select="concat($downloadLink, @Id)" />
</dc:identifier> </dc:identifier>
</xsl:template> --> </xsl:template> -->
<xsl:template match="Identifier" mode="oai_dc"> <xsl:template match="Identifier" mode="oai_dc">
<dc:relation> <dc:relation>
<!-- <xsl:value-of select="concat($doiLink, @Value)" /> --> <!-- <xsl:value-of select="concat($doiLink, @Value)" /> -->
<xsl:value-of select="concat($doiPrefix, @Value)" /> <xsl:value-of select="concat($doiPrefix, @Value)" />
</dc:relation> </dc:relation>
</xsl:template> </xsl:template>
<xsl:template match="@CreatingCorporation" mode="oai_dc"> <xsl:template match="@CreatingCorporation" mode="oai_dc">
<dc:language> <dc:language>

View File

@ -183,7 +183,8 @@
</xsl:attribute> </xsl:attribute>
<xsl:if test="@Type != ''"> <xsl:if test="@Type != ''">
<xsl:attribute name="descriptionType"> <xsl:attribute name="descriptionType">
<xsl:value-of select="@Type" /> <!-- <xsl:value-of select="@Type" /> -->
<xsl:text>Abstract</xsl:text>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
<xsl:value-of select="@Value" /> <xsl:value-of select="@Value" />

View File

@ -185,7 +185,8 @@
</xsl:attribute> </xsl:attribute>
<xsl:if test="@Type != ''"> <xsl:if test="@Type != ''">
<xsl:attribute name="descriptionType"> <xsl:attribute name="descriptionType">
<xsl:value-of select="@Type" /> <!-- <xsl:value-of select="@Type" /> -->
<xsl:text>Abstract</xsl:text>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
<xsl:value-of select="@Value" /> <xsl:value-of select="@Value" />
@ -261,11 +262,20 @@
<xsl:value-of select="@Language" /> <xsl:value-of select="@Language" />
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
<xsl:if test="@Type != '' and @Type != 'Main'"> <xsl:choose>
<xsl:attribute name="titleType"> <xsl:when test="@Type != '' and @Type != 'Sub' and @Type != 'Main'">
<xsl:value-of select="@Type" /> <xsl:attribute name="titleType">
</xsl:attribute> <xsl:value-of select="@Type" />
</xsl:if> <xsl:text>Title</xsl:text>
</xsl:attribute>
</xsl:when>
<xsl:when test="@Type = 'Sub'">
<xsl:attribute name="titleType">
<xsl:value-of select="@Type" />
<xsl:text>title</xsl:text>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:value-of select="@Value"/> <xsl:value-of select="@Value"/>
</title> </title>
</xsl:template> </xsl:template>
@ -353,7 +363,7 @@
<familyName> <familyName>
<xsl:value-of select="@LastName" /> <xsl:value-of select="@LastName" />
</familyName> </familyName>
<affiliation>GBA</affiliation> <affiliation>GBA</affiliation>
</xsl:if> </xsl:if>
<xsl:if test="@IdentifierOrcid != ''"> <xsl:if test="@IdentifierOrcid != ''">
@ -364,14 +374,21 @@
<!-- <!--
<nameType><xsl:value-of select="@NameType" /></nameType> <nameType><xsl:value-of select="@NameType" /></nameType>
</xsl:if> --> </xsl:if> -->
</creator> </creator>
</xsl:template> </xsl:template>
<xsl:template match="File/@MimeType" mode="oai_datacite" <xsl:template match="File/@MimeType" mode="oai_datacite"
xmlns="http://datacite.org/schema/kernel-4"> xmlns="http://datacite.org/schema/kernel-4">
<format> <format>
<xsl:value-of select="." /> <xsl:choose>
<xsl:when test=". = 'application/x-sqlite3'">
<xsl:text>application/geopackage+sqlite3</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="." />
</xsl:otherwise>
</xsl:choose>
</format> </format>
</xsl:template> </xsl:template>
@ -393,7 +410,7 @@
<xsl:text>SPDX</xsl:text> <xsl:text>SPDX</xsl:text>
</xsl:attribute> </xsl:attribute>
<xsl:attribute name="rightsIdentifier"> <xsl:attribute name="rightsIdentifier">
<xsl:value-of select="@Name" /> <xsl:value-of select="@Name" />
</xsl:attribute> </xsl:attribute>
<xsl:value-of select="@NameLong" /> <xsl:value-of select="@NameLong" />
</rights> </rights>