use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class IconNote method setDisableViewExport.
@Override
public void setDisableViewExport(final boolean enabled) {
// $NON-NLS-1$ //$NON-NLS-2$
XMLNode node = getDxlNode("/note/item[@name='" + DbProperties.NO_EXPORT_VIEW.getPropertyName() + "']");
if (enabled) {
if (node == null) {
// $NON-NLS-1$ //$NON-NLS-2$
node = getDxlNode("/note").addChildElement("item");
// $NON-NLS-1$
node.setAttribute("name", DbProperties.NO_EXPORT_VIEW.getPropertyName());
// $NON-NLS-1$ //$NON-NLS-2$
node.addChildElement("text").setTextContent("1");
}
} else {
if (node != null) {
node.getParentNode().removeChild(node);
}
}
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class IconNote method setBlockICAA.
@Override
public void setBlockICAA(final boolean enabled) {
// $NON-NLS-1$ //$NON-NLS-2$
XMLNode node = getDxlNode("/note/item[@name='" + DbProperties.BLOCK_ICAA.getPropertyName() + "']");
if (enabled) {
if (node == null) {
// $NON-NLS-1$ //$NON-NLS-2$
node = getDxlNode("/note").addChildElement("item");
// $NON-NLS-1$
node.setAttribute("name", DbProperties.BLOCK_ICAA.getPropertyName());
// $NON-NLS-1$ //$NON-NLS-2$
node.addChildElement("text").setTextContent("1");
}
} else {
if (node != null) {
node.getParentNode().removeChild(node);
}
}
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class Subform method getComputedSubforms.
/* (non-Javadoc)
* @see org.openntf.domino.design.AnyFormOrSubform#getComputedSubforms()
*/
@Override
public List<String> getComputedSubforms() {
XMLNodeList nodes = getSubformNodes();
ArrayList<String> subforms = new ArrayList<String>();
for (XMLNode node : nodes) {
// $NON-NLS-1$
String name = node.getAttribute("name");
if (Strings.isBlankString(name)) {
// $NON-NLS-1$
subforms.add(node.selectSingleNode("code[@event='value']/formula").getText());
}
}
return subforms;
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class Subform method addField.
@Override
public FormField addField() {
XMLNode body = getBody();
// Create an appropriate paragraph definition
// $NON-NLS-1$
XMLNode finalPardef = getDxl().selectSingleNode("//pardef[last()]");
// $NON-NLS-1$
int nextId = Integer.valueOf(finalPardef.getAttribute("id")) + 1;
// $NON-NLS-1$
XMLNode pardef = body.addChildElement("pardef");
// $NON-NLS-1$
pardef.setAttribute("id", String.valueOf(nextId));
// Now create the par and the field
// $NON-NLS-1$
XMLNode par = body.addChildElement("par");
// $NON-NLS-1$ //$NON-NLS-2$
par.setAttribute("def", pardef.getAttribute("id"));
// Now add the field
// $NON-NLS-1$
XMLNode field = par.addChildElement("field");
// $NON-NLS-1$ //$NON-NLS-2$
field.setAttribute("kind", "editable");
// $NON-NLS-1$ //$NON-NLS-2$
field.setAttribute("name", "");
// $NON-NLS-1$ //$NON-NLS-2$
field.setAttribute("type", "text");
return new org.openntf.domino.design.impl.FormField(field);
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class DesignColumn method setTitle.
@Override
public void setTitle(final String title) {
// $NON-NLS-1$
XMLNode columnHeader = node_.selectSingleNode("columnheader");
if (columnHeader == null) {
XMLNode firstChild = node_.getFirstChild();
if (firstChild != null) {
// $NON-NLS-1$
columnHeader = node_.insertChildElementBefore("columnheader", firstChild);
} else {
// $NON-NLS-1$
columnHeader = node_.addChildElement("columnheader");
}
}
// $NON-NLS-1$
columnHeader.setAttribute("title", title);
}
Aggregations