例: createView method

次のエージェントは、新しいビューを作成し、別のビューから 2 つの列をコピーして追加します。

import lotus.domino.*;

public class JavaAgent extends AgentBase {

  public void NotesMain() {

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

      // (Your code goes here) 
      Database db = agentContext.getCurrentDatabase();
      View viewAll = db.getView("All Documents");
      View viewTopics = db.createView("Topics", "SELECT @All");
      ViewColumn col1 = viewTopics.copyColumn(viewAll.getColumn(5), 1);
      System.out.println("Column " + 
        col1.getPosition() + " = " + col1.getTitle());
      ViewColumn col2 = viewTopics.copyColumn(viewAll.getColumn(1), 2);
      System.out.println("Column " + 
        col2.getPosition() + " = " + col2.getTitle());

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