use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class AbstractDesignBase method appendItemValueNode.
/*
* Helper
*/
private final void appendItemValueNode(final XMLNode node, final Object value) {
XMLNode child;
if (value instanceof Number) {
// $NON-NLS-1$
child = node.addChildElement("number");
} else {
// $NON-NLS-1$
child = node.addChildElement("text");
}
child.setText(String.valueOf(value));
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class FormField method getFieldType.
// DXL uses the "keyword" field type for several field types, so it's more convenient to make a new faux
// attribute to handle referring to the field type like a human might
@Override
public Type getFieldType() {
// $NON-NLS-1$
String type = node_.getAttribute("type");
if (type.equals("keyword")) {
// $NON-NLS-1$
XMLNode keywords = this.getKeywordsNode();
// $NON-NLS-1$
String ui = keywords.getAttribute("ui");
if (ui.equals("checkbox")) {
// $NON-NLS-1$
return Type.CHECKBOX;
} else if (ui.equals("radiobutton")) {
// $NON-NLS-1$
return Type.RADIOBUTTON;
} else if (ui.equals("combobox")) {
// $NON-NLS-1$
return Type.COMBOBOX;
} else {
return Type.DIALOGLIST;
}
} else {
return Type.valueOf(type.toUpperCase());
}
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class FormField method createDefaultValueFormulaNode.
private XMLNode createDefaultValueFormulaNode() {
// $NON-NLS-1$
XMLNode node = node_.addChildElement("code");
// $NON-NLS-1$ //$NON-NLS-2$
node.setAttribute("event", "defaultvalue");
// $NON-NLS-1$
node = node.addChildElement("formula");
return node;
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class IconNote method setJsExpiry.
@Override
public void setJsExpiry(final int days) {
// $NON-NLS-1$
XMLNode node = getDxlNode("/note/item[@name='$JSExpires']");
if (days > Integer.MIN_VALUE) {
if (node == null) {
// $NON-NLS-1$ //$NON-NLS-2$
node = getDxlNode("/note").addChildElement("item");
// $NON-NLS-1$
node.setAttribute("name", DbProperties.LAUNCH_XPAGE_ON_SERVER.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 setEnhancedHTML.
@Override
public void setEnhancedHTML(final boolean enabled) {
// $NON-NLS-1$ //$NON-NLS-2$
XMLNode node = getDxlNode("/note/item[@name='" + DbProperties.ENHANCED_HTML.getPropertyName() + "']");
if (enabled) {
if (node == null) {
// $NON-NLS-1$ //$NON-NLS-2$
node = getDxlNode("/note").addChildElement("item");
// $NON-NLS-1$
node.setAttribute("name", DbProperties.ENHANCED_HTML.getPropertyName());
// $NON-NLS-1$ //$NON-NLS-2$
node.addChildElement("text").setTextContent("1");
}
} else {
if (node != null) {
node.getParentNode().removeChild(node);
}
}
}
Aggregations