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) Database db = agentContext.getCurrentDatabase(); DocumentCollection dc = db.getAllDocuments(); int N = 3; printDocument(dc, N); } catch(Exception e) { e.printStackTrace(); } } void printDocument(DocumentCollection dc, int n) { try { if (n < 0 || n > dc.getCount()) System.out.println("N out of range"); else System.out.println("Doc #" + n + ": " + dc.getNthDocument(n).getItemValueString("Subject")); } catch(Exception e) { e.printStackTrace(); } } }
See Also