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(); View view = db.getView("By Category"); ViewEntryCollection vec = view.getAllEntriesByKey("Category 1"); DocumentCollection dc = view.getAllDocumentsByKey("Category 1"); System.out.println("Number of entries = " + vec.getCount()); Document doc = view.getFirstDocument(); while (doc != null) { ViewEntry entry = vec.getEntry(doc); System.out.println("Entry is at position " + entry.getPosition('.')); doc = view.getNextDocument(doc); } } catch(NotesException e) { System.out.println(e.id + " " + e.text); e.printStackTrace(); } } }
See Also