次のエージェントは、現在のデータベースのカテゴリを出力します。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();
String title = db.getTitle();
String cat = db.getCategories();
if (cat != "")
System.out.println("Database ¥"" +
title + "¥" has the categories: " + cat);
else
System.out.println("Database ¥"" +
title + "¥" has no categories");
} catch(Exception e) {
e.printStackTrace();
}
}
}