Skip to content

Commit

Permalink
MIR-1361 Allow to enter ROR as affiliation for authors
Browse files Browse the repository at this point in the history
  • Loading branch information
Possommi committed Oct 17, 2024
1 parent afcb647 commit a7a9b63
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@
</xed:template>

<xed:template id="person.affiliation">
<mir:textfield repeat="true" xpath="mods:affiliation" help-text="{i18n:mir.help.affiliation}" label="mir.affiliation" />
<mir:textfield repeat="true" xpath="mods:affiliation[not(@authorityURI)]" help-text="{i18n:mir.help.affiliation}" label="mir.affiliation" />
<mir:textfield repeat="true" xpath="mods:affiliation[@authorityURI='https://ror.org/']" help-text="{i18n:mir.help.affiliation.ror}" label="mir.affiliation.ror" />
</xed:template>

<xed:template id="nameIdentifier.repeated">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ mir.actions.noaccess = Um das Dokument zu bearbeiten,
mir.actions.norights = Sie besitzen nicht die ben\u00F6tigten Rechte, um das Dokument zu bearbeiten.
mir.admineditor = Bearbeiten im Admin-Editor
mir.affiliation = Zugeh\u00F6rigkeit
mir.affiliation.ror = ROR
mir.articlenumber = Artikelnummer:
mir.articlenumber.short = Art.-Nr.:
mir.breadcrumb.home = Start
Expand Down Expand Up @@ -384,6 +385,7 @@ mir.help.abstract.language = Geben Sie die Sprache an, in d
mir.help.abstract.ortext = Eine kurze Zusammenfassung des Dokumentinhalts.
mir.help.access = Geben Sie hier an, wer auf die angehangenen Dokumente zugreifen darf.
mir.help.affiliation = Organisation bzw. Institution der betreffenden Person.
mir.help.affiliation.ror = <a href="https://ror.org/">ROR ID</a> der Organisation bzw. Institution der betreffenden Person.
mir.help.articlenumber = Die Nummer eines Artikels, der in einer Online-Zeitschrift oder auf einer Publikationsplattform erschienen ist.
mir.help.artist.photographer = K\u00FCnstler des Werkes oder Fotograf des Bildes.
mir.help.authorSpecification = Genauere Beschreibung der Autor(innen)-Rolle, meist relevant f\u00C3\u00BCr Kontaktaufnahme oder statistische Auswertungen.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ mir.actions.noaccess = To edit the document, please lo
mir.actions.norights = You don't have the rights to edit the document.
mir.admineditor = Edit in admin editor
mir.affiliation = Affiliation
mir.affiliation.ror = ROR
mir.articlenumber = Article number:
mir.articlenumber.short = Art.-No.:
mir.breadcrumb.home = Home
Expand Down Expand Up @@ -362,6 +363,7 @@ mir.help.abstract.aslink = Weblink to abstract.
mir.help.abstract.ortext = A short summary of the document content.
mir.help.access = Specify who should be able to access the dataset after publication. The metadata will be public in any case.
mir.help.affiliation = Organisation/Affiliation of the Person.
mir.help.affiliation.ror = <a href="https://ror.org/">ROR ID</a> of the Organisation/Affiliation of the Person.
mir.help.articlenumber = The number of an article published in an online journal or publication platform.
mir.help.artist.photographer = Creator of the Picture/Image.
mir.help.author.interviewee = A person, family or organization responsible for creating or contributing to a resource by responding to an interviewer, usually a reporter, pollster, or some other information gathering agent.
Expand Down
6 changes: 6 additions & 0 deletions mir-module/src/main/resources/xsl/editor/mods2xeditor.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,12 @@
</xsl:copy>
</xsl:template>

<xsl:template match="mods:affiliation[@authorityURI='https://ror.org/'][@valueURI]">
<mods:affiliation authorityURI="{@authorityURI}">
<xsl:value-of select="substring-after(@valueURI, @authorityURI)"/>
</mods:affiliation>
</xsl:template>

<!-- Remove this mods:classification entry, will be created again while saving using mods:accessCondtition (see MIR-161) -->
<xsl:template match="mods:classification[@authority='accessRestriction']">
<!-- do nothing -->
Expand Down
4 changes: 4 additions & 0 deletions mir-module/src/main/resources/xsl/editor/xeditor2mods.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@
</mods:nameIdentifier>
</xsl:template>

<xsl:template match="mods:affiliation[@authorityURI='https://ror.org/']">
<mods:affiliation authorityURI="{@authorityURI}" valueURI="{@authorityURI}{.}"/>
</xsl:template>

<!-- Copy content of mods:accessCondtition to mods:classification to enable classification support (see MIR-161) -->
<xsl:template match="mods:accessCondition[@type='restriction on access'][contains(@xlink:href,'mir_access')]">
<mods:accessCondition type="restriction on access">
Expand Down
12 changes: 11 additions & 1 deletion mir-module/src/main/resources/xsl/mir-mods-utils.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
</xsl:variable>

<xsl:variable name="affiliation" select="mods:affiliation/text()" />
<xsl:variable name="affiliation-ror" select="mods:affiliation[contains(@authorityURI, '//ror.org')]" />
<xsl:variable name="personNodeId" select="generate-id(.)"/>
<xsl:variable name="personName"><xsl:apply-templates select="." mode="nameString"/></xsl:variable>
<xsl:if test="count($nameIdentifiers) &gt; 0 or string-length($affiliation) &gt; 0">
Expand All @@ -71,12 +72,21 @@
</dd>
</xsl:for-each>
</xsl:if>
<xsl:if test="string-length($affiliation) &gt; 0">
<xsl:if test="string-length($affiliation) &gt; 0 or $affiliation-ror">
<dt>
<xsl:value-of select="i18n:translate('mir.affiliation')"/>
</dt>
<dd>
<xsl:value-of select="$affiliation"/>
<xsl:for-each select="mods:affiliation[contains(@authorityURI, '//ror.org')][@valueURI]">
<xsl:sort select="@valueURI"/>
<div class="mir-affiliation-ror">
<xsl:value-of select="'ROR ID: '"/>
<a href="{@valueURI}">
<xsl:value-of select="substring-after(@valueURI, @authorityURI)"/>
</a>
</div>
</xsl:for-each>
</dd>
</xsl:if>
</dl>
Expand Down

0 comments on commit a7a9b63

Please sign in to comment.