Examples: addEntry, createEntry, and save methods, OutlineEntry FrameText, ImagesText, setNamedElement properties

  1. This agent creates an entry as a subentry to the first entry in an outline.
    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();
                Outline outline = db.getOutline("DiscOutline");
                System.out.println(
                     "Creating entry ... Some Documents ...");
                OutlineEntry entry = outline.createEntry(
                                "Some Documents",outline.getFirst(),
                                 true,false);
                entry.setNamedElement(db, "Database", 
                       OutlineEntry.OUTLINE_CLASS_DATABASE); 
                entry.setFrameText("NotesView"); 
                entry.setImagesText("Domino\\icons\\abook.gif"); 
                entry.setLabel("Some Documents");
                outline.save();
               } catch(Exception e) {
                      e.printStackTrace();
                }
         }
    }
  2. This example creates a copy of the first entry in the "Some Documents" outline. The entry is then added to the outline after the second entry at the top level.
    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();
                Outline outline = db.getOutline("Some Documents");
                OutlineEntry entryA = outline.getFirst();
                OutlineEntry entryB = outline.getNext(entryA);
                outline.createEntry(entryA,entryB,true,false);
                outline.save();    
            } catch(Exception e) {
                e.printStackTrace();
            }
        }
    }