JAVA/CORBA CLASSES


Examples: getChild and getNextSibling methods
This agent gets the first document sorted by the key "Internet" and all its response documents to two levels.

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("Internet");
     System.out.println
     ("Project name: " + doc.getItemValueString("Subject"));
     Document response = view.getChild(doc);
     Document rtor;
     while (response != null) {
       System.out.println
       ("\t" + response.getItemValueString("Subject"));
       rtor = view.getChild(response);
       while (rtor != null) {
         System.out.println
         ("\t\t" + rtor.getItemValueString("Subject"));
         rtor = view.getNextSibling(rtor); }
       response = view.getNextSibling(response); }
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also