JAVA/CORBA CLASSES


Examples: markRead method
This agent marks a document as read if the current user is one of the authors.

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("By Category");
     Document doc = view.getFirstDocument();
     while (doc != null) {
       if (!doc.isResponse()) {
         authors = doc.getAuthors();
         if (authors.contains(session.getUserName()))
           try {
           doc.markRead();
         } catch (NotesException e) {
           System.out.println(e.id + " " + e.text);
           break; } }
       doc = view.getNextDocument(doc); }
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also