getEntry (NotesCalendar - Java)

カレンダーエントリを取得します。

定義位置

NotesCalendar

構文

NotesCalendarEntry NotesCalendar.getEntry(String uid)
	throws NotesException
パラメータ 説明
uid エントリの iCalendar 識別子 (UID アイテム)
戻り値 説明
NotesCalendarEntry カレンダーエントリ。このメソッドでは、識別子が正しくない場合でも例外は発生しません。ただし、返された NotesCalendarEntry オブジェクトを使用しようとすると、例外「エントリが索引に見つかりません」が発生します。

使用法

このメソッドは uid については、存在するかどうかのみを検査します。返された NotesCalendarEntry オブジェクトを使用しようとすると、妥当性検査が行われ、エラーが報告されます。

例

このエージェントは、環境変数として保存された 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();
       }
   }
}

クロスリファレンス

LotusScript® NotesCalendar クラスの GetEntry メソッド