Package org.openntf.domino.utils.xml

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


   *
   * @see org.openntf.domino.types.Design#getUniversalID()
   */
  @Override
  public String getUniversalID() {
    XMLNode node = getDxl().selectSingleNode("//noteinfo");
    if (node != null) {
      return node.getAttribute("unid");
    }
    return "";
  }
View Full Code Here


  protected String getFlags() {
    return getFlagsNode().getText();
  }

  protected void addFlag(final String flag) {
    XMLNode flagsNode = getFlagsNode();
    String flags = flagsNode.getText();
    if (!flags.contains(flag)) {
      flagsNode.setText(flags + flag);
    }
  }
View Full Code Here

      flagsNode.setText(flags + flag);
    }
  }

  protected void removeFlag(final String flag) {
    XMLNode flagsNode = getFlagsNode();
    String flags = flagsNode.getText();
    if (flags.contains(flag)) {
      // Assume this works for now
      flagsNode.setText(flags.replace(flag, ""));
    }
  }
View Full Code Here

      flagsNode.setText(flags.replace(flag, ""));
    }
  }

  protected XMLNode getFlagsNode() {
    XMLNode flagsNode = getDxl().selectSingleNode("//item[@name='$Flags']/text");
    if (flagsNode != null) {
      return flagsNode;
    } else {
      // Better add one!
      flagsNode = getDocumentElement().addChildElement("item");
      flagsNode.setAttribute("name", "$Flags");
      flagsNode = flagsNode.addChildElement("text");
      return flagsNode;
    }
  }
View Full Code Here

  protected String getFlagsExt() {
    return getFlagsExtNode().getText();
  }

  protected void addFlagExt(final String flag) {
    XMLNode flagsNode = getFlagsExtNode();
    String flags = flagsNode.getText();
    if (!flags.contains(flag)) {
      flagsNode.setText(flags + flag);
    }
  }
View Full Code Here

      flagsNode.setText(flags + flag);
    }
  }

  protected void removeFlagExt(final String flag) {
    XMLNode flagsNode = getFlagsExtNode();
    String flags = flagsNode.getText();
    if (flags.contains(flag)) {
      // Assume this works for now
      flagsNode.setText(flags.replace(flag, ""));
    }
  }
View Full Code Here

      flagsNode.setText(flags.replace(flag, ""));
    }
  }

  protected XMLNode getFlagsExtNode() {
    XMLNode flagsNode = getDxl().selectSingleNode("//item[@name='$FlagExt']/text");
    if (flagsNode != null) {
      return flagsNode;
    } else {
      // Better add one!
      flagsNode = getDocumentElement().addChildElement("item");
      flagsNode.setAttribute("name", "$FlagsExt");
      flagsNode = flagsNode.addChildElement("text");
      return flagsNode;
    }
  }
View Full Code Here

    return result;
  }

  private void setTitles(final Iterable<String> titles) {
    // Clear out existing titles
    XMLNode titleNode = getTitleNode();
    titleNode.getParentNode().removeChild(titleNode);

    // Now re-add them
    titleNode = getTitleNode();
    XMLNode listNode = titleNode.addChildElement("textlist");
    for (String title : titles) {
      XMLNode text = listNode.addChildElement("text");
      text.setText(title);
    }
  }
View Full Code Here

      text.setText(title);
    }
  }

  private XMLNode getTitleNode() {
    XMLNode titleNode = getDxl().selectSingleNode("//item[@name='$TITLE']");
    if (titleNode == null) {
      titleNode = getDocumentElement().addChildElement("item");
      titleNode.setAttribute("name", "$TITLE");
    }
    return titleNode;
  }
View Full Code Here

    return new FormFieldList(this, "//field");
  }

  @Override
  public FormField addField() {
    XMLNode body = getDxl().selectSingleNode("/form/body/richtext");

    // Create an appropriate paragraph definition
    XMLNode finalPardef = getDxl().selectSingleNode("//pardef[last()]");
    int nextId = Integer.valueOf(finalPardef.getAttribute("id")) + 1;
    XMLNode pardef = body.addChildElement("pardef");
    pardef.setAttribute("id", String.valueOf(nextId));
    pardef.setAttribute("hide", "notes web mobile");

    // Now create the par and the field
    XMLNode par = body.addChildElement("par");
    par.setAttribute("def", pardef.getAttribute("id"));

    // Now add the field
    XMLNode field = par.addChildElement("field");
    field.setAttribute("kind", "editable");
    field.setAttribute("name", "");
    field.setAttribute("type", "text");

    return new FormField(field);
  }
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.