JAVA/CORBA CLASSES


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

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 view = db.getView("All Documents");
     ViewColumn vc = view.getColumn(1);
     String fmtString = null;
     if (vc.getTimeZoneFmt() == ViewColumn.FMT_ALWAYS) {
       vc.setTimeZoneFmt(ViewColumn.FMT_NEVER);
       fmtString = "Never";
     }
     else if (vc.getTimeZoneFmt() == ViewColumn.FMT_NEVER) {
       vc.setTimeZoneFmt(ViewColumn.FMT_SOMETIMES);
       fmtString = "Sometimes";
     }
     else {
       vc.setTimeZoneFmt(ViewColumn.FMT_ALWAYS);
       fmtString = "Always";
     }
     System.out.println("Time zone format = " + fmtString);
       
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also