Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MIR 1410 show metadata when document is blocked #1087

Open
wants to merge 3 commits into
base: 2023.06.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions mir-module/src/main/resources/config/mir/mycore.properties
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,7 @@ MIR.Layout.Abstract.Type.Classification=

MIR.NotFullAccessInfo.Genres=
MIR.Viewer.DisableDerivateType=thumbnail
MIR.Blocked.Detailpage=false
##############################################################################
# Canonical link for any metadata frontpage #
##############################################################################
Expand Down
109 changes: 109 additions & 0 deletions mir-module/src/main/resources/xsl/metadata/mods-metadata.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,15 @@
xmlns:encoder="xalan://java.net.URLEncoder"
xmlns:i18n="xalan://org.mycore.services.i18n.MCRTranslation"
exclude-result-prefixes=" i18n mods mcrmods mcrxsl xlink encoder">

<xsl:import href="xslImport:modsmeta" />
<xsl:include href="layout/mir-layout-utils.xsl" />
<xsl:include href="mods-utils.xsl" />
<xsl:include href="mir-mods-utils.xsl" />
<xsl:key use="@id" name="rights" match="/mycoreobject/rights/right" />
<xsl:param name="MCR.DOI.Resolver.MasterURL" select="''"/>
<xsl:param name="MCR.URN.Resolver.MasterURL" select="''"/>
<xsl:param name="MIR.Blocked.Detailpage" select="'false'"/>
<xsl:variable name="mods-type">
<xsl:apply-templates mode="mods-type" select="." />
</xsl:variable>
Expand Down Expand Up @@ -86,6 +90,20 @@
<p>
<xsl:copy-of select="$msg" />
</p>
<xsl:if test="$MIR.Blocked.Detailpage='true'">
<xsl:call-template name="renderMetadata">
<xsl:with-param name="mods"
select="mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods"/>
<xsl:with-param name="doiResolver" select="$MCR.DOI.Resolver.MasterURL"/>
<xsl:with-param name="urnResolver" select="$MCR.URN.Resolver.MasterURL"/>
</xsl:call-template>
<xsl:apply-templates select="mods:name" mode="printName"/>
</xsl:if>
<xsl:if test="$msg">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the $msg is already displayed in line 91

<p>
<xsl:copy-of select="$msg"/>
</p>
</xsl:if>
</xsl:if>
</div>
</div>
Expand Down Expand Up @@ -182,4 +200,95 @@
</a>
</xsl:template>

<xsl:template name="renderMetadata">
<xsl:param name="mods" select="mycoreobject/metadata/def.modsContainer/modsContainer/mods:mods"/>
<xsl:param name="doiResolver" select="$MCR.DOI.Resolver.MasterURL"/>
<xsl:param name="urnResolver" select="$MCR.URN.Resolver.MasterURL"/>

<div class="mb-3">
<h2 class="text-primary">
<xsl:value-of select="$mods/mods:titleInfo/mods:title"/>
</h2>
<xsl:choose>
<xsl:when test="$mods/mods:name[mods:role/mods:roleTerm/text()='aut']">
<xsl:for-each select="$mods/mods:name[mods:role/mods:roleTerm/text()='aut']">
<xsl:if test="position()!=1">
<xsl:value-of select="'; '"/>
</xsl:if>
<xsl:apply-templates select="." mode="mirNameLink"/>
<xsl:if test="mods:etal">
<em>et.al.</em>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:when test="$mods/mods:name[mods:role/mods:roleTerm/text()='edt']">
<xsl:for-each select="$mods/mods:name[mods:role/mods:roleTerm/text()='edt']">
<xsl:if test="position()!=1">
<xsl:value-of select="'; '"/>
</xsl:if>
<xsl:apply-templates select="." mode="mirNameLink"/>
<xsl:text> </xsl:text>
<xsl:value-of select="i18n:translate('mir.abstract.editor')"/>
<xsl:if test="mods:etal">
<em>et.al.</em>
</xsl:if>
</xsl:for-each>
</xsl:when>
</xsl:choose>
</div>

<dl class="mb-3 mir_metadata">
<xsl:if test="$mods/mods:originInfo/mods:dateIssued">
<dt style="width:auto">
<xsl:value-of select="concat(i18n:translate('component.mods.metaData.dictionary.dateIssued'),':')"/>
</dt>
<dd>
<xsl:value-of select="$mods/mods:originInfo/mods:dateIssued"/>
</dd>
</xsl:if>
<xsl:if test="$mods/mods:identifier[@type='doi']">
<dt style="width:auto">
<xsl:value-of select="i18n:translate('mir.identifier.doi')"/>
</dt>
<dd>
<a href="{concat($doiResolver, '/', $mods/mods:identifier[@type='doi'])}">
<xsl:value-of select="$mods/mods:identifier[@type='doi']"/>
</a>
</dd>
</xsl:if>
<xsl:if test="$mods/mods:identifier[@type='urn']">
<dt style="width:auto">
<xsl:value-of select="i18n:translate('mir.identifier.urn')"/>
</dt>
<dd>
<a href="{concat($urnResolver, '/', $mods/mods:identifier[@type='urn'])}">
<xsl:value-of select="$mods/mods:identifier[@type='urn']"/>
</a>
</dd>
</xsl:if>
</dl>
</xsl:template>

<!-- copied from modsmetadata.xsl -->
<xsl:template match="mods:name" mode="printName">
<xsl:choose>
<xsl:when test="mods:namePart">
<xsl:choose>
<xsl:when test="mods:namePart[@type='given'] and mods:namePart[@type='family']">
<xsl:value-of
select="concat(mods:namePart[@type='family'], ', ',mods:namePart[@type='given'])"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="mods:namePart"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="mods:displayForm">
<xsl:value-of select="mods:displayForm"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="."/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
Loading