JAVA/CORBA CLASSES
import lotus.domino.*; public class JavaAgent extends AgentBase { public void NotesMain() { try { Session session = getSession(); AgentContext agentContext = session.getAgentContext(); // (Your code goes here) DocumentCollection dc = agentContext.getUnprocessedDocuments(); Document doc = dc.getFirstDocument(); RichTextItem body = (RichTextItem)doc.getFirstItem("Body"); RichTextNavigator rtnav = body.createNavigator(); if (rtnav.findFirstElement(RichTextItem.RTELEM_TYPE_DOCLINK)) { RichTextDoclink rtlink = (RichTextDoclink)rtnav.getElement(); DbDirectory dbdir = session.getDbDirectory(""); Database db = dbdir.openDatabaseByReplicaID( rtlink.getDBReplicaID()); if (db.isOpen()) System.out.println(db.getTitle()); else System.out.println("Database has no local replica"); } else System.out.println("No doclinks in Body"); } catch(Exception e) { e.printStackTrace(); } } }
See Also