Package org.openntf.domino

Examples of org.openntf.domino.DxlImporter


    return getAncestorDatabase().getAncestorSession();
  }

  @Override
  public boolean save() {
    DxlImporter importer = null;
    try {
      importer = getAncestorSession().createDxlImporter();
      importer.setDesignImportOption(DxlImporter.DesignImportOption.REPLACE_ELSE_CREATE);
      importer.setReplicaRequiredForReplaceOrUpdate(false);
      Database database = getAncestorDatabase();

      importer.importDxl(getDxl().getXml(), database);

      noteId_ = importer.getFirstImportedNoteID();

      // Reset the DXL so that it can pick up new noteinfo
      Document document = database.getDocumentByID(noteId_);
      DxlExporter exporter = getAncestorSession().createDxlExporter();
      exporter.setForceNoteFormat(true);
      exporter.setOutputDOCTYPE(false);
      loadDxl(exporter.exportDxl(document));
    } catch (IOException e) {
      DominoUtils.handleException(e);
      if (importer != null) {
        System.out.println(importer.getLog());
      }
      return false;
    }
    return true;
  }
View Full Code Here


    } else if (create) {
      try {
        InputStream is = AboutDocument.class.getResourceAsStream("/org/openntf/domino/design/impl/dxl_helpaboutdocument.xml");
        String dxl = StreamUtil.readString(is);
        is.close();
        DxlImporter importer = getAncestorSession().createDxlImporter();
        importer.setDesignImportOption(DxlImporter.DesignImportOption.REPLACE_ELSE_CREATE);
        importer.setReplicaRequiredForReplaceOrUpdate(false);
        importer.importDxl(dxl, database_);
        doc = database_.getDocumentByID(ABOUT_NOTE);
        return new AboutDocument(doc);
      } catch (IOException e) {
        DominoUtils.handleException(e);
      }
View Full Code Here

    } else if (create) {
      try {
        InputStream is = AboutDocument.class.getResourceAsStream("/org/openntf/domino/design/impl/dxl_helpusingdocument.xml");
        String dxl = StreamUtil.readString(is);
        is.close();
        DxlImporter importer = getAncestorSession().createDxlImporter();
        importer.setDesignImportOption(DxlImporter.DesignImportOption.REPLACE_ELSE_CREATE);
        importer.setReplicaRequiredForReplaceOrUpdate(false);
        importer.importDxl(dxl, database_);
        doc = database_.getDocumentByID(USING_NOTE);
        return new UsingDocument(doc);
      } catch (IOException e) {
        DominoUtils.handleException(e);
      }
View Full Code Here

  }

  @Override
  public boolean save() {

    DxlImporter importer = getAncestorSession().createDxlImporter();
    importer.setDesignImportOption(DxlImporter.DesignImportOption.REPLACE_ELSE_CREATE);
    importer.setReplicaRequiredForReplaceOrUpdate(false);
    Database database = getAncestorDatabase();
    try {
      importer.importDxl(getDxl().getXml(), database);
    } catch (IOException e) {
      DominoUtils.handleException(e);
      return false;
    }
    noteId_ = importer.getFirstImportedNoteID();

    // Reset the DXL so that it can pick up new noteinfo
    Document document = database.getDocumentByID(noteId_);
    loadDxl(document.generateXML());
View Full Code Here

TOP

Related Classes of org.openntf.domino.DxlImporter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.