【发布时间】:2017-05-31 04:07:38
【问题描述】:
我们希望在商品处于禁运状态时从商品视图(以及 HTML 源的元数据中)中删除商品的摘要。我们可以使用一些选择“锁定”缩略图的代码来实现这一点吗?
【问题讨论】:
标签: dspace
我们希望在商品处于禁运状态时从商品视图(以及 HTML 源的元数据中)中删除商品的摘要。我们可以使用一些选择“锁定”缩略图的代码来实现这一点吗?
【问题讨论】:
标签: dspace
您的假设是正确的,您可以查询用于显示锁定图标的相同信息来控制您的元数据显示。检索信息有点难看,但确实存在。
我提取了一些可能有用的代码。我实际上使用它来自定义缩略图显示,但在您的情况下这个概念将是相似的。
<!-- Get the current item handle -->
<xsl:variable name="HANDLE" select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='request'][@qualifier='URI']"/>
<!-- Generate the URL to the rights information for the item -->
<xsl:variable name="EXTMETSURL" select="concat('cocoon://metadata/',$HANDLE,'/mets.xml?rightsMDTypes=METSRIGHTS')"/>
<!-- Retrieve the rights information (as a cocoon request) -->
<xsl:variable name="EXTMETS" select="document($EXTMETSURL)"/>
<!-- Point this variable at a specific bitstream of interest (such as the primary bitstream or the first original bitstream)-->
<xsl:variable name="bit" select="..."/>
<!-- Retrieve the rights information for a specific bitstream -->
<xsl:variable name="bitmets" select="$EXTMETS//mets:fileSec/mets:fileGrp[@USE='ORIGINAL']/mets:file[@GROUPID=$bit/@GROUPID]"/>
<!-- Get the authorization id for the bitstream -->
<xsl:variable name="authid" select="$bitmets/@ADMID"/>
<!-- Get the authorization record based on that id -->
<xsl:variable name="authrec" select="$EXTMETS//mets:rightsMD[@ID=$authid]"/>
<!-- Check that General Public (aka Anonymous) can access that record -->
<xsl:variable name="pubrec" select="$authrec//metsrights:Context[@in-effect='true'][@CONTEXTCLASS='GENERAL PUBLIC']"/>
【讨论】: