1

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

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

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

PS 是的,我正在使用 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();
}
4

2 回答 2

2

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

如果你已经有一个 NotesUIView,NotesUIViewgetActionableEntries将为您提供选定的文档。

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

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

于 2011-06-22T06:30:02.413 回答
0

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

于 2011-06-17T23:06:43.697 回答