NotesCalendarNotice (Java)

Represents a Domino® calendar notice.

Properties

OverwriteCheckEnabled (NotesCalendarNotice - Java)

NoteID (NotesCalendarEntry - Java) through getNoteID

UNID (NotesCalendarEntry - Java) through getNoteUNID

Methods

accept (NotesCalendarNotice - Java)

acceptCounter (NotesCalendarNotice - Java)

counter (NotesCalendarNotice - Java)

decline (NotesCalendarNotice - Java)

declineCounter (NotesCalendarNotice - Java)

delegate (NotesCalendarNotice - Java)

getAsDocument (NotesCalendarNotice - Java)

getOutstandingInvitations (NotesCalendar - Java)

read (NotesCalendarNotice - Java)

removeCancelled (NotesCalendarNotice - Java)

requestInfo (NotesCalendarNotice - Java)

sendUpdatedInfo (NotesCalendarNotice - Java)

tentativelyAccept (NotesCalendarNotice - Java)

Usage

This object provides access to one notice of the calendar and scheduling services in a Domino® mail application in standard iCalendar format. See Internet Calendaring and Scheduling Core Object Specification (iCalendar) at http://tools.ietf.org/html/rfc5545 for the format.
NotesCalendar and NotesCalendarEntry provide methods for getting and creating calendar notices.

Notices include invitations, reschedules, information updates, confirmations, cancellations, counterproposals, requests for information, acceptances, declines, and tentative acceptances received from another user and not yet processed. You can treat a notice as a NotesCalendarEntry object to apply the following methods: accept, cancel, counter, decline, delegate, remove, requestInfo, and tentativelyAccept. The NotesCalendarEntry methods have scope and recurid parameters, which the corresponding NotesCalendarNotice methods do not. Application of other NotesCalendarEntry methods to a notice causes an exception.

Examples

This agent reads the first meeting invitation since yesterday at 2:00 AM for meetings posted starting at the beginning of 2012.
import lotus.domino.*;

public class JavaAgent extends AgentBase {

    public void NotesMain() {

      try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();

          // (Your code goes here)
          DbDirectory dbdir = session.getDbDirectory("");
          Database maildb = dbdir.openMailDatabase();
          NotesCalendar cal = session.getCalendar(maildb);
          java.util.Calendar jdt = java.util.Calendar.getInstance();
          jdt.set(2012, 1, 1, 1, 1, 1);
          DateTime dt1 = session.createDateTime(jdt);
          DateTime dt2 = session.createDateTime("Yesterday 02");
          java.util.Vector invites = cal.getNewInvitations(dt1, dt2);
          Database db = agentContext.getCurrentDatabase();
          // Create document to post results
          Document doc = db.createDocument();
          doc.appendItemValue("Form", "main");
          doc.appendItemValue("subject", "New invitation");
          RichTextItem body = doc.createRichTextItem("body");
          if (invites.size() == 0) body.appendText("No invitation");
          else {
        	NotesCalendarNotice invite = (NotesCalendarNotice)invites.firstElement();
        	body.appendText(invite.read()); 
          }
          doc.save(true, true);
          
      } catch(Exception e) {
          e.printStackTrace();
      }
   }
}