我正在使用 Domino .NET 包装类来允许用户将电子邮件从他们的 Lotus 收件箱拖到 winform。
我正在获取一个数据对象,其中包含文档的注释 URL,格式为
notes://server/replicaID/viewID/documentUNID
并将其传递给应该返回匹配文档的 Domino.NotesSession.Resolve(pUrl)。实际上,在我的浏览器中粘贴链接(用 http:// 替换 notes:// 就像一个魅力,我得到了电子邮件的 HTML 版本)工作。
但是 Resolve 方法继续返回似乎是 NotesView 的内容,而不是实际的文档:
Dim notesSession as Domino.NotesSession = ' ... Initialize session here
Dim notesURL as string = "notes://server/replicaID/viewId/documentID"
Dim draggedDocument = notesSession.Resolve(notesURL)
' Here, I do get an actual document, but its UnID matches the viewId
' part of the url, not the document.
我尝试从 URL 中删除 viewID,但没有成功。我发现成功检索文档的唯一方法是使用 OLE 对象(莲花命名空间):
' Get UnId from url
Dim unid as String = notesURL.Split("/").Last()
' Get UI Automation object
Dim workspace = CreateObject("Notes.NotesUIWorkspace")
' Get currently open DB (the where the drag event was initiated)
Dim notesDb = workspace.CURRENTDATABASE.Database
' Retrieve matching document
Dim notesDoc = notesDb.GetDocumentByUNID(unid)
虽然这种方法有效,但我不想使用 UI 自动化类 (OLE),而是使用 Domino 的 COM 包装器 (.NET)。
那么这些笔记 URL 究竟是如何在互操作中工作的呢?有没有什么方法可以在不知道数据库的情况下检索匹配的文档?为什么在给定文档 URL 时 Resolve 方法会返回视图对象?
欢迎任何帮助。