Search in sources :

Example 26 with XMLNode

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));
}
Also used : XMLNode(org.openntf.domino.utils.xml.XMLNode)

Example 27 with XMLNode

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());
    }
}
Also used : XMLNode(org.openntf.domino.utils.xml.XMLNode)

Example 28 with XMLNode

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;
}
Also used : XMLNode(org.openntf.domino.utils.xml.XMLNode)

Example 29 with XMLNode

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);
        }
    }
}
Also used : XMLNode(org.openntf.domino.utils.xml.XMLNode)

Example 30 with XMLNode

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);
        }
    }
}
Also used : XMLNode(org.openntf.domino.utils.xml.XMLNode)

Aggregations

XMLNode (org.openntf.domino.utils.xml.XMLNode)35 ArrayList (java.util.ArrayList)7 XMLNodeList (org.openntf.domino.utils.xml.XMLNodeList)3 CDResourceFile (org.openntf.domino.nsfdata.structs.obj.CDResourceFile)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Database (org.openntf.domino.Database)1 DxlExporter (org.openntf.domino.DxlExporter)1 DatabaseDesign (org.openntf.domino.design.DatabaseDesign)1 FormField (org.openntf.domino.design.FormField)1 OpenNTFNotesException (org.openntf.domino.exceptions.OpenNTFNotesException)1 CData (org.openntf.domino.nsfdata.structs.cd.CData)1 CDObject (org.openntf.domino.nsfdata.structs.obj.CDObject)1 CDResourceEvent (org.openntf.domino.nsfdata.structs.obj.CDResourceEvent)1