use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class AbstractFolder method setAllowDAS.
public void setAllowDAS(final boolean allowDAS) {
XMLNode node = getDxlNode("//item[@name='$WebFlags']/text");
if (node == null) {
node = getDxl().getDocumentElement().addChildElement("item");
node.setAttribute("name", "$WebFlags");
node = node.addChildElement("text");
}
if (allowDAS) {
if (!node.getText().contains("A")) {
node.setText(node.getText() + "A");
}
} else {
if (node.getText().contains("A")) {
node.setText(node.getText().replace("A", ""));
}
}
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class AbstractFolder method getOnRefreshUISetting.
@Override
public OnRefreshType getOnRefreshUISetting() {
XMLNode viewNode = getDxl().selectSingleNode("/view");
String value = viewNode.getAttribute("onrefresh");
for (OnRefreshType type : OnRefreshType.values()) {
if (type.getPropertyName().equals(value)) {
return type;
}
}
return null;
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class AbstractFolder method addColumn.
/*
* (non-Javadoc)
*
* @see org.openntf.domino.design.DesignColumnList#addColumn()
*/
@Override
public DesignColumn addColumn() {
// Create the column node and set the defaults
// Make sure to add the node before any items
XMLNode node;
XMLNode item = getDxl().selectSingleNode("//item");
if (item != null) {
node = getDocumentElement().insertChildElementBefore("column", item);
} else {
node = getDocumentElement().addChildElement("column");
}
node.setAttribute("hidedetailrows", "false");
node.setAttribute("width", "10");
node.setAttribute("resizable", "true");
node.setAttribute("separatemultiplevalues", "false");
node.setAttribute("sortnoaccent", "false");
node.setAttribute("sortnocase", "true");
node.setAttribute("showaslinks", "false");
return new DesignColumn(node);
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class AbstractFolder method setOnRefreshUISetting.
@Override
public void setOnRefreshUISetting(final OnRefreshType onRefreshUISetting) {
XMLNode viewNode = getDxl().selectSingleNode("/view");
viewNode.setAttribute("onrefresh", onRefreshUISetting.getPropertyName());
}
use of org.openntf.domino.utils.xml.XMLNode 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