I'm not familiar with Lotus Notes. The task is the following: I need to implement the plug in which listen "Calendar Entry created/deleted" event. And send this scheduling (iCal) data to some web service so that it could be synchronized in the another system. I would appreciate if somebody could give me some vector, where I need to find solution, how to subscribe to such an event? Thanks
-
You need to give more detail. Where do you expect this plugin to run: on the user's Notes client, or on the Domino server? (If you expect to get all events, including auto-accepts it had better be on the server!) Also, do you need the users' credentials to connect to the web service? – Richard Schwartz Nov 15 '12 at 01:49
1 Answers
You need to look into agents, specifically the type that runs when documents are created / modified. For deletes look at the QueryDocumentDelete event on the database. Between those two code points you can add the necessary logic to respond to calendar (or other) document creation and deletion.
You'll have to check the documents form to determine if the document being acted upon is a calendar event, but after that it should be straightforward.
Note there can be a delay between when a document is created and when the agent runs.
UPDATE: Within the agent, you'll need to get the unprocessed documents collection from the database object and operate on that. Using LotusScript it would look like this:
Dim s as New NotesSession
Dim db as NotesDatabase
Dim docCollection as NotesDocumentCollection
Set db = s.CurrentDatabase
Set docCollection = db.UnprocessedDocuments
Then from there you can loop over the document collection and process each NotesDocument object.

- 21,989
- 3
- 55
- 63
-
thanks for a quick reply!! I do the following: NotesUIWorkspace ws = new NotesUIWorkspace(); NotesUIElement elem = ws.getCurrentElement(); NotesUIDocument uidoc = (NotesUIDocument)elem; uidoc.addModifiedListener(new Listener(){ public void handleEvent(Event arg0) {}}); But I don't know who to get field values. Or I go the wrong way? – user470071 Nov 14 '12 at 13:59
-
A listener looks like it would help, but not in this case. In the "created/modified" agent you are already getting the newly created or modified documents, so the listening part is over. You can just process them. I updated my answer to get you started, though I don't know the Java API for Notes very well so I wrote it in LotusScript. – Ken Pespisa Nov 14 '12 at 14:30