Package org.openntf.domino.utils.xml

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


      /* (non-Javadoc)
       * @see org.openntf.domino.design.FacesConfig.ManagedBean.Property#setMapEntries(java.util.Map)
       */
      public void setMapEntries(final Map<?, ?> mapEntries) {
        XMLNode mapEntriesNode = node_.selectSingleNode("map-entries");
        if (mapEntriesNode != null) {
          node_.removeChild(mapEntriesNode);
        }
        mapEntriesNode = node_.addChildElement("map-entries");
        for (Map.Entry<?, ?> entry : mapEntries.entrySet()) {
          XMLNode entryNode = mapEntriesNode.addChildElement("map-entry");
          XMLNode keyNode = entryNode.addChildElement("key");
          keyNode.setText(String.valueOf(entry.getKey()));
          if (entry.getValue() == null) {
            entryNode.addChildElement("null-value");
          } else {
            XMLNode valueNode = entryNode.addChildElement("value");
            valueNode.setText(String.valueOf(entry.getValue()));
          }
        }

        // Clear out any value or list-entries, as they're mutually incompatible with map-entries
        XMLNode value = node_.selectSingleNode("value");
        if (value != null) {
          node_.removeChild(value);
        }
        XMLNode listEntries = node_.selectSingleNode("list-entries");
        if (listEntries != null) {
          node_.removeChild(listEntries);
        }
      }
View Full Code Here


    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.Converter#getId()
     */
    public String getId() {
      XMLNode valueNode = node_.selectSingleNode("converter-id");
      if (valueNode == null) {
        return "";
      }
      return valueNode.getText();
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.Converter#setId(java.lang.String)
     */
    public void setId(final String id) {
      XMLNode valueNode = node_.selectSingleNode("converter-id");
      if (valueNode == null) {
        valueNode = node_.addChildElement("converter-id");
      }
      valueNode.setText(id);
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.Converter#getClassName()
     */
    public String getClassName() {
      XMLNode valueNode = node_.selectSingleNode("converter-class");
      if (valueNode == null) {
        return "";
      }
      return valueNode.getText();
    }
View Full Code Here

    /* (non-Javadoc)
     * @see org.openntf.domino.design.FacesConfig.Converter#setClassName(java.lang.String)
     */
    public void setClassName(final String className) {
      XMLNode valueNode = node_.selectSingleNode("converter-class");
      if (valueNode == null) {
        valueNode = node_.addChildElement("converter-class");
      }
      valueNode.setText(className);
    }
View Full Code Here

public class DXLItemRaw extends AbstractDXLItem {
  private static final long serialVersionUID = 1L;

  protected static DXLItemRaw create(final XMLNode node, final int dupItemId) {
    XMLNode rawitemdata = node.selectSingleNode("rawitemdata");
    int typeCode = Integer.parseInt(rawitemdata.getAttribute("type"), 16);
    Type type = Type.valueOf(typeCode);

    switch (type) {
    case COMPOSITE:
      return new DXLItemComposite(node, dupItemId);
View Full Code Here

  private byte[] data_;

  protected DXLItemRaw(final XMLNode node, final int dupItemId) {
    super(node, dupItemId);

    XMLNode rawitemdata = node.selectSingleNode("rawitemdata");
    int typeCode = Integer.parseInt(rawitemdata.getAttribute("type"), 16);
    type_ = Type.valueOf(typeCode);

    String rawData = rawitemdata.getText();
    data_ = parseBase64Binary(rawData);
  }
View Full Code Here

  private final byte[] value_;

  protected DXLItemObjectFile(final XMLNode node, final int dupItemId) {
    super(node, dupItemId);

    XMLNode objectNode = node.getFirstChildElement();
    XMLNode fileNode = objectNode.getFirstChildElement();

    hostType_ = HostType.valueOf(fileNode.getAttribute("hosttype").toUpperCase());
    compressionType_ = CompressionType.valueOf(fileNode.getAttribute("compression").toUpperCase());
    encoding_ = fileNode.getAttribute("encoding");
    fileName_ = fileNode.getAttribute("name");
    fileSize_ = Long.parseLong(fileNode.getAttribute("size"), 10);

    flags_ = EnumSet.noneOf(Flag.class);
    for (String flag : fileNode.getAttribute("flags").split("[,\\s]")) {
      flags_.add(Flag.valueOf(flag.toUpperCase()));
    }

    XMLNode createdNode = fileNode.selectSingleNode("./created/datetime");
    fileCreated_ = DXLItemFactory.createDateTime(createdNode).toDate();
    XMLNode modifiedNode = fileNode.selectSingleNode("./modified/datetime");
    fileModified_ = DXLItemFactory.createDateTime(modifiedNode).toDate();

    value_ = parseBase64Binary(fileNode.selectSingleNode("./filedata").getText());
  }
View Full Code Here

      DominoUtils.handleException(e);
    }
  }

  public String getSelectionFormula() {
    XMLNode formula = getDxl().selectSingleNode("/view/code[@event='selection']/formula");
    if (formula != null) {
      return formula.getText();
    }
    return null;
  }
View Full Code Here

    }
    return null;
  }

  public void setSelectionFormula(final String selectionFormula) {
    XMLNode formula = getDxl().selectSingleNode("/view/code[@event='selection']/formula");
    if (formula != null) {
      formula.setTextContent(selectionFormula);
    }
  }
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.