Package org.openntf.domino.utils.xml

Examples of org.openntf.domino.utils.xml.XMLNode


    node_.setAttribute("lookupeachchar", String.valueOf(lookUpEachChar));
  }

  @Override
  public String getDefaultValueFormula() {
    XMLNode node = this.getDefaultValueFormulaNode();
    if (node != null) {
      return node.getText();
    }
    return "";
  }
View Full Code Here


  }

  @Override
  public void setDefaultValueFormula(final String defaultValueFormula) {
    // DXL is not happy with empty default value nodes, so delete when empty
    XMLNode node = this.getDefaultValueFormulaNode();
    if (defaultValueFormula == null || defaultValueFormula.length() == 0) {
      if (node != null) {
        node_.removeChild(node.getParentNode());
      }
    } else {
      if (node == null) {
        if (defaultValueFormula == null || defaultValueFormula.length() == 0) {
          return;
        }
        node = this.createDefaultValueFormulaNode();
      }
      node.setText(defaultValueFormula);
    }
  }
View Full Code Here

  // attribute to handle referring to the field type like a human might
  @Override
  public Type getFieldType() {
    String type = node_.getAttribute("type");
    if (type.equals("keyword")) {
      XMLNode keywords = this.getKeywordsNode();
      String ui = keywords.getAttribute("ui");
      if (ui.equals("checkbox")) {
        return Type.CHECKBOX;
      } else if (ui.equals("radiobutton")) {
        return Type.RADIOBUTTON;
      } else if (ui.equals("combobox")) {
View Full Code Here

      case CHECKBOX:
      case COMBOBOX:
      case DIALOGLIST:
      case RADIOBUTTON:
        node_.setAttribute("type", "keyword");
        XMLNode keywords = this.getKeywordsNode();
        keywords.setAttribute("ui", fieldType.toString().toLowerCase());
        keywords.setAttribute("helperbutton", String.valueOf(fieldType.name().equals("dialoglist")));
        if (keywords.getAttribute("columns").length() == 0) {
          keywords.setAttribute("columns", "1");
        }
        break;
      default:
        node_.setAttribute("type", fieldType.toString().toLowerCase());
        if (fieldType == Type.PASSWORD) {
View Full Code Here

  /* ******************************************************************************************
   * Internal utility methods
   ********************************************************************************************/
  private XMLNode getKeywordsNode() {
    XMLNode node = node_.selectSingleNode("keywords");

    if (node == null) {
      node = node_.addChildElement("keywords");
    }
    return node;
View Full Code Here

    }
    return node;
  }

  private XMLNode getDefaultValueFormulaNode() {
    XMLNode node = node_.selectSingleNode("code[@event='defaultvalue']");

    if (node == null) {
      return null;
    } else {
      node = node.selectSingleNode("formula");
    }
    return node;
  }
View Full Code Here

    }
    return node;
  }

  private XMLNode createDefaultValueFormulaNode() {
    XMLNode node = node_.addChildElement("code");
    node.setAttribute("event", "defaultvalue");
    node = node.addChildElement("formula");
    return node;
  }
View Full Code Here

    getDxlNode("/note/item[@name='$TITLE']/text").setTextContent(name);
  }

  @Override
  public void setDASMode(final DASMode mode) {
    XMLNode node = getDxlNode("/note/item[@name='$AllowRESTDbAPI']");
    if (node == null) {
      node = getDxlNode("/note").addChildElement("item");
      node.setAttribute("name", "AllowRESTDbAPI");
      node = node.addChildElement("number");
    }
    switch (mode) {
    case NONE:
      node.setTextContent("0");
      break;
    case VIEWS:
      node.setTextContent("1");
      break;
    case VIEWSANDDOCUMENTS:
      node.setTextContent("2");
      break;
    }
  }
View Full Code Here

    }
  }

  @Override
  public DASMode getDASMode() {
    XMLNode node = getDxlNode("/note/item[name='$AllowRESTDbAPI']/number");
    if (node == null) {
      return DASMode.NONE;
    } else {
      if ("1".equals(node.getText())) {
        return DASMode.VIEWS;
      } else if ("2".equals(node.getText())) {
        return DASMode.VIEWSANDDOCUMENTS;
      } else {
        return DASMode.NONE;
      }
    }
View Full Code Here

   */
  @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");
    }
View Full Code Here

TOP

Related Classes of org.openntf.domino.utils.xml.XMLNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.