Wednesday, 21 September 2011

Create Lotus Notes form dynamically

In order to create Lotus Notes form dynamically, you can use following code:

  DxlImporter dxl = session.createDxlImporter();
  dxl.setReplaceDbProperties(true); 
  dxl.setDesignImportOption(DxlImporter.DXLIMPORTOPTION_CREATE); 
  dxl.setInputValidationOption(DxlImporter.DXLVALIDATIONOPTION_VALIDATE_ALWAYS);
  try {
    String xml = "Output of DxlExporter which is modified by removing \r\n";
    lotus.domino.Stream stream = s.createStream();
    stream.writeText(xml);
    dxl.importDxl(stream, database);
  } catch (Exception e) {
    logger.error("", e);
  }
  logger.info(dxl.getLog()); // Use this line to view error log from DxlImporter

No comments:

Post a Comment