Examples: abstractText method

This agent generates an abstract of an item.

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();
      DocumentCollection dc = db.getAllDocuments();
      Document doc = dc.getFirstDocument();
      if (doc != null) {
        System.out.println(" Subject: " +
        doc.getItemValueString("Subject"));
        System.out.println(" Body summary: " +
        doc.getFirstItem("Body").abstractText(80, true, true));
        doc = dc.getNextDocument();
        }
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}