import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
// Create a hierarchical name
Name nam = session.createName(
"CN=John B Goode/OU=Sales/OU=East/O=Acme/C=US");
// Returns:
// John B Goode
// John B Goode/Sales/East/Acme/US
// CN=John B Goode/OU=Sales/OU=East/O=Acme/C=US
System.out.println(nam.getCommon());
System.out.println(nam.getAbbreviated());
System.out.println(nam.getCanonical());
} catch(Exception e) {
e.printStackTrace();
}
}
}
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
// Create a hierarchical name
Name nam = session.createName(
"¥"John B Goode¥" <jbg@us.acme.com> (Guitars) (Music) (East)");
// Returns:
// "John B Goode"
// jbg@us.acme.com
// Guitars
// Music
// East
System.out.println(nam.getAddr822Phrase());
System.out.println(nam.getAddr821());
System.out.println(nam.getAddr822Comment1());
System.out.println(nam.getAddr822Comment2());
System.out.println(nam.getAddr822Comment3());
} catch(Exception e) {
e.printStackTrace();
}
}
}
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
// Get user name
Name nam = session.createName(session.getUserName());
// Display common, abbreviated, and canonical formats
System.out.println(nam.getCommon());
System.out.println(nam.getAbbreviated());
System.out.println(nam.getCanonical());
} catch(Exception e) {
e.printStackTrace();
}
}
}
import lotus.domino.*;
public class JavaAgent extends AgentBase {
public void NotesMain() {
try {
Session session = getSession();
AgentContext agentContext = session.getAgentContext();
// (Your code goes here)
Document doc = agentContext.getDocumentContext();
// Create NotesName from SendTo item
// We expect an Internet name
Name nam = session.createName(doc.getItemValueString("SendTo"));
// Display Addr821 name
System.out.println(nam.getAddr821());
} catch(Exception e) {
e.printStackTrace();
}
}
}