Skip to content

Commit

Permalink
set provider name as collection display name if parameter is set. Refs
Browse files Browse the repository at this point in the history
  • Loading branch information
twagoo committed Jan 6, 2025
1 parent 7545fad commit 04f3507
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 22 deletions.
83 changes: 66 additions & 17 deletions datacite-cmdi/datacite-cmdi.xpr
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project>
<project version="22.1">
<meta>
<filters directoryPatterns="" filePatterns="datacite-cmdi.xpr" positiveFilePatterns="" showHiddenFiles="false"/>
<options>
<serialized xml:space="preserve">
<serialized version="22.1" xml:space="preserve">
<serializableOrderedMap>
<entry>
<String>scenario.associations</String>
<scenarioAssociation-array>
<scenarioAssociation>
<field name="url">
<String>datacite_to_cmdi.xsl</String>
<String>test/example/trolling/doi_10_5072_FK2_VA3BVU.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>datacite_to_cmdi_hamburg</String>
<String>DataCite to CMDI</String>
</list>
</field>
<field name="scenarioTypes">
<list>
<String>XML</String>
<String>XSL</String>
</list>
</field>
<field name="scenarioStorageLocations">
Expand All @@ -30,16 +30,16 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>../../test-oai-harvest/output-test/filtertest/workdir/test-test/oai-pmh/DataCite/DataCite_0000001.xml</String>
<String>datacite_to_cmdi.xsl</String>
</field>
<field name="scenarioIds">
<list>
<String>OAI-PMH filter</String>
<String>datacite_to_cmdi_hamburg</String>
</list>
</field>
<field name="scenarioTypes">
<list>
<String>XSL</String>
<String>XML</String>
</list>
</field>
<field name="scenarioStorageLocations">
Expand All @@ -50,11 +50,11 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>../../../../../Downloads/oai_doreco_huma_num_fr_anal1239.xml</String>
<String>../../test-oai-harvest/output-test/filtertest/workdir/test-test/oai-pmh/DataCite/DataCite_0000001.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>olac2cmdi</String>
<String>OAI-PMH filter</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -70,7 +70,7 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>../../../../../Desktop/Untitled1.xml</String>
<String>../../../../../Downloads/oai_doreco_huma_num_fr_anal1239.xml</String>
</field>
<field name="scenarioIds">
<list>
Expand All @@ -90,11 +90,11 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>test/example/dariah/10.20375_0000-000E-8BE7-1.xml</String>
<String>../../../../../Desktop/Untitled1.xml</String>
</field>
<field name="scenarioIds">
<list>
<String>DataCite to CMDI</String>
<String>olac2cmdi</String>
</list>
</field>
<field name="scenarioTypes">
Expand All @@ -110,7 +110,7 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>test/example/afp/adp_ads974_v1.xml</String>
<String>test/example/dariah/10.20375_0000-000E-8BE7-1.xml</String>
</field>
<field name="scenarioIds">
<list>
Expand All @@ -130,7 +130,7 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>test/example/celr/ty_0005.xml</String>
<String>test/example/afp/adp_ads974_v1.xml</String>
</field>
<field name="scenarioIds">
<list>
Expand All @@ -150,7 +150,7 @@
</scenarioAssociation>
<scenarioAssociation>
<field name="url">
<String>test/example/trolling/doi_10_5072_FK2_VA3BVU.xml</String>
<String>test/example/celr/ty_0005.xml</String>
</field>
<field name="scenarioIds">
<list>
Expand Down Expand Up @@ -3304,7 +3304,56 @@
<Boolean>true</Boolean>
</field>
<field name="xsltParams">
<list/>
<list>
<transformationParameter>
<field name="paramDescription">
<paramDescriptor>
<field name="localName">
<String>collection_name</String>
</field>
<field name="prefix">
<null/>
</field>
<field name="namespace">
<null/>
</field>
</paramDescriptor>
</field>
<field name="value">
<String>test collection name</String>
</field>
<field name="hasXPathValue">
<Boolean>false</Boolean>
</field>
<field name="isStatic">
<Boolean>false</Boolean>
</field>
</transformationParameter>
<transformationParameter>
<field name="paramDescription">
<paramDescriptor>
<field name="localName">
<String>provider_name</String>
</field>
<field name="prefix">
<null/>
</field>
<field name="namespace">
<null/>
</field>
</paramDescriptor>
</field>
<field name="value">
<String>test provider name</String>
</field>
<field name="hasXPathValue">
<Boolean>false</Boolean>
</field>
<field name="isStatic">
<Boolean>false</Boolean>
</field>
</transformationParameter>
</list>
</field>
<field name="cascadingStylesheets">
<String-array/>
Expand Down
9 changes: 9 additions & 0 deletions datacite-cmdi/datacite_to_cmdi-common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@
</xsl:element>
</xsl:if>
</xsl:template>

<xsl:template name="collectionDisplayName">
<xsl:param name="collection_name" select="''"/>
<xsl:if test="normalize-space($collection_name)!=''">
<MdCollectionDisplayName>
<xsl:value-of select="$collection_name"/>
</MdCollectionDisplayName>
</xsl:if>
</xsl:template>

<xsl:function name="datacite_cmd:isAbsoluteUri">
<xsl:param name="value"/>
Expand Down
6 changes: 4 additions & 2 deletions datacite-cmdi/datacite_to_cmdi-kernel3.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<xsl:template match="resource" mode="root">
<cmd:CMD CMDVersion="1.2"
xsi:schemaLocation="http://www.clarin.eu/cmd/1 https://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/1.x/profiles/clarin.eu:cr1:p_1610707853541/xsd">
<xsl:apply-templates select="." mode="header-section"/>
<xsl:apply-templates select="." mode="header-section" />
<xsl:apply-templates select="." mode="resource-section"/>
<cmd:Components>
<DataCiteRecord>
Expand Down Expand Up @@ -109,7 +109,9 @@
<!-- Can we generate a selflink? -->
<!-- <cmd:MdSelfLink>http://www.oxygenxml.com/</cmd:MdSelfLink>-->
<cmd:MdProfile><xsl:value-of select="$cmdiProfileId"/></cmd:MdProfile>
<!--<cmd:MdCollectionDisplayName>MdCollectionDisplayName0</cmd:MdCollectionDisplayName>-->
<xsl:call-template name="collectionDisplayName">
<xsl:with-param name="collection_name" select="$collection_name" />
</xsl:call-template>
</cmd:Header>
</xsl:template>

Expand Down
6 changes: 4 additions & 2 deletions datacite-cmdi/datacite_to_cmdi-kernel4.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<xsl:template match="resource" mode="root">
<cmd:CMD CMDVersion="1.2"
xsi:schemaLocation="http://www.clarin.eu/cmd/1 https://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/1.x/profiles/clarin.eu:cr1:p_1610707853541/xsd">
<xsl:apply-templates select="." mode="header-section"/>
<xsl:apply-templates select="." mode="header-section" />
<xsl:apply-templates select="." mode="resource-section"/>
<cmd:Components>
<DataCiteRecord>
Expand Down Expand Up @@ -109,7 +109,9 @@
<!-- Can we generate a selflink? -->
<!-- <cmd:MdSelfLink>http://www.oxygenxml.com/</cmd:MdSelfLink>-->
<cmd:MdProfile><xsl:value-of select="$cmdiProfileId"/></cmd:MdProfile>
<!--<cmd:MdCollectionDisplayName>MdCollectionDisplayName0</cmd:MdCollectionDisplayName>-->
<xsl:call-template name="collectionDisplayName">
<xsl:with-param name="collection_name" select="$collection_name" />
</xsl:call-template>
</cmd:Header>
</xsl:template>

Expand Down
3 changes: 3 additions & 0 deletions datacite-cmdi/datacite_to_cmdi.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@

<xsl:output indent="yes"/>

<xsl:param name="provider_name" select="''"/>
<xsl:param name="collection_name" select="$provider_name"/>

<xsl:include href="datacite_to_cmdi-common.xsl"/>
<xsl:include href="datacite_to_cmdi-kernel3.xsl"/>
<xsl:include href="datacite_to_cmdi-kernel4.xsl"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
xsi:schemaLocation="http://www.clarin.eu/cmd/1 https://catalog.clarin.eu/ds/ComponentRegistry/rest/registry/1.x/profiles/clarin.eu:cr1:p_1610707853541/xsd">
<cmd:Header>
<cmd:MdProfile>clarin.eu:cr1:p_1610707853541</cmd:MdProfile>
<MdCollectionDisplayName>test collection name</MdCollectionDisplayName>
</cmd:Header>
<cmd:Resources>
<cmd:ResourceProxyList>
Expand Down Expand Up @@ -214,7 +215,7 @@
<note>Conversion from DataCite (http://datacite.org/schema/kernel-4) to CMD (profile clarin.eu:cr1:p_1610707853541)</note>
<ActivityInfo>
<When>
<date>2022-04-11+03:00</date>
<date>2025-01-06+02:00</date>
</When>
</ActivityInfo>
</Activity>
Expand Down

0 comments on commit 04f3507

Please sign in to comment.