在 Lotus Notes 客户端的 Eclipse 插件中,我需要在用户的邮件文件中创建会议。我已经使用 NotesCalendar 对象在自己的邮件文件中成功创建了约会。(见下面的代码)。我似乎不正确的是创建会议而不是约会。在数据库级别上,不同之处在于名为约会类型的字段,在会议的情况下设置为 3,在约会的情况下设置为 0。
根据我发现的资源,我需要将值为“3”的 xProperty“X-LOTUS-APPTTYPE”添加到我的 Ical4j 对象中,但由于某种原因,NotesCalendar.createEntry() 方法没有处理它。
有人知道如何使用 NotesCalendar 笔记类和 Ical4j 在邮件文件中创建会议吗?
(我添加 xPages 标签的原因是我希望 xPages 社区中的某个人曾经使用过 notescalendar 对象)
创建约会的代码:
DateTime meetingStart = new DateTime(c.getStartTime().getTime());
DateTime meetingEnd = new DateTime(c.getEndTime().getTime());
VEvent meeting = new VEvent(meetingStart, meetingEnd, c.getSubject());
// Add chair
Attendee chairAttendee = new Attendee(URI.create("mailto:j.somhorst@development.acuity.nl"));
chairAttendee.getParameters().add(Role.CHAIR);
// Add invitees
for(User invitee : c.getUserParticipants()){
Attendee attendee = new Attendee(URI.create("mailto:"+invitee.getEmail()));
attendee.getParameters().add(Role.REQ_PARTICIPANT);
meeting.getProperties().add(attendee);
}
// create calendar for ics export
Calendar call = new Calendar();
call.getProperties().add(new ProdId("-//Lotus Development Corporation//NONSGML Notes 9.0.1//EN_API_C"));
call.getComponents().add(meeting);
// notes specific fields
meeting.getProperties().add(new XProperty("X-LOTUS-NOTESVERSION","2"));
meeting.getProperties().add(new XProperty("X-LOTUS-APPTTYPE","3"));
NotesCalendar notesCalendar = NotesUtil.getNotesCalendar(s);
if(notesCalendar!=null){
notesCalendar.setAutoSendNotices(false);
NotesCalendarEntry entry = notesCalendar.createEntry(call.toString());
String icallvalue = entry.read();
System.out.println(icallvalue);
}