Examples: markAllUnread method (View - Java)

This agent displays number of read documents in the view before and after marking them all unread.

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("All");
      ViewEntryCollection vec = view.getAllReadDocuments();
      System.out.println("View has " +
      vec.getCount() + " read entries");     
      view.markAllUnread();
      view.refresh();
      vec = view.getAllReadDocuments();
      System.out.println("View has " +
      vec.getCount() + " read entries after markAllUnread");    


    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}