how to create a lotus notes meeting using java in

2019-09-05 20:29发布

Hi i am trying to create meeting in lotus notes using java.i am able to send a meeting invite to the recipients.But when i send a meeting the options available to the chair and the recipients are the same.(options like accept,decline).But the options for the chair and the recipients should be different.can anyone please tell how to do this?

public DocumentKey save(final Session session, final Database db, boolean send,
        String moveToFolder) throws NotesException, Io Exception {
    //setBody(null);
    Document doc = null;
    RichTextItem rti = null;
    try {
        doc = db.createDocument();
        db.getView(ServiceConstants.MEETINGS);
        // Here i am setting all the properties for that document.
        // I cant post that code as it has
        // over 100 properties, so more than 100 lines of code

        rti = doc.createRichTextItem(ServiceConstants.BODY);
        rti.appendText(getBody());
        if ((attachment != null) && (attachment.length > 0)) {
            for (int i = 0; i < attachment.length; i++) {
                attachment[i].save(rti);
            }
        }
        doc.save(true, true, true);
        if (send) {
            doc.send();
        }
        if (!isBlank(moveToFolder)) {
            doc.putInFolder(moveToFolder, true);
        }
        setKey(new DocumentKey(doc.getNoteID()));
    } finally {
        Helper.cleanupIfNeeded(rti);
        Helper.cleanupIfNeeded(doc);
    }
    return getKey();
}

2条回答
别忘想泡老子
2楼-- · 2019-09-05 20:42

To successfully schedule a meeting, you need to follow the calendaring and scheduling schema

In short: A meeting has to be created in the chair's mail file and the invitations have to be responses (doc.MakeResponse(...)) to that main document and sent via mail. The "ApptUnid"- item ties them all together.

Read the documentation in the link, it is very good

查看更多
等我变得足够好
3楼-- · 2019-09-05 20:58

If you are using Notes / Domino 9.0 or greater, you should consider using the lotus.domino.NotesCalendar interface and its related interfaces. These relatively new interfaces let you create, read and update calendar entries using iCalendar format.

Here's some sample code:

// Get the NotesCalendar object from the database
NotesCalendar notesCalendar = session.getCalendar(database);
if ( notesCalendar == null ) {
    throw new Exception("Cannot open calendar.");
}

// Create a meeting in iCalendar format
String ical = iCalendarMeeting();

// Create the meeting on the Notes calendar
NotesCalendarEntry entry = notesCalendar.createEntry(ical);

This code creates an instance of NotesCalendar from an instance of Database. Then it gets the representation of a meeting in iCalendar format (the iCalendarMeeting method is not shown). Finally, it calls NotesCalendar.createEntry() to create the meeting. The createEntry method places the meeting on the organizer's calender and sends an invitation to all attendees.

查看更多
登录 后发表回答