JAVA/CORBA クラス


例:unlock メソッド
次の例では、「Main」という名のフォームをロック解除しようとします。有効なユーザーがロック所有者である場合、ロック解除は成功します。

import lotus.domino.*;

public class JavaAgent extends AgentBase {

public void NotesMain() {

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

// (Your code goes here)
Database db = agentContext.getCurrentDatabase();

// Design locking must be enabled
if (db.isDesignLockingEnabled()) {
// Get form and unlock
// Not unlocked if exception thrown
Form form = db.getForm("Main");
form.unlock();
System.out.println("Form unlocked");
}
else
System.out.println("Design locking not enabled");

} catch(NotesException e) {
System.out.println(e.id + "Form not unlocked");

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

関連項目