JAVA/CORBA CLASSES


Examples: send method and IsSaveMessageOnSend, IsSigned, and SignerVerifier properties
This agent sends an encrypted, saved, and signed message.

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();
   }
 }
}

See Also