- OAI RequestController.php: earliest publication date in format: 'Y-m-d\TH:i:s\Z'

- datasetxml2oai-pmh.xslt: Rdr_Dataset_Data -> dates in correct format
- oai2_style.xslt: haeding with TETHYS OAI 2.0
This commit is contained in:
Arno Kaimbacher 2020-04-01 10:33:55 +02:00
parent 6a8b27efa6
commit fd4b0eb87d
3 changed files with 54 additions and 46 deletions

View File

@ -144,10 +144,10 @@ class RequestController extends Controller
{ {
$email = "repository@geologie.ac.at"; $email = "repository@geologie.ac.at";
$repositoryName = "Tethys RDR"; $repositoryName = "Tethys RDR";
$repIdentifier = "tethys.geologie.ac.at"; $repIdentifier = "tethys.at";
$sampleIdentifier = "oai:" . $repIdentifier . ":27"; //$this->_configuration->getSampleIdentifier(); $sampleIdentifier = "oai:" . $repIdentifier . ":27"; //$this->_configuration->getSampleIdentifier();
$earliestDateFromDb = Dataset::earliestPublicationDate() != null ? $earliestDateFromDb = Dataset::earliestPublicationDate() != null ?
Dataset::earliestPublicationDate()->server_date_published : null; Dataset::earliestPublicationDate()->server_date_published->format('Y-m-d\TH:i:s\Z') : null;
// set parameters for oai-pmh.xslt // set parameters for oai-pmh.xslt
$this->proc->setParameter('', 'email', $email); $this->proc->setParameter('', 'email', $email);

View File

@ -162,12 +162,8 @@
<metadataPrefix> <metadataPrefix>
<xsl:text>oai_datacite</xsl:text> <xsl:text>oai_datacite</xsl:text>
</metadataPrefix> </metadataPrefix>
<schema> <schema>http://schema.datacite.org/meta/kernel-4.1/metadata.xsd</schema>
http://schema.datacite.org/meta/kernel-4.1/metadata.xsd <metadataNamespace>http://datacite.org/schema/kernel-4</metadataNamespace>
</schema>
<metadataNamespace>
http://datacite.org/schema/kernel-4
</metadataNamespace>
</metadataFormat> </metadataFormat>
</ListMetadataFormats> </ListMetadataFormats>
</xsl:template> </xsl:template>
@ -266,16 +262,28 @@
<xsl:value-of select="@Id" /> <xsl:value-of select="@Id" />
</identifier> </identifier>
<datestamp> <datestamp>
<xsl:choose> <xsl:choose>
<xsl:when test="ServerDateModified"> <xsl:when test="ServerDateModified">
<xsl:value-of select="ServerDateModified/@Year"/>- <xsl:variable name="dateModified" select="concat(
<xsl:value-of select="format-number(ServerDateModified/@Month,'00')"/>- ServerDateModified/@Year, '-',
<xsl:value-of select="format-number(ServerDateModified/@Day,'00')"/> format-number(ServerDateModified/@Month,'00'), '-',
format-number(ServerDateModified/@Day,'00'), 'T',
format-number(ServerDateModified/@Hour,'00'), ':',
format-number(ServerDateModified/@Minute,'00'), ':',
format-number(ServerDateModified/@Second,'00'), 'Z'
)" />
<xsl:value-of select="$dateModified" />
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="ServerDatePublished/@Year"/>- <xsl:variable name="datePublished" select="concat(
<xsl:value-of select="format-number(ServerDatePublished/@Month,'00')"/>- ServerDatePublished/@Year, '-',
<xsl:value-of select="format-number(ServerDatePublished/@Day,'00')"/> format-number(ServerDatePublished/@Month,'00'), '-',
format-number(ServerDatePublished/@Day,'00'), 'T',
format-number(ServerDatePublished/@Hour,'00'), ':',
format-number(ServerDatePublished/@Minute,'00'), ':',
format-number(ServerDatePublished/@Second,'00'), 'Z'
)" />
<xsl:value-of select="$datePublished" />
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</datestamp> </datestamp>
@ -290,7 +298,7 @@
<xsl:when test="$oai_verb!='ListIdentifiers' and @ServerState!='deleted'"> <xsl:when test="$oai_verb!='ListIdentifiers' and @ServerState!='deleted'">
<metadata> <metadata>
<!-- <xsl:value-of select="$oai_metadataPrefix" /> --> <!-- <xsl:value-of select="$oai_metadataPrefix" /> -->
<xsl:choose> <xsl:choose>
<xsl:when test="$oai_metadataPrefix='oai_dc'"> <xsl:when test="$oai_metadataPrefix='oai_dc'">
<xsl:apply-templates select="." mode="oai_dc" /> <xsl:apply-templates select="." mode="oai_dc" />
@ -319,7 +327,7 @@
<xsl:apply-templates select="TitleAdditional" mode="oai_dc" /> <xsl:apply-templates select="TitleAdditional" mode="oai_dc" />
<!-- dc:description --> <!-- dc:description -->
<xsl:apply-templates select="TitleAbstract" mode="oai_dc" /> <xsl:apply-templates select="TitleAbstract" mode="oai_dc" />
<!-- dc:description --> <!-- dc:description -->
<xsl:apply-templates select="TitleAbstractAdditional" mode="oai_dc" /> <xsl:apply-templates select="TitleAbstractAdditional" mode="oai_dc" />
<!-- dc:subject --> <!-- dc:subject -->
<xsl:apply-templates select="Subject" mode="oai_dc" /> <xsl:apply-templates select="Subject" mode="oai_dc" />
@ -373,26 +381,26 @@
<xsl:text>&#xA;</xsl:text> <xsl:text>&#xA;</xsl:text>
<xsl:if test="@ElevationMin != '' and @ElevationMax != ''"> <xsl:if test="@ElevationMin != '' and @ElevationMax != ''">
<xsl:value-of select="concat(' * ELEVATION MIN: ', @ElevationMin, ' * ELEVATION MAX: ', @ElevationMax)" /> <xsl:value-of select="concat(' * ELEVATION MIN: ', @ElevationMin, ' * ELEVATION MAX: ', @ElevationMax)" />
</xsl:if> </xsl:if>
<xsl:if test="@ElevationAbsolut != ''"> <xsl:if test="@ElevationAbsolut != ''">
<xsl:value-of select="concat(' * ELEVATION ABSOLUT: ', @ElevationAbsolut)" /> <xsl:value-of select="concat(' * ELEVATION ABSOLUT: ', @ElevationAbsolut)" />
</xsl:if> </xsl:if>
<xsl:text>&#xA;</xsl:text> <xsl:text>&#xA;</xsl:text>
<xsl:if test="@DepthMin != '' and @DepthMax != ''"> <xsl:if test="@DepthMin != '' and @DepthMax != ''">
<xsl:value-of select="concat(' * DEPTH MIN: ', @DepthMin, ' * DEPTH MAX: ', @DepthMax)" /> <xsl:value-of select="concat(' * DEPTH MIN: ', @DepthMin, ' * DEPTH MAX: ', @DepthMax)" />
</xsl:if> </xsl:if>
<xsl:if test="@DepthAbsolut != ''"> <xsl:if test="@DepthAbsolut != ''">
<xsl:value-of select="concat(' * DEPTH ABSOLUT: ', @DepthAbsolut)" /> <xsl:value-of select="concat(' * DEPTH ABSOLUT: ', @DepthAbsolut)" />
</xsl:if> </xsl:if>
<xsl:text>&#xA;</xsl:text> <xsl:text>&#xA;</xsl:text>
<xsl:if test="@TimeMin != '' and @TimeMax != ''"> <xsl:if test="@TimeMin != '' and @TimeMax != ''">
<xsl:value-of select="concat(' * TIME MIN: ', @TimeMin, ' * TIME MAX: ', @TimeMax)" /> <xsl:value-of select="concat(' * TIME MIN: ', @TimeMin, ' * TIME MAX: ', @TimeMax)" />
</xsl:if> </xsl:if>
<xsl:if test="@TimeAbsolut != ''"> <xsl:if test="@TimeAbsolut != ''">
<xsl:value-of select="concat(' * TIME ABSOLUT: ', @TimeAbsolut)" /> <xsl:value-of select="concat(' * TIME ABSOLUT: ', @TimeAbsolut)" />
</xsl:if> </xsl:if>
</dc:coverage> </dc:coverage>
@ -438,7 +446,7 @@
</dc:subject> </dc:subject>
</xsl:template> </xsl:template>
<xsl:template match="Reference" mode="oai_dc"> <xsl:template match="Reference" mode="oai_dc">
<dc:relation> <dc:relation>
<xsl:value-of select="@Value" /> <xsl:value-of select="@Value" />
</dc:relation> </dc:relation>
@ -480,7 +488,7 @@
<dc:date> <dc:date>
<xsl:choose> <xsl:choose>
<xsl:when test="PublishedDate"> <xsl:when test="PublishedDate">
<xsl:value-of select="PublishedDate/@Year"/> <xsl:value-of select="PublishedDate/@Year"/>
- <xsl:value-of select="format-number(PublishedDate/@Month,'00')"/> - <xsl:value-of select="format-number(PublishedDate/@Month,'00')"/>
- <xsl:value-of select="format-number(PublishedDate/@Day,'00')"/> - <xsl:value-of select="format-number(PublishedDate/@Day,'00')"/>
</xsl:when> </xsl:when>
@ -531,7 +539,7 @@
</dc:identifier> </dc:identifier>
</xsl:template> </xsl:template>
<xsl:template match="@CreatingCorporation" mode="oai_dc"> <xsl:template match="@CreatingCorporation" mode="oai_dc">
<dc:language> <dc:language>
<xsl:value-of select="." /> <xsl:value-of select="." />
</dc:language> </dc:language>

View File

@ -160,11 +160,11 @@ p.intro {
<xsl:template match="/"> <xsl:template match="/">
<html> <html>
<head> <head>
<title>OAI 2.0 Request Results</title> <title>TETHYS OAI 2.0 Request Results</title>
<style><xsl:call-template name="style"/></style> <style><xsl:call-template name="style"/></style>
</head> </head>
<body> <body>
<h1>OAI 2.0 Request Results</h1> <h1>TETHYS OAI 2.0 Request Results</h1>
<xsl:call-template name="quicklinks"/> <xsl:call-template name="quicklinks"/>
<p class="intro">You are viewing an HTML version of the XML OAI response. To see the underlying XML use your web browsers view source option. More information about this XSLT is at the <a href="#moreinfo">bottom of the page</a>.</p> <p class="intro">You are viewing an HTML version of the XML OAI response. To see the underlying XML use your web browsers view source option. More information about this XSLT is at the <a href="#moreinfo">bottom of the page</a>.</p>
<xsl:apply-templates select="/oai:OAI-PMH" /> <xsl:apply-templates select="/oai:OAI-PMH" />