Domino カレンダーエントリを表します。
Cancel (NotesCalendarEntry - LotusScript)
Counter (NotesCalendarEntry - LotusScript)
Decline (NotesCalendarEntry - LotusScript)
Delegate (NotesCalendarEntry - LotusScript)
GetAsDocument (NotesCalendarEntry - LotusScript)
GetNotices (NotesCalendar - LotusScript)
Read (NotesCalendarEntry - LotusScript)
Remove (NotesCalendarEntry - LotusScript)
RequestInfo (NotesCalendarEntry - LotusScript)TentativelyAccept (NotesCalendarEntry - LotusScript)Update (NotesCalendarEntry - LotusScript)
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();
}
}
}
NotesCalendarEntry
このエージェントは、指定された UID のカレンダーエントリ (繰り返し発生するエントリの場合は最初のインスタンス) を読み込みます。Sub Initialize
Dim session As New NotesSession
Dim maildb As New NotesDatabase("", "")
Dim cal As NotesCalendar
Dim cale As NotesCalendarEntry
Dim uid As String
Dim calestr As String
Dim recurid As String
Dim i As Integer
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim body As NotesRichTextItem
uid = session.Getenvironmentstring("currentuid")
If uid = "" Then
MessageBox "No current UID",, "Error"
Exit sub
End If
Call maildb.Openmail()
Set cal = session.getCalendar(maildb)
Set cale = cal.Getentry(uid)
calestr = cale.Read()
i = InStr(calestr, "RECURRENCE-ID:")
If i > 0 Then
recurid = Mid$(calestr, i + 14, 16)
calestr = cale.Read(recurid)
End If
REM Write results to document
Set db = session.Currentdatabase
Set doc = db.Createdocument()
doc.Form = "main"
doc.Subject = "Calendar entry"
Set body = doc.Createrichtextitem("body")
body.Appendtext(calestr)
Call doc.Save(true, true)
End Sub