从文档获取 Lotus Notes 数据

发布于 2024-11-15 21:08:11 字数 1247 浏览 2 评论 0原文

我在我的 Lotus Notes(8.5.2),我正在尝试获取两件事的数据:

  1. NotesUIView 中突出显示的文档/项目
  2. 文档在 NotesUIDocument 中选择

但是,我得到的只是 Notes URL,而且我不知道应该如何处理这些 URL。谁能帮我/给我扔面包屑吗?

PS 是的,我正在使用 Eclipse 的 Java API。

这是我所做的代码示例:

NotesUIWorkspace workSpace = new NotesUIWorkspace();
NotesUIElement currentElement = workSpace.getCurrentElement();

if (currentElement instanceof NotesUIView) {
    NotesUIView currentView = (NotesUIView) currentElement;
    NotesUIViewEntryCollection collection = currentView
            .getActionableEntries();
    Iterator docIterator = collection.documentIterator();
    while (docIterator.hasNext()) {
        NotesUIDocumentEntry entry = (NotesUIDocumentEntry) docIterator.next();
        //I can't seem to get to the NoesUIDocument case like I can below... I want fields!
    }
}

if(currentElement instanceof NotesUIDocument){
    NotesUIDocument document = (NotesUIDocument) currentElement;
    //Seem to be able to get the correct data fields only in this case!
    document.getFields();
}

I am using a local database in my version of Lotus notes(8.5.2), and I am trying to get the data for two things:

  1. The highlighted document/item in a NotesUIView
  2. The document selected in a NotesUIDocument

However, all I get are the Notes URLs and I don't know what I should do with those. Can anyone help me out/throw me a breadcrumb?

P.S. Yes I am using the Java API for Eclipse.

Here is a code sample of what I do:

NotesUIWorkspace workSpace = new NotesUIWorkspace();
NotesUIElement currentElement = workSpace.getCurrentElement();

if (currentElement instanceof NotesUIView) {
    NotesUIView currentView = (NotesUIView) currentElement;
    NotesUIViewEntryCollection collection = currentView
            .getActionableEntries();
    Iterator docIterator = collection.documentIterator();
    while (docIterator.hasNext()) {
        NotesUIDocumentEntry entry = (NotesUIDocumentEntry) docIterator.next();
        //I can't seem to get to the NoesUIDocument case like I can below... I want fields!
    }
}

if(currentElement instanceof NotesUIDocument){
    NotesUIDocument document = (NotesUIDocument) currentElement;
    //Seem to be able to get the correct data fields only in this case!
    document.getFields();
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

爱的十字路口 2024-11-22 21:08:11

获取“当前”文档通常是通过 NotesAgentContext未处理的文档。在一个视图中,如果用户勾选了多个,则可能会返回文档集合。

如果您已经有 NotesUIView,NotesUIViewgetActionableEntries 将为您提供所选文档。

当您有 NotesDocumentData 实例,NotesUIWorkspace.openDocument 可用于在编辑模式下打开它。然后 NotesUIWorkspace.getCurrentDocument 可用于获取 UI 文档。

请注意,如果您只想从文档中读取值,那么使用 文档

Fetching the "current" document is usually done via the NotesAgentContext.UnprocessedDocuments. In a view, that might return a collection of documents if the user as ticked several.

If you already have an NotesUIView, NotesUIView.getActionableEntries will give you the selected document(s).

When you have a NotesDocumentData instance, NotesUIWorkspace.openDocument can be used to open it up in edit mode. Then NotesUIWorkspace.getCurrentDocument can be used to get hold of the UI Document.

Notice that if you only want to read values from the document, it is more convenient to use the back-end classes like Document.

国际总奸 2024-11-22 21:08:11

你有一个 URL 作为例子吗?如果它包含相关文档的 UUID,那么您应该能够使用 getDocument() 直接引用它。否则,URL 应包含视图引用和相关视图的查找键。

Have you got a URL as an example? If it includes the UUID of the document in question then you should be able to reference it directly with a getDocument(). Otherwise, the URL should include a view reference and a lookup key for that view in question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文