JAVA/CORBA CLASSES


Examples: Formula, isField, isFormula, ItemName, and Position properties
For each column in the "By Category" view of the current database, this agent prints the column formula or the column item name, depending on how the column is calculated.

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 Category");
     System.out.println("\"By Category\" view");
     Vector columns = view.getColumns();
     String colAction = null;
     for (int i=0; i<columns.size(); i++) {
       ViewColumn column  = (ViewColumn)columns.elementAt(i);
       String vtitle = column.getTitle();
       if (vtitle.equals("")) vtitle = "No title";
       System.out.println("\n" + column.getPosition() +
       "  " + vtitle);
       if (column.isFormula())
         colAction = column.getFormula();
       else if (column.isField())
         colAction = column.getItemName();
       System.out.println(colAction); }
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also