次のエージェントは、暗号化され、保存され、署名されたメッセージを送信します。
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.search("Subject =
¥"Test appendItemValue¥"");
if (dc.getCount() == 1) {
Document doc = dc.getFirstDocument();
Document memo = db.createDocument();
memo.appendItemValue("Form", "Memo");
memo.appendItemValue
("Subject", "Test - please reply if you get this");
RichTextItem rti = memo.createRichTextItem("Body");
doc.renderToRTItem(rti);
Vector v = new Vector();
v.addElement(session.getUserName());
v.addElement("Kyla Annavajhala");
v.addElement("Lakshmi McKay");
v.addElement("Evelyn Town");
memo.setEncryptOnSend(true);
memo.setSaveMessageOnSend(true);
memo.setSignOnSend(true);
memo.sign();
memo.send(true, v); }
} catch(Exception e) {
e.printStackTrace();
}
}
}