如何在 DSpace 的摘要视图中显示自定义元数据?
How to show custom metadata in DSpace's summary view?
我只是 "inherited" 我办公室里的这个存储库。我完全没有这方面的经验,我被要求在摘要视图中的项目标题下方显示自定义元数据。自定义元数据已经注册(称为 dc.magazine.title),我设法编辑了输入表单,以便可以在数据库中注册所有新元数据。
存储库使用带有 XMLUI 的默认海市蜃楼主题。我更改了文件 DIM-Handler.xsl 中的一些代码,试图模拟其他信息的呈现方式,但我不知道它是如何工作的,所以我的方法没有给出任何结果。这是我试过的:
<!-- Magazine row -->
<tr class="ds-table-row {$phase}">
<td><span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-title</i18n:text>: </span></td>
<td>
<xsl:choose>
<xsl:when test="count(dim:field[@element='magazine'][@qualifier='title']) = 1">
<xsl:value-of select="dim:field[@element='magazine'][@qualifier='title'][1]/node()"/>
</xsl:when>
<xsl:otherwise>
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<xsl:call-template name="itemSummaryView-DIM-fields">
<xsl:with-param name="clause" select="($clause + 1)"/>
<xsl:with-param name="phase" select="$otherPhase"/>
</xsl:call-template>
但除了默认元数据外,没有显示任何内容。有人可以告诉我如何显示这个新元数据吗?非常感谢有关此代码如何工作的一些线索,以便我可以进行未来的更改!
如果您使用 Mirage 1 主题的 DSpace 默认安装,项目元数据的显示将在 [DSpace-installed-directory]/webapps/xmlui/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-view.xsl
中呈现。在我的评论中,我指定了 [DSpace-installed-directory]
,因为我不太确定您 'inherited' 的存储库是否可以使用具有不同于 Mirage 的主题名称的自定义主题。
您说过您需要在项目标题下方显示自定义元数据。尝试在 <!-- Author(s) row -->
之前插入
<xsl:when test="$clause = 2 and (dim:field[@element='magazine' and @qualifier='title' and descendant::text()])">
<div class="simple-item-view-other">
<span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-title</i18n:text>:</span>
<span>
<xsl:for-each select="dim:field[@element='magazine' and @qualifier='title']">
<xsl:value-of select="./node()"/>
<xsl:if test="count(following-sibling::dim:field[@element='magazine' and @qualifier='title']) != 0">
<br/>
</xsl:if>
</xsl:for-each>
</span>
</div>
<xsl:call-template name="itemSummaryView-DIM-fields">
<xsl:with-param name="clause" select="($clause + 1)"/>
<xsl:with-param name="phase" select="$otherPhase"/>
</xsl:call-template>
</xsl:when>
请记下 $clause
号码。您应该更新下面所有的条款编号,即作者的行应该 $clause = 3
到
的部分
<!-- IMPORTANT: This test should be updated if clauses are added! -->
<xsl:if test="$clause < 8">
<xsl:call-template name="itemSummaryView-DIM-fields">
<xsl:with-param name="clause" select="($clause + 1)"/>
<xsl:with-param name="phase" select="$phase"/>
</xsl:call-template>
</xsl:if>
@euler 感谢您的回答,通过您的 post,(尽管 4 岁),我能够弄清楚这个简单的项目视图是如何工作的,并使用 dc.identifier.citation 创建了一个条目.如下
<xsl:when test="$clause = 6 and (dim:field[@element='identifier' and @qualifier='citation'])">
<div class="simple-item-view-other">
<span class="bold"><i18n:text>xmlui.ETCRiverRun.METS-1.0.item-citation</i18n:text>:</span>
<span>
<xsl:for-each select="dim:field[@element='identifier' and @qualifier='citation']">
<xsl:copy-of select="./node()"/>
<xsl:if test="count(following-sibling::dim:field[@element='identifier' and @qualifier='citation']) != 0">
<br/>
</xsl:if>````
我只是 "inherited" 我办公室里的这个存储库。我完全没有这方面的经验,我被要求在摘要视图中的项目标题下方显示自定义元数据。自定义元数据已经注册(称为 dc.magazine.title),我设法编辑了输入表单,以便可以在数据库中注册所有新元数据。
存储库使用带有 XMLUI 的默认海市蜃楼主题。我更改了文件 DIM-Handler.xsl 中的一些代码,试图模拟其他信息的呈现方式,但我不知道它是如何工作的,所以我的方法没有给出任何结果。这是我试过的:
<!-- Magazine row -->
<tr class="ds-table-row {$phase}">
<td><span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-title</i18n:text>: </span></td>
<td>
<xsl:choose>
<xsl:when test="count(dim:field[@element='magazine'][@qualifier='title']) = 1">
<xsl:value-of select="dim:field[@element='magazine'][@qualifier='title'][1]/node()"/>
</xsl:when>
<xsl:otherwise>
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
</xsl:otherwise>
</xsl:choose>
</td>
</tr>
<xsl:call-template name="itemSummaryView-DIM-fields">
<xsl:with-param name="clause" select="($clause + 1)"/>
<xsl:with-param name="phase" select="$otherPhase"/>
</xsl:call-template>
但除了默认元数据外,没有显示任何内容。有人可以告诉我如何显示这个新元数据吗?非常感谢有关此代码如何工作的一些线索,以便我可以进行未来的更改!
如果您使用 Mirage 1 主题的 DSpace 默认安装,项目元数据的显示将在 [DSpace-installed-directory]/webapps/xmlui/themes/Mirage/lib/xsl/aspect/artifactbrowser/item-view.xsl
中呈现。在我的评论中,我指定了 [DSpace-installed-directory]
,因为我不太确定您 'inherited' 的存储库是否可以使用具有不同于 Mirage 的主题名称的自定义主题。
您说过您需要在项目标题下方显示自定义元数据。尝试在 <!-- Author(s) row -->
<xsl:when test="$clause = 2 and (dim:field[@element='magazine' and @qualifier='title' and descendant::text()])">
<div class="simple-item-view-other">
<span class="bold"><i18n:text>xmlui.dri2xhtml.METS-1.0.item-title</i18n:text>:</span>
<span>
<xsl:for-each select="dim:field[@element='magazine' and @qualifier='title']">
<xsl:value-of select="./node()"/>
<xsl:if test="count(following-sibling::dim:field[@element='magazine' and @qualifier='title']) != 0">
<br/>
</xsl:if>
</xsl:for-each>
</span>
</div>
<xsl:call-template name="itemSummaryView-DIM-fields">
<xsl:with-param name="clause" select="($clause + 1)"/>
<xsl:with-param name="phase" select="$otherPhase"/>
</xsl:call-template>
</xsl:when>
请记下 $clause
号码。您应该更新下面所有的条款编号,即作者的行应该 $clause = 3
到
<!-- IMPORTANT: This test should be updated if clauses are added! -->
<xsl:if test="$clause < 8">
<xsl:call-template name="itemSummaryView-DIM-fields">
<xsl:with-param name="clause" select="($clause + 1)"/>
<xsl:with-param name="phase" select="$phase"/>
</xsl:call-template>
</xsl:if>
@euler 感谢您的回答,通过您的 post,(尽管 4 岁),我能够弄清楚这个简单的项目视图是如何工作的,并使用 dc.identifier.citation 创建了一个条目.如下
<xsl:when test="$clause = 6 and (dim:field[@element='identifier' and @qualifier='citation'])">
<div class="simple-item-view-other">
<span class="bold"><i18n:text>xmlui.ETCRiverRun.METS-1.0.item-citation</i18n:text>:</span>
<span>
<xsl:for-each select="dim:field[@element='identifier' and @qualifier='citation']">
<xsl:copy-of select="./node()"/>
<xsl:if test="count(following-sibling::dim:field[@element='identifier' and @qualifier='citation']) != 0">
<br/>
</xsl:if>````