如何缩短DSpace中显示的文件名 [英] How to shorten filename displayed in DSpace

查看:19
本文介绍了如何缩短DSpace中显示的文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想缩短在简单项目视图中显示的文件名.

I would like to shorten the file name that is being displayed in the simple item view.

如果我有一个很长的文件名,它会显示在简单的项目记录中:

If I have a very long file name, this is displayed in the simple item record:

如果您查看完整的项目记录,则会缩短此示例文件名:

This example file name is shortened if you view the full item record:

但是如果您编辑此项目并单击项目位流选项卡,文件名将显示如下:

But if you edit this item and click the Item Bitstreams tab, the file name is being displayed like this:

我的目标是将编辑比特流(第三张图片)中显示的内容应用到简单且完整的项目视图中.我不知道这种转变是在哪里产生的.我查看了administration.xsl 并没有找到关于缩短文件名的任何内容.请就如何实现这一目标或在哪里寻找这种转变提出建议.

My goal is to apply what is being displayed in the edit bitstream (the 3rd picture) to the simple and full item view. I don't know where this transformation is being generated. I looked at administrative.xsl and I can't find anything on the shortening of the file name. Please advice on how to achieve this or where to look for this transformation.

推荐答案

Item Bitstreams"选项卡中文件名的重写是在 Java 代码中完成的,而不是在 XSL 中完成.它在这里:EditItemBitstreamsForm.java.

The rewrite of the file name in the "Item Bitstreams" tab is done in Java code, not in the XSL. It's here: EditItemBitstreamsForm.java.

您的项目页面截图看起来像是在 XMLUI/Mirage 2 中工作,是吗?最好的办法是使用 org.dspace.app.xmlui.utils.XSLUtils 中的 shortenString 方法(代码).实际上,您可能没有使用 Mirage 2,因为 Mirage 2 就是这样做的,请参阅 item-view.xsl:

Your item page screenshot looks like you're working in XMLUI / Mirage 2, is that right? Your best bet is to use the shortenString method in org.dspace.app.xmlui.utils.XSLUtils (code). Actually maybe you aren't using Mirage 2 because Mirage 2 does just that, see item-view.xsl:

<xsl:value-of select="util:shortenString(mets:FLocat[@LOCTYPE='URL']/@xlink:title, 30, 5)"/>

这篇关于如何缩短DSpace中显示的文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆