Examples: IsResponse property

This agent prints whether the "By Author" view of the current database contains a response-only column.

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("By Author");
      Vector columns = view.getColumns();
      ViewColumn column = null;
      boolean gotIt = false;
      for (int i=0; i<columns.size(); i++) {
        column = (ViewColumn)columns.elementAt(i);
        if (column.isResponse()) {
          gotIt = true; break; } }
        if (gotIt)
          System.out.println
          ("At least one response-only column");
        else
          System.out.println
          ("No response-only column");
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}