JAVA/CORBA CLASSES


Examples: Parent property
This agent demonstrates a function that gets the parent document of an item.

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();
     DocumentCollection dc = db.getAllDocuments();
     Document doc = dc.getFirstDocument();
     Item item = doc.getFirstItem("Subject");
     if (doc != null) parentdoc(item);
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
 public void parentdoc(Item i) {
   try {
     Document doc = i.getParent();
     if (doc.isResponse())
       System.out.println("Parent doc is a response
       document");
     else
       System.out.println("Parent doc is a main document");
   } catch (Exception e) {
     e.printStackTrace();
   }
 }
}

See Also