JAVA/CORBA CLASSES
import lotus.domino.*; import java.util.Vector; 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("All Documents"); Vector v; String s, tabs; DateTime dt; Double d; Document doc = view.getFirstDocument(); while (doc != null) { v = doc.getColumnValues(); tabs = ""; for (int i=0; i<v.size(); i++) { if (v.elementAt(i).getClass().getName().endsWith("String")) s = (String)v.elementAt(i); else if (v.elementAt(i).getClass().getName().endsWith("DateTime")) { dt = (DateTime)v.elementAt(i); s = dt.getLocalTime(); } else if (v.elementAt(i).getClass().getName().endsWith("Double")) { d = (Double)v.elementAt(i); s = d.toString(); } else s = "not String, DateTime, or Double"; if (s.length() == 0) s = "*no value*"; System.out.println(tabs + s); tabs = tabs + "\t"; } doc = view.getNextDocument(doc); } } catch(Exception e) { e.printStackTrace(); } } }
See Also