JAVA/CORBA CLASSES


Examples: TimeDateFmt property
This agent toggles the time-date format.

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.getTimeDateFmt() == ViewColumn.FMT_DATE) {
       vc.setTimeDateFmt(ViewColumn.FMT_DATETIME);
       fmtString = "Date, time";
     }
     else if (vc.getTimeDateFmt() == ViewColumn.FMT_DATETIME) {
       vc.setTimeDateFmt(ViewColumn.FMT_TIME);
       fmtString = "Time";
     }
     else if (vc.getTimeDateFmt() == ViewColumn.FMT_TIME) {
       vc.setTimeDateFmt(ViewColumn.FMT_TODAYTIME);
       fmtString = "Today, time";
     }
     else {
       vc.setTimeDateFmt(ViewColumn.FMT_DATE);
       fmtString = "Date";
     }
     System.out.println("Time format = " + fmtString);
       
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also