use of org.openntf.domino.DxlExporter in project org.openntf.domino by OpenNTF.
the class DatabaseDesign method loadDatabaseXml.
private void loadDatabaseXml() {
DxlExporter exporter = getAncestorSession().createDxlExporter();
exporter.setOutputDOCTYPE(false);
NoteCollection nc = database_.createNoteCollection(false);
nc.setSelectAcl(true);
nc.setSelectIcon(true);
nc.buildCollection();
String xml = exporter.exportDxl(nc);
databaseXml = loadDxl(xml);
}
use of org.openntf.domino.DxlExporter in project org.openntf.domino by OpenNTF.
the class Database method isDesignProtected.
public boolean isDesignProtected() {
if (designProtected_ == null) {
Document iconNote = getDocumentByID(org.openntf.domino.design.impl.DatabaseDesign.ICON_NOTE);
designProtected_ = Boolean.FALSE;
try {
if (iconNote != null) {
DxlExporter exporter = getAncestorSession().createDxlExporter();
exporter.exportDxl(iconNote);
}
} catch (OpenNTFNotesException e) {
designProtected_ = Boolean.TRUE;
}
}
return designProtected_.booleanValue();
}
use of org.openntf.domino.DxlExporter in project org.openntf.domino by OpenNTF.
the class AbstractDesignBase method getDxl.
protected final XMLDocument getDxl() {
if (dxl_ == null) {
DxlExporter exporter = getAncestorSession().createDxlExporter();
exporter.setOutputDOCTYPE(false);
exporter.setForceNoteFormat(enforceRawFormat());
// TODO: You will get an exporter error, if the design is protected. This should be handled correctly
String xml = doExport(exporter);
loadDxl(xml);
if (dxl_ == null) {
// $NON-NLS-1$
throw new IllegalStateException(getClass().getSimpleName() + ": Could not load DXL");
}
XMLNode docRoot = getDocumentElement();
if (docRoot.getNodeName() == "note") {
// $NON-NLS-1$
if (!enforceRawFormat()) {
throw new UnsupportedOperationException(// $NON-NLS-1$
getClass().getSimpleName() + ": got note in RAW format. this was not expected. NoteID " + // $NON-NLS-1$
(document_ == null ? "" : document_.getNoteID()));
}
dxlFormat_ = DxlFormat.RAWNOTE;
} else {
if (enforceRawFormat()) {
throw new UnsupportedOperationException(// $NON-NLS-1$
getClass().getSimpleName() + ": Raw format was enforced, but we got a " + docRoot.getNodeName());
}
dxlFormat_ = DxlFormat.DXL;
}
}
return dxl_;
}
Aggregations