カレンダーエントリを取得します。
パラメータ |
説明 |
uid |
エントリの iCalendar 識別子 (UID アイテム) |
使用法
このメソッドは
uid については、存在するかどうかのみを検査します。返された
NotesCalendarEntry オブジェクトを使用しようとすると、妥当性検査が行われ、エラーが報告されます。
例
このボタンイベントは、sessionScope 変数として保存された UID に対応するカレンダーエントリを取得します。
try {
var dbdir:NotesDbDirectory = session.getDbDirectory("");
var maildb:NotesDatabase = dbdir.openMailDatabase();
var cal:NotesCalendar = session.getCalendar(maildb);
var uid:string = sessionScope.currentuid;
var cale:NotesCalendarEntry = cal.getEntry(uid);
requestScope.status = "Calendar entry for UID " + uid + "¥n";
requestScope.status = requestScope.status + cale.read();
} catch(e) {
requestScope.status = "Cannot locate calendar entry with UID " + sessionScope.currentuid;
}
LotusScript® 構文と例
NotesCalendar.GetEntry(Byval uid As String) As NotesCalendarEntry
このエージェントは、環境変数として保存された UID に対応するカレンダーエントリを取得します。
Sub Initialize
Dim session As New NotesSession
Dim maildb As New NotesDatabase("", "")
Dim uid As String
Dim cal As NotesCalendar
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)
REM Create document to post results
Set db = session.CurrentDatabase
Set doc = db.CreateDocument
doc.Form = "main"
doc.Subject = "Calendar entry"
Set body = doc.Createrichtextitem("body")
REM Get entry and put in body of document
uid = session.Getenvironmentstring("currentuid")
If uid = "" Then
body.Appendtext("Current UID not set")
Else
body.Appendtext("Calendar entry for UID " & uid)
body.Addnewline(1)
body.Appendtext(cal.Getentry(uid).Read())
End If
Call doc.Save( True, True )
End Sub
Java™ 構文と例
NotesCalendarEntry NotesCalendar.getEntry(String uid)
このエージェントは、環境変数として保存された UID に対応するカレンダーエントリを取得します。
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();
// Create document to post results
Database db = agentContext.getCurrentDatabase();
Document doc = db.createDocument();
doc.appendItemValue("Form", "main");
doc.appendItemValue("subject", "Calendar entry");
RichTextItem body = doc.createRichTextItem("body");
// Get entry and put in body of document
String uid = session.getEnvironmentString("currentuid");
if (uid != null) {
NotesCalendar cal = session.getCalendar(maildb);
body.appendText("Calendar entry for UID " + uid + "¥n");
body.appendText(cal.getEntry(uid).read());
} else {
body.appendText("Current UID not set");
}
doc.save(true, true);
} catch(Exception e) {
e.printStackTrace();
}
}
}