简体   繁体   English

在plone 4.2.4中,如何在GUI中获取文件和文件夹的大小?

[英]In plone 4.2.4, how do I get file and folder size in GUI?

I am using Plone 4.2.4 on linux. 我在Linux上使用Plone 4.2.4。 I wish to display the size of the uploaded files and the folders created in the site. 我希望显示上载文件的大小以及在站点中创建的文件夹。 Is there some addon that can be plugged in easily to display the same in the tabular folder view? 是否有一些插件可以轻松插入以在表格文件夹视图中显示它们?

Showing the file is quite easy: you simply need to customize the folder_tabular_view.pt adding a new column. 显示文件非常容易:您只需要自定义folder_tabular_view.pt并添加新列即可。 The TAL expression for this should be something like item/getObjSize . TAL表达式应该类似于item/getObjSize


Size of folders is not that easy because is a complex information: size of a container is the size of objects inside (probably: recursive). 文件夹的大小不是那么容易,因为它是一个复杂的信息:容器的大小就是内部对象的大小(可能是递归的)。

You should override the getObjSize catalog metadata for folders (See plone.indexer ) but you must also trigger some event that reindex the whole subtree when some files are changed... 您应该覆盖文件夹的getObjSize目录元数据(请参阅plone.indexer ),但是还必须触发一些事件,当某些文件更改时,该事件会重新索引整个子树...

Can be complex. 可能很复杂。 And slow . 又慢

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM