java - 使用 Notes.jar 获取给定日期的所有日历条目

标签 java lotus-notes

我正在编写一个简单的 Java 代码来提取给定日期的所有日历条目。我知道可以使用 Domingo,但我只想使用 Notes.jar 来实现此目的。我可以根据给定的凭据创建 session 并获取日历对象。我希望提取当前正在运行的 Notes session ,并使用该 session 对象打开邮件文件中的日历 View 并开始使用它。但我无法让它工作。有人对此有任何想法或链接吗?

最佳答案

我已经完成了默认的笔记 API,下面是代码。

NotesAPITest nat = new NotesAPITest();
        NotesThread.sinitThread();

        Session sess1 = NotesFactory.createSession();
        System.out.println(sess1.getUserName());
        Database database = sess1.getDatabase("", "mailfile");
        View calendarView = database.getView("($Calendar)");
        DateTime dt = sess1.createDateTime("today");
        ViewEntryCollection vec = calendarView.getAllEntriesByKey(dt, true);

        ViewEntry entry = vec.getFirstEntry();
         while (entry != null) 
         {

           Document caldoc = entry.getDocument();

           System.out.println("Subject: " + caldoc.getItemValueString("Subject"));
           System.out.println("Chair Person: " + caldoc.getItemValueString("Chair"));
           System.out.println("Start Time: " + nat.getStartEndTimes(caldoc, "StartDateTime") );
           System.out.println("Start Time: " + nat.getStartEndTimes(caldoc, "EndDateTime") );
           System.out.println("Required: " + caldoc.getItemValueString("RequiredAttendees"));
           entry = vec.getNextEntry(); 
         }  

我看到的唯一缺点是,每当提取 session 时,Notes 都会弹出一个密码对话框。到目前为止,在我的搜索中,我还没有找到解决方案。我猜显然是 LN 的安全安排。

关于java - 使用 Notes.jar 获取给定日期的所有日历条目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1438665/

相关文章:

java - Stream.count() 与 Collectors.counting() 有什么区别

xpages - 将二进制响应(流)直接写入 Notes 文档中的 MIME

excel - 如何使用 VBA 版本的内置 PDF+附加到邮件按钮将多个工作表作为一个 PDF 附加到邮件

java - 在 Windows 7 上运行 Windows XP 批处理

lotus-notes - 如何为笔记文档创建人类可读的 key

javascript - 在 javascript 中通过 Lotus Notes 发送邮件

java - 我需要在我的 Java 项目中使用什么相对路径

java - 缺少返回声明错误

Java 将 ArrayList 转换为字符串并返回 ArrayList?

java - 如何通过 netbeans 使用 wsdl 中的 w3schools tempCnvertor Web 服务?