You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by mc...@apache.org on 2010/04/30 08:24:25 UTC

svn commit: r939565 - in /geronimo/devtools/eclipse-plugin/trunk/plugins: org.apache.geronimo.st.core/ org.apache.geronimo.st.ui/ org.apache.geronimo.st.v30.core/ org.apache.geronimo.st.v30.core/META-INF/ org.apache.geronimo.st.v30.core/src/main/java/o...

Author: mcconne
Date: Fri Apr 30 06:24:25 2010
New Revision: 939565

URL: http://svn.apache.org/viewvc?rev=939565&view=rev
Log:
GERONIMODEVTOOLS-615 Create two runtime components for WTP to support deployment of OGSi artifacts

Added:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanCreationOperation.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanInstallConfig.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/GeronimoJEEFacetInstallDelegate.java   (with props)
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/facets/
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/facets/GeronimoJEEFacetInstallWizardPage.java   (with props)
Removed:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/DeploymentPlanInstallConfig.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/GeronimoFacetInstallDelegate.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/operations/DeploymentPlanCreationOperation.java
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/FacetInstallPage.java
Modified:
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.xml
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.properties
    geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.properties?rev=939565&r1=939564&r2=939565&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.core/plugin.properties Fri Apr 30 06:24:25 2010
@@ -16,6 +16,6 @@
 #
 # $Rev$ $Date$
 #
-geronimo-facet-label=Geronimo Deployment
+geronimo-facet-label=Geronimo Java EE Deployment
 geronimo-facet-description=Creates Geronimo specific deployment plan file(s).
 geronimoLaunchConfigurationType=Apache Geronimo
\ No newline at end of file

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml?rev=939565&r1=939564&r2=939565&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.ui/plugin.xml Fri Apr 30 06:24:25 2010
@@ -92,7 +92,7 @@
             <enablement>
                 <test forcePluginActivation="true"
                     property="org.eclipse.wst.server.ui.serverType"
-                    value="org.apache.geronimo.*" />
+                    value="org.apache.geronimo.server.1*,org.apache.geronimo.server.2*"/>
             </enablement>
             <action id="org.apache.geronimo.ui.launchSupport"
                 label="%PopupMenus.launchSupport" icon="icons/obj16/littleG.gif"
@@ -110,7 +110,7 @@
             <enablement>
                 <test forcePluginActivation="true"
                     property="org.eclipse.wst.server.ui.serverType"
-                    value="org.apache.geronimo.*" />
+                    value="org.apache.geronimo.server.1*,org.apache.geronimo.server.2*"/>
             </enablement>
             <action id="org.apache.geronimo.ui.launchconsole"
                 label="%PopupMenus.launchconsole" icon="icons/obj16/littleG.gif"

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF?rev=939565&r1=939564&r2=939565&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/META-INF/MANIFEST.MF Fri Apr 30 06:24:25 2010
@@ -30,7 +30,9 @@ Require-Bundle: 
 Bundle-ActivationPolicy: lazy
 Export-Package: 
  org.apache.geronimo.st.v30.core,
+ org.apache.geronimo.st.v30.core.commands,
  org.apache.geronimo.st.v30.core.descriptor,
+ org.apache.geronimo.st.v30.core.facets,
  org.apache.geronimo.st.v30.core.internal,
  org.apache.geronimo.st.v30.core.jaxb,
  org.apache.geronimo.st.v30.core.operations

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.properties?rev=939565&r1=939564&r2=939565&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.properties Fri Apr 30 06:24:25 2010
@@ -26,6 +26,10 @@ runtimeTypeVendor=Apache
 serverTypeName=Apache Geronimo v3.0 Server
 serverTypeDescription=Apache Geronimo v3.0 Server
 
+geronimo-facet-label=Geronimo Java EE Deployment
+geronimo-facet-description=Creates Geronimo specific deployment plan file(s).
+geronimoLaunchConfigurationType=Apache Geronimo
+
 serverRootDirectory=Application Server Directory:
 port=Port:
 rmiport=RMI Naming Port:

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.xml?rev=939565&r1=939564&r2=939565&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/plugin.xml Fri Apr 30 06:24:25 2010
@@ -24,17 +24,17 @@
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
-     ## Geronimo Server - Define a 3.0 version of the Geronimo runtime type along with the list of module types that  ##
-     ##                   it supports                                                                                 ##
+     ## Geronimo Runtime Type - Define a 3.0 version of the Geronimo runtime-type along with the list of module types ##
+     ##                         that it supports                                                                      ##
      ##                                                                                                               ##
      ###################################################################################################################
      -->
     <extension point="org.eclipse.wst.server.core.runtimeTypes">
         <runtimeType id="org.apache.geronimo.runtime.30" version="3.0"
-                     name="%runtimeTypeName"
-                     description="%runtimeTypeDescription"
-                     vendor="%runtimeTypeVendor"
-                     class="org.apache.geronimo.st.v30.core.GeronimoRuntime">
+                name="%runtimeTypeName"
+                description="%runtimeTypeDescription"
+                vendor="%runtimeTypeVendor"
+                class="org.apache.geronimo.st.v30.core.GeronimoRuntime">
             <moduleType types="jst.web"       versions="2.2, 2.3, 2.4, 2.5, 3.0"/>
             <moduleType types="jst.ejb"       versions="1.1, 2.0, 2.1, 3.0, 3.1"/>
             <moduleType types="jst.connector" versions="1.0, 1.5"/>
@@ -43,14 +43,20 @@
             <moduleType types="jst.appclient" versions="1.2, 1.3, 1.4, 5.0"/>
             <moduleType types="osgi.app"      versions="1.0"/>
             <moduleType types="osgi.bundle"   versions="1.0"/>
+            <moduleType types="osgi.comp"     versions="1.0"/>
         </runtimeType>
     </extension>
     
 
+
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
-     ## Geronimo Server - Associate a Geronimo server configuration with the Geronimo runtime type defined above      ##
+     ## Geronimo Server Type - Define a Geronimo server-type for the Geronimo runtime-type defined above. In this     ##
+     ##                        case the Geronimo server is simply an instance of the Geronimo runtime. The two are    ##
+     ##                        associated by the runtimeTypeid in the server, and the id of the runtime type. The     ##
+     ##                        runtime-type could also have been a GenericServerRuntime, but we have implemented our  ##
+     ##                        own.                                                                                   ##
      ##                                                                                                               ##
      ###################################################################################################################
      -->
@@ -74,12 +80,13 @@
     </extension>
     
     
+    
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
-     ## Geronimo Server - Associate a runtime target handler with the Geronimo runtime type defined above. This class ##
-     ##                   will provide the libraries required for the development of a Web project targeted for the   ##
-     ##                   Geronimo runtime type.                                                                      ##
+     ## Geronimo Runtime Target Handler - Define a runtime target handler for the Geronimo runtime-type defined       ##
+     ##                                   above. This class will provide the libraries required for the development   ##
+     ##                                   of a Web project targeted for the Geronimo runtime type.                    ##
      ##                                                                                                               ##
      ###################################################################################################################
      -->
@@ -88,20 +95,28 @@
             runtimeTypeIds="org.apache.geronimo.runtime.30"
             class="org.apache.geronimo.st.v30.core.GeronimoServerRuntimeTargetHandler"/>
     </extension>
-    
-    
+
+
+
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
-     ## Geronimo Server - Define a runtime component and the facets it supports                                       ##
+     ## Geronimo Runtime Component - Define a Java EE runtime-component and the facets it supports                    ##
      ##                                                                                                               ##
      ###################################################################################################################
      -->
     <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
-        <runtime-component-type id="org.apache.geronimo.runtime"/>
-        <runtime-component-version type="org.apache.geronimo.runtime" version="3.0"/>
+        <runtime-component-type id="org.apache.geronimo.runtime.jee"/>  
+        <runtime-component-version type="org.apache.geronimo.runtime.jee" version="3.0"/>   
+        <adapter>
+            <runtime-component id="org.apache.geronimo.runtime.jee"/>
+            <factory
+                class="org.eclipse.jst.server.core.internal.RuntimeClasspathProvider$Factory"/>
+            <type
+                class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+        </adapter>
         <supported>
-            <runtime-component id="org.apache.geronimo.runtime" version="3.0"/>
+            <runtime-component id="org.apache.geronimo.runtime.jee" version="3.0"/>
             <facet id="org.apache.geronimo.facet"   version="1.3"/>
             <facet id="jst.web"                     version="2.2,2.3,2.4,2.5,3.0"/>
             <facet id="jst.ejb"                     version="1.1,2.0,2.1,3.0,3.1"/>
@@ -109,40 +124,169 @@
             <facet id="jst.connector"               version="1.0,1.5,1.6"/>
             <facet id="jst.appclient"               version="1.2,1.3,1.4,5.0"/>
             <facet id="jst.utility"                 version="1.0"/>
-            <facet id="osgi.app"                    version="1.0"/>
-            <facet id="osgi.bundle"                 version="1.0"/>
-        </supported>
+        </supported>    
+    </extension>
+    
+    
+    
+    <!-- 
+     ###################################################################################################################
+     ##                                                                                                               ##
+     ## Geronimo Runtime Component - Define a OSGi runtime-component and the facets it supports                       ##
+     ##                                                                                                               ##
+     ###################################################################################################################
+     -->
+    <extension point="org.eclipse.wst.common.project.facet.core.runtimes">
+        <runtime-component-type id="org.apache.geronimo.runtime.osgi"/>  
+        <runtime-component-version type="org.apache.geronimo.runtime.osgi" version="3.0"/>   
+        <adapter>
+            <runtime-component id="org.apache.geronimo.runtime.osgi"/>
+            <factory
+                class="org.eclipse.jst.server.core.internal.RuntimeClasspathProvider$Factory"/>
+            <type
+                class="org.eclipse.jst.common.project.facet.core.IClasspathProvider"/>
+        </adapter>
+        <supported>
+            <runtime-component id="org.apache.geronimo.runtime.osgi" version="3.0"/>    
+            <facet id="osgi.app"        version="1.0"/>
+            <facet id="osgi.bundle"     version="1.0"/>
+            <facet id="osgi.comp"       version="1.0"/>
+        </supported>    
     </extension>
     
     
+    
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
-     ## Geronimo Server - Map the runtime component defined above with the Geronimo runtime type also defined above   ##
+     ## Geronimo Runtime Facet Mapping - Map the runtime-component defined above with the Geronimo runtime-type also  ##
+     ##                                  defined above                                                                ##
      ##                                                                                                               ##
      ###################################################################################################################
      -->
     <extension point="org.eclipse.jst.server.core.runtimeFacetMappings">
         <runtimeFacetMapping
             runtimeTypeId="org.apache.geronimo.runtime.30"
-            runtime-component="org.apache.geronimo.runtime" version="3.0"/>
+            runtime-component="org.apache.geronimo.runtime.jee" version="3.0"/>        
+    </extension>
+    <extension point="org.eclipse.jst.server.core.runtimeFacetMappings">
+        <runtimeFacetMapping
+            runtimeTypeId="org.apache.geronimo.runtime.30"
+            runtime-component="org.apache.geronimo.runtime.osgi" version="3.0"/>        
     </extension>
     
 
+    
+    <!-- 
+     ###################################################################################################################
+     ##                                                                                                               ##
+     ## Geronimo Default Facets - Map the runtime-component defined above to a specific version of the "Geronimo      ##
+     ##                           Java EE Deployment" project facet                                                   ##
+     ##                                                                                                               ##
+     ## Note(s) - This will force the selection of this facet without explicit input from the user                    ##
+     ##                                                                                                               ##
+     ##         - Multiple entries are required to prevent the Geronimo Java EE Deployment facet from being the       ##
+     ##           default for OSGi projects                                                                           ##
+     ##                                                                                                               ##
+     ###################################################################################################################
+     -->
+    <extension point="org.eclipse.wst.common.project.facet.core.defaultFacets"
+        id="org.apache.geronimo.defaultFacets"
+        name="Geronimo Default Facets">
+        <default-facets>
+            <runtime-component id="org.apache.geronimo.runtime.jee" version="3.0"/>
+            <facet id="org.apache.geronimo.facet" version="1.3"/>
+            <context>
+                <fixed-facet id="jst.web"/>
+            </context>
+        </default-facets>
+    </extension> 
+    <extension point="org.eclipse.wst.common.project.facet.core.defaultFacets"
+        id="org.apache.geronimo.defaultFacets"
+        name="Geronimo Default Facets">
+        <default-facets>
+            <runtime-component id="org.apache.geronimo.runtime.jee" version="3.0"/>
+            <facet id="org.apache.geronimo.facet" version="1.3"/>
+            <context>
+                <fixed-facet id="jst.ejb"/>
+            </context>
+        </default-facets>
+    </extension> 
+    <extension point="org.eclipse.wst.common.project.facet.core.defaultFacets"
+        id="org.apache.geronimo.defaultFacets"
+        name="Geronimo Default Facets">
+        <default-facets>
+            <runtime-component id="org.apache.geronimo.runtime.jee" version="3.0"/>
+            <facet id="org.apache.geronimo.facet" version="1.3"/>
+            <context>
+                <fixed-facet id="jst.connector"/>
+            </context>
+        </default-facets>
+    </extension> 
+    <extension point="org.eclipse.wst.common.project.facet.core.defaultFacets"
+        id="org.apache.geronimo.defaultFacets"
+        name="Geronimo Default Facets">
+        <default-facets>
+            <runtime-component id="org.apache.geronimo.runtime.jee" version="3.0"/>
+            <facet id="org.apache.geronimo.facet" version="1.3"/>
+            <context>
+                <fixed-facet id="jst.ear"/>
+            </context>
+        </default-facets>
+    </extension> 
+    <extension point="org.eclipse.wst.common.project.facet.core.defaultFacets"
+        id="org.apache.geronimo.defaultFacets"
+        name="Geronimo Default Facets">
+        <default-facets>
+            <runtime-component id="org.apache.geronimo.runtime.jee" version="3.0"/>
+            <facet id="org.apache.geronimo.facet" version="1.3"/>
+            <context>
+                <fixed-facet id="jst.utility"/>
+            </context>
+        </default-facets>
+    </extension> 
+    <extension point="org.eclipse.wst.common.project.facet.core.defaultFacets"
+        id="org.apache.geronimo.defaultFacets"
+        name="Geronimo Default Facets">
+        <default-facets>
+            <runtime-component id="org.apache.geronimo.runtime.jee" version="3.0"/>
+            <facet id="org.apache.geronimo.facet" version="1.3"/>
+            <context>
+                <fixed-facet id="jst.appclient"/>
+            </context>
+        </default-facets>
+    </extension>
+
+
+
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
-     ## Geronimo Server - Declare the 1.3 version of the "Geronimo Deployment" project-facet and the action that the  ##
-     ##                   user can perform on the facet (i.e., install). Note that the id associated action must be   ##
-     ##                   unique across all plugins.                                                                  ##
+     ## Geronimo Facets - Declare the 1.3 version of the "Geronimo Java EE Deployment" project-facet and the action   ##
+     ##                   that the user can perform on the facet (i.e., install, uninstall, version-change). This     ##
+     ##                   will invoke the FacetInstallPage wizard to configure the Geronimo Deployment Plan for the   ##
+     ##                   Java EE project when it is created.                                                         ##
+     ##                                                                                                               ##
+     ## Note(s) - The id associated with that action must be unique across all plugins because the wizardPages        ##
+     ##           extension point will reference this action by the id (in the corrsponding ui plugin)                ##
+     ##                                                                                                               ##
+     ##         - The action configuration factory is used to enable comminications between the facet action delegate ##
+     ##           and the wizard page(s). The object created by the factory will be populated by the wizard pages and ##
+     ##           can then be read by the action delegate.                                                            ##
+     ##                                                                                                               ##
+     ##         - The GEP only supports the install action                                                            ##
      ##                                                                                                               ##
      ###################################################################################################################
      -->
     <extension point="org.eclipse.wst.common.project.facet.core.facets">
+        <project-facet id="org.apache.geronimo.facet">
+            <label>%geronimo-facet-label</label>
+            <description>%geronimo-facet-description</description>
+        </project-facet>
         <project-facet-version facet="org.apache.geronimo.facet" version="1.3">
             <action type="install" id="geronimo.plan.install.v30">
-                <delegate class="org.apache.geronimo.st.v30.core.operations.GeronimoFacetInstallDelegate"/>
-                <config-factory class="org.apache.geronimo.st.v30.core.DeploymentPlanInstallConfig$Factory"/>
+                <delegate class="org.apache.geronimo.st.v30.core.facets.GeronimoJEEFacetInstallDelegate"/>
+                <config-factory class="org.apache.geronimo.st.v30.core.facets.DeploymentPlanInstallConfig$Factory"/>
             </action>
             <constraint>
                 <or>
@@ -168,33 +312,13 @@
                     <requires facet="jst.web"       version="2.5"/>
                     <requires facet="jst.web"       version="3.0"/>
                     <requires facet="jst.utility"   version="1.0"/>
-                    <requires facet="osgi.app"      version="1.0"/>     
-                    <requires facet="osgi.bundle"   version="1.0"/>     
                 </or>
             </constraint>
         </project-facet-version>
     </extension>
     
-
-    <!-- 
-     ###################################################################################################################
-     ##                                                                                                               ##
-     ## Geronimo Server - Map the runtime component defined above to a specific version of the "Geronimo Deployment"  ##
-     ##                   project facet                                                                               ##
-     ##                                                                                                               ##
-     ###################################################################################################################
-     -->
-    <extension point="org.eclipse.wst.common.project.facet.core.defaultFacets"
-        id="org.apache.geronimo.defaultFacets"
-        name="Geronimo Default Facets">
-        <default-facets>
-            <runtime-component id="org.apache.geronimo.runtime" version="3.0"/>
-            <facet id="org.apache.geronimo.facet" version="1.3"/>
-        </default-facets>
-    </extension>
-
-
-
+    
+    
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
@@ -299,18 +423,4 @@
         </operationExtension>
     </extension>
     
-   
-   
-   <!-- 
-    ###################################################################################################################
-    ##                                                                                                               ##
-    ## Geronimo JAXB Utils                                                                                           ##
-    ##                                                                                                               ##
-    ###################################################################################################################
-    -->
-   <extension-point id="JAXBUtilsProvider" name="Geronimo JAXB Utils" schema="schema/JAXBUtilsProvider.exsd"/>
-   <extension point="org.apache.geronimo.st.v30.core.JAXBUtilsProvider">
-       <provider class="org.apache.geronimo.st.v30.core.jaxb.JAXB21Utils" version="3.0"/>
-   </extension>
- 
 </plugin>

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanCreationOperation.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanCreationOperation.java?rev=939565&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanCreationOperation.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanCreationOperation.java Fri Apr 30 06:24:25 2010
@@ -0,0 +1,307 @@
+/*
+ * 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.st.v30.core.facets;
+
+import javax.xml.bind.JAXBElement;
+
+import org.apache.geronimo.jee.application.Application;
+import org.apache.geronimo.jee.applicationclient.ApplicationClient;
+import org.apache.geronimo.jee.connector.Connector;
+import org.apache.geronimo.jee.connector.Resourceadapter;
+import org.apache.geronimo.jee.deployment.Artifact;
+import org.apache.geronimo.jee.deployment.Dependency;
+import org.apache.geronimo.jee.deployment.Dependencies;
+import org.apache.geronimo.jee.deployment.Environment;
+import org.apache.geronimo.jee.openejb.OpenejbJar;
+import org.apache.geronimo.jee.web.WebApp;
+import org.apache.geronimo.st.v30.core.Activator;
+import org.apache.geronimo.st.v30.core.GeronimoUtils;
+import org.apache.geronimo.st.v30.core.internal.Trace;
+import org.apache.geronimo.st.v30.core.jaxb.JAXBUtils;
+import org.apache.geronimo.st.v30.core.operations.AbstractGeronimoJ2EEComponentOperation;
+import org.apache.geronimo.st.v30.core.operations.IDeploymentPlanCreationOp;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+
+
+/**
+ * <strong>DeploymentPlanCreationOperation</strong>
+ * is invoked when projects are created that are to be deployment on the 2.1
+ * version of the Geronimo server. One of these Geronimo-specific deployment
+ * plans is created as a result and is inserted into the user's Eclipse workspace in
+ * the appropriate folder:
+ * 
+ * <ol>
+ *      <li>geronimo-application.xml
+ *      <li>geronimo-application-client.xml
+ *      <li>geronimo-ra.xml
+ *      <li>geronimo-service.xml
+ *      <li>geronimo-web.xml
+ *      <li>openejb-jar.xml
+ * </ol>
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DeploymentPlanCreationOperation extends
+        AbstractGeronimoJ2EEComponentOperation implements
+        IDeploymentPlanCreationOp {
+    
+    DeploymentPlanInstallConfig cfg;
+
+    public DeploymentPlanCreationOperation(IDataModel model, Object config) {
+        super(model);
+        this.cfg = (DeploymentPlanInstallConfig) config;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.core.commands.operations.AbstractOperation#execute(org.eclipse.core.runtime.IProgressMonitor,
+     *      org.eclipse.core.runtime.IAdaptable)
+     */
+    public IStatus execute(IProgressMonitor monitor, IAdaptable info)
+            throws ExecutionException {
+        try {
+            execute();
+        }catch (Exception e){
+            return new Status(IStatus.ERROR,Activator.PLUGIN_ID,"Error in creating deployment plan",e);
+        }
+        return Status.OK_STATUS;
+    }
+
+    public void execute() throws Exception {
+        IVirtualComponent comp = ComponentCore.createComponent(getProject());
+
+        String type = J2EEProjectUtilities.getJ2EEProjectType(getProject());
+
+        if (IModuleConstants.JST_WEB_MODULE.equals(type)) {
+            createGeronimoWebDeploymentPlan(GeronimoUtils.getWebDeploymentPlanFile(comp));          
+        } else if (IModuleConstants.JST_EJB_MODULE.equals(type)) {
+            createOpenEjbDeploymentPlan(GeronimoUtils.getOpenEjbDeploymentPlanFile(comp));
+        } else if (IModuleConstants.JST_EAR_MODULE.equals(type)) {
+            createGeronimoApplicationDeploymentPlan(GeronimoUtils.getApplicationDeploymentPlanFile(comp));
+        } else if (IModuleConstants.JST_APPCLIENT_MODULE.equals(type)) {
+            createGeronimoApplicationClientDeploymentPlan(GeronimoUtils.getApplicationClientDeploymentPlanFile(comp));
+        } else if (IModuleConstants.JST_CONNECTOR_MODULE.equals(type)) {
+            createConnectorDeploymentPlan(GeronimoUtils.getConnectorDeploymentPlanFile(comp));
+        } else if (IModuleConstants.JST_UTILITY_MODULE.equals(type)) {
+            createServiceDeploymentPlan(GeronimoUtils.getServiceDeploymentPlanFile(comp));
+        }
+    }
+
+    
+    public JAXBElement createServiceDeploymentPlan(IFile file) throws Exception{
+        return null;
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createGeronimoApplicationDeploymentPlan(org.eclipse.core.resources.IFile)
+     */
+    public JAXBElement createGeronimoApplicationDeploymentPlan(IFile dpFile) throws Exception {
+        Trace.tracePoint("Entry",
+                "DeploymentPlanCreationOperation.createGeronimoApplicationDeploymentPlan", dpFile);
+
+        org.apache.geronimo.jee.application.ObjectFactory applicationFactory = new org.apache.geronimo.jee.application.ObjectFactory();
+        Application application = applicationFactory.createApplication();
+
+        application.setApplicationName(getProject().getName());
+        application.setEnvironment(getConfigEnvironment());
+
+        JAXBElement jaxbElement = applicationFactory.createApplication(application);
+        JAXBUtils.marshalDeploymentPlan(jaxbElement, dpFile);
+
+        Trace.tracePoint("Exit ", "DeploymentPlanCreationOperation.createGeronimoApplicationDeploymentPlan",
+                applicationFactory.createApplication(application));
+        return applicationFactory.createApplication(application);
+    }
+
+    
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createGeronimoWebDeploymentPlan(org.eclipse.core.resources.IFile)
+     */
+    public JAXBElement createGeronimoWebDeploymentPlan(IFile dpFile) throws Exception {
+        Trace.tracePoint("Entry", "DeploymentPlanCreationOperation.createGeronimoWebDeploymentPlan",
+                dpFile, dpFile.getFullPath());
+
+        org.apache.geronimo.jee.web.ObjectFactory webFactory = new org.apache.geronimo.jee.web.ObjectFactory();
+        WebApp web = webFactory.createWebApp();
+
+        web.setContextRoot("/" + getProject().getName());
+        web.setEnvironment(getConfigEnvironment());
+
+        JAXBElement jaxbElement = webFactory.createWebApp(web);
+        JAXBUtils.marshalDeploymentPlan(jaxbElement, dpFile);
+
+        Trace.tracePoint("Exit ", "DeploymentPlanCreationOperation.createGeronimoWebDeploymentPlan", jaxbElement);
+        return jaxbElement;
+    }
+
+    
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createOpenEjbDeploymentPlan(org.eclipse.core.resources.IFile)
+     */
+    public JAXBElement createOpenEjbDeploymentPlan(IFile dpFile) throws Exception {
+        Trace.tracePoint("Entry", "DeploymentPlanCreationOperation.createOpenEjbDeploymentPlan", dpFile);
+
+        org.apache.geronimo.jee.openejb.ObjectFactory ejbFactory = new org.apache.geronimo.jee.openejb.ObjectFactory();
+        OpenejbJar ejbJar = ejbFactory.createOpenejbJar();
+
+        ejbJar.setEnvironment(getConfigEnvironment());
+
+        JAXBElement jaxbElement = ejbFactory.createOpenejbJar(ejbJar);
+        JAXBUtils.marshalDeploymentPlan(jaxbElement, dpFile);
+
+        Trace.tracePoint("Exit ", "DeploymentPlanCreationOperation.createOpenEjbDeploymentPlan", jaxbElement);
+        return jaxbElement;
+    }
+
+    
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createConnectorDeploymentPlan(org.eclipse.core.resources.IFile)
+     */
+    public JAXBElement createConnectorDeploymentPlan(IFile dpFile) throws Exception {
+        Trace.tracePoint("Entry", "DeploymentPlanCreationOperation.createConnectorDeploymentPlan", dpFile);
+
+        org.apache.geronimo.jee.connector.ObjectFactory connectorFactory = new org.apache.geronimo.jee.connector.ObjectFactory();
+        Connector connector = connectorFactory.createConnector();
+        Resourceadapter resourceadapter = connectorFactory.createResourceadapter();
+    
+        connector.setEnvironment(getConfigEnvironment());
+        connector.getResourceadapter().add(resourceadapter);
+
+        JAXBElement jaxbElement = connectorFactory.createConnector(connector);
+        JAXBUtils.marshalDeploymentPlan(jaxbElement, dpFile);
+
+        Trace.tracePoint("Exit ", "DeploymentPlanCreationOperation.createConnectorDeploymentPlan", jaxbElement);
+        return jaxbElement;
+    }
+
+        
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.apache.geronimo.st.core.operations.IDeploymentPlanCreationOp#createGeronimoApplicationDeploymentPlan(org.eclipse.core.resources.IFile)
+     */
+    public JAXBElement createGeronimoApplicationClientDeploymentPlan(IFile dpFile) throws Exception {
+        Trace.tracePoint("Entry","DeploymentPlanCreationOperation.createGeronimoApplicationClientDeploymentPlan", dpFile);
+
+        org.apache.geronimo.jee.applicationclient.ObjectFactory applicationClientFactory = new org.apache.geronimo.jee.applicationclient.ObjectFactory();
+        ApplicationClient applicationClient = applicationClientFactory.createApplicationClient();
+
+        applicationClient.setServerEnvironment(getConfigEnvironment());
+        applicationClient.setClientEnvironment(getConfigEnvironment());
+        
+        JAXBElement jaxbElement = applicationClientFactory.createApplicationClient(applicationClient);
+        JAXBUtils.marshalDeploymentPlan(jaxbElement, dpFile);
+
+        Trace.tracePoint("Exit ", "DeploymentPlanCreationOperation.createGeronimoApplicationClientDeploymentPlan", applicationClientFactory.createApplicationClient(applicationClient));
+        return applicationClientFactory.createApplicationClient(applicationClient);
+    }
+
+    
+    public Environment getConfigEnvironment() {
+        Trace.tracePoint("Entry", "DeploymentPlanCreationOperation.getConfigEnvironment");
+        
+        String groupId = cfg != null && hasValue(cfg.getGroupId()) ? cfg.getGroupId()
+                : "default";
+        String artifactId = cfg != null && hasValue(cfg.getArtifactId()) ? cfg.getArtifactId()
+                : getProject().getName();
+        String version = cfg != null && hasValue(cfg.getVersion()) ? cfg.getVersion()
+                : "1.0";
+        String type = cfg != null && hasValue(cfg.getType()) ? cfg.getType()
+                : "car";
+
+        Artifact artifact = createArtifact(groupId, artifactId, version, type);
+        org.apache.geronimo.jee.deployment.ObjectFactory serviceFactory = new org.apache.geronimo.jee.deployment.ObjectFactory();
+   
+        Environment env = serviceFactory.createEnvironment();
+        env.setModuleId(artifact);
+
+        if (cfg != null && cfg.isSharedLib()) {
+            Dependencies dt = serviceFactory.createDependencies();
+            Dependency sharedLib = createDependency("org.apache.geronimo.configs", "sharedlib", null, "car");
+            dt.getDependency().add(sharedLib);
+            env.setDependencies(dt);
+        }
+
+        Trace.tracePoint("Exit ", "DeploymentPlanCreationOperation.getConfigEnvironment", env);
+        return env;
+    }
+
+    
+    public static Artifact createArtifact(String groupId, String artifactId, String version, String type) {
+        Trace.tracePoint("Entry", "DeploymentPlanCreationOperation.createArtifact", groupId, artifactId, version, type);
+
+        org.apache.geronimo.jee.deployment.ObjectFactory serviceFactory = new org.apache.geronimo.jee.deployment.ObjectFactory();
+        Artifact artifact = serviceFactory.createArtifact();
+
+        if (groupId != null)
+            artifact.setGroupId(groupId);
+        if (artifactId != null)
+            artifact.setArtifactId(artifactId);
+        if (version != null)
+            artifact.setVersion(version);
+        artifact.setType(type);
+        
+        Trace.tracePoint("Exit ", "DeploymentPlanCreationOperation.createArtifact", artifact);
+        return artifact;
+    }
+
+    
+    public static Dependency createDependency(String groupId, String artifactId, String version, String type) {
+        Trace.tracePoint("Entry", "DeploymentPlanCreationOperation.createDependency", groupId, artifactId, version, type);
+
+        org.apache.geronimo.jee.deployment.ObjectFactory serviceFactory = new org.apache.geronimo.jee.deployment.ObjectFactory();
+        Dependency dependency = serviceFactory.createDependency();
+        if (groupId != null)
+            dependency.setGroupId(groupId);
+        if (artifactId != null)
+            dependency.setArtifactId(artifactId);
+        if (version != null)
+            dependency.setVersion(version);
+        dependency.setType(type);
+        
+        Trace.tracePoint("Exit ", "DeploymentPlanCreationOperation.createDependency", dependency);
+        return dependency;
+    }
+
+    
+    private static boolean hasValue(String attribute) {
+        Trace.tracePoint("Entry", "DeploymentPlanCreationOperation.hasValue", attribute);
+        Trace.tracePoint("Exit ", "DeploymentPlanCreationOperation.hasValue", (attribute != null && attribute.trim().length() != 0) );
+        
+        return attribute != null && attribute.trim().length() != 0;
+    }
+
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanCreationOperation.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanCreationOperation.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanCreationOperation.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanInstallConfig.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanInstallConfig.java?rev=939565&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanInstallConfig.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanInstallConfig.java Fri Apr 30 06:24:25 2010
@@ -0,0 +1,107 @@
+/*
+ * 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.st.v30.core.facets;
+
+import org.apache.geronimo.st.v30.core.internal.Trace;
+import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
+import org.eclipse.jst.j2ee.internal.plugin.J2EEPreferences;
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+
+/**
+ * <b>DeploymentPlanInstallConfig</b> is used to enable comminications between the facet action delegate and any
+ * wizard page(s). The object created by the factory will be populated by the wizard page(s) 
+ * (i.e., GeronimoJEEFacetInstallWizardPage) and can then be read by corresponding action delegate 
+ * (i.e., GeronimoJEEFacetInstallDelegate). 
+ * 
+ * @version $Rev$ $Date$
+ */
+public class DeploymentPlanInstallConfig {
+    
+    private String groupId;
+    
+    private String artifactId;
+    
+    private String version;
+    
+    private String type;
+    
+    private boolean sharedLib;
+    
+    public static final class Factory implements IActionConfigFactory {
+    
+        public Object create() {
+            Trace.tracePoint("Entry/Exit", "DeploymentPlanInstallConfig.create");
+            
+            enableGenerationDDByDefault();
+            
+            return new DeploymentPlanInstallConfig();
+        }
+        
+        /*
+         * by default, WTP won't generate deployment descriptor for all the projects(only true for web project).
+         * Try to generate deployment descriptor by default for all projects, the default value are set here
+         * 
+         * reference to J2EEPreferences.java in org.eclipse.jst.j2ee bundle
+         */
+        private void enableGenerationDDByDefault(){
+            J2EEPlugin.getDefault().getJ2EEPreferences().setValue(J2EEPreferences.Keys.APPLICATION_GENERATE_DD,true);
+            J2EEPlugin.getDefault().getJ2EEPreferences().setValue(J2EEPreferences.Keys.DYNAMIC_WEB_GENERATE_DD,true);
+            J2EEPlugin.getDefault().getJ2EEPreferences().setValue(J2EEPreferences.Keys.EJB_GENERATE_DD,true);
+            J2EEPlugin.getDefault().getJ2EEPreferences().setValue(J2EEPreferences.Keys.APP_CLIENT_GENERATE_DD,true);
+        }
+    }
+
+    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 boolean isSharedLib() {
+        return sharedLib;
+    }
+
+    public void setSharedLib(boolean sharedLib) {
+        this.sharedLib = sharedLib;
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanInstallConfig.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanInstallConfig.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/DeploymentPlanInstallConfig.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/GeronimoJEEFacetInstallDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/GeronimoJEEFacetInstallDelegate.java?rev=939565&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/GeronimoJEEFacetInstallDelegate.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/GeronimoJEEFacetInstallDelegate.java Fri Apr 30 06:24:25 2010
@@ -0,0 +1,92 @@
+/*
+ * 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.st.v30.core.facets;
+
+import org.apache.geronimo.st.v30.core.internal.Trace;
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.jst.common.project.facet.JavaProjectFacetCreationDataModelProvider;
+import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.IProjectFacet;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
+
+/**
+ * <b>GeronimoJEEFacetInstallDelegate</b> implements any Geronimo-specific functions for JEE projects when the 
+ *    project is created, which is mainly to create a Geronimo deployment plan
+ * 
+ * @version $Rev$ $Date$
+ */
+public class GeronimoJEEFacetInstallDelegate implements IDelegate {
+
+    public static final String FACET_ID = "org.apache.geronimo.facet";
+
+    /**
+     * The method that's called to execute the delegate
+     * 
+     * @param project   The workspace project
+     * @param fv        The project facet version that this delegate is handling; this
+     *                  is useful when sharing the delegate among several versions of the same
+     *                  project facet or even different project facets
+     * @param config    The configuration object, or null if defaults should be used
+     * @param monitor   The progress monitor
+     * 
+     * @throws CoreException if the delegate fails for any reason
+     */
+    public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor) throws CoreException {
+        Trace.tracePoint("Entry", "GeronimoJEEFacetInstallDelegate.execute", project, fv, config, monitor);
+
+        try {
+            createDeploymentPlanCreationOp(project, config).execute(monitor, null);
+        } catch (ExecutionException e) {
+            e.printStackTrace();
+        }
+
+        IProject[] ears = J2EEProjectUtilities.getReferencingEARProjects(project);
+        IProjectFacet facet = ProjectFacetsManager.getProjectFacet(FACET_ID);
+        for (int i = 0; i < ears.length; i++) {
+            IFacetedProject fp = ProjectFacetsManager.create(ears[i]);
+            if (!fp.hasProjectFacet(facet)) {
+                try {
+                    createDeploymentPlanCreationOp(ears[i], config).execute(monitor, null);
+                } catch (ExecutionException e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        Trace.tracePoint("Exit ", "GeronimoJEEFacetInstallDelegate.execute");
+    }
+
+    public IDataModelOperation createDeploymentPlanCreationOp(IProject project, Object config) {
+        Trace.tracePoint("Entry", "GeronimoJEEFacetInstallDelegate.createDeploymentPlanCreationOp", project, config);
+        
+        IDataModel model = DataModelFactory.createDataModel(new JavaProjectFacetCreationDataModelProvider());
+        model.setStringProperty(IFacetDataModelProperties.FACET_PROJECT_NAME, project.getName());
+        
+        Trace.tracePoint("Exit ", "GeronimoJEEFacetInstallDelegate.createDeploymentPlanCreationOp");
+        return new DeploymentPlanCreationOperation(model, config);       
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/GeronimoJEEFacetInstallDelegate.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/GeronimoJEEFacetInstallDelegate.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.core/src/main/java/org/apache/geronimo/st/v30/core/facets/GeronimoJEEFacetInstallDelegate.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.properties
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.properties?rev=939565&r1=939564&r2=939565&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.properties (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.properties Fri Apr 30 06:24:25 2010
@@ -17,3 +17,9 @@
 # $Rev$ $Date$
 #
 serverEditorPluginPage=Plugin
+pluginName=Geronimo Server Tools UI
+providerName=Apache Software Foundation
+
+PopupMenus.launchconsole=Launch Geronimo Console
+PopupMenus.launchSupport=Launch Geronimo Support
+deploymentPlanEditorName=Geronimo Deployment Plan Editor

Modified: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml?rev=939565&r1=939564&r2=939565&view=diff
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml (original)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/plugin.xml Fri Apr 30 06:24:25 2010
@@ -63,14 +63,14 @@
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
-     ## Geronimo Server - Map the action defined for the "Geronimo Deployment" project-facet to a specific class. The ##
-     ##                   action must have been defined in the corresponding core plugin.                             ## 
+     ## Geronimo Facets - Map the action defined for the "Geronimo Java EE Deployment" project-facet to a specific    ##
+     ##                   wizard class. The action must have been defined in the corresponding core plugin.           ## 
      ##                                                                                                               ##
      ###################################################################################################################
      -->
     <extension point="org.eclipse.wst.common.project.facet.ui.wizardPages">
         <wizard-pages action="geronimo.plan.install.v30">
-            <page class="org.apache.geronimo.st.v30.ui.wizards.FacetInstallPage"/>
+            <page class="org.apache.geronimo.st.v30.ui.wizards.facets.GeronimoJEEFacetInstallWizardPage"/>
         </wizard-pages>
     </extension>
 
@@ -79,8 +79,8 @@
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
-     ## Geronimo Server - Define the icon for the Geronimo facet. The runtime component must have been defined in the ##
-     ##                   corresponding core plugin.                                                                  ##
+     ## Geronimo Facets - Define the icon for the Geronimo Jave EE and OSGi facets. The runtime component must have   ##
+     ##                   been defined in the corresponding core plugin.                                              ##
      ##                                                                                                               ##
      ###################################################################################################################
      -->
@@ -225,7 +225,7 @@
             <enablement>
                 <test forcePluginActivation="true"
                     property="org.eclipse.wst.server.ui.serverType"
-                    value="org.apache.geronimo.*" />
+                    value="org.apache.geronimo.server.3*" />
             </enablement>
             <action id="org.apache.geronimo.ui.launchSupport"
                 label="%PopupMenus.launchSupport" icon="icons/obj16/littleG.gif"
@@ -243,7 +243,7 @@
             <enablement>
                 <test forcePluginActivation="true"
                     property="org.eclipse.wst.server.ui.serverType"
-                    value="org.apache.geronimo.*" />
+                    value="org.apache.geronimo.server.3*" />
             </enablement>
             <action id="org.apache.geronimo.ui.launchconsole"
                 label="%PopupMenus.launchconsole" icon="icons/obj16/littleG.gif"
@@ -282,13 +282,12 @@
     </extension>
     
 
-
-    
     
     <!-- 
      ###################################################################################################################
      ##                                                                                                               ##
-     ## Refactoring                                                                                                   ##
+     ## Refactoring - Invoked when the user changes a project name, so that the artifact ID in the deployment plan    ##
+     ##               changes automatically                                                                           ##
      ##                                                                                                               ##
      ###################################################################################################################
      -->
@@ -306,7 +305,6 @@
         </renameParticipant>    
     </extension>
 
-    
 
 
     <!-- 

Added: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/facets/GeronimoJEEFacetInstallWizardPage.java
URL: http://svn.apache.org/viewvc/geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/facets/GeronimoJEEFacetInstallWizardPage.java?rev=939565&view=auto
==============================================================================
--- geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/facets/GeronimoJEEFacetInstallWizardPage.java (added)
+++ geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/facets/GeronimoJEEFacetInstallWizardPage.java Fri Apr 30 06:24:25 2010
@@ -0,0 +1,140 @@
+/*
+ * 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.st.v30.ui.wizards.facets;
+
+import org.apache.geronimo.st.v30.core.facets.DeploymentPlanInstallConfig;
+import org.apache.geronimo.st.v30.ui.CommonMessages;
+import org.apache.geronimo.st.v30.ui.internal.Trace;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
+
+/**
+ * <b>GeroniomoJEEFacetInstallWizardPage</b> gathers user input to create the Geronmio deployment plan. It
+ *    is invoked just prior to the installation of the corresponding facet. 
+ * 
+ * @version $Rev$ $Date$
+ */
+public class GeronimoJEEFacetInstallWizardPage extends AbstractFacetWizardPage {
+
+    private DeploymentPlanInstallConfig config;
+
+    private Text groupText;
+    private Text artifactText;
+    private Text versionText;
+    private Text typeText;
+    private Button sharedLib;
+
+    public GeronimoJEEFacetInstallWizardPage() {
+        super("geronimo.plan.install");
+        Trace.tracePoint("Constructor Entry", "GeroniomoJEEFacetInstallWizardPage");
+        
+        setTitle("Geronimo Deployment Plan");
+        setDescription("Configure the geronimo deployment plan.");
+        
+        Trace.tracePoint("Constructor Exit", "GeronimoJEEFacetInstallWizardPage");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.wst.common.project.facet.ui.IFacetWizardPage#setConfig(java.lang.Object)
+     */
+    public void setConfig(Object config) {
+        Trace.tracePoint("Entry", "GeronimoJEEFacetInstallWizardPage.setConfig", config);
+
+        this.config = (DeploymentPlanInstallConfig) config;
+        
+        Trace.tracePoint("Exit", "GeronimoJEEFacetInstallWizardPage.setConfig");
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
+     */
+    public void createControl(Composite parent) {
+        Trace.tracePoint("Entry", "GeronimoJEEFacetInstallWizardPage.createControl", parent);
+        
+        Composite composite = new Composite(parent, SWT.NONE);
+        composite.setLayout(new GridLayout(2, false));
+
+        Label groupLabel = new Label(composite, SWT.NONE);
+        groupLabel.setText(CommonMessages.groupId);
+
+        groupText = new Text(composite, SWT.BORDER);
+        groupText.setLayoutData(createGridData());
+        groupText.setText("default");
+        
+        Label artifactLabel = new Label(composite, SWT.NONE);
+        artifactLabel.setText(CommonMessages.artifactId);
+
+        artifactText = new Text(composite, SWT.BORDER);
+        artifactText.setLayoutData(createGridData());
+        
+        Label versionLabel = new Label(composite, SWT.NONE);
+        versionLabel.setText(CommonMessages.version);
+
+        versionText = new Text(composite, SWT.BORDER);
+        versionText.setLayoutData(createGridData());
+        versionText.setText("1.0");
+        
+        Label typeLabel = new Label(composite, SWT.NONE);
+        typeLabel.setText(CommonMessages.artifactType);
+
+        typeText = new Text(composite, SWT.BORDER);
+        typeText.setLayoutData(createGridData());
+        typeText.setText("car");
+        
+        sharedLib = new Button(composite, SWT.CHECK);
+        GridData data = createGridData();
+        data.horizontalSpan = 2;
+        data.verticalIndent = 5;
+        sharedLib.setLayoutData(data);
+        sharedLib.setText(CommonMessages.addSharedLib);
+        
+        setControl(composite);
+        
+        Trace.tracePoint("Exit", "GeronimoJEEFacetInstallWizardPage.createControl");      
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage#transferStateToConfig()
+     */
+    public void transferStateToConfig() {
+        Trace.tracePoint("Entry", "GeronimoJEEFacetInstallWizardPage.transferStateToConfig");     
+    
+        config.setGroupId(groupText.getText());
+        config.setArtifactId(artifactText.getText());
+        config.setVersion(versionText.getText());
+        config.setType(typeText.getText());
+        config.setSharedLib(sharedLib.getSelection());
+        
+        Trace.tracePoint("Exit", "GeronimoJEEFacetInstallWizardPage.transferStateToConfig");      
+    }
+
+    private static GridData createGridData() {
+        return new GridData(GridData.FILL_HORIZONTAL);
+    }
+}

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/facets/GeronimoJEEFacetInstallWizardPage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/facets/GeronimoJEEFacetInstallWizardPage.java
------------------------------------------------------------------------------
    svn:keywords = Date Revision

Propchange: geronimo/devtools/eclipse-plugin/trunk/plugins/org.apache.geronimo.st.v30.ui/src/main/java/org/apache/geronimo/st/v30/ui/wizards/facets/GeronimoJEEFacetInstallWizardPage.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain