Lotus Notes Java插件创建委托会议

时间:2015-02-18 08:01:06

标签: eclipse-plugin eclipse-rcp lotus-notes

我有一个代码可以在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);

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

感谢。

1 个答案:

答案 0 :(得分:0)

好的,我找到了

                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);