Hi Mark,
Thank you for looking into the issue.
1. I checked my local.cfg file again, I didn't find
event.consumer.harvester.class in it.
The datacite configuration is in the bottom and the actual file is
attached. May I ask how I could define the event.consumer.harvester.class?
2. I didn't get the comments on 'diff' or 'diff -u'; and I didn't find the
keyword from the attached 'DIM2DataCite.xsl' file.
Please advise.
Tianyi
On Wednesday, June 22, 2022 at 8:31:48 AM UTC-4 Mark H. Wood wrote:
> On Tue, Jun 21, 2022 at 03:02:22PM -0700, Tianyi Gu wrote:
> > I had a new DSpace 7.2.1 instance installed. Everything went well at
> > beginning, until I modified the local.cfg file, DIM2DataCite.xsl and
> > identifier-service.xml, according to the guide
> > <https://wiki.lyrasis.org/display/DSDOC7x/DOI+Digital+Object+Identifier>.
>
> >
> > When I submit an new item, I would get an error as below:
> > An error occurred
> > An exception has occurred
>
> Thank you for attaching the error traces.
>
> The first error is difficult to track down, but it appears that in
> 'local.cfg' you may have invented an event consumer "harvester" without
> defining 'event.consumer.harvester.class'.
>
> The second error seems to be associated with 'DIM2DataCite.xsl'. I
> would check that carefully, perhaps even validate it against its
> schema. 'diff' or 'diff -u' between the stock 'DIM2DataCite.xsl' and
> your modified one may help you to find the problem.
>
> --
> Mark H. Wood
> Lead Technology Analyst
>
> University Library
> Indiana University - Purdue University Indianapolis
> 755 W. Michigan Street
> Indianapolis, IN 46202
> 317-274-0749 <(317)%20274-0749>
> www.ulib.iupui.edu
>
--
All messages to this mailing list should adhere to the Code of Conduct:
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
---
You received this message because you are subscribed to the Google Groups
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dspace-tech/fe2c2d3d-9c6d-46e7-bd1f-69958a74f355n%40googlegroups.com.
# EXAMPLE "local.cfg" for DSpace.
#
# Any configurations added to this file will automatically OVERRIDE
configurations
# of the same name in any of the DSpace *.cfg files. This includes overriding
# settings in any of these files:
# * [dspace]/config/dspace.cfg
# * Any configuration file that is included in 'dspace.cfg'
# (See "include = [filepath]" settings near the end of dspace.cfg.
# By default, it includes all [dspace]/config/modules/*.cfg files)
# * Spring Boot's application.properties
#
([dspace-src]/dspace-server-webapp/src/main/resources/application.properties)
#
# By default, this EXAMPLE file includes a number of commonly overridden
configurations.
# * ADD configurations by simply copying them into this file from any existing
*.cfg file.
# * REMOVE configurations by simply commenting them out or deleting them below.
#
# Any commented out settings in this file are simply ignored. A configuration
# will only override another configuration if it has the EXACT SAME key/name.
# For example, including "dspace.dir" in this local.cfg will override the
# default value of "dspace.dir" in the dspace.cfg file.
# Similarly, including "oai.solr.url" in this local.cfg will override the
# default value of "oai.solr.url" in the modules/oai.cfg file.
#
##########################
# SERVER CONFIGURATION #
##########################
# DSpace installation directory.
# This is the location where you want to install DSpace.
# Windows note: Please remember to use forward slashes for all paths (e.g.
C:/dspace)
dspace.dir=C:/dspace2
# URL of DSpace backend ('server' webapp). Include port number etc.
# DO NOT end it with '/'.
# This is where REST API and all enabled server modules (OAI-PMH, SWORD,
# SWORDv2, RDF, etc) will respond.
dspace.server.url = http://localhost:8080/server
# URL of DSpace frontend (Angular UI). Include port number etc.
# DO NOT end it with '/'.
# This is used by the backend to provide links in emails, RSS feeds, Sitemaps,
# etc.
dspace.ui.url = http://localhost:4000
# Name of the site
dspace.name = vanilla DSpace
# assetstore.dir, look at DSPACE/config/spring/api/bitstore.xml for more options
# default is ${dspace.dir}/assetstore, uncomment and modify if you need to use
a different path
#assetstore.dir = ${dspace.dir}/assetstore
# Default language for metadata values
#default.language = en_US
# Solr server/webapp.
# DSpace uses Solr for all search/browse capability (and for usage statistics).
# Since DSpace 7, SOLR must be installed as a stand-alone service
#solr.server = http://localhost:8983/solr
##########################
# DATABASE CONFIGURATION #
##########################
# DSpace only supports two database types: PostgreSQL or Oracle
# URL for connecting to database
# * Postgres template: jdbc:postgresql://localhost:5432/dspace
# * Oracle template: jdbc:oracle:thin:@//localhost:1521/xe
db.url = jdbc:postgresql://localhost:5433/dspace
# JDBC Driver
# * For Postgres: org.postgresql.Driver
# * For Oracle: oracle.jdbc.OracleDriver
db.driver = org.postgresql.Driver
# Database Dialect (for Hibernate)
# * For Postgres:
org.dspace.storage.rdbms.hibernate.postgres.DSpacePostgreSQL82Dialect
# * For Oracle: org.hibernate.dialect.Oracle10gDialect
db.dialect =
org.dspace.storage.rdbms.hibernate.postgres.DSpacePostgreSQL82Dialect
# Database username and password
db.username = postgres
db.password = 123qwe
# Database Schema name
# * For Postgres, this is often "public" (default schema)
# * For Oracle, schema is equivalent to the username of your database
account,
# so this may be set to ${db.username} in most scenarios.
db.schema = public
## Connection pool parameters
# Maximum number of DB connections in pool (default = 30)
#db.maxconnections = 30
# Maximum time to wait before giving up if all connections in pool are busy
(milliseconds)
# (default = 10000ms or 10 seconds)
#db.maxwait = 10000
# Maximum number of idle connections in pool (-1 = unlimited)
# (default = 10)
#db.maxidle = 10
#######################
# EMAIL CONFIGURATION #
#######################
# SMTP mail server (allows DSpace to send email notifications)
#mail.server = smtp.example.com
# SMTP mail server authentication username and password (if required)
#mail.server.username = myusername
#mail.server.password = mypassword
# SMTP mail server alternate port (defaults to 25)
#mail.server.port = 25
# From address for mail
# All mail from the DSpace site will use this 'from' address
#mail.from.address = [email protected]
# When feedback is submitted via the Feedback form, it is sent to this address
# Currently limited to one recipient!
#feedback.recipient = [email protected]
# General site administration (Webmaster) e-mail
#mail.admin = [email protected]
# Recipient for server errors and alerts (defaults to mail.admin)
#alert.recipient = ${mail.admin}
# Recipient for new user registration emails (defaults to unspecified)
#registration.notify =
########################
# HANDLE CONFIGURATION #
########################
#
# Canonical Handle URL prefix
#
# Items in DSpace receive a unique URL, stored in dc.identifier.uri
# after it is generated during the submission process.
#
# If you register with CNRI's handle service at https://www.handle.net/,
# these links can be generated as permalinks using https://hdl.handle.net/
# as canonical prefix. Please make sure to change handle.canonical.prefix
# after registering with handle.net by uncommenting one of the following
# lines, depending if you prefer to use https or http:
# handle.canonical.prefix = https://hdl.handle.net/
# handle.canonical.prefix = http://hdl.handle.net/
#
# Note that this will not alter dc.identifier.uri metadata for existing
# items (only for subsequent submissions).
# CNRI Handle prefix
# (Defaults to the reserved dummy/fake prefix of 123456789)
#handle.prefix = 123456789
#######################
# PROXY CONFIGURATION #
#######################
# Uncomment and specify both properties if proxy server is required for
external http requests
# (e.g. requests from DSpace to third party services like Creative Commons use
this setting when enabled)
# Use regular hostname without port number
#http.proxy.host =
# port number of proxy server
#http.proxy.port =
##########################
# AUTHENTICATION METHODS #
##########################
# EXAMPLE OVERRIDE:
# Override the default authentication method(s) defined in authentication.cfg
# by defining your own custom ordered list in this local.cfg.
#
# By default, all of these methods are commented out and DSpace will use the
# settings from authentication.cfg. But you may uncomment whichever plugins you
# need in order to change the default settings (or reorder them below).
#
# You may also copy default settings from the corresponding authentication-*.cfg
# configuration file and override them in this local.cfg.
# IP-based authentication/authorization. See authentication-ip.cfg for default
configuration.
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod =
org.dspace.authenticate.IPAuthentication
# LDAP authentication/authorization. See authentication-ldap.cfg for default
configuration.
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod =
org.dspace.authenticate.LDAPAuthentication
# OIDC authentication/authorization. See authenication-oidc.cfg for default
configuration.
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod =
org.dspace.authenticate.OidcAuthentication
# Shibboleth authentication/authorization. See authentication-shibboleth.cfg
for default configuration.
# Check also the cors settings below
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod =
org.dspace.authenticate.ShibAuthentication
# X.509 certificate authentication. See authentication-x509.cfg for default
configuration.
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod =
org.dspace.authenticate.X509Authentication
# Authentication by Password (encrypted in DSpace's database). See
authentication-password.cfg for default configuration.
# Enabled by default in authentication.cfg
#plugin.sequence.org.dspace.authenticate.AuthenticationMethod =
org.dspace.authenticate.PasswordAuthentication
#####################
# REST API SETTINGS #
#####################
# Allowed Cross-Origin-Resource-Sharing (CORS) origins (in
"Access-Control-Allow-Origin" header).
# Only these origins (client URLs) can successfully authenticate with your REST
API.
# Defaults to ${dspace.ui.url} if unspecified (as the UI must have access to
the REST API).
# Multiple allowed origin URLs may be comma separated. Wildcard value (*) is
NOT SUPPORTED.
# (Requires reboot of servlet container, e.g. Tomcat, to reload)
# When an external authentication system is involved like Shibboleth some
browsers (i.e. Safari) include
# in the request the Origin header with the url of the IdP. In such case you
need to allow also the IdP to
# avoid trouble for such browsers (i.e. rest.cors.allowed-origins =
${dspace.ui.url}, https://samltest.id )
#rest.cors.allowed-origins = ${dspace.ui.url}
#################################################
# SPRING BOOT SETTINGS (Used by Server Webapp) #
#################################################
# NOTE: Common Spring Boot application settings may be found at
#
http://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html
#
# EXAMPLE OVERRIDE:
# By uncommenting the below Spring Boot settings, you can increase or decrease
the maximum upload size.
# These defaults are specified in
[dspace-src]/dspace-server-webapp/src/main/resources/application.properties
# but may be overridden in this local.cfg
#
# Maximum size of a single uploaded file
#spring.servlet.multipart.max-file-size = 512MB
# Maximum size of a multipart request (i.e. max total size of all files in one
request)
#spring.servlet.multipart.max-request-size = 512MB
# 2022-05-26
## Credentials used to authenticate against the registration agency:
identifier.doi.user = SSC.DATA
identifier.doi.password = topsecret-tbd
# DOI prefix used to mint DOIs. All DOIs minted by DSpace will use this prefix.
# The Prefix will be assigned by the registration agency.
identifier.doi.prefix = 10.82284
# If you want to, you can further separate your namespace. Should all the
# suffixes of all DOIs minted by DSpace start with a special string to separate
# it from other services also minting DOIs under your prefix?
identifier.doi.namespaceseparator = TGTEST
event.consumer.doi.class = org.dspace.identifier.doi.DOIConsumer
event.consumer.doi.filters = Item+Modify_Metadata
event.dispatcher.default.consumers = versioning, discovery, eperson, harvester,
doi
<?xml version="1.0" encoding="UTF-8"?>
<!--
Document : DIM2DataCite.xsl
Created on : January 23, 2013, 1:26 PM
Updated on : November 26, 2015, 3:00 PM
Author : pbecker, ffuerste
Description: Converts metadata from DSpace Intermediate Format (DIM) into
metadata following the DataCite Schema for the Publication and
Citation of Research Data, Version 3.1
-->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dspace="http://www.dspace.org/xmlns/dspace/dim"
xmlns="http://datacite.org/schema/kernel-3"
version="2.0">
<!-- CONFIGURATION -->
<!-- The parameters prefix, publisher, datamanager and hostinginstitution
moved to DSpace's configuration. They will be substituted automatically.
It is not necessary anymore to change this file.
Please take a look into the DSpace documentation for details on how to
change those. -->
<!-- DO NOT CHANGE ANYTHING BELOW THIS LINE EXCEPT YOU REALLY KNOW WHAT YOU ARE DOING! -->
<!-- We need the prefix to determine DOIs that were minted by ourself. -->
<!-- <xsl:variable name="prefix">10.5072-dspace-</xsl:variable> -->
<xsl:param name="prefix">10.82284-TGTEST-</xsl:param>
<!-- The content of the following parameter will be used as element publisher. -->
<xsl:param name="publisher">TGTEST</xsl:param>
<!-- The content of the following variable will be used as element contributor with contributorType datamanager. -->
<xsl:variable name="publisher">SSC-OSPR</xsl:variable>
<!-- The content of the following variable will be used as element contributor with contributorType datamanager. -->
<xsl:variable name="datamanager"><xsl:value-of select="$publisher" /></xsl:variable>
<!-- The content of the following variable will be used as element contributor with contributorType hostingInstitution. -->
<xsl:variable name="hostinginstitution"><xsl:value-of select="$publisher" /></xsl:variable>
<!-- Please take a look into the DataCite schema documentation if you want to know how to use these elements.
http://schema.datacite.org -->
<!-- Don't copy everything by default! -->
<xsl:template match="@* | text()" />
<xsl:template match="/dspace:dim[@dspaceType='ITEM']">
<!--
org.dspace.identifier.doi.DataCiteConnector uses this XSLT to
transform metadata for the DataCite metadata store. This crosswalk
should only be used, when it is ensured that all mandatory
properties are in the metadata of the item to export.
The classe named above respects this.
-->
<resource xmlns="http://datacite.org/schema/kernel-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
<!--
MANDATORY PROPERTIES
-->
<!--
DataCite (1)
Template Call for DOI identifier.
Occ: 1
-->
<!--
dc.identifier.uri may contain more than one DOI, e.g. if the
repository contains an item that is published by a publishing
company as well. We have to ensure to use URIs of our prefix
as primary identifiers only.
-->
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='identifier' and starts-with(., concat('http://dx.doi.org/', $prefix))]" />
<!--
DataCite (2)
Add creator information.
Occ: 1-n
-->
<creators>
<xsl:choose>
<xsl:when test="//dspace:field[@mdschema='dc' and @element='contributor' and @qualifier='author']">
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='contributor' and @qualifier='author']" />
</xsl:when>
<xsl:otherwise>
<creator>
<creatorName>(:unkn) unknown</creatorName>
</creator>
</xsl:otherwise>
</xsl:choose>
</creators>
<!--
DataCite (3)
Add Title information.
Occ: 1-n
-->
<titles>
<xsl:choose>
<xsl:when test="//dspace:field[@mdschema='dc' and @element='title']">
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='title']" />
</xsl:when>
<xsl:otherwise>
<title>(:unas) unassigned</title>
</xsl:otherwise>
</xsl:choose>
</titles>
<!--
DataCite (4)
Add Publisher information from configuration above
Occ: 1
Use dc.publisher if it exists, use $publisher otherwise.
-->
<xsl:element name="publisher">
<xsl:choose>
<xsl:when test="//dspace:field[@mdschema='dc' and @element='publisher']">
<xsl:value-of select="//dspace:field[@mdschema='dc' and @element='publisher'][1]" />
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$publisher" />
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<!--
DataCite (5)
Add PublicationYear information
Occ: 1
Format: YYYY
-->
<publicationYear>
<xsl:choose>
<xsl:when test="//dspace:field[@mdschema='dc' and @element='date' and @qualifier='issued']">
<xsl:value-of select="substring(//dspace:field[@mdschema='dc' and @element='date' and @qualifier='issued'], 1, 4)" />
</xsl:when>
<xsl:when test="//dspace:field[@mdschema='dc' and @element='date' and @qualifier='available']">
<xsl:value-of select="substring(//dspace:field[@mdschema='dc' and @element='date' and @qualifier='available'], 1, 4)" />
</xsl:when>
<xsl:when test="//dspace:field[@mdschema='dc' and @element='date']">
<xsl:value-of select="substring(//dspace:field[@mdschema='dc' and @element='date'], 1, 4)" />
</xsl:when>
<xsl:otherwise>0000</xsl:otherwise>
</xsl:choose>
</publicationYear>
<!--
OPTIONAL PROPERTIES
-->
<!--
DataCite (6)
Template Call for subjects.
Occ: 0-n
Format: open
Attribute: subjectSchema (optional), schemeURI (optional)
-->
<xsl:if test="//dspace:field[@mdschema='dc' and @element='subject']">
<subjects>
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='subject']" />
</subjects>
</xsl:if>
<!--
DataCite (7)
Add contributorType from configuration above.
Template Call for Contributors
Occ: 0-n
Format: personal name: family, given
Required Attribute: contributorType - controlled list
-->
<contributors>
<xsl:element name="contributor">
<xsl:attribute name="contributorType">DataManager</xsl:attribute>
<xsl:element name="contributorName">
<xsl:value-of select="$datamanager"/>
</xsl:element>
</xsl:element>
<xsl:element name="contributor">
<xsl:attribute name="contributorType">HostingInstitution</xsl:attribute>
<contributorName>
<xsl:value-of select="$hostinginstitution" />
</contributorName>
</xsl:element>
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='contributor'][not(@qualifier='author')]" />
</contributors>
<!--
DataCite (8)
Template Call for Dates
Occ: 0-n
Required Attribute: dataType - controlled list
-->
<xsl:if test="//dspace:field[@mdschema='dc' and @element='date' and
(@qualifier='accessioned'
or @qualifier='available'
or @qualifier='copyright'
or @qualifier='created'
or @qualifier='issued'
or @qualifier='submitted'
or @qualifier='updated')]" >
<xsl:element name="dates">
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='date' and
(@qualifier='accessioned'
or @qualifier='available'
or @qualifier='copyright'
or @qualifier='created'
or @qualifier='issued'
or @qualifier='submitted'
or @qualifier='updated')]" />
</xsl:element>
</xsl:if>
<!--
DataCite (9)
Templacte Call for Language
Occ: 0-1
Format: IETF BCP 47 or ISO 639-1
-->
<xsl:apply-templates select="(//dspace:field[@mdschema='dc' and @element='language' and (@qualifier='iso' or @qualifier='rfc3066')])[1]" />
<!--
DataCite (10)
Template call for ResourceType
DataCite allows the ResourceType to ouccre not more than once.
-->
<xsl:apply-templates select="(//dspace:field[@mdschema='dc' and @element='type'])[1]" />
<!--
DataCite (11)
Add alternativeIdentifiers.
This element is important as it is used to recognize for which
DSpace object a DOI is reserved for.
See the primary identifier for which the doi is registered.
Occ: 0-n
Required Attribute: alternateIdentifierType (free format)
-->
<xsl:if test="//dspace:field[@mdschema='dc' and @element='identifier' and @qualifier and not(starts-with(., concat('http://dx.doi.org/', $prefix)))]">
<xsl:element name="alternateIdentifiers">
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='identifier' and @qualifier and not(starts-with(., concat('http://dx.doi.org/', $prefix)))]" />
</xsl:element>
</xsl:if>
<!--
DataCite (12)
Add sizes.
-->
<xsl:if test="//dspace:field[@mdschema='dc' and @element='format' and @qualifier='extent']">
<xsl:element name="sizes">
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='format' and @qualifier='extent']" />
</xsl:element>
</xsl:if>
<!-- DataCite (13)
Add formats.
-->
<xsl:if test="//dspace:field[@mdschema='dc' and @element='format'][not(@qualifier='extent')]">
<xsl:element name="formats">
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='format'][not(@qualifier='extent')]" />
</xsl:element>
</xsl:if>
<!--
DataCite (16)
Rights.
Occ: 0-1
-->
<xsl:if test="//dspace:field[@mdschema='dc' and @element='rights']">
<xsl:element name="rightsList">
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='rights']" />
</xsl:element>
</xsl:if>
<!--
DataCite (17)
Add descriptions.
Occ: 0-n
Required Attribute: descriptionType - controlled list
-->
<xsl:if test="//dspace:field[@mdschema='dc' and @element='description' and (@qualifier='abstract' or @qualifier='tableofcontents' or not(@qualifier))]">
<xsl:element name="descriptions">
<xsl:apply-templates select="//dspace:field[@mdschema='dc' and @element='description' and (@qualifier='abstract' or @qualifier='tableofcontents' or not(@qualifier))]" />
</xsl:element>
</xsl:if>
<!--
DataCite (18)
GeoLocation
DSpace currently doesn't store geolocations.
-->
</resource>
</xsl:template>
<!-- Add doi identifier information. -->
<!--
dc.identifier.uri may contain more than one DOI, e.g. if the
repository contains an item that is published by a publishing
company as well. We have to ensure to use URIs of our prefix
as primary identifiers only.
-->
<xsl:template match="dspace:field[@mdschema='dc' and @element='identifier' and @qualifier and starts-with(., concat('http://dx.doi.org/', $prefix))]">
<identifier identifierType="DOI">
<xsl:value-of select="substring(., 19)"/>
</identifier>
</xsl:template>
<!-- DataCite (2) :: Creator -->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='contributor' and @qualifier='author']">
<creator>
<creatorName>
<xsl:value-of select="." />
</creatorName>
</creator>
</xsl:template>
<!-- DataCite (3) :: Title -->
<xsl:template match="dspace:field[@mdschema='dc' and @element='title']">
<xsl:element name="title">
<xsl:if test="@qualifier='alternative'">
<xsl:attribute name="titleType">AlternativeTitle</xsl:attribute>
</xsl:if>
<!-- DSpace does include niehter a dc.title.subtitle nor a
dc.title.translated. If necessary, please create those in the
metadata field registry. -->
<xsl:if test="@qualifier='subtitle'">
<xsl:attribute name="titleType">Subtitle</xsl:attribute>
</xsl:if>
<xsl:if test="@qualifier='translated'">
<xsl:attribute name="titleType">TranslatedTitle</xsl:attribute>
</xsl:if>
<xsl:value-of select="." />
</xsl:element>
</xsl:template>
<!--
DataCite (6), DataCite (6.1)
Adds subject and subjectScheme information
"This term is intended to be used with non-literal values as defined in the
DCMI Abstract Model (http://dublincore.org/documents/abstract-model/).
As of December 2007, the DCMI Usage Board is seeking a way to express
this intention with a formal range declaration."
(http://dublincore.org/documents/dcmi-terms/#terms-subject)
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='subject']">
<xsl:element name="subject">
<xsl:if test="@qualifier">
<xsl:attribute name="subjectScheme"><xsl:value-of select="@qualifier" /></xsl:attribute>
</xsl:if>
<xsl:value-of select="." />
</xsl:element>
</xsl:template>
<!--
DataCite (7), DataCite (7.1)
Adds contributor and contributorType information
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='contributor'][not(@qualifier='author')]">
<xsl:choose>
<xsl:when test="@qualifier='editor'">
<xsl:element name="contributor">
<xsl:attribute name="contributorType">Editor</xsl:attribute>
<contributorName>
<xsl:value-of select="." />
</contributorName>
</xsl:element>
</xsl:when>
<xsl:when test="@qualifier='advisor'">
<xsl:element name="contributor">
<xsl:attribute name="contributorType">RelatedPerson</xsl:attribute>
<contributorName>
<xsl:value-of select="." />
</contributorName>
</xsl:element>
</xsl:when>
<xsl:when test="@qualifier='illustrator'">
<xsl:element name="contributor">
<xsl:attribute name="contributorType">Other</xsl:attribute>
<contributorName>
<xsl:value-of select="." />
</contributorName>
</xsl:element>
</xsl:when>
<xsl:when test="@qualifier='other'">
<xsl:element name="contributor">
<xsl:attribute name="contributorType">Other</xsl:attribute>
<contributorName>
<xsl:value-of select="." />
</contributorName>
</xsl:element>
</xsl:when>
<xsl:when test="not(@qualifier)">
<xsl:element name="contributor">
<xsl:attribute name="contributorType">Other</xsl:attribute>
<contributorName>
<xsl:value-of select="." />
</contributorName>
</xsl:element>
</xsl:when>
</xsl:choose>
</xsl:template>
<!--
DataCite (8), DataCite (8.1)
Adds Date and dateType information
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='date' and
(@qualifier='accessioned'
or @qualifier='available'
or @qualifier='copyright'
or @qualifier='created'
or @qualifier='issued'
or @qualifier='submitted'
or @qualifier='updated')]">
<xsl:if test="@qualifier='accessioned'
or @qualifier='available'
or @qualifier='copyright'
or @qualifier='created'
or @qualifier='issued'
or @qualifier='submitted'
or @qualifier='updated'">
<xsl:element name="date">
<xsl:if test="@qualifier='accessioned'">
<xsl:attribute name="dateType">Accepted</xsl:attribute>
</xsl:if>
<xsl:if test="@qualifier='available'">
<xsl:attribute name="dateType">Available</xsl:attribute>
</xsl:if>
<xsl:if test="@qualifier='copyright'">
<xsl:attribute name="dateType">Copyrighted</xsl:attribute>
</xsl:if>
<xsl:if test="@qualifier='created'">
<xsl:attribute name="dateType">Created</xsl:attribute>
</xsl:if>
<xsl:if test="@qualifier='issued'">
<xsl:attribute name="dateType">Issued</xsl:attribute>
</xsl:if>
<!-- DSpace recommends to use dc.date.submitted for theses and/or
dissertations. DataCite uses submitted for the "date the
creator submits the resource to the publisher". -->
<xsl:if test="@qualifier='submitted'">
<xsl:attribute name="dateType">Issued</xsl:attribute>
</xsl:if>
<xsl:if test="@qualifier='updated'">
<xsl:attribute name="dateType">Updated</xsl:attribute>
</xsl:if>
<xsl:value-of select="substring(., 1, 10)" />
</xsl:element>
</xsl:if>
</xsl:template>
<!--
DataCite (9)
Adds Language information
Transforming the language flags according to IETF BCP 47 or ISO 639-1
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='language' and (@qualifier='iso' or @qualifier='rfc3066')][1]">
<xsl:element name="language">
<xsl:choose>
<xsl:when test="contains(string(text()), '_')">
<xsl:value-of select="translate(string(text()), '_', '-')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="string(text())"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<!--
DataCite (10), DataCite (10.1)
Adds resourceType and resourceTypeGeneral information
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='type'][1]">
<xsl:element name="resourceType">
<xsl:attribute name="resourceTypeGeneral">
<xsl:choose>
<xsl:when test="string(text())='Animation'">Audiovisual</xsl:when>
<xsl:when test="string(text())='Article'">Text</xsl:when>
<xsl:when test="string(text())='Book'">Text</xsl:when>
<xsl:when test="string(text())='Book chapter'">Text</xsl:when>
<xsl:when test="string(text())='Dataset'">Dataset</xsl:when>
<xsl:when test="string(text())='Learning Object'">InteractiveResource</xsl:when>
<xsl:when test="string(text())='Image'">Image</xsl:when>
<xsl:when test="string(text())='Image, 3-D'">Image</xsl:when>
<xsl:when test="string(text())='Map'">Model</xsl:when>
<xsl:when test="string(text())='Musical Score'">Other</xsl:when>
<xsl:when test="string(text())='Plan or blueprint'">Model</xsl:when>
<xsl:when test="string(text())='Preprint'">Text</xsl:when>
<xsl:when test="string(text())='Presentation'">Text</xsl:when>
<xsl:when test="string(text())='Recording, acoustical'">Sound</xsl:when>
<xsl:when test="string(text())='Recording, musical'">Sound</xsl:when>
<xsl:when test="string(text())='Recording, oral'">Sound</xsl:when>
<xsl:when test="string(text())='Software'">Software</xsl:when>
<xsl:when test="string(text())='Technical Report'">Text</xsl:when>
<xsl:when test="string(text())='Thesis'">Text</xsl:when>
<xsl:when test="string(text())='Video'">Audiovisual</xsl:when>
<xsl:when test="string(text())='Working Paper'">Text</xsl:when>
<xsl:when test="string(text())='Other'">Other</xsl:when>
<xsl:otherwise>Other</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="." />
</xsl:element>
</xsl:template>
<!--
DataCite (11), DataCite (11.1)
Adds AlternativeIdentifier and alternativeIdentifierType information
Adds all identifiers except the doi.
This element is important as it is used to recognize for which DSpace
objet a DOI is reserved for. The DataCiteConnector will test all
AlternativeIdentifiers by using HandleManager.
resolveUrlToHandle(context, altId) until one is recognized or all have
been tested.
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='identifier' and @qualifier and not(starts-with(., concat('http://dx.doi.org/', $prefix)))]">
<xsl:element name="alternateIdentifier">
<xsl:if test="@qualifier">
<xsl:attribute name="alternateIdentifierType"><xsl:value-of select="@qualifier" /></xsl:attribute>
</xsl:if>
<xsl:value-of select="." />
</xsl:element>
</xsl:template>
<!--
DataCite (12), DataCite (12.1)
Adds RelatedIdentifier and relatedIdentifierType information
DataCite requires a relatedIdentifierType, but we do not know which
type of identifier is part of the dc.relation.* fields within DSpace.
Skip the related identifier until we find a proper solution.
-->
<!--
DataCite (13)
Adds Size information
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='format' and @qualifier='extent']">
<xsl:element name="size">
<xsl:value-of select="." />
</xsl:element>
</xsl:template>
<!--
DataCite (14)
Adds Format information
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='format'][not(@qualifier='extent')]">
<xsl:element name="format">
<xsl:value-of select="." />
</xsl:element>
</xsl:template>
<!--
DataCite (15)
Version information.
As we currently do not link versions as related identifier, we skip
the version information too.
-->
<!--
DataCite (16)
Adds Rights information
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='rights']">
<xsl:choose>
<xsl:when test="@qualifier='uri'">
<xsl:element name="rights">
<xsl:attribute name="rightsURI">
<xsl:value-of select="." />
</xsl:attribute>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="rights">
<xsl:value-of select="." />
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!--
DataCite (17)
Description
-->
<xsl:template match="//dspace:field[@mdschema='dc' and @element='description' and (@qualifier='abstract' or @qualifier='tableofcontents' or not(@qualifier))]">
<xsl:element name="description">
<xsl:attribute name="descriptionType">
<xsl:choose>
<xsl:when test="@qualifier='abstract'">Abstract</xsl:when>
<xsl:when test="@qualifier='tableofcontents'">TableOfContents</xsl:when>
<xsl:otherwise>Other</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="." />
</xsl:element>
</xsl:template>
</xsl:stylesheet>