Package com.dotcms.repackage.org.dom4j

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


    Document doc = reader.read(new File("classes/META-INF/ejb-jar.xml"));

    Iterator itr = doc.getRootElement().element("enterprise-beans").elements("session").iterator();

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

      sb.append("\t<jonas-session>\n");
      sb.append("\t\t<ejb-name>").append(entity.elementText("ejb-name")).append("</ejb-name>\n");

      if (entity.elementText("display-name").endsWith("LocalManagerEJB")) {
        sb.append("\t\t<jndi-name>ejb/liferay/").append(entity.elementText("display-name")).append("Home</jndi-name>\n");
      }
      else {
        sb.append("\t\t<jndi-name>").append(entity.elementText("ejb-name")).append("</jndi-name>\n");
      }

      sb.append("\t</jonas-session>\n");
    }
View Full Code Here


    Document doc = reader.read(new File("classes/META-INF/ejb-jar.xml"));

    Iterator itr = doc.getRootElement().element("enterprise-beans").elements("session").iterator();

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

      sb.append("\t\t<session>\n");
      sb.append("\t\t\t<ejb-name>").append(entity.elementText("ejb-name")).append("</ejb-name>\n");

      if (entity.elementText("display-name").endsWith("LocalManagerEJB")) {
        sb.append("\t\t\t<local-jndi-name>ejb/liferay/").append(entity.elementText("display-name")).append("Home</local-jndi-name>\n");
      }
      else {
        sb.append("\t\t\t<jndi-name>").append(entity.elementText("ejb-name")).append("</jndi-name>\n");
      }

      sb.append("\t\t\t<cluster-home>false</cluster-home>\n");
      sb.append("\t\t\t<cluster-object>false</cluster-object>\n");
      sb.append("\t\t\t<timeout>3000</timeout>\n");
View Full Code Here

    Document doc = reader.read(new File("classes/META-INF/ejb-jar.xml"));

    Iterator itr = doc.getRootElement().element("enterprise-beans").elements("session").iterator();

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

      sb.append("\t\t<ejb>\n");
      sb.append("\t\t\t<name>").append(entity.elementText("ejb-name")).append("</name>\n");
      sb.append("\t\t\t<max-pool-size>40</max-pool-size>\n");
      sb.append("\t\t\t<min-pool-size>20</min-pool-size>\n");
      sb.append("\t\t\t<enable-freepool>false</enable-freepool>\n");
      sb.append("\t\t\t<pool-waittimeout-millis>60000</pool-waittimeout-millis>\n");

      sb.append("\t\t\t<low-activity-interval>20</low-activity-interval>\n");
      sb.append("\t\t\t<is-secure>false</is-secure>\n");
      sb.append("\t\t\t<is-clustered>true</is-clustered>\n");

      if (entity.elementText("display-name").endsWith("LocalManagerEJB")) {
        sb.append("\t\t\t<jndi-name>ejb/liferay/").append(entity.elementText("display-name")).append("Home</jndi-name>\n");
      }
      else {
        sb.append("\t\t\t<jndi-name>").append(entity.elementText("ejb-name")).append("</jndi-name>\n");
      }

      sb.append("\t\t\t<local-jndi-name>").append(entity.elementText("ejb-name")).append("__PRAMATI_LOCAL").append("</local-jndi-name>\n");

      sb.append(_buildPramatiXMLRefs(entity));

      sb.append("\t\t</ejb>\n");
    }
View Full Code Here

    Map preferences = prefs.getPreferences();

    try {
      Document doc = new SAXReader().read(new StringReader(xml));

      Element root = doc.getRootElement();

      Iterator itr1 = root.elements("preference").iterator();

      while (itr1.hasNext()) {
        Element prefEl = (Element)itr1.next();

        String name = prefEl.elementTextTrim("name");

        List values = new ArrayList();

        Iterator itr2 = prefEl.elements("value").iterator();

        while (itr2.hasNext()) {
          Element valueEl = (Element)itr2.next();

          /*if (valueEl.nodeCount() <= 0) {
            values.add(valueEl.getText());
          }
          else {
            values.add(valueEl.node(0).asXML());
          }*/

          values.add(valueEl.getTextTrim());
        }

        boolean readOnly =
          GetterUtil.get(prefEl.elementText("read-only"), false);

View Full Code Here

    StringBuffer sb = new StringBuffer();

    Iterator itr = entity.elements("ejb-local-ref").iterator();

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

      sb.append("\t\t\t<ejb-local-ref>\n");
      sb.append("\t\t\t\t<ejb-ref-name>").append(ejbRef.elementText("ejb-ref-name")).append("</ejb-ref-name>\n");
      sb.append("\t\t\t\t<ejb-link>").append(ejbRef.elementText("ejb-ref-name")).append("__PRAMATI_LOCAL").append("</ejb-link>\n");
      sb.append("\t\t\t</ejb-local-ref>\n");
    }

    return sb.toString();
  }
View Full Code Here

    Document doc = reader.read(new File("classes/META-INF/ejb-jar.xml"));

    Iterator itr = doc.getRootElement().element("enterprise-beans").elements("session").iterator();

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

      sb.append("\t\t<session>\n");
      sb.append("\t\t\t<ejb-name>").append(entity.elementText("ejb-name")).append("</ejb-name>\n");

      if (entity.elementText("display-name").endsWith("LocalManagerEJB")) {
        sb.append("\t\t\t<local-jndi-name>ejb/liferay/").append(entity.elementText("display-name")).append("Home</local-jndi-name>\n");
      }
      else {
        sb.append("\t\t\t<jndi-name>").append(entity.elementText("ejb-name")).append("</jndi-name>\n");
      }

      sb.append("\t\t\t<clustered>true</clustered>\n");
      sb.append("\t\t\t<pool-size>20</pool-size>\n");
      sb.append("\t\t\t<cache-size>20</cache-size>\n");
View Full Code Here

    Document doc = reader.read(new File("classes/META-INF/ejb-jar.xml"));

    Iterator itr = doc.getRootElement().element("enterprise-beans").elements("session").iterator();

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

      sb.append("\t\t<ejb>\n");
      sb.append("\t\t\t<ejb-name>").append(entity.elementText("ejb-name")).append("</ejb-name>\n");

      if (entity.elementText("display-name").endsWith("LocalManagerEJB")) {
        sb.append("\t\t\t<jndi-name>ejb/liferay/").append(entity.elementText("display-name")).append("Home</jndi-name>\n");
      }
      else {
        sb.append("\t\t\t<jndi-name>").append(entity.elementText("ejb-name")).append("</jndi-name>\n");
      }

      sb.append("\t\t\t<bean-pool>\n");
      sb.append("\t\t\t\t<steady-pool-size>0</steady-pool-size>\n");
      sb.append("\t\t\t\t<resize-quantity>60</resize-quantity>\n");
View Full Code Here

    try {
      Map preferences = prefs.getPreferences();

      DocumentFactory docFactory = DocumentFactory.getInstance();

      Element portletPreferences =
        docFactory.createElement("portlet-preferences");

      Iterator itr = preferences.entrySet().iterator();

      while (itr.hasNext()) {
        Map.Entry entry = (Map.Entry)itr.next();

        Preference preference = (Preference)entry.getValue();

        Element prefEl = docFactory.createElement("preference");

        Element nameEl = docFactory.createElement("name");
        nameEl.addText(preference.getName());

        prefEl.add(nameEl);

        String[] values = preference.getValues();

        for (int i = 0; i < values.length; i++) {
          Element valueEl = docFactory.createElement("value");
          valueEl.addText(values[i]);

          prefEl.add(valueEl);
        }

        if (preference.isReadOnly()) {
          Element valueEl = docFactory.createElement("read-only");
          valueEl.addText("true");
        }

        portletPreferences.add(prefEl);
      }
View Full Code Here

    Document doc = reader.read(new File("classes/META-INF/ejb-jar.xml"));

    Iterator itr = doc.getRootElement().element("enterprise-beans").elements("session").iterator();

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

      sb.append("\t<weblogic-enterprise-bean>\n");
      sb.append("\t\t<ejb-name>").append(entity.elementText("ejb-name")).append("</ejb-name>\n");

      if (entity.elementText("display-name").endsWith("LocalManagerEJB")) {
        sb.append("\t\t<local-jndi-name>ejb/liferay/").append(entity.elementText("display-name")).append("Home</local-jndi-name>\n");
      }
      else {
        sb.append("\t\t<jndi-name>").append(entity.elementText("ejb-name")).append("</jndi-name>\n");
      }

      sb.append("\t</weblogic-enterprise-bean>\n");
    }
View Full Code Here

    int ejbLocalRefCount = 0;

    Iterator itr1 = doc.getRootElement().element("enterprise-beans").elements("session").iterator();

    while (itr1.hasNext()) {
      Element sessionEl = (Element)itr1.next();

      sb.append("\t<ejbBindings xmi:id=\"Session_").append(++sessionCount).append("_Bnd\" jndiName=\"");

      if (sessionEl.elementText("display-name").endsWith("LocalManagerEJB")) {
        sb.append("ejb/liferay/").append(sessionEl.elementText("display-name")).append("Home");
      }
      else {
        sb.append(sessionEl.elementText("ejb-name"));
      }

      sb.append("\">\n");

      sb.append("\t\t<enterpriseBean xmi:type=\"com.ibm.etools.ejb:Session\" href=\"META-INF/ejb-jar.xml#Session_").append(sessionCount).append("\" />\n");

      Iterator itr2 = sessionEl.elements("ejb-local-ref").iterator();

      while (itr2.hasNext()) {
        Element ejbLocalRefEl = (Element)itr2.next();

        sb.append("\t\t<ejbRefBindings xmi:id=\"EjbRefBinding_").append(++ejbLocalRefCount).append("\" jndiName=\"").append(ejbLocalRefEl.elementText("ejb-ref-name")).append("\">\n");
        sb.append("\t\t\t<bindingEjbRef xmi:type=\"com.ibm.etools.j2ee.common:EJBLocalRef\" href=\"META-INF/ejb-jar.xml#EjbRef_").append(ejbLocalRefCount).append("\" />\n");
        sb.append("\t\t</ejbRefBindings>\n");
      }

      sb.append("\t</ejbBindings>\n");
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.