- 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>
@ -268,14 +264,26 @@
<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>

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" />