.

HCLSoftware Business Partner
Domino Consulting Services
CRUCIAL Notes Tools
+1 212-599-2048

Domino Consulting Services
CRUCIAL Notes Tools
Domino administration
Notes development

Facebook Twitter YouTube
Chat now       
.
ProductsDownloadsNewsAbout usContact


Need a Domino Consultant? Call NotesMail +1 212-599-2048 - HCLSoftware Business Partner

JAVA/CORBA CLASSES


Examples: IsOnServer property
This agent gets names.nsf from the user's mail server if the program is running on a server, and from the local Domino data directory otherwise.

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;
     if (session.isOnServer()) {
       String ms = session.getEnvironmentString("MailServer",
         true);
       db = session.getDatabase(ms, "names.nsf"); }
     else {
       db = session.getDatabase(null, "names.nsf"); }
     System.out.println("Title of names.nsf: \""
     + db.getTitle() + "\"");
   } catch(Exception e) {
     e.printStackTrace();
   }
 }
}

See Also