Package org.dom4j

Examples of org.dom4j.Element.element()


            // Find all <servlet> entries to discover name to class mapping.
            List classes = doc.selectNodes("//servlet");
            Map<String, Class> classMap = new HashMap<String, Class>();
            for (int i = 0; i < classes.size(); i++) {
                Element servletElement = (Element)classes.get(i);
                String name = servletElement.element("servlet-name").getTextTrim();
                String className = servletElement.element("servlet-class").getTextTrim();
                classMap.put(name, finder.loadClass(className, component));
            }
            // Find all <servelt-mapping> entries to discover name to URL mapping.
            List names = doc.selectNodes("//servlet-mapping");
View Full Code Here


            List classes = doc.selectNodes("//servlet");
            Map<String, Class> classMap = new HashMap<String, Class>();
            for (int i = 0; i < classes.size(); i++) {
                Element servletElement = (Element)classes.get(i);
                String name = servletElement.element("servlet-name").getTextTrim();
                String className = servletElement.element("servlet-class").getTextTrim();
                classMap.put(name, finder.loadClass(className, component));
            }
            // Find all <servelt-mapping> entries to discover name to URL mapping.
            List names = doc.selectNodes("//servlet-mapping");
            for (int i = 0; i < names.size(); i++) {
View Full Code Here

            }
            // Find all <servelt-mapping> entries to discover name to URL mapping.
            List names = doc.selectNodes("//servlet-mapping");
            for (int i = 0; i < names.size(); i++) {
                Element nameElement = (Element)names.get(i);
                String name = nameElement.element("servlet-name").getTextTrim();
                String url = nameElement.element("url-pattern").getTextTrim();
                // Register the servlet for the URL.
                Class servletClass = classMap.get(name);
                Object instance = servletClass.newInstance();
                if (instance instanceof HttpServlet) {
View Full Code Here

            // Find all <servelt-mapping> entries to discover name to URL mapping.
            List names = doc.selectNodes("//servlet-mapping");
            for (int i = 0; i < names.size(); i++) {
                Element nameElement = (Element)names.get(i);
                String name = nameElement.element("servlet-name").getTextTrim();
                String url = nameElement.element("url-pattern").getTextTrim();
                // Register the servlet for the URL.
                Class servletClass = classMap.get(name);
                Object instance = servletClass.newInstance();
                if (instance instanceof HttpServlet) {
                    // Initialize the servlet then add it to the map..
View Full Code Here

            Document doc = saxReader.read(webXML);
            // Find all <servelt-mapping> entries to discover name to URL mapping.
            List names = doc.selectNodes("//servlet-mapping");
            for (int i = 0; i < names.size(); i++) {
                Element nameElement = (Element)names.get(i);
                String url = nameElement.element("url-pattern").getTextTrim();
                // Destroy the servlet than remove from servlets map.
                HttpServlet servlet = servlets.get(pluginName + url);
                servlet.destroy();
                servlets.remove(pluginName + url);
                servlet = null;
View Full Code Here

    result.setName(root.elementText("name"))
    result.setTitle(root.elementText("title"));
    result.setVersion(root.elementText("version"));
    result.setDescription(root.elementText("description"));
    result.setWebsite(root.elementText("website"));
    if (root.element("entry-point-class") != null) {
      result.setEntryPointClass(StringUtils.strip(
          root.elementText("entry-point-class")));
    }
    if (root.element("plugin-config-url") != null) {
      result.setConfigURL(StringUtils.strip(
View Full Code Here

    result.setWebsite(root.elementText("website"));
    if (root.element("entry-point-class") != null) {
      result.setEntryPointClass(StringUtils.strip(
          root.elementText("entry-point-class")));
    }
    if (root.element("plugin-config-url") != null) {
      result.setConfigURL(StringUtils.strip(
          root.elementText("plugin-config-url")));
    }
    StringBuffer header = new StringBuffer();
    if (root.element("header-javascript") != null) {
View Full Code Here

    if (root.element("plugin-config-url") != null) {
      result.setConfigURL(StringUtils.strip(
          root.elementText("plugin-config-url")));
    }
    StringBuffer header = new StringBuffer();
    if (root.element("header-javascript") != null) {
      for (Element e : (List<Element>)root.elements("header-javascript")) {
        header.append("<script type=\"text/javascript\" src=\"/file/plugins/")
          .append(result.getName()).append("/").append(e.getText())
          .append("\"></script>\n");
      }
View Full Code Here

        header.append("<script type=\"text/javascript\" src=\"/file/plugins/")
          .append(result.getName()).append("/").append(e.getText())
          .append("\"></script>\n");
      }
    }
    if (root.element("header-css") != null) {
      for (Element e : (List<Element>)root.elements("header-css")) {
        header.append("<link rel=\"stylesheet\" type=\"text/css\" href=\"/file/plugins/")
          .append(result.getName()).append("/").append(e.getText())
          .append("\"/>\n");
      }
View Full Code Here

          .append(result.getName()).append("/").append(e.getText())
          .append("\"/>\n");
      }
    }
    result.setPageHeader(header.toString());
    if (root.element("config") != null) {
      result.setConfigStructure(root.element("config").asXML());
    }
    return result;
  }
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.