Lotus Notes Java 插件创建代表会议

Lotus Notes Java plugin create a delegate meeting

我有一个代码可以在 Notes 日历上创建会议。 我想识别我是否处于委托状态(在其他人的日历上创建会议 [并且我事先不知道它是谁])。 现在我的代码在我的用户日历(我登录的用户)上自动创建它,它看起来像 -

NotesUIWorkspace nui = new NotesUIWorkspace();
session = NotesFactory.createSessionWithFullAccess();                                                                
DbDirectory dbdir = session.getDbDirectory(null);                                                                                                   
Database maildb = dbdir.openMailDatabase();

NotesDatabaseData dbData = new NotesDatabaseData(maildb);
NotesFormData formData = new NotesFormData (dbData, "Appointment"); 

formData.addComposeItem("SendTo", Eto); 
formData.addComposeItem("Subject", Esub); 
formData.addComposeItem("Body", Ebody); 

nui.composeDocument(formData);

如何在委托日历打开时通过单击侧边栏按钮来打开委托数据库?

谢谢。

好的,我找到了

                NotesUIWorkspace nui = new NotesUIWorkspace();
                session = NotesFactory.createSessionWithFullAccess();   

                NotesUIElement elem = nui.getCurrentElement();
                NotesDatabaseData dbData = null;
                if (elem instanceof NotesUIView){
                    final NotesUIElement view = elem;
                    NotesViewData viewData = (NotesViewData) Platform.getAdapterManager().getAdapter(view, 
                            NotesViewData.class);
                    dbData = (NotesDatabaseData) Platform.getAdapterManager().getAdapter(view, 
                            NotesDatabaseData.class);

                    System.out.println(dbData.getReplicaId());
                    System.out.println(viewData.getOpenUrl());

                } 

                DbDirectory dbdir = session.getDbDirectory(null);

                if(dbData == null){
                    Database maildb = dbdir.openMailDatabase();
                    dbData = new NotesDatabaseData(maildb);
                }

                NotesFormData formData = new NotesFormData (dbData, "Appointment"); //$NON-NLS-1$

                formData.addComposeItem("Subject", Esub); //$NON-NLS-1$
                formData.addComposeItem("Body", Ebody); //$NON-NLS-1$
                //formData.addComposeItem("IWFlag", "1");  //uses LNA if configured

                nui.composeDocument(formData);