Examples: Created, LastAccessed, and LastModified properties

This agent gets the creation, last accessed, and last modified dates for all documents in a database.

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();
      DocumentCollection dc = db.getAllDocuments();
      Document doc = dc.getFirstDocument();
      while (doc != null) {
        System.out.println(doc.getItemValueString("Subject"));
        System.out.println("\tCreated on " +
        doc.getCreated().getLocalTime());
        System.out.println("\tLast accessed on " +
        doc.getLastAccessed().getLocalTime());
        System.out.println("\tLast modified on " +
        doc.getLastModified().getLocalTime());
        doc = dc.getNextDocument(doc); }
  
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}