JAVA/CORBA CLASSES


Examples: getEntry method
This agent gets all the entries in a view entry collection associated with documents in a document collection.

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");
     view.setAutoUpdate(false);
     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