例: IsIncludeFormulas property

次のエージェントは、複製に複製式が含まれるかどうかを切り替えます。

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

    try {
      Session session = getSession();
      AgentContext agentContext = session.getAgentContext();

      // (Your code goes here) 
      String server = "Server1/East/Acme";
      String database = "test¥¥DatabaseJava";
      String AnyServer = "-";
      Database db = session.getDatabase(server, database);
      if (db.isOpen()) {
        Replication rep = db.getReplicationInfo();
        ReplicationEntry re = rep.getEntry(AnyServer, AnyServer, false);
        if (re != null) {
          if (re.isIncludeFormulas())
            re.setIncludeFormulas(false);
          else
            re.setIncludeFormulas(true);
          re.save();
          System.out.println(
            "IsIncludeFormulas = " + re.isIncludeFormulas());
        }
        else
          System.out.println("Entry does not exist");
      }
      else
        System.out.println(
          "Can't get " + database + " on " + server);

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