JAVA/CORBA クラス


例:NotesURL プロパティ
次のエージェントは、現在のエージェントの Lotus Notes と HTTP URL を取得します。Lotus Notes (HTTP URL は空白) または HTTP プロトコルのどちらのアクセスを使用しているかによって表示が変わります。

import lotus.domino.*;
import java.io.PrintWriter;

public class JavaAgent extends AgentBase {

public void NotesMain() {

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

// (Your code goes here)
Agent agent = agentContext.getCurrentAgent();

// Get URLs
String notesURL = agent.getNotesURL();
String httpURL = agent.getHttpURL();

// Assume local if http is blank and print info for notes
if (httpURL.length() == 0) {
System.out.println("NotesURL = " + notesURL);
System.out.println("Http URL = None");
}

// If http exists print info for both assuming output to browser
else {
PrintWriter pw = getAgentOutput();
pw.println("NotesURL = " + notesURL);
pw.println("<BR>HttpURL = " + httpURL);
}

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

関連項目