UID (NotesCalendarEntry - JavaScript)

読み取り専用。iCalendar 形式の、カレンダーエントリのグローバル固有識別子。

定義場所

NotesCalendarEntry

構文

getUID() : string

使用法

エントリを作成すると、次の形式で UID が生成されます。
UID:F0A3694E4E7E20938525790F004D370A-Lotus_Notes_Generated

このボタンイベントは、 現在のユーザーのメールデータベースの ($Calendar) ビューから、 文書の UNID を使用してカレンダーエントリを取得し、 その UID を sessionScope 変数に書き込みます。
// requestScope.calentry is bound to an edit box whose data is decimal, integer only
var n = Math.floor(requestScope.calentry);
var dbdir:NotesDbDirectory = session.getDbDirectory("");
var maildb:NotesDatabase = dbdir.openMailDatabase();
var calview:NotesView = maildb.getView("($Calendar)");
var caldoc:NotesDocument = calview.getNthDocument(n);
if (caldoc == null) {
	requestScope.status = "Calendar entry out of range";
	return;
}
var unid:string = caldoc.getUniversalID();
var cal:NotesCalendar = session.getCalendar(maildb);
var cale:NotesCalendarEntry = cal.getEntryByUNID(unid);
sessionScope.currentuid = cale.getUID();
requestScope.status = "Current entry is UID " + sessionScope.currentuid;

LotusScript® 構文と例

NotesCalendarEntry.UID As String
このエージェントは、 現在のユーザーのメールデータベースの ($Calendar) ビューから、 文書の UNID を使用してカレンダーエントリを取得し、 その UID を環境変数に書き込みます。
Sub Initialize
	Dim session As New NotesSession
	Dim maildb As New NotesDatabase("", "")
	Dim calview As NotesView
	Dim caldoc As NotesDocument
	Dim unid As String
	Dim cal As NotesCalendar
	Dim cale As NotesCalendarEntry
	Dim s As String
	Dim n As Long
	REM Get calendar for current user
	Call maildb.Openmail()
	Set cal = session.getCalendar(maildb)
	REM Get number of calendar entry
	s = InputBox("Enter an integer", "calentry", 1)
	If IsNumeric(s) Then
		n = Clng(s)
	Else
		MessageBox "Not numeric: " & s,, "Error"
		Exit sub
	End If
	REM Get calendar entry and post UID to environment variable
	Set calview = maildb.Getview("($Calendar)")
	Set caldoc = calview.Getnthdocument(n)
	If caldoc Is Nothing Then
		MessageBox "Calendar entry out of range",, "Error"
		Exit sub
	Else
		unid = caldoc.Universalid
		Set cale = cal.Getentrybyunid(unid)
		Call session.Setenvironmentvar("currentuid", cale.Uid)
	End If
End Sub

Java™ 構文と例

String NotesCalendarEntry.getUID()
このエージェントは、 現在のユーザーのメールデータベースの ($Calendar) ビューから、 文書の UNID を使用してカレンダーエントリを取得し、 その UID を環境変数に書き込みます。
import lotus.domino.*;

public class JavaAgent extends AgentBase {

    public void NotesMain() {

      try {
          Session session = getSession();
          AgentContext agentContext = session.getAgentContext();

          // (Your code goes here)
          Integer n = (Integer)session.getEnvironmentValue("calentry");
          DbDirectory dbdir = session.getDbDirectory("");
          Database maildb = dbdir.openMailDatabase();
          View calview = maildb.getView("($Calendar)");
          Document caldoc = calview.getNthDocument(n.intValue());
          if (caldoc == null) return;
          String unid = caldoc.getUniversalID();
          NotesCalendar cal = session.getCalendar(maildb);
          NotesCalendarEntry cale = cal.getEntryByUNID(unid);
          session.setEnvironmentVar("currentuid", cale.getUID());

      } catch(Exception e) {
          e.printStackTrace();
       }
   }
}