次のエージェントは、各ビューの名前と別名を表示します。import lotus.domino.*;
import java.util.Vector;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Database db = agentContext.getCurrentDatabase();
Vector views = db.getViews();
for (int i=0; i<views.size(); i++) {
View view = (View)views.elementAt(i);
Vector aliases = view.getAliases();
if (aliases.size() == 0)
System.out.println
(view.getName() + " has no aliases");
else if (aliases.size() == 1)
System.out.println
(view.getName() + " has 1 alias");
else
System.out.println
(view.getName() + " has " +
aliases.size() + " aliases");
for (int j=0; j<aliases.size(); j++)
System.out.println
("¥t" + aliases.elementAt(j)); }
} catch(Exception e) {
e.printStackTrace();
}
}
}