Package org.dom4j

Examples of org.dom4j.Document.selectSingleNode()


                            pluginLoader.addURLFile(classes.getAbsoluteFile().toURL());
                        }
                    }
                }

                String className = pluginXML.selectSingleNode("/plugin/class").getText().trim();
                plugin = (Plugin)pluginLoader.loadClass(className).newInstance();
                if (parentPluginNode != null) {
                    String parentPlugin = parentPluginNode.getTextTrim();
                    // See if the parent is already loaded.
                    if (plugins.containsKey(parentPlugin)) {
View Full Code Here


                Thread.currentThread().setContextClassLoader(pluginLoader);
                plugin.initializePlugin(this, pluginDir);
                Thread.currentThread().setContextClassLoader(oldLoader);

                // If there a <adminconsole> section defined, register it.
                Element adminElement = (Element)pluginXML.selectSingleNode("/plugin/adminconsole");
                if (adminElement != null) {
                    Element appName = (Element)adminElement.selectSingleNode(
                        "/plugin/adminconsole/global/appname");
                    if (appName != null) {
                        // Set the plugin name so that the proper i18n String can be loaded.
View Full Code Here

            File pluginConfig = new File(pluginDir, "plugin.xml");
            if (pluginConfig.exists()) {
                SAXReader saxReader = new SAXReader();
                saxReader.setEncoding("UTF-8");
                Document pluginXML = saxReader.read(pluginConfig);
                Element element = (Element)pluginXML.selectSingleNode(xpath);
                if (element != null) {
                    return element.getTextTrim();
                }
            }
        }
View Full Code Here

     * @throws Exception if an error occurs when parsing the XML or adding it to the model.
     */
    public static void addModel(String name, InputStream in) throws Exception {
        SAXReader saxReader = new SAXReader();
        Document doc = saxReader.read(in);
        addModel(name, (Element)doc.selectSingleNode("/adminconsole"));
    }

    /**
     * Adds an &lt;adminconsole&gt; Element to the tabs/sidebar model.
     *
 
View Full Code Here

            return;
        }
        try {
            SAXReader saxReader = new SAXReader();
            Document doc = saxReader.read(in);
            coreModel = (Element)doc.selectSingleNode("/adminconsole");
        }
        catch (Exception e) {
            Log.error("Failure when parsing main admin-sidebar.xml file", e);
        }
        try {
View Full Code Here

            final String xml2 = sw.toString();
            try {
                doc = DocumentHelper.parseText(xml2);
                for (final String s : keyStorageId.keySet()) {
                    final String stoId = keyStorageId.get(s);
                    final Element sel = (Element) doc
                            .selectSingleNode("/ob:Openbravo/MaterialMgmtStorageDetail[@id="
                                    + stoId + "]");
                    sel.element("quantityOnHand").setText(
                            keyUnits.get(s).toString());
                }
View Full Code Here

                fax = locationList.elementText("fax");
                locationId = locationList.element("locationAddress")
                        .attributeValue("id");
                // Get Location info

                final Element locEle = (Element) doc2
                        .selectSingleNode("/ob:Openbravo/Location[id='"
                                + locationId + "']");
                postal = locEle.elementText("postal");
                address1 = locEle.elementText("address1");
                address2 = locEle.elementText("address2");
View Full Code Here

    }
    else if ("get".equals(type))
    {
      if (locale != null)
      {
        Element e = (Element) document.selectSingleNode("//String[@id='"
            + idstr + "']");
        if (e == null)
        {
          return "";
        }
View Full Code Here

      catch (DocumentException e)
      {
        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      Element e = (Element) document.selectSingleNode("//String[@id='"
          + localeid + "']/locales");
      Element localeElement = (Element) e.selectSingleNode("/locale[@code='"
          + locale.toString() + "']");
      String value = (String) mapAddValue.get("value");
      String reason = (String) mapAddValue.get("reason");
View Full Code Here

        // TODO Auto-generated catch block
        e.printStackTrace();
      }
      String serchstr = "//String[@id='" + idstr
          + "']/locales/locale[@code='" + locale.toString() + "']";
      Element e = (Element) document.selectSingleNode(serchstr);
      List list = e.elements();
      if (list.size() < isug)
      {
        return;
      }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.