例: SelectHelpIndex property (NoteCollection - Java™)

次のエージェントはヘルプ索引文書で構成される文書コレクションをビルドします。

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();
      
      // Open DXL file named after current database
      Stream stream = session.createStream();
      String filename = "c:¥¥dxl¥¥";
      filename = filename + db.getFileName();
      filename = filename.substring(0, filename.length() - 3) + "dxl";
      if (stream.open(filename)) {
        System.out.println("Opened " + filename);
        stream.truncate();
        
        // Create note collection
        NoteCollection nc = db.createNoteCollection(false);
        nc.setSelectHelpIndex(true);
        nc.buildCollection();
        
        // Export note collection as DXL
        DxlExporter exporter = session.createDxlExporter();
        String output = exporter.exportDxl(nc);
        stream.writeText(output);
        stream.close();
      }
      else {
        System.out.println("Cannot open " + filename);
      }

    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}