在 DSpace 4.2 xmlui 中查看上传的项目
Viewing an uploaded item in DSpace 4.2 xmlui
这是 DSpace 我的搜索结果页面的样子:
单击该项目会打开一个新页面,显示其描述:
描述页面在点击 View/Open 后打开文件。是否可以在结果页面上单击标题直接打开文件?我想跳过项目描述页面。
据我了解,this 是 Java
文件,调用它来呈现项目。我需要更改此文件吗?或者是否可以通过简单地修改 sitemap
和 xsl
文件来实现我想要的?
生成缩略图的代码在这里。
您可以创建类似的逻辑来创建原始比特流的 href。
查看 /metadata/handle/xxx/yyy/mets 中的 XML。xml 其中 xxx/yyy 是您的项目句柄。您应该会看到指向原始比特流的信息。
如评论中所述,要修改的 xsl 模板是 "itemSummaryList" in discovery.xsl
将 href 值替换为 $metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="dri:list[@n=(concat($handle, ':dc.title')) and descendant::text()]">
<xsl:apply-templates select="dri:list[@n=(concat($handle, ':dc.title'))]/dri:item"/>
</xsl:when>
<xsl:otherwise>
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
在 Antoine Snyers、terrywb 和 this link 的帮助下,我实现了我想要的目标。正如 terrywb 所指出的,我需要读取的信息,即上传文件的比特流地址,存储在 metsDoc
中。这是我的 metsDoc
的屏幕截图,其中 fileSec
已展开:
为了能够访问 metsDoc
的 fileSec
,我将 this line in discovery.xsl and this line in common.xsl 更改为 <xsl:text>?sections=dmdSec,fileSec&fileGrpTypes=ORIGINAL,THUMBNAIL</xsl:text>
。
然后我 added/modified 将以下代码添加到 discovery.xsl
中的 itemSummaryList
以便标题超链接现在指向文件比特流。
<xsl:variable name="filetype">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']"/>
</xsl:variable>
<xsl:variable name="fileurl">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:variable>
<div class="artifact-title">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="$metsDoc/mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim/@withdrawn">
<xsl:value-of select="$metsDoc/mets:METS/@OBJEDIT"/>
</xsl:when>
<xsl:when test="$filetype">
<xsl:value-of select="$fileurl"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
同样,我也对 item-list.xsl
文件进行了更改,并将这一行 <xsl:apply-templates select="mets:fileSec/mets:fileGrp[@USE='CONTENT']"
mode="itemSummaryList-DIM"/>
添加到模板 itemSummaryList-DIM
.
最后我得到了我想要的结果:
在检查器中可见,标题的 href
属性现在指向文件的原始比特流:)
这是 DSpace 我的搜索结果页面的样子:
描述页面在点击 View/Open 后打开文件。是否可以在结果页面上单击标题直接打开文件?我想跳过项目描述页面。
据我了解,this 是 Java
文件,调用它来呈现项目。我需要更改此文件吗?或者是否可以通过简单地修改 sitemap
和 xsl
文件来实现我想要的?
生成缩略图的代码在这里。
您可以创建类似的逻辑来创建原始比特流的 href。
查看 /metadata/handle/xxx/yyy/mets 中的 XML。xml 其中 xxx/yyy 是您的项目句柄。您应该会看到指向原始比特流的信息。
如评论中所述,要修改的 xsl 模板是 "itemSummaryList" in discovery.xsl
将 href 值替换为 $metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$metsDoc//mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="dri:list[@n=(concat($handle, ':dc.title')) and descendant::text()]">
<xsl:apply-templates select="dri:list[@n=(concat($handle, ':dc.title'))]/dri:item"/>
</xsl:when>
<xsl:otherwise>
<i18n:text>xmlui.dri2xhtml.METS-1.0.no-title</i18n:text>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
在 Antoine Snyers、terrywb 和 this link 的帮助下,我实现了我想要的目标。正如 terrywb 所指出的,我需要读取的信息,即上传文件的比特流地址,存储在 metsDoc
中。这是我的 metsDoc
的屏幕截图,其中 fileSec
已展开:
为了能够访问 metsDoc
的 fileSec
,我将 this line in discovery.xsl and this line in common.xsl 更改为 <xsl:text>?sections=dmdSec,fileSec&fileGrpTypes=ORIGINAL,THUMBNAIL</xsl:text>
。
然后我 added/modified 将以下代码添加到 discovery.xsl
中的 itemSummaryList
以便标题超链接现在指向文件比特流。
<xsl:variable name="filetype">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']"/>
</xsl:variable>
<xsl:variable name="fileurl">
<xsl:value-of select="$metsDoc/mets:METS/mets:fileSec/mets:fileGrp[@USE='CONTENT']/mets:file/mets:FLocat[@LOCTYPE='URL']/@xlink:href"/>
</xsl:variable>
<div class="artifact-title">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="$metsDoc/mets:METS/mets:dmdSec/mets:mdWrap/mets:xmlData/dim:dim/@withdrawn">
<xsl:value-of select="$metsDoc/mets:METS/@OBJEDIT"/>
</xsl:when>
<xsl:when test="$filetype">
<xsl:value-of select="$fileurl"/>
</xsl:when>
</xsl:choose>
</xsl:attribute>
同样,我也对 item-list.xsl
文件进行了更改,并将这一行 <xsl:apply-templates select="mets:fileSec/mets:fileGrp[@USE='CONTENT']"
mode="itemSummaryList-DIM"/>
添加到模板 itemSummaryList-DIM
.
最后我得到了我想要的结果:
在检查器中可见,标题的 href
属性现在指向文件的原始比特流:)