在Lotus Notes客户端的eclipse插件中,我需要在用户的邮件文件中创建会议。我已经使用NotesCalendar对象在我自己的邮件文件中成功创建了一个约会。 (请参见下面的代码)。我似乎不正确的是创建会议而不是约会。在数据库级别,区别在于称为约会类型的字段,在会议中将其设置为3,在约会中将设置为0。
根据资源,我发现需要将xProperty“ X-LOTUS-APPTTYPE”的值添加为“ 3”到我的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:[email protected]"));
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);
}
我知道这是将近5年的代码,但是您可以共享此代码。我在同一个问题上挣扎。