How to launch an application from Lotus Notes, then later save into Lotus database?

纵然是瞬间 提交于 2020-01-04 07:00:46

问题


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?


回答1:


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




回答2:


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:

  • use COM or Java API to call Notes objects and methods (see Domino Designer Help).
  • use NotesSQL to INSERT data back into Notes using SQL commands.
  • Setup the Notes database as a mail-in database and pass data via an email
  • Setup a scheduled agent to read from a specified directory (have it run every minute or two), and import the data from a file.
  • If you are using Domino, you can pass data in via a URL's query string and process it within an agent.



回答3:


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.



来源:https://stackoverflow.com/questions/4605082/how-to-launch-an-application-from-lotus-notes-then-later-save-into-lotus-databa

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!