例: getReceivedItemText method

次のエージェントは、現在の文書の Received アイテムのテキストを表示します。

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) 
      DocumentCollection dc = agentContext.getUnprocessedDocuments();
      Document doc = dc.getFirstDocument();
      Vector received = doc.getReceivedItemText();
      if (received.size() > 0) {
        for (int i = 0; i < received.size(); i++) {
          System.out.println("***Received item " + (i + 1) + "***");
          System.out.println(received.elementAt(i) + "¥n");
        }
      }
      else
        System.out.println("No received items in document");

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