例: renderToRTItem method

次のエージェントは、文書の画像を別文書内に入れて送信します。

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.search("Subject = 
                   ¥"Test appendItemValue¥"");
      if (dc.getCount() == 1) {
        Document doc = dc.getFirstDocument();
        Document memo = db.createDocument();
        memo.appendItemValue("Form", "Memo");
        memo.appendItemValue("Subject", 
                   "Picture of Test appendItemValue");
        RichTextItem rti = memo.createRichTextItem("Body");
        memo.save();
        doc.renderToRTItem(rti);
        memo.send(session.getUserName()); }
      } catch(NotesException e) {
      System.out.println(e.id + " " + e.text);
      e.printStackTrace();
    }
  }
}