例: ItemName property

次のスクリプトは、ビューのすべての列のプログラム名を取得します。

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();
      View view = db.getView("All Documents");
      Vector columns = view.getColumns();
      for (int i = 0; i < columns.size(); i++) {
        ViewColumn column = (ViewColumn)columns.elementAt(i);
        String itemName = column.getItemName();
        if (itemName.length() == 0) itemName = "<No item name>";
        System.out.println(
          "Position " + column.getPosition() + ": " + itemName);
      }
        
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}