是否有与@AttachmentModifiedTimes 等效的 Java/SSJS? [英] Is there Java/SSJS equivalent of @AttachmentModifiedTimes?

查看:31
本文介绍了是否有与@AttachmentModifiedTimes 等效的 Java/SSJS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想显示附件列表,但 FileDownload 控件不是一个选项(每个文件都需要自定义操作).

I want to show list of attachments and FileDownload control is not an option (need custom actions for every file).

要获取附件的名称和大小,有EmbeddedObject 的属性.AFAIK,要获得附件的修改时间,只有一种选择:使用纯 @Formula,通过 session.evaluate 或使用 @AttachmentModifiedTimes 查看包含列.

To get name and size of attachments there are properties of EmbeddedObject. AFAIK, to get modified time of attachment there is only one option: to use pure @Formula, either via session.evaluate or view containing column with @AttachmentModifiedTimes.

有没有办法(Java/SSJS)在没有原生@Formulas 的情况下获得附件的修改(和创建)时间?这意味着与 $FILE 项目的文档属性中显示的文件一起存储的日期.

Is there a way (Java/SSJS) to get attachment's modified (and created) time without native @Formulas? That means date stored with file shown in document properties for $FILE item.

推荐答案

您可以向页面添加一个重复控件,并使用 document1.getAttachmentList("rt_field_name") 将其绑定到附件(存储在富文本字段中).该列表中的每一项都是类的对象

You can add a Repeat Control to the page and bind that to the attachments (stored in a rich text field) using document1.getAttachmentList("rt_field_name"). Every item in that list is an object of class

com.ibm.xsp.model.domino.wrapped.DominoDocument$AttachmentValueHolder

该类有一个 getLastModified() 方法,该方法以 Double 形式返回上次修改时间.

That class has a getLastModified() method that returns the last modified time as a Double.

在 Web 上找不到显示完整 API 的参考,但是如果您使用 XPage 调试工具栏中的 API Inspector(对不起无耻的插件...),您可以使用以下方法查看所有属性和方法:

A couldn't find a reference on the web showing the full API, but if you use the API Inspector in the XPage Debug Toolbar (sorry for the shameless plug...) you can view all properties and methods using:

getComponent('id_of_repeat_control').getDataModel().getRowData()

getComponent( 'id_of_repeat_control' ).getDataModel().getRowData()

更新

找到 API 此处

这篇关于是否有与@AttachmentModifiedTimes 等效的 Java/SSJS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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