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();
View view = db.getView("By Category");
ViewNavigator nav = view.createViewNav();
System.out.println("Categories:");
ViewEntry tmpentry;
ViewEntry entry = nav.getFirst();
while (entry != null) {
if (entry.isCategory())
System.out.println
("¥tPosition " + entry.getPosition('.') +
" has " + entry.getDescendantCount() +
" descendants");
tmpentry = nav.getNext();
entry.recycle();
entry = tmpentry; }
} catch(Exception e) {
e.printStackTrace();
}
}
}
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();
View view = db.getView("By Category");
ViewEntryCollection vec = view.getAllEntries();
System.out.println("Documents:");
ViewEntry tmpentry;
ViewEntry entry = vec.getFirstEntry();
while (entry != null) {
System.out.println
("¥tPosition " + entry.getPosition('.') + "¥t" +
entry.getDocument().getItemValueString("Subject"));
tmpentry = vec.getNextEntry();
entry.recycle;
entry = tmpentry; }
} catch(Exception e) {
e.printStackTrace();
}
}
}