Domino® カレンダーエントリを表します。
cancel (NotesCalendarEntry - Java)
counter (NotesCalendarEntry - Java)
decline (NotesCalendarEntry - Java)
delegate (NotesCalendarEntry - Java)
getAsDocument (NotesCalendarEntry - Java)
getNotices (NotesCalendar - Java)
read (NotesCalendarEntry - Java)
remove (NotesCalendarEntry - Java)
requestInfo (NotesCalendarEntry - Java)
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
String uid = session.getEnvironmentString("currentuid");
String calestr = "";
if (uid != null) {
DbDirectory dbdir = session.getDbDirectory("");
Database maildb = dbdir.openMailDatabase();
NotesCalendar cal = session.getCalendar(maildb);
NotesCalendarEntry cale = cal.getEntry(uid);
calestr = cale.read();
int i = calestr.indexOf("RECURRENCE-ID:");
if (i >= 0) {
String recurid = calestr.substring(i + 14, i + 30);
calestr = cale.read(recurid);
}
} else {
calestr = "Null UID";
}
// Write result to document
Database db = agentContext.getCurrentDatabase();
Document doc = db.createDocument();
doc.appendItemValue("Form", "main");
doc.appendItemValue("subject", "Calendar entry");
RichTextItem body = doc.createRichTextItem("body");
body.appendText(calestr);
doc.save(true, true);
} catch(Exception e) {
e.printStackTrace();
}
}
}