Examples: getProfileDocument method

This agent gets the profile document for the current user based on the "Author Profile" form.

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();
      Document doc = db.getProfileDocument
      ("Author Profile", session.getUserName());
      String who = doc.getItemValueString("Who");
      String email = doc.getItemValueString("Email");
      String phone = doc.getItemValueString("Phone");
      System.out.println("Who: " + who);
      System.out.println("Email: " + email);
      System.out.println("Phone: " + phone);
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}