JAVA/CORBA クラス


例:embedObject メソッド
次のエージェントは、リッチテキストアイテムを作成し、添付ファイルを埋め込みます。

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();
     Document doc = db.createDocument();
     doc.replaceItemValue("Subject", "Attachment");
     RichTextItem body = doc.createRichTextItem("Body");
     body.appendText("Here is the attachment:");
     body.addNewLine(2);
     body.embedObject(EmbeddedObject.EMBED_ATTACHMENT,
     null, "c:\\notes\\notes.ini", "notesini");
     // Save the document
     doc.save(true, true);
   } catch(NotesException e) {
     System.out.println(e.id + " " + e.text);
     e.printStackTrace();
   }
 }
}

関連項目