JAVA/CORBA CLASSES


Examples: createViewNavFromDescendants method
This agent gets all the entries that are descendants of the first entry under "category 2."

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");
     Document doc = view.getDocumentByKey("category 2");
     ViewNavigator nav =
       view.createViewNavFromDescendants(doc);
     int n = 0;
     String t = null;
     ViewEntry entry = nav.getFirst();
     while (entry != null) {
       n++;
       if (entry.isCategory()) t = "category";
       else if (entry.isDocument()) t = "document";
       else if (entry.isTotal()) t = "total";
       System.out.println("Entry #" + n + " is a " + t);
       entry = nav.getNext(); }
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also