Package com.dotcms.repackage.org.dom4j

Examples of com.dotcms.repackage.org.dom4j.Element


    for (int i = 0; i < orderedChildrenNames.length; i++) {
      elements.addAll(parent.elements(orderedChildrenNames[i]));
    }

    for (int i = 0; i < elements.size(); i++) {
      Element el = (Element)elements.get(i);
      el.detach();
      parent.add(el);
    }
  }
View Full Code Here


    SAXReader reader = new SAXReader();
    reader.setEntityResolver(null);

    Document doc = reader.read(new StringReader(xml));

    Element root = doc.getRootElement();

    int timeout = GetterUtil.getInteger(PropsUtil.get(PropsUtil.SESSION_TIMEOUT));

    Element sessionConfig = root.element("session-config");

    if (sessionConfig != null) {
      String sessionTimeout = sessionConfig.elementText("session-timeout");

      timeout = GetterUtil.get(sessionConfig.elementText("session-timeout"), timeout);
    }

    PropsUtil.set(PropsUtil.SESSION_TIMEOUT, Integer.toString(timeout));
  }
View Full Code Here

        try {
          SAXReader reader = new SAXReader();

          Document doc = reader.read(portalLog4jUrl);

          Element root = doc.getRootElement();

          Iterator itr = root.elements("category").iterator();

          while (itr.hasNext()) {
            Element category = (Element)itr.next();

            String name = category.attributeValue("name");
            String priority =
              category.element(
                "priority").attributeValue("value");

            Logger logger = Logger.getLogger(name);

            logger.setLevel(Level.toLevel(priority));
View Full Code Here

  public String[] getRootChildrenOrder() {
    return _ROOT_ORDERED_CHILDREN;
  }

  private int _compare(Object obj1, Object obj2) {
    Element el1 = (Element)obj1;
    Element el2 = (Element)obj2;

    String el1Name = el1.getName();
    String el2Name = el2.getName();

    if (!el1Name.equals(el2Name)) {
      return el1Name.compareTo(el2Name);
    }

    String el1Text = el1.getTextTrim();
    String el2Text = el2.getTextTrim();

    if (!el1Text.equals(el2Text)) {
      return el1Text.compareTo(el2Text);
    }
View Full Code Here

    else if (el1Children.size() > el2Children.size()) {
      return 1;
    }

    for (int i = 0; i < el1Children.size(); i++) {
      Element el = (Element)el1Children.get(i);

      int value = _contains(el2Children, el, new ElementComparator());

      if (value != 0) {
        return value;
View Full Code Here

TOP

Related Classes of com.dotcms.repackage.org.dom4j.Element

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.