指定した時刻範囲内でカレンダーエントリを取得します。
getEntries(start:NotesDateTime、end:NotesDateTime、 skipcount:int, maxreturn:int) : java.util.Vector
パラメータ | 説明 |
---|---|
start | エントリの開始時刻。 |
end | エントリの終了時刻。終了時刻が開始時刻より後の時刻になっていない場合は、例外が発生します。 |
skipcount | 取得操作を開始する前にスキップするエントリの数。デフォルトは 0 です。 |
maxreturn | 返されるエントリの最大数。skipcount も maxreturn も指定しない場合は、 範囲内のすべてのエントリが返されます。 |
戻り値 | 説明 |
---|---|
java.util.Vector | 範囲内のカレンダーエントリ。エントリが存在しない場合は空ベクトル。各ベクトル要素は NotesCalendarEntry 型です。 |
var dbdir:NotesDbDirectory = session.getDbDirectory("");
var maildb:NotesDatabase = dbdir.openMailDatabase();
var cal:NotesCalendar = session.getCalendar(maildb);var dt1:NotesDateTime = session.createDateTime("Today 08");
var dt2:NotesDateTime = session.createDateTime("Tomorrow 17");
var entries:java.util.Vector = cal.getEntries(dt1, dt2);
for (i = 0; i < entries.size(); i++) {
var cale:NotesCalendarEntry = entries.elementAt(i);
requestScope.status = requestScope.status + cale.read() + "¥n";
cale.recycle();
}
NotesCalendar.GetEntries(start As NotesDateTime, end As NotesDateTime, Optional skipcount As Long, Optional maxreturn As Long) As Variant
このエージェントにより、現在のユーザーについて、今日と明日のカレンダー情報とスケジュール情報が取得されます。Sub Initialize
Dim session As New NotesSession
Dim maildb As New NotesDatabase("", "")
Dim cal As NotesCalendar
Dim dt1 As NotesDateTime
Dim dt2 As NotesDateTime
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim body As NotesRichTextItem
REM Get calendar for current user
Call maildb.Openmail()
Set cal = session.getCalendar(maildb) ' Not In ref pane
Set dt1 = session.createdatetime("Today 08")
Set dt2 = session.Createdatetime("Tomorrow 17")
Set db = session.CurrentDatabase
REM Create document to post results
Set doc = db.CreateDocument
doc.Form = "main"
doc.Subject = "Today and tomorrow"
Set body = doc.Createrichtextitem("body")
REM Get entries and put in body of document
ForAll cale In cal.Getentries(dt1, dt2)
Call body.Appendtext(cale.Read())
Call body.Addnewline(1)
End ForAll
Call body.Appendtext(cal.ReadRange(dt1, dt2))
Call doc.Save( True, True )
End Sub
java.util.Vector NotesCalendar.getEntries(DateTime start, DateTime end)
java.util.Vector NotesCalendar.getEntries(DateTime start, DateTime end, int skipcount, int maxreturn)
このエージェントにより、現在のユーザーについて、今日と明日のカレンダー情報とスケジュール情報が取得されます。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);
DateTime dt1 = session.createDateTime("Today 08");
DateTime dt2 = session.createDateTime("Tomorrow 17");
// Create document to post results
Database db = agentContext.getCurrentDatabase();
Document doc = db.createDocument();
doc.appendItemValue("Form", "main");
doc.appendItemValue("subject", "Today and tomorrow");
RichTextItem body = doc.createRichTextItem("body");
// Get entries and put in body of document
java.util.Vector entries = cal.getEntries(dt1, dt2);
for (int i = 0; i < entries.size(); i++) {
NotesCalendarEntry cale = (NotesCalendarEntry)entries.elementAt(i);
body.appendText(cale.read());
cale.recycle();
body.addNewLine(1);
}
doc.save(true, true);
} catch(Exception e) {
e.printStackTrace();
}
}
}