JAVA/CORBA CLASSES


Examples: TimeFmt property
This agent toggles the time format for a column.

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");
     ViewColumn vc = view.getColumn(1);
     String fmtString = null;
     if (vc.getTimeFmt() == ViewColumn.FMT_HMS) {
       vc.setTimeFmt(ViewColumn.FMT_HM);
       fmtString = "Hour, minute";
     }
     else if (vc.getTimeFmt() == ViewColumn.FMT_HM) {
       vc.setTimeFmt(ViewColumn.FMT_H);
       fmtString = "Hour";
     }
     else if (vc.getTimeFmt() == ViewColumn.FMT_H) {
       vc.setTimeFmt(ViewColumn.FMT_ALL);
       fmtString = "Hour, minute, second, hundreths";
     }
     else {
       vc.setTimeFmt(ViewColumn.FMT_HMS);
       fmtString = "Hour, minute, second";
     }
     System.out.println("Time format = " + fmtString);
       
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also