読み込み専用。 getEntries 操作と readRange 操作によって処理されたエントリの数。
int NotesCalendar.getEntriesProcessed())
throws NotesException
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, 0, 1);
while (entries.size() > 0) {
NotesCalendarEntry cale = (NotesCalendarEntry)entries.elementAt(0);
body.appendText(cale.read());
cale.recycle();
body.addNewLine(1);
entries = cal.getEntries(dt1, dt2, cal.getEntriesProcessed(), 1);
}
doc.save(true, true);
} catch(Exception e) {
e.printStackTrace();
}
}
}
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
String entrystring = cal.readRange(dt1, dt2, 0, 1);
while (entrystring.length() > 0) {
body.appendText(entrystring);
body.addNewLine(1);
entrystring = cal.readRange(dt1, dt2, cal.getEntriesProcessed(), 1);
}
doc.save(true, true);
} catch(Exception e) {
e.printStackTrace();
}
}
}
LotusScript® NotesCalendar クラスの EntriesProcessed プロパティ