use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class Subform method getExplicitSubforms.
/* (non-Javadoc)
* @see org.openntf.domino.design.AnyFormOrSubform#getExplicitSubforms()
*/
@Override
public List<String> getExplicitSubforms() {
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.getAttribute("name"));
}
}
return subforms;
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class Subform method getExplicitSubformsRecursive.
/* (non-Javadoc)
* @see org.openntf.domino.design.AnyFormOrSubform#getExplicitSubformsRecursive(java.util.List)
*/
@Override
public List<String> getExplicitSubformsRecursive(final List<String> existingList) {
Database db = getAncestorDatabase();
DatabaseDesign dbDesign = db.getDesign();
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)) {
if (!existingList.contains(name)) {
// $NON-NLS-1$
existingList.add(node.getAttribute("name"));
org.openntf.domino.design.Subform sf = dbDesign.getSubform(name);
existingList.addAll(sf.getExplicitSubformsRecursive(subforms));
}
}
}
return existingList;
}
use of org.openntf.domino.utils.xml.XMLNode in project org.openntf.domino by OpenNTF.
the class IconNote method setLaunchXPageRunOnServer.
@Override
public void setLaunchXPageRunOnServer(final boolean enabled) {
// $NON-NLS-1$ //$NON-NLS-2$
XMLNode node = getDxlNode("/note/item[@name='" + DbProperties.LAUNCH_XPAGE_ON_SERVER.getPropertyName() + "']");
if (enabled) {
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 setFileExpiry.
@Override
public void setFileExpiry(final int days) {
// $NON-NLS-1$
XMLNode node = getDxlNode("/note/item[@name='$FileExpires']");
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 setImageExpiry.
@Override
public void setImageExpiry(final int days) {
// $NON-NLS-1$
XMLNode node = getDxlNode("/note/item[@name='$ImageExpires']");
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);
}
}
}
Aggregations