geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shiv...@apache.org
Subject svn commit: r654200 [1/2] - in /geronimo/server/trunk: framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/local/ plugins/console/console-portal-driver/src/main/webapp/WEB-INF/ plugins/j2ee/geronimo-j2ee-builder/...
Date Wed, 07 May 2008 18:17:29 GMT
Author: shivahr
Date: Wed May  7 11:17:09 2008
New Revision: 654200

URL: http://svn.apache.org/viewvc?rev=654200&view=rev
Log:
GERONIMO-3433 - Plan Creator for geronimo-application.xml - first of many patches.

Added:
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EARHandler.java   (with props)
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EjbHandler.java   (with props)
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/configData/
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/ejbPage.jsp   (with props)
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/enterpriseApp.jsp   (with props)
Modified:
    geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
    geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
    geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java
    geronimo/server/trunk/plugins/plancreator/plancreator-console-jetty/pom.xml
    geronimo/server/trunk/plugins/plancreator/plancreator-console-tomcat/pom.xml
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/pom.xml
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/AbstractHandler.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/CreatePlanPortlet.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DependenciesHandler.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DeployStatusHandler.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DisplayPlanHandler.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EnvironmentHandler.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/GetArchiveHandler.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR88_Util.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/ReferencesHandler.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/SecurityHandler.java
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/dependencies.jsp
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/deployStatus.jsp
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/environment.jsp
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/view/configcreator/references.jsp
    geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/webapp/WEB-INF/web.xml

Modified: geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java (original)
+++ geronimo/server/trunk/framework/modules/geronimo-deploy-jsr88/src/main/java/org/apache/geronimo/deployment/plugin/local/AbstractDeployCommand.java Wed May  7 11:17:09 2008
@@ -109,7 +109,7 @@
         }
     }
 
-    protected void doDeploy(Target target, boolean finished) throws Exception {
+    public void doDeploy(Target target, boolean finished) throws Exception {
         File[] args = {moduleArchive, deploymentPlan};
         massageFileNames(args);
         Object deployParams[] = new Object[] {Boolean.valueOf(commandContext.isInPlace()), args[0], args[1], target.getName()};

Modified: geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml (original)
+++ geronimo/server/trunk/plugins/console/console-portal-driver/src/main/webapp/WEB-INF/web.xml Wed May  7 11:17:09 2008
@@ -113,6 +113,21 @@
     </init-param>
   </servlet>
 
+  <!-- DWR for the plan creator portlets -->
+  <servlet>
+    <display-name>DWR Forward Servlet 5</display-name>
+    <servlet-name>dwr-forward5</servlet-name>
+    <servlet-class>org.apache.geronimo.console.servlet.ContextForwardServlet</servlet-class>
+    <init-param>
+       <param-name>servlet-path</param-name>
+       <param-value>/dwr5</param-value>
+    </init-param>
+    <init-param>
+       <param-name>context-path</param-name>
+       <param-value>/plan-creator</param-value>
+    </init-param>
+  </servlet>
+
   <servlet>
     <display-name>Generic Context Forward Servlet</display-name>
     <servlet-name>context-forward</servlet-name>
@@ -156,6 +171,11 @@
   </servlet-mapping>
 
   <servlet-mapping>
+    <servlet-name>dwr-forward5</servlet-name>
+    <url-pattern>/dwr5/*</url-pattern>
+  </servlet-mapping>
+
+  <servlet-mapping>
     <servlet-name>plutoPortalDriver</servlet-name>
     <url-pattern>/portal/*</url-pattern>
   </servlet-mapping>
@@ -217,6 +237,7 @@
       <url-pattern>/dwr2/*</url-pattern>
       <url-pattern>/dwr3/*</url-pattern>
       <url-pattern>/dwr4/*</url-pattern>
+      <url-pattern>/dwr5/*</url-pattern>
       <http-method>GET</http-method>
       <http-method>POST</http-method>
       <http-method>PUT</http-method>

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/EARConfigBuilder.java Wed May  7 11:17:09 2008
@@ -137,6 +137,20 @@
     private final Naming naming;
     private final Collection<? extends ArtifactResolver> artifactResolvers;
 
+    public static ThreadLocal<Boolean> createPlanMode = new ThreadLocal<Boolean>() {
+        @Override
+        protected Boolean initialValue() {
+            return Boolean.FALSE;
+        }
+    };
+
+    public static ThreadLocal<ApplicationInfo> appInfo = new ThreadLocal<ApplicationInfo>() {
+        @Override
+        protected ApplicationInfo initialValue() {
+            return (ApplicationInfo) null;
+        }
+    };
+
     public EARConfigBuilder(Environment defaultEnvironment,
             AbstractNameQuery transactionManagerAbstractName,
             AbstractNameQuery connectionTrackerAbstractName,
@@ -592,7 +606,16 @@
             ClassLoader cl = earContext.getClassLoader();
             for (Object module3 : modules) {
                 Module module = (Module) module3;
-                getBuilder(module).initContext(earContext, module, cl);
+                if (createPlanMode.get().booleanValue()) {
+                    try {
+                        getBuilder(module).initContext(earContext, module, cl);
+                    } catch (Exception e) {
+                        // ignore any exceptions to continue processing with the rest of the modules;
+                        System.out.println("Exception during initContext() phase");
+                    }
+                } else {
+                    getBuilder(module).initContext(earContext, module, cl);
+                }
             }
 
             // add gbeans declared in the geronimo-application.xml
@@ -644,7 +667,21 @@
             // each module can now add it's GBeans
             for (Object module1 : modules) {
                 Module module = (Module) module1;
-                getBuilder(module).addGBeans(earContext, module, cl, repositories);
+                if (createPlanMode.get().booleanValue()) {
+                    try {
+                        getBuilder(module).addGBeans(earContext, module, cl, repositories);
+                    } catch (DeploymentException e) {
+                        // ignore any exceptions to continue processing with the rest of the modules;
+                        System.out.println("Exception during addGBeans() phase");
+                    }
+                } else {
+                    getBuilder(module).addGBeans(earContext, module, cl, repositories);
+                }
+            }
+
+            if (createPlanMode.get().booleanValue()) {
+                EARConfigBuilder.appInfo.set(applicationInfo);
+                throw new DeploymentException();
             }
 
             // it's the caller's responsibility to close the context...

Modified: geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java (original)
+++ geronimo/server/trunk/plugins/j2ee/geronimo-j2ee-builder/src/main/java/org/apache/geronimo/j2ee/deployment/NamingBuilderCollection.java Wed May  7 11:17:09 2008
@@ -54,7 +54,15 @@
 
     public void buildNaming(XmlObject specDD, XmlObject plan, Module module, Map componentContext) throws DeploymentException {
         for (NamingBuilder namingBuilder : getSortedBuilders()) {
-            namingBuilder.buildNaming(specDD, plan, module, componentContext);
+            if (EARConfigBuilder.createPlanMode.get().booleanValue()) {
+                try {
+                    namingBuilder.buildNaming(specDD, plan, module, componentContext);
+                } catch (Exception e) {
+                    // ignore exceptions & continue processing with rest of the builders
+                }
+            } else {
+                namingBuilder.buildNaming(specDD, plan, module, componentContext);
+            }
         }
     }
     

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-console-jetty/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-console-jetty/pom.xml?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-console-jetty/pom.xml (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-console-jetty/pom.xml Wed May  7 11:17:09 2008
@@ -85,6 +85,13 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>openejb-deployer</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-test-ddbean</artifactId>
             <version>${version}</version>

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-console-tomcat/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-console-tomcat/pom.xml?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-console-tomcat/pom.xml (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-console-tomcat/pom.xml Wed May  7 11:17:09 2008
@@ -85,6 +85,13 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.geronimo.configs</groupId>
+            <artifactId>openejb-deployer</artifactId>
+            <version>${version}</version>
+            <type>car</type>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.geronimo.modules</groupId>
             <artifactId>geronimo-test-ddbean</artifactId>
             <version>${version}</version>

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/pom.xml?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/pom.xml (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/pom.xml Wed May  7 11:17:09 2008
@@ -92,6 +92,13 @@
         </dependency>
 
         <dependency>
+            <groupId>org.apache.geronimo.modules</groupId>
+            <artifactId>geronimo-openejb-builder</artifactId>
+            <version>${version}</version>
+            <scope>provided</scope>
+        </dependency>
+
+        <dependency>
             <groupId>org.apache.geronimo.framework</groupId>
             <artifactId>geronimo-deploy-jsr88</artifactId>
             <version>${version}</version>
@@ -122,6 +129,12 @@
             <artifactId>xmlbeans</artifactId>
             <scope>provided</scope>
         </dependency>
+
+        <dependency>
+            <groupId>org.directwebremoting</groupId>
+            <artifactId>dwr</artifactId>
+            <scope>provided</scope>
+        </dependency>
     </dependencies>
 
     <build>

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/AbstractHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/AbstractHandler.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/AbstractHandler.java (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/AbstractHandler.java Wed May  7 11:17:09 2008
@@ -16,10 +16,6 @@
  */
 package org.apache.geronimo.console.configcreator;
 
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
 import javax.portlet.ActionResponse;
 import javax.portlet.PortletRequest;
 import javax.portlet.PortletSession;
@@ -28,16 +24,9 @@
 import org.slf4j.LoggerFactory;
 import org.apache.geronimo.console.MultiPageAbstractHandler;
 import org.apache.geronimo.console.MultiPageModel;
-import org.apache.geronimo.deployment.xbeans.PatternType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerPortType;
-import org.apache.geronimo.xbeans.geronimo.naming.GerServiceRefType;
-import org.apache.geronimo.xbeans.geronimo.security.GerDistinguishedNameType;
-import org.apache.geronimo.xbeans.geronimo.security.GerLoginDomainPrincipalType;
-import org.apache.geronimo.xbeans.geronimo.security.GerPrincipalType;
-import org.apache.geronimo.xbeans.geronimo.security.GerRealmPrincipalType;
-import org.apache.geronimo.xbeans.geronimo.security.GerRoleType;
-import org.apache.geronimo.xbeans.geronimo.security.GerSecurityType;
-import org.apache.geronimo.xbeans.geronimo.security.GerSubjectInfoType;
+import org.apache.geronimo.console.configcreator.configData.EARConfigData;
+import org.apache.geronimo.console.configcreator.configData.EjbConfigData;
+import org.apache.geronimo.console.configcreator.configData.WARConfigData;
 
 /**
  * Base class for portlet helpers
@@ -47,7 +36,14 @@
 public abstract class AbstractHandler extends MultiPageAbstractHandler {
     private static final Logger log = LoggerFactory.getLogger(AbstractHandler.class);
 
+    protected final static String MODULE_URI_PARAMETER = "moduleURI";
+
+    protected final static String UPLOADED_WAR_URI_PARAMETER = "uploadedWarUri";
+
+    protected final static String DEPLOYMENT_PLAN_PARAMETER = "deploymentPlan";
+
     protected final static String GET_ARCHIVE_MODE = "index";
+
     // 'mode' of initial portlet must be one of "index" or "list"
 
     protected final static String ENVIRONMENT_MODE = "environment";
@@ -62,55 +58,17 @@
 
     protected final static String DEPLOY_STATUS_MODE = "deployStatus";
 
-    protected final static String WAR_CONFIG_DATA_ID = "org.apache.geronimo.configcreator.warConfigData";
-
-    protected final static String DATA_PARAMETER = "data";
-
-    protected final static String MODULE_URI_PARAMETER = "moduleURI";
-
-    protected final static String UPLOADED_WAR_URI_PARAMETER = "uploadedWarUri";
-
-    protected final static String DEPLOYMENT_PLAN_PARAMETER = "deploymentPlan";
-
-    protected final static String CONTEXT_ROOT_PARAMETER = "contextRoot";
-
-    protected final static String ARTIFACT_ID_PARAMETER = "artifactId";
-
-    protected final static String GROUP_ID_PARAMETER = "groupId";
-
-    protected final static String VERSION_PARAMETER = "version";
+    protected final static String EJB_MODE = "ejbPage";
 
-    protected final static String TYPE_PARAMETER = "type";
+    protected final static String EAR_MODE = "enterpriseApp";
 
-    protected final static String HIDDEN_CLASSES_PARAMETER = "hiddenClasses";
-
-    protected final static String NON_OVERRIDABLE_CLASSES_PARAMETER = "nonOverridableClasses";
-
-    protected final static String INVERSE_CLASSLOADING_PARAMETER = "inverseClassLoading";
-
-    protected final static String EJB_REF_PREFIX = "ejbRef";
-
-    protected final static String EJB_LOCAL_REF_PREFIX = "ejbLocalRef";
-
-    protected final static String JMS_CONNECTION_FACTORY_REF_PREFIX = "jmsConnectionFactoryRef";
-
-    protected final static String JMS_DESTINATION_REF_PREFIX = "jmsDestinationRef";
-
-    protected final static String MESSAGE_DESTINATION_PREFIX = "messageDestination";
-
-    protected final static String JDBC_POOL_REF_PREFIX = "jdbcPoolRef";
-
-    protected final static String JAVAMAIL_SESSION_REF_PREFIX = "javaMailSessionRef";
-
-    protected final static String REF_NAME = "refName";
-
-    protected final static String REF_LINK = "refLink";
+    protected final static String WAR_CONFIG_DATA_ID = "org.apache.geronimo.configcreator.warConfigData";
 
-    protected final static String DEPENDENCY_PREFIX = "dependency";
+    protected final static String EJB_JAR_CONFIG_DATA_ID = "org.apache.geronimo.configcreator.ejbJarConfigData";
 
-    protected final static String ARCHIVE_NOT_SUPPORTED_PARAMETER = "archiveNotSupported";
+    public final static String EAR_CONFIG_DATA_ID = "org.apache.geronimo.configcreator.earConfigData";
 
-    protected final static String REFERENCE_NOT_RESOLVED_PARAMETER = "referenceNotResolved";
+    protected final static String DATA_PARAMETER = "data";
 
     protected final static String DEPLOYED_EJBS_PARAMETER = "deployedEjbs";
 
@@ -134,469 +92,49 @@
 
     protected final static String DEPLOY_FULL_STATUS_PARAMETER = "fullStatusMessage";
 
+    protected final static String ARCHIVE_NOT_SUPPORTED_PARAMETER = "archiveNotSupported";
+
+    protected final static String REFERENCE_NOT_RESOLVED_PARAMETER = "referenceNotResolved";
+
     public AbstractHandler(String mode, String viewName) {
         super(mode, viewName);
     }
 
-    public static class WARConfigModel implements MultiPageModel {
-        public WARConfigModel(PortletRequest request) {
+    public static class TempConfigModel implements MultiPageModel {
+        public TempConfigModel(PortletRequest request) {
         }
 
         public void save(ActionResponse response, PortletSession session) {
         }
     }
 
-    public WARConfigData getSessionData(PortletRequest request) {
-        return (WARConfigData) request.getPortletSession().getAttribute(WAR_CONFIG_DATA_ID);
+    public WARConfigData setNewWARSessionData(PortletRequest request) {
+        WARConfigData configData = new WARConfigData();
+        request.getPortletSession().setAttribute(WAR_CONFIG_DATA_ID, configData);
+        return configData;
     }
 
-    public void setNewSessionData(PortletRequest request) {
-        request.getPortletSession().setAttribute(WAR_CONFIG_DATA_ID, new WARConfigData());
+    public WARConfigData getWARSessionData(PortletRequest request) {
+        return (WARConfigData) request.getPortletSession().getAttribute(WAR_CONFIG_DATA_ID);
     }
 
-    public static class WARConfigData {
-        private String uploadedWarUri;
-
-        private String deploymentPlan;
-
-        private String contextRoot;
-
-        private String artifactId;
-
-        private String groupId;
-
-        private String version;
-
-        private String type;
-
-        private String hiddenClasses;
-
-        private String nonOverridableClasses;
-
-        private boolean inverseClassLoading;
-
-        private List ejbRefs = new ArrayList();
-
-        private List ejbLocalRefs = new ArrayList();
-
-        private List jdbcPoolRefs = new ArrayList();
-
-        private List jmsConnectionFactoryRefs = new ArrayList();
-
-        private List jmsDestinationRefs = new ArrayList();
-
-        private List messageDestinations = new ArrayList();
-
-        private List javaMailSessionRefs = new ArrayList();
-
-        private List<GerServiceRefType> webServiceRefs = new ArrayList<GerServiceRefType>();
-
-        private List dependencies = new ArrayList();
-
-        private boolean referenceNotResolved;
-
-        private String securityRealmName;
-
-        private GerSecurityType security = null;
-
-        public WARConfigData() {
-        }
-
-        public void readEnvironmentData(PortletRequest request) {
-            contextRoot = request.getParameter(CONTEXT_ROOT_PARAMETER);
-            artifactId = request.getParameter(ARTIFACT_ID_PARAMETER);
-            groupId = request.getParameter(GROUP_ID_PARAMETER);
-            version = request.getParameter(VERSION_PARAMETER);
-            type = request.getParameter(TYPE_PARAMETER);
-            hiddenClasses = request.getParameter(HIDDEN_CLASSES_PARAMETER);
-            nonOverridableClasses = request.getParameter(NON_OVERRIDABLE_CLASSES_PARAMETER);
-            inverseClassLoading = "true".equalsIgnoreCase(request
-                            .getParameter(INVERSE_CLASSLOADING_PARAMETER)) ? true : false;
-        }
-
-        public void readReferencesData(PortletRequest request) {
-            readParameters(EJB_REF_PREFIX, ejbRefs, request);
-            readParameters(EJB_LOCAL_REF_PREFIX, ejbLocalRefs, request);
-            readParameters(JMS_CONNECTION_FACTORY_REF_PREFIX, jmsConnectionFactoryRefs, request);
-            readParameters(JMS_DESTINATION_REF_PREFIX, jmsDestinationRefs, request);
-            readParameters(MESSAGE_DESTINATION_PREFIX, messageDestinations, request);
-            readParameters(JDBC_POOL_REF_PREFIX, jdbcPoolRefs, request);
-            readParameters(JAVAMAIL_SESSION_REF_PREFIX, javaMailSessionRefs, request);
-            readWebServiceRefsData(request);
-        }
-
-        private void readParameters(String prefix1, List list, PortletRequest request) {
-            list.clear();
-            Map map = request.getParameterMap();
-            int index = 0;
-            while (true) {
-                String prefix2 = prefix1 + "." + (index++) + ".";
-                if (!map.containsKey(prefix2 + REF_NAME)) {
-                    break;
-                }
-                ReferenceData data = new ReferenceData();
-                data.load(request, prefix2);
-                list.add(data);
-            }
-        }
-
-        public void readWebServiceRefsData(PortletRequest request) {
-            Map map = request.getParameterMap();
-            for (int i = 0; i < getWebServiceRefs().size(); i++) {
-                GerServiceRefType serviceRef = getWebServiceRefs().get(i);
-                for (int j = serviceRef.getPortArray().length - 1; j >= 0; j--) {
-                    serviceRef.removePort(j);
-                }
-                String prefix1 = "serviceRef" + "." + i + "." + "port" + ".";
-                int lastIndex = Integer.parseInt(request.getParameter(prefix1 + "lastIndex"));
-                for (int j = 0; j < lastIndex; j++) {
-                    String prefix2 = prefix1 + j + ".";
-                    if (!map.containsKey(prefix2 + "portName")) {
-                        continue;
-                    }
-                    GerPortType port = serviceRef.addNewPort();
-                    String value = request.getParameter(prefix2 + "portName");
-                    if (!isEmpty(value)) {
-                        port.setPortName(value);
-                    }
-                    value = request.getParameter(prefix2 + "protocol");
-                    if (!isEmpty(value)) {
-                        port.setProtocol(value);
-                    }
-                    value = request.getParameter(prefix2 + "host");
-                    if (!isEmpty(value)) {
-                        port.setHost(value);
-                    }
-                    value = request.getParameter(prefix2 + "port");
-                    if (!isEmpty(value)) {
-                        int portValue = Integer.parseInt(value);
-                        port.setPort(portValue);
-                    }
-                    value = request.getParameter(prefix2 + "uri");
-                    if (!isEmpty(value)) {
-                        port.setUri(value);
-                    }
-                    value = request.getParameter(prefix2 + "credentialsName");
-                    if (!isEmpty(value)) {
-                        port.setCredentialsName(value);
-                    }
-                }
-            }
-        }
-
-        public void readSecurityData(PortletRequest request) {
-            securityRealmName = request.getParameter("securityRealmName");
-            readSecurityParameters(request);
-        }
-
-        private void readSecurityParameters(PortletRequest request) {
-            Map map = request.getParameterMap();
-            boolean processAdvancedSettings = false;
-            if (map.containsKey("security.advancedSettings.isPresent")
-                    && "true".equalsIgnoreCase(request.getParameter("security.advancedSettings.isPresent"))) {
-                processAdvancedSettings = true;
-            }
-            GerRoleType[] roles = security.getRoleMappings().getRoleArray();
-            for (int index = 0; index < roles.length; index++) {
-                String prefix1 = "security.roleMappings" + "." + index + ".";
-                GerRoleType role = roles[index];
-
-                for (int i = role.sizeOfPrincipalArray() - 1; i >= 0; i--) {
-                    role.removePrincipal(i);
-                }
-                int lastIndex = Integer.parseInt(request.getParameter(prefix1 + "principal.lastIndex"));
-                for (int i = 0; i < lastIndex; i++) {
-                    String prefix2 = prefix1 + "principal" + "." + i + ".";
-                    if (!map.containsKey(prefix2 + "name")) {
-                        continue;
-                    }
-                    GerPrincipalType principal = role.addNewPrincipal();
-                    principal.setName(request.getParameter(prefix2 + "name"));
-                    principal.setClass1(request.getParameter(prefix2 + "class"));
-                }
-
-                for (int i = role.sizeOfLoginDomainPrincipalArray() - 1; i >= 0; i--) {
-                    role.removeLoginDomainPrincipal(i);
-                }
-                lastIndex = Integer.parseInt(request.getParameter(prefix1 + "loginDomainPrincipal.lastIndex"));
-                for (int i = 0; i < lastIndex; i++) {
-                    String prefix2 = prefix1 + "loginDomainPrincipal" + "." + i + ".";
-                    if (!map.containsKey(prefix2 + "name")) {
-                        continue;
-                    }
-                    GerLoginDomainPrincipalType loginDomainPrincipal = role.addNewLoginDomainPrincipal();
-                    loginDomainPrincipal.setName(request.getParameter(prefix2 + "name"));
-                    loginDomainPrincipal.setClass1(request.getParameter(prefix2 + "class"));
-                    loginDomainPrincipal.setDomainName(request.getParameter(prefix2 + "domainName"));
-                }
-
-                for (int i = role.sizeOfRealmPrincipalArray() - 1; i >= 0; i--) {
-                    role.removeRealmPrincipal(i);
-                }
-                lastIndex = Integer.parseInt(request.getParameter(prefix1 + "realmPrincipal.lastIndex"));
-                for (int i = 0; i < lastIndex; i++) {
-                    String prefix2 = prefix1 + "realmPrincipal" + "." + i + ".";
-                    if (!map.containsKey(prefix2 + "name")) {
-                        continue;
-                    }
-                    GerRealmPrincipalType realmPrincipal = role.addNewRealmPrincipal();
-                    realmPrincipal.setName(request.getParameter(prefix2 + "name"));
-                    realmPrincipal.setClass1(request.getParameter(prefix2 + "class"));
-                    realmPrincipal.setDomainName(request.getParameter(prefix2 + "domainName"));
-                    realmPrincipal.setRealmName(request.getParameter(prefix2 + "realmName"));
-                }
-
-                for (int i = role.sizeOfDistinguishedNameArray() - 1; i >= 0; i--) {
-                    role.removeDistinguishedName(i);
-                }
-                lastIndex = Integer.parseInt(request.getParameter(prefix1 + "distinguishedName.lastIndex"));
-                for (int i = 0; i < lastIndex; i++) {
-                    String prefix2 = prefix1 + "distinguishedName" + "." + i + ".";
-                    if (!map.containsKey(prefix2 + "name")) {
-                        continue;
-                    }
-                    GerDistinguishedNameType distinguishedName = role.addNewDistinguishedName();
-                    distinguishedName.setName(request.getParameter(prefix2 + "name"));
-                }
-
-                if (processAdvancedSettings) {
-                    String prefix2 = prefix1 + "runAsSubject" + ".";
-                    if (map.containsKey(prefix2 + "realm")) {
-                        if (role.isSetRunAsSubject()) {
-                            role.unsetRunAsSubject();
-                        }
-                        String realm = request.getParameter(prefix2 + "realm");
-                        String id = request.getParameter(prefix2 + "id");
-                        if (!isEmpty(realm) && !isEmpty(id)) {
-                            GerSubjectInfoType runAsSubject = role.addNewRunAsSubject();
-                            runAsSubject.setRealm(realm);
-                            runAsSubject.setId(id);
-                        }
-                    }
-                }
-            }
-            if(processAdvancedSettings) {
-                String parameterName = "security" + "." + "credentialStoreRef";
-                if (map.containsKey(parameterName)) {
-                    String patternString = request.getParameter(parameterName);
-                    String[] elements = patternString.split("/", 6);
-                    PatternType pattern = PatternType.Factory.newInstance();
-                    pattern.setGroupId(elements[0]);
-                    pattern.setArtifactId(elements[1]);
-                    //pattern.setVersion(elements[2]);
-                    //pattern.setType(elements[3]);
-                    //pattern.setModule(elements[4]);
-                    pattern.setName(elements[5]);
-                    security.setCredentialStoreRef(pattern);
-                    dependencies.add(JSR88_Util.getDependencyString(patternString));
-                }
-                String prefix = "security" + "." + "defaultSubject" + ".";
-                if (map.containsKey(prefix + "realm")) {
-                    if(security.isSetDefaultSubject()) {
-                        security.unsetDefaultSubject();
-                    }
-                    String realm = request.getParameter(prefix + "realm");
-                    String id = request.getParameter(prefix + "id");
-                    if (!isEmpty(realm) && !isEmpty(id)) {
-                        GerSubjectInfoType runAsSubject = security.addNewDefaultSubject();
-                        runAsSubject.setRealm(realm);
-                        runAsSubject.setId(id);
-                    }
-                }
-                parameterName = "security" + "." + "doasCurrentCaller";
-                if ("true".equalsIgnoreCase(request.getParameter(parameterName))) {
-                    security.setDoasCurrentCaller(true);
-                }
-                parameterName = "security" + "." + "useContextHandler";
-                if ("true".equalsIgnoreCase(request.getParameter(parameterName))) {
-                    security.setUseContextHandler(true);
-                }
-                String defaultRole = request.getParameter("security" + "." + "defaultRole");
-                if (!isEmpty(defaultRole)) {
-                    security.setDefaultRole(defaultRole);
-                }
-            }
-        }
-
-        public String getContextRoot() {
-            return contextRoot;
-        }
-
-        public void setContextRoot(String contextRoot) {
-            this.contextRoot = contextRoot;
-        }
-
-        public String getArtifactId() {
-            return artifactId;
-        }
-
-        public void setArtifactId(String artifactId) {
-            this.artifactId = artifactId;
-        }
-
-        public String getGroupId() {
-            return groupId;
-        }
-
-        public void setGroupId(String groupId) {
-            this.groupId = groupId;
-        }
-
-        public String getType() {
-            return type;
-        }
-
-        public void setType(String type) {
-            this.type = type;
-        }
-
-        public String getVersion() {
-            return version;
-        }
-
-        public void setVersion(String version) {
-            this.version = version;
-        }
-
-        public String getHiddenClasses() {
-            return hiddenClasses;
-        }
-
-        public void setHiddenClasses(String hiddenClasses) {
-            this.hiddenClasses = hiddenClasses;
-        }
-
-        public String getNonOverridableClasses() {
-            return nonOverridableClasses;
-        }
-
-        public void setNonOverridableClasses(String nonOverridableClasses) {
-            this.nonOverridableClasses = nonOverridableClasses;
-        }
-
-        public boolean isInverseClassLoading() {
-            return inverseClassLoading;
-        }
-
-        public void setInverseClassLoading(boolean inverseClassLoading) {
-            this.inverseClassLoading = inverseClassLoading;
-        }
-
-        public List getDependencies() {
-            return dependencies;
-        }
-
-        public List getEjbLocalRefs() {
-            return ejbLocalRefs;
-        }
-
-        public List getEjbRefs() {
-            return ejbRefs;
-        }
-
-        public List getJdbcPoolRefs() {
-            return jdbcPoolRefs;
-        }
-
-        public List getJmsConnectionFactoryRefs() {
-            return jmsConnectionFactoryRefs;
-        }
-
-        public List getJmsDestinationRefs() {
-            return jmsDestinationRefs;
-        }
-
-        public List getMessageDestinations() {
-            return messageDestinations;
-        }
-
-        public List getJavaMailSessionRefs() {
-            return javaMailSessionRefs;
-        }
-
-        public List<GerServiceRefType> getWebServiceRefs() {
-            return webServiceRefs;
-        }
-
-        public boolean isReferenceNotResolved() {
-            return referenceNotResolved;
-        }
-
-        public void setReferenceNotResolved(boolean referenceNotResolved) {
-            this.referenceNotResolved = referenceNotResolved;
-        }
-
-        public String getUploadedWarUri() {
-            return uploadedWarUri;
-        }
-
-        public void setUploadedWarUri(String uploadedWarUri) {
-            this.uploadedWarUri = uploadedWarUri;
-        }
-
-        public String getDeploymentPlan() {
-            return deploymentPlan;
-        }
-
-        public void setDeploymentPlan(String deploymentPlan) {
-            this.deploymentPlan = deploymentPlan;
-        }
-
-        public String getSecurityRealmName() {
-            return securityRealmName;
-        }
-
-        public void setSecurityRealmName(String securityRealmName) {
-            this.securityRealmName = securityRealmName;
-        }
-
-        public GerSecurityType getSecurity() {
-            return security;
-        }
-
-        public void setSecurity(GerSecurityType security) {
-            this.security = security;
-        }
+    public EjbConfigData setNewEjbJarSessionData(PortletRequest request) {
+        EjbConfigData configData = new EjbConfigData();
+        request.getPortletSession().setAttribute(EJB_JAR_CONFIG_DATA_ID, configData);
+        return configData;
     }
 
-    public static class ReferenceData {
-        private String refName;
-
-        private String refLink;
-
-        public ReferenceData() {
-        }
-
-        public ReferenceData(String refName) {
-            this.refName = refName;
-        }
-
-        public void load(PortletRequest request, String prefix) {
-            refName = request.getParameter(prefix + REF_NAME);
-            refLink = request.getParameter(prefix + REF_LINK);
-        }
-
-        public void save(ActionResponse response, String prefix) {
-            if (!isEmpty(refName))
-                response.setRenderParameter(prefix + REF_NAME, refName);
-            if (!isEmpty(refLink))
-                response.setRenderParameter(prefix + REF_LINK, refLink);
-        }
-
-        public String getRefName() {
-            return refName;
-        }
-
-        public void setRefName(String refName) {
-            this.refName = refName;
-        }
+    public EjbConfigData getEjbJarSessionData(PortletRequest request) {
+        return (EjbConfigData) request.getPortletSession().getAttribute(EJB_JAR_CONFIG_DATA_ID);
+    }
 
-        public String getRefLink() {
-            return refLink;
-        }
+    public EARConfigData setNewEARSessionData(PortletRequest request) {
+        EARConfigData configData = new EARConfigData();
+        request.getPortletSession().setAttribute(EAR_CONFIG_DATA_ID, configData, PortletSession.APPLICATION_SCOPE);
+        return configData;
+    }
 
-        public void setRefLink(String refLink) {
-            this.refLink = refLink;
-        }
+    public EARConfigData getEARSessionData(PortletRequest request) {
+        return (EARConfigData) request.getPortletSession().getAttribute(EAR_CONFIG_DATA_ID, PortletSession.APPLICATION_SCOPE);
     }
 }

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/CreatePlanPortlet.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/CreatePlanPortlet.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/CreatePlanPortlet.java (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/CreatePlanPortlet.java Wed May  7 11:17:09 2008
@@ -37,6 +37,8 @@
         addHelper(new DependenciesHandler(), config);
         addHelper(new DisplayPlanHandler(), config);
         addHelper(new DeployStatusHandler(), config);
+        addHelper(new EjbHandler(), config);
+        addHelper(new EARHandler(), config);
     }
 
     protected String getModelJSPVariableName() {
@@ -44,6 +46,6 @@
     }
 
     protected MultiPageModel getModel(PortletRequest request) {
-        return new AbstractHandler.WARConfigModel(request);
+        return new AbstractHandler.TempConfigModel(request);
     }
 }

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DependenciesHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DependenciesHandler.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DependenciesHandler.java (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DependenciesHandler.java Wed May  7 11:17:09 2008
@@ -29,6 +29,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.configcreator.configData.WARConfigData;
 
 /**
  * A handler for ...
@@ -49,10 +50,11 @@
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model)
             throws PortletException, IOException {
-        WARConfigData data = getSessionData(request);
+        WARConfigData data = getWARSessionData(request);
+        data.consolidateDependencies();
         request.setAttribute(DATA_PARAMETER, data);
-        List commonLibs = JSR77_Util.getCommonLibs(request);
-        List addedDependencies = data.getDependencies();
+        List<String> commonLibs = JSR77_Util.getCommonLibs(request);
+        List<String> addedDependencies = data.getEnvironmentConfig().getDependencies();
         //addedDependencies will be a subset of commonLibs
         //sort commonLibs so that addedDependencies show up towards the beginning
         commonLibs.removeAll(addedDependencies);
@@ -64,11 +66,11 @@
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model)
             throws PortletException, IOException {
-        WARConfigData data = getSessionData(request);
-        data.getDependencies().clear();
+        WARConfigData data = getWARSessionData(request);
+        data.getEnvironmentConfig().getDependenciesSet().clear();
         String[] selectedJars = request.getParameterValues(SELECTED_LIBS_PARAMETER);
         for (int i = 0; selectedJars != null && i < selectedJars.length; i++) {
-            data.getDependencies().add(selectedJars[i]);
+            data.getEnvironmentConfig().getDependenciesSet().add(selectedJars[i]);
         }
         return DISPLAY_PLAN_MODE + "-before";
     }

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DeployStatusHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DeployStatusHandler.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DeployStatusHandler.java (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DeployStatusHandler.java Wed May  7 11:17:09 2008
@@ -31,6 +31,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.configcreator.configData.WARConfigData;
 
 /**
  * A handler for ...
@@ -51,7 +52,7 @@
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model)
             throws PortletException, IOException {
-        WARConfigData data = getSessionData(request);
+        WARConfigData data = getWARSessionData(request);
         try {
             File moduleFile = new File(new URI(data.getUploadedWarUri()));
 

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DisplayPlanHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DisplayPlanHandler.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DisplayPlanHandler.java (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/DisplayPlanHandler.java Wed May  7 11:17:09 2008
@@ -17,11 +17,7 @@
 package org.apache.geronimo.console.configcreator;
 
 import java.io.IOException;
-import java.net.URL;
 
-import javax.enterprise.deploy.model.exceptions.DDBeanCreateException;
-import javax.enterprise.deploy.spi.exceptions.ConfigurationException;
-import javax.enterprise.deploy.spi.exceptions.InvalidModuleException;
 import javax.enterprise.deploy.spi.exceptions.DeploymentManagerCreationException;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -32,6 +28,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.configcreator.configData.WARConfigData;
 
 /**
  * A handler for ...
@@ -52,25 +49,14 @@
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model)
             throws PortletException, IOException {
-        WARConfigData data = getSessionData(request);
-        try {
-            String plan = JSR88_Util.createDeploymentPlan(request, data, new URL(data.getUploadedWarUri()));
-            data.setDeploymentPlan(plan);
-        } catch (DDBeanCreateException e) {
-            log.error(e.getMessage(), e);
-        } catch (InvalidModuleException e) {
-            log.error(e.getMessage(), e);
-        } catch (ConfigurationException e) {
-            log.error(e.getMessage(), e);
-        } catch (DeploymentManagerCreationException e) {
-            log.error(e.getMessage(), e);
-        }
+        WARConfigData data = getWARSessionData(request);
+        data.createDeploymentPlan();
         request.setAttribute(DATA_PARAMETER, data);
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model)
             throws PortletException, IOException {
-        WARConfigData data = getSessionData(request);
+        WARConfigData data = getWARSessionData(request);
         data.setDeploymentPlan(request.getParameter(DEPLOYMENT_PLAN_PARAMETER));
         return DEPLOY_STATUS_MODE;
     }

Added: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EARHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EARHandler.java?rev=654200&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EARHandler.java (added)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EARHandler.java Wed May  7 11:17:09 2008
@@ -0,0 +1,60 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.configcreator;
+
+import java.io.IOException;
+import java.util.List;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.configcreator.configData.EARConfigData;
+
+/**
+ * A handler for ...
+ * 
+ * @version $Rev$ $Date$
+ */
+public class EARHandler extends AbstractHandler {
+    //private static final Log log = LogFactory.getLog(EARHandler.class);
+
+    public EARHandler() {
+        super(EAR_MODE, "/WEB-INF/view/configcreator/enterpriseApp.jsp");
+    }
+
+    public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model)
+            throws PortletException, IOException {
+        return getMode();
+    }
+
+    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model)
+            throws PortletException, IOException {
+        EARConfigData data = getEARSessionData(request);
+        request.setAttribute(DATA_PARAMETER, data);
+        List<String> commonLibs = JSR77_Util.getCommonLibs(request);
+        request.setAttribute(COMMON_LIBS_PARAMETER, commonLibs);
+    }
+
+    public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model)
+            throws PortletException, IOException {
+        return "";
+    }
+}

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EARHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EARHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EARHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EjbHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EjbHandler.java?rev=654200&view=auto
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EjbHandler.java (added)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EjbHandler.java Wed May  7 11:17:09 2008
@@ -0,0 +1,57 @@
+/**
+ *  Licensed to the Apache Software Foundation (ASF) under one or more
+ *  contributor license agreements.  See the NOTICE file distributed with
+ *  this work for additional information regarding copyright ownership.
+ *  The ASF licenses this file to You under the Apache License, Version 2.0
+ *  (the "License"); you may not use this file except in compliance with
+ *  the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *  Unless required by applicable law or agreed to in writing, software
+ *  distributed under the License is distributed on an "AS IS" BASIS,
+ *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *  See the License for the specific language governing permissions and
+ *  limitations under the License.
+ */
+package org.apache.geronimo.console.configcreator;
+
+import java.io.IOException;
+
+import javax.portlet.ActionRequest;
+import javax.portlet.ActionResponse;
+import javax.portlet.PortletException;
+import javax.portlet.RenderRequest;
+import javax.portlet.RenderResponse;
+
+import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.configcreator.configData.EjbConfigData;
+
+/**
+ * A handler for ...
+ * 
+ * @version $Rev$ $Date$
+ */
+public class EjbHandler extends AbstractHandler {
+    //private static final Log log = LogFactory.getLog(EjbHandler.class);
+
+    public EjbHandler() {
+        super(EJB_MODE, "/WEB-INF/view/configcreator/ejbPage.jsp");
+    }
+
+    public String actionBeforeView(ActionRequest request, ActionResponse response, MultiPageModel model)
+            throws PortletException, IOException {
+        return getMode();
+    }
+
+    public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model)
+            throws PortletException, IOException {
+        EjbConfigData data = getEjbJarSessionData(request);
+        request.setAttribute(DATA_PARAMETER, data);
+    }
+
+    public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model)
+            throws PortletException, IOException {
+        return "";
+    }
+}

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EjbHandler.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EjbHandler.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EjbHandler.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EnvironmentHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EnvironmentHandler.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EnvironmentHandler.java (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/EnvironmentHandler.java Wed May  7 11:17:09 2008
@@ -27,6 +27,7 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.configcreator.configData.WARConfigData;
 
 /**
  * A handler for ...
@@ -47,18 +48,15 @@
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model)
             throws PortletException, IOException {
-        WARConfigData data = getSessionData(request);
+        WARConfigData data = getWARSessionData(request);
         request.setAttribute(DATA_PARAMETER, data);
     }
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model)
             throws PortletException, IOException {
-        WARConfigData data = getSessionData(request);
+        WARConfigData data = getWARSessionData(request);
         data.readEnvironmentData(request);
-        if (data.getEjbRefs().size() > 0 || data.getEjbLocalRefs().size() > 0 
-                || data.getJdbcPoolRefs().size() > 0 || data.getJavaMailSessionRefs().size() > 0 
-                || data.getJmsConnectionFactoryRefs().size() > 0 || data.getJmsDestinationRefs().size() > 0
-                || data.getWebServiceRefs().size() > 0) {
+        if (data.needsResolveReferences()) {
             return REFERENCES_MODE + "-before";
         }
         if (data.getSecurity() != null) {

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/GetArchiveHandler.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/GetArchiveHandler.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/GetArchiveHandler.java (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/GetArchiveHandler.java Wed May  7 11:17:09 2008
@@ -29,6 +29,13 @@
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.apache.geronimo.console.MultiPageModel;
+import org.apache.geronimo.console.configcreator.configData.EARConfigData;
+import org.apache.geronimo.console.configcreator.configData.EjbConfigData;
+import org.apache.geronimo.console.configcreator.configData.WARConfigData;
+import org.apache.geronimo.j2ee.ApplicationInfo;
+import org.apache.geronimo.j2ee.deployment.WebModule;
+import org.apache.geronimo.kernel.config.ConfigurationModuleType;
+import org.apache.geronimo.openejb.deployment.EjbModule;
 
 /**
  * A handler for ...
@@ -49,7 +56,6 @@
 
     public void renderView(RenderRequest request, RenderResponse response, MultiPageModel model)
             throws PortletException, IOException {
-        setNewSessionData(request);
         if ("true".equals(request.getParameter(ARCHIVE_NOT_SUPPORTED_PARAMETER))) {
             request.setAttribute(ARCHIVE_NOT_SUPPORTED_PARAMETER, "true");
         }
@@ -57,43 +63,31 @@
 
     public String actionAfterView(ActionRequest request, ActionResponse response, MultiPageModel model)
             throws PortletException, IOException {
-        WARConfigData data = getSessionData(request);
         FileItem fileItem = (FileItem) getUploadFiles().get(MODULE_URI_PARAMETER);
-
         String fileName = fileItem.getName();
-        if (fileName == null || fileName.length() <= 0) {
-            return getMode();
-        }
-
-        // TODO Is there a better way of checking whether the archive is a WAR or not?
-        int i = fileName.length() - 4;
-        if (!fileName.substring(i).equalsIgnoreCase(".war")) {
-            response.setRenderParameter(ARCHIVE_NOT_SUPPORTED_PARAMETER, "true");
-            return getMode();
+        if (fileName != null && fileName.length() > 0) {
+            File uploadedFile = uploadFile(fileItem);
+            ApplicationInfo applicationInfo = JSR88_Util.createApplicationInfo(request, uploadedFile);
+            ConfigurationModuleType applicationType = applicationInfo.getType();
+            if (ConfigurationModuleType.WAR == applicationType) {
+                WARConfigData data = setNewWARSessionData(request);
+                data.setUploadedWarUri(uploadedFile.toURI().toString());
+                data.parseWeb((WebModule) (applicationInfo.getModules().toArray()[0]));
+                return ENVIRONMENT_MODE + "-before";
+            }
+            if (ConfigurationModuleType.EAR == applicationType) {
+                EARConfigData earConfigData = setNewEARSessionData(request);
+                earConfigData.parseEAR(applicationInfo);
+                return EAR_MODE + "-before";
+            }
+            if (ConfigurationModuleType.EJB == applicationType) {
+                EjbConfigData ejbJarConfigData = setNewEjbJarSessionData(request);
+                ejbJarConfigData.parseEjbJar((EjbModule) (applicationInfo.getModules().toArray()[0]));
+                return EJB_MODE + "-before";
+            }
         }
-
-        File uploadedFile = uploadFile(fileItem);
-        data.setUploadedWarUri(uploadedFile.toURI().toString());
-
-        String str = getBasename(fileItem.getName().trim());
-        String warName = str.substring(0, str.length() - 4);
-        data.setContextRoot(warName);
-        data.setGroupId("default");
-        data.setArtifactId(warName);
-        data.setVersion("1.0");
-        data.setType("war");
-        data.setHiddenClasses("");
-        data.setNonOverridableClasses("");
-        data.setInverseClassLoading(false);
-
-        try {
-            JSR88_Util.parseWarReferences(request, data, uploadedFile.toURL());
-        } catch (Exception e) {
-            log.error(e.getMessage(), e);
-            return getMode();
-        }
-
-        return ENVIRONMENT_MODE + "-before";
+        response.setRenderParameter(ARCHIVE_NOT_SUPPORTED_PARAMETER, "true");
+        return getMode();
     }
 
     private File uploadFile(FileItem fileItem) throws PortletException, IOException {

Modified: geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java
URL: http://svn.apache.org/viewvc/geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java?rev=654200&r1=654199&r2=654200&view=diff
==============================================================================
--- geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java (original)
+++ geronimo/server/trunk/plugins/plancreator/plancreator-portlets/src/main/java/org/apache/geronimo/console/configcreator/JSR77_Util.java Wed May  7 11:17:09 2008
@@ -19,7 +19,6 @@
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.SortedSet;
 
 import javax.management.MalformedObjectNameException;
 import javax.management.ObjectName;
@@ -28,6 +27,7 @@
 import org.apache.geronimo.console.util.PortletManager;
 import org.apache.geronimo.gbean.AbstractName;
 import org.apache.geronimo.j2ee.j2eeobjectnames.NameFactory;
+import org.apache.geronimo.kernel.repository.Artifact;
 import org.apache.geronimo.kernel.repository.ListableRepository;
 import org.apache.geronimo.management.EJBModule;
 import org.apache.geronimo.management.J2EEResource;
@@ -70,8 +70,8 @@
         }
     }
 
-    protected static List getDeployedEJBs(PortletRequest request) {
-        List ejbList = new ArrayList();
+    protected static List<ReferredData> getDeployedEJBs(PortletRequest request) {
+        List<ReferredData> ejbList = new ArrayList<ReferredData>();
         EJBModule[] ejbModules = PortletManager.getManagementHelper(request).getEJBModules(
                 PortletManager.getCurrentServer(request));
         for (int i = 0; ejbModules != null && i < ejbModules.length; i++) {
@@ -102,11 +102,11 @@
         return ejbList;
     }
 
-    protected static List getJMSConnectionFactories(PortletRequest request) {
+    protected static List<ReferredData> getJMSConnectionFactories(PortletRequest request) {
         // TODO this is a duplicate of the code from
         // org.apache.geronimo.console.jmsmanager.wizard.ListScreenHandler.populateExistingList()
         // TODO need to eliminate this duplicate code probably by putting it in a common place
-        List connectionFactories = new ArrayList();
+        List<ReferredData> connectionFactories = new ArrayList<ReferredData>();
 
         // Get the list of connection factories
         ResourceAdapterModule[] modules = PortletManager.getOutboundRAModules(request, new String[] {
@@ -137,11 +137,11 @@
         return connectionFactories;
     }
 
-    protected static List getJMSDestinations(PortletRequest request) {
+    protected static List<ReferredData> getJMSDestinations(PortletRequest request) {
         // TODO this is a duplicate of the code from
         // org.apache.geronimo.console.jmsmanager.wizard.ListScreenHandler.populateExistingList()
         // TODO need to eliminate this duplicate code probably by putting it in a common place
-        List jmsDestinations = new ArrayList();
+        List<ReferredData> jmsDestinations = new ArrayList<ReferredData>();
 
         // Get the list of connection factories
         ResourceAdapterModule[] modules = PortletManager.getOutboundRAModules(request, new String[] {
@@ -171,11 +171,11 @@
         return jmsDestinations;
     }
 
-    protected static List getJDBCConnectionPools(PortletRequest request) {
+    protected static List<ReferredData> getJDBCConnectionPools(PortletRequest request) {
         // TODO this is a duplicate of the code from
         // org.apache.geronimo.console.databasemanager.wizard.DatabasePoolPortlet.populatePoolList()
         // TODO need to eliminate this duplicate code probably by putting it in a common place
-        List list = new ArrayList();
+        List<ReferredData> list = new ArrayList<ReferredData>();
         ResourceAdapterModule[] modules = PortletManager.getOutboundRAModules(request, "javax.sql.DataSource");
         for (int i = 0; i < modules.length; i++) {
             ResourceAdapterModule module = modules[i];
@@ -194,8 +194,8 @@
         return list;
     }
 
-    protected static List getJavaMailSessions(PortletRequest request) {
-        List mailSessionList = new ArrayList();
+    protected static List<ReferredData> getJavaMailSessions(PortletRequest request) {
+        List<ReferredData> mailSessionList = new ArrayList<ReferredData>();
         J2EEResource[] j2eeResources = PortletManager.getManagementHelper(request).getResources(
                 PortletManager.getCurrentServer(request));
         for (int i = 0; i < j2eeResources.length; i++) {
@@ -219,8 +219,8 @@
         return mailSessionList;
     }
 
-    protected static List getDeployedCredentialStores(PortletRequest request) {
-        List credentialStoreList = new ArrayList();
+    protected static List<ReferredData> getDeployedCredentialStores(PortletRequest request) {
+        List<ReferredData> credentialStoreList = new ArrayList<ReferredData>();
         Object[] objects = PortletManager.getGBeansImplementing(request,
                 org.apache.geronimo.security.credentialstore.CredentialStore.class);
         for (int i = 0; i < objects.length; i++) {
@@ -234,16 +234,15 @@
         return credentialStoreList;
     }
 
-    protected static List getCommonLibs(PortletRequest request) {
+    protected static List<String> getCommonLibs(PortletRequest request) {
         // TODO this is a duplicate of the code from
         // org.apache.geronimo.console.repository.RepositoryViewPortlet.doView()
         // TODO need to eliminate this duplicate code probably by putting it in a common place
-        List list = new ArrayList();
+        List<String> list = new ArrayList<String>();
         ListableRepository[] repos = PortletManager.getCurrentServer(request).getRepositories();
         for (int i = 0; i < repos.length; i++) {
             ListableRepository repo = repos[i];
-            final SortedSet artifacts = repo.list();
-            for (Iterator iterator = artifacts.iterator(); iterator.hasNext();) {
+            for (Iterator<Artifact> iterator = repo.list().iterator(); iterator.hasNext();) {
                 String fileName = iterator.next().toString();
                 list.add(fileName);
             }



Mime
View raw message