【问题标题】:Getting Lotus Notes data from Document从 Document 获取 Lotus Notes 数据
【发布时间】:2011-06-17 18:50:11
【问题描述】:

我在我的Lotus notes(8.5.2) 版本中使用本地数据库,我试图获取两件事的数据:

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

但是,我得到的只是 Notes URL,我不知道应该如何处理这些 URL。任何人都可以帮我/扔给我一个面包屑吗?

附:是的,我正在使用 Java API for Eclipse。

这是我所做的代码示例:

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();
}

【问题讨论】:

  • 你能发布一些你得到的代码和网址吗?另外,我假设您想要获取文档的 UniversalID - 然后您可以使用它来访问后端文档及其项目。对吗?

标签: java lotus-notes lotus


【解决方案1】:

获取“当前”文档通常通过NotesAgentContext.UnprocessedDocuments 完成。在一个视图中,如果用户勾选了几个,它可能会返回一个文档集合。

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

当你有一个NotesDocumentData 实例时,NotesUIWorkspace.openDocument 可以用来在编辑模式下打开它。然后可以使用 NotesUIWorkspace.getCurrentDocument 来获取 UI 文档。

请注意,如果您只想从文档中读取值,则使用 Document 之类的后端类会更方便。

【讨论】:

  • 感谢您的回答,我会尝试一下,看看我能想出什么。
【解决方案2】:

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

【讨论】:

    猜你喜欢
    • 2012-09-25
    • 2011-07-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多