我所在的团队开发了 Java Swing 应用程序,现在我正在尝试帮助另一个团队将该应用程序集成到 Lotus Notes 中。不幸的是,我对 Notes 不太了解,并且似乎找不到与我们正在尝试做的事情相关的任何文档。
我们想要做的是让用户使用从 Notes 传入的一些数据启动我们的应用程序,让用户使用传入的数据,然后当他们准备好保存时,修改后的数据将保存回 Notes 数据库中。
我们使用 Notes 代理实现的第一部分 - 它能够启动我们的应用程序并传入原始数据 - 问题是保存。代理似乎在调用启动我们的应用程序后完成并“死亡”,因此当用户准备保存时无法获得对会话/数据库的引用。一位 Lotus 开发人员通过在代理中创建一个繁忙的等待循环来使其工作,以在启动应用程序后保持其活动状态 - 但这会产生副作用,会在应用程序打开时阻止对 Lotus Notes 的任何其他使用,因此这并不是一个真正可以接受的解决方案。
有人知道我们正在尝试做的事情是否可能吗?怎么做呢?有关于此的任何示例/文档的链接吗?
I work on a team that's developed a Java Swing application, and now I'm trying to help another team integrate this application into Lotus Notes. Unfortunately, I don't know that much about Notes, and can't seem to find any documentation related to what we're trying to do.
What we want to do is have the user launch our application with some data passed in from Notes, have the user work with the passed in data, then when they are ready to save, the modified data is saved back into the Notes database.
The first part we achieved with a Notes agent - it's able to launch our application and pass the original data in - the problem is saving. The agent seems to complete and "die" after the call to launch our application, so there's no way to get a reference to the session/database later when the user is ready to save. One of the Lotus developers kind of got it to work by making a busy wait loop in the agent to keep it alive after launching the application - but this has the side effect of preventing any other use of Lotus Notes while the application was open, so it's not really an acceptable solution.
Anyone know if what we're trying to do is possible? How to do it? Links to any examples/documentation on this?
发布评论
评论(3)
一种选择是让 Notes 代理启动 Java 应用程序并允许 Java 应用程序异步运行;然后它可以直接写入 Notes 数据库(使用 Notes Java API)。您可以将客户端配置为与 Notes 客户端共享凭证,因此身份验证不是问题(或者您可以让 Java 应用程序向 Notes 进行身份验证)。 Java API 相当简单 - 它基本上模仿了 LotusScript 中可用的后端类。如果需要将结果写回到特定文档中,可以将 DocumentUniqueID (docid) 从 Notes 代理传递到 Java 应用程序,然后在 Java 应用程序中使用它来写回。 (请参阅Database 类中的GetdocumentByUnid 方法)。
这篇文章有点旧,但我认为仍然有意义:
http://www.ibm.com/developerworks/lotus/library /ls-Java_access_pt1/index.html
One option is to have the Notes agent start the Java app and allow the Java app to run asynchronously; it can then write directly into the Notes database (using the Notes Java API). You can configure the client to share credentials with the Notes client, so authenticating is not an issue (or you can have the Java app authenticate to Notes). The Java API is fairly straightforward - it basically mimics the back-end classes available in LotusScript. If you need to write resuls back into a specific document, you can pass the DocumentUniqueID (docid) to Java app from the Notes agent, and then use that within the Java app to write back. (See the GetdocumentByUnid method in the Database class).
This article is a bit old, but I think still relevant:
http://www.ibm.com/developerworks/lotus/library/ls-Java_access_pt1/index.html
您可以通过多种方式将数据恢复到 Lotus Notes 中。我认为最好的选择是使用 Java API 调用 Lotus Notes 并将数据添加回其中。Java API 的一个开源接口可能会让生活变得更轻松,称为 多明戈。否则,请参阅 domino 设计器帮助了解如何使用 Java API。
以下是我在五分钟内能想到的将数据返回 Notes 的所有方法的列表:
You have a few options to get data back into Lotus Notes. I think the best bet is to use the Java API to call into Lotus Notes and add the data back in. There is an open-source interface to the Java API that might make life easier, called domingo. Otherwise, see the domino designer help on how to use the Java API.
Here is a list of all the ways to get data back into Notes that I can think of in five minutes:
Lotus Notes 数据库有一个成熟的 Java API。唯一需要注意的是:该 API 是 C 核心的一个薄包装器,并且要求您对 Notes 对象进行垃圾回收的释放。因此,在使用 NotesDocument 后,您需要调用其 .recycle() 方法,否则会耗尽内存。
There is a full fledged Java API for Lotus Notes databases. The only caveat: the API is a thin wrapper around the C core and required that you do the release for garbage collection on the Notes objects. So after using e.g. a NotesDocument you need to call its .recycle() method otherwise you bleed memory.