Examples: createFromTemplate method

This agent creates a new database from the discussion template.

import lotus.domino.*;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext = 
          session.getAgentContext();
      // (Your code goes here) 
      Database template = session.getDatabase(null,
      "discsw50.ntf");
      Database newdb = template.createFromTemplate
      (null, "suggest", true);
      newdb.setTitle("Suggestions for Giving Campaign");
      newdb.grantAccess("-Default-", ACL.LEVEL_READER);
      System.out.println("\"Suggestions for Giving 
      Campagn\" created");
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}