Skip to content

Commit 2b86c7f

Browse files
committed
UBO-438 Updated templates orcid-status and orcid-publish
1 parent d9d1d0e commit 2b86c7f

7 files changed

Lines changed: 26 additions & 33 deletions

File tree

ubo-common/src/main/resources/config/ubo-common/mycore.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ MCR.ContentTransformer.modsCsl-xhtml-pdf.FileExtension=html
504504
# #
505505
######################################################################
506506
MCR.ContentTransformer.mods2citation.Class = org.mycore.csl.MCRCSLTransformer
507-
MCR.ContentTransformer.mods2citation.format = xml
507+
MCR.ContentTransformer.mods2citation.format = html
508508
MCR.ContentTransformer.mods2citation.style = ubo-presentation
509509
MCR.ContentTransformer.mods2citation.ItemProviderClass = org.mycore.mods.csl.MCRModsItemDataProvider
510510
MCR.ContentTransformer.mods2citation.MIMEType = text/html; charset\="UTF-8"

ubo-common/src/main/resources/config/ubo-common/solr/main/solr-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"q.op": "AND",
1212
"df": "all",
1313
"rows": 10,
14-
"fl": "id cite cite.de cite.en year genre host_genre oa_exact",
14+
"fl": "id cite cite.de cite.en year genre host_genre oa_exact nid_connection",
1515
"facet": "true",
1616
"facet.mincount": "1",
1717
"facet.field": [

ubo-common/src/main/resources/xsl/basket-bibentries.xsl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,10 @@
153153
<div class="col">
154154
<xsl:call-template name="label-year" />
155155
<xsl:call-template name="pubtype" />
156-
<xsl:call-template name="orcid-status" />
156+
<xsl:call-template name="orcid-status">
157+
<xsl:with-param name="mycore-id" select="@ID"/>
158+
<xsl:with-param name="publication-connection-ids" select="//mods:mods//mods:nameIdentifier[@type='connection']"/>
159+
</xsl:call-template>
157160
</div>
158161
<div class="col">
159162
<xsl:call-template name="buttons">

ubo-common/src/main/resources/xsl/mods-display.xsl

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
<xsl:param name="UBO.DESTATIS.omit.ID"/>
3030
<xsl:param name="UBO.Affiliation.Suppress.ConnectedIndicator"/>
3131

32-
<xsl:param name="current-user" select="document('notnull:user:current')/user"/>
33-
3432
<!-- Expect one more author to be displayed as the last author is always getting displayed -->
3533
<xsl:param name="UBO.Initially.Visible.Authors" select="14" />
3634

@@ -333,25 +331,6 @@
333331
</span>
334332
</xsl:template>
335333

336-
<!-- ========== ORCID status and publish button ========== -->
337-
<xsl:variable name="current-user-connection-id" select="$current-user/attributes/attribute[@name='id_connection']/@value"/>
338-
339-
<xsl:template name="orcid-status">
340-
<xsl:variable name="publication-connection-ids" select="ancestor::mycoreobject//mods:nameIdentifier[@type='connection']"/>
341-
342-
<xsl:if test="$publication-connection-ids = $current-user-connection-id">
343-
<div class="orcid-status" data-id="{ancestor::mycoreobject/@ID}"/>
344-
</xsl:if>
345-
</xsl:template>
346-
347-
<xsl:template name="orcid-publish">
348-
<xsl:variable name="publication-connection-ids" select="ancestor::mycoreobject//mods:nameIdentifier[@type='connection']"/>
349-
350-
<xsl:if test="$publication-connection-ids = $current-user-connection-id">
351-
<div class="orcid-publish d-inline" data-id="{ancestor::mycoreobject/@ID}"/>
352-
</xsl:if>
353-
</xsl:template>
354-
355334
<!-- ========== URI bauen, um Dubletten zu finden ========== -->
356335

357336
<xsl:template name="buildFindDuplicatesURI">

ubo-common/src/main/resources/xsl/mycoreobject.xsl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,10 @@
202202
<xsl:call-template name="pubtype" />
203203
<xsl:call-template name="label-kdsf-pub-doc-type" />
204204
<xsl:call-template name="label-oa" />
205-
<xsl:call-template name="orcid-status" />
205+
<xsl:call-template name="orcid-status">
206+
<xsl:with-param name="mycore-id" select="@ID"/>
207+
<xsl:with-param name="publication-connection-ids" select="//mods:mods//mods:nameIdentifier[@type='connection']"/>
208+
</xsl:call-template>
206209
</div>
207210
</div>
208211
<div class="row">

ubo-common/src/main/resources/xsl/response.xsl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,7 @@
347347
</xsl:if>
348348

349349
<xsl:if test="string-length($MCR.ORCID2.OAuth.ClientSecret) &gt; 0 and contains($MCR.ORCID2.OAuth.Scope,'update')">
350-
<xsl:call-template name="orcid-status">
351-
<xsl:with-param name="mcrid" select="$id"/>
352-
</xsl:call-template>
350+
<xsl:call-template name="orcid-status"/>
353351
</xsl:if>
354352
</div>
355353

ubo-common/src/main/resources/xsl/ubo-orcid.xsl

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,27 @@
55

66
<xsl:param name="WebApplicationBaseURL"/>
77
<xsl:param name="MCR.ORCID2.LinkURL"/>
8+
<xsl:param name="current-user" select="document('notnull:user:current')/user"/>
89

910
<!-- ========== ORCID status and publish button ========== -->
11+
<xsl:variable name="current-user-connection-id" select="$current-user/attributes/attribute[@name='id_connection']/@value"/>
12+
1013
<xsl:template name="orcid-status">
11-
<xsl:param name="mcrid" select="ancestor::mycoreobject/@ID"/>
12-
<div class="orcid-status" data-id="{$mcrid}"/>
14+
<xsl:param name="mycore-id" select="str[@name='id']"/>
15+
<xsl:param name="publication-connection-ids" select="arr[@name='nid_connection']/str/text()" />
16+
17+
<xsl:if test="contains($publication-connection-ids, $current-user-connection-id)">
18+
<div class="orcid-status" data-id="{$mycore-id}"/>
19+
</xsl:if>
1320
</xsl:template>
1421

1522
<xsl:template name="orcid-publish">
16-
<xsl:param name="mcrid" select="ancestor::mycoreobject/@ID"/>
17-
<div class="orcid-publish d-inline" data-id="{$mcrid}"/>
23+
<xsl:param name="mycore-id" select="str[@name='id']"/>
24+
<xsl:param name="publication-connection-ids" select="arr[@name='nid_connection']/str/text()" />
25+
26+
<xsl:if test="contains($publication-connection-ids, $current-user-connection-id)">
27+
<div class="orcid-publish d-inline" data-id="{$mycore-id}"/>
28+
</xsl:if>
1829
</xsl:template>
1930

2031
<!-- If current user has ORCID, and we are his trusted party, display ORCID icon to indicate that -->
@@ -25,5 +36,4 @@
2536
</a>
2637
</xsl:if>
2738
</xsl:template>
28-
2939
</xsl:stylesheet>

0 commit comments

Comments
 (0)