[jbosstools-commits] JBoss Tools SVN: r30320 - in trunk/bpel/plugins/org.jboss.tools.bpel.runtimes: src/org/jboss/tools/bpel/runtimes and 2 other directories.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Tue Apr 5 11:14:04 EDT 2011


Author: bbrodt
Date: 2011-04-05 11:14:04 -0400 (Tue, 05 Apr 2011)
New Revision: 30320

Added:
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/facets/BPELCoreFacetUninstallDelegate.java
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/facets/JBT_BPELFacetInstallDataModelProvider.java
Modified:
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.properties
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.xml
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/IBPELModuleFacetConstants.java
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELDeployableArtifactUtil.java
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELModuleFactoryDelegate.java
Log:
https://issues.jboss.org/browse/JBIDE-8533
Deprecated the jbt.bpel.facet.core in favor of bpel.facet.core with backward compatibility for SOA-P 5.1


Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.properties
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.properties	2011-04-05 01:26:19 UTC (rev 30319)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.properties	2011-04-05 15:14:04 UTC (rev 30320)
@@ -16,9 +16,14 @@
 MODULE_TYPE_DESCRIPTION=Module representing a BPEL process
 
 BPEL_CORE_FACET_LABEL=BPEL 2.0 Facet
-BPEL_CORE_FACET_DESCRIPTION=Enables modelling and deployment of BPEL processes.
+BPEL_CORE_FACET_DESCRIPTION=Enables modeling and deployment of BPEL processes.
 BPEL_FACET_CATEGORY_LABEL=BPEL 2.0
 BPEL_FACET_TEMPLATE_LABEL=BPEL 2.0 Project
 NEW_BPEL_CATEGORY=BPEL 2.0
 NEW_BPEL_PROJECT=BPEL Project
 NEW_BPEL_PROJECT_DESCRIPTION=Create a new BPEL project. 
+
+# This is provided for backward compatibility with the deprecated jbt.bpel.facet.core
+OLD_BPEL_CORE_FACET_LABEL=JBoss BPEL 2.0 Facet (SOA-P v5.1 and earlier)
+OLD_BPEL_CORE_FACET_DESCRIPTION=Enables modeling and deployment of BPEL processes to JBoss SOA-Platform version 5.1 and earlier.
+OLD_BPEL_FACET_TEMPLATE_LABEL=JBoss BPEL 2.0 Project (SOA-P v5.1 and earlier)

Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.xml
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.xml	2011-04-05 01:26:19 UTC (rev 30319)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/plugin.xml	2011-04-05 15:14:04 UTC (rev 30320)
@@ -65,14 +65,19 @@
 <!-- BPEL Facet							 									 -->
 <!--=========================================================================-->
 
+	<!--
+	This facet is now the same as the one defined by the eclipse.org BPEL editor.
+	An uninstall action was added to allow the facet to be swapped out with the
+	deprecated jbt.bpel.facet.core facet, or to be removed altogether
+	-->
 	<extension point="org.eclipse.wst.common.project.facet.core.facets">
 		
-		<project-facet id="jbt.bpel.facet.core">
+		<project-facet id="bpel.facet.core">
 		  <label>%BPEL_CORE_FACET_LABEL</label>
 		  <description>%BPEL_CORE_FACET_DESCRIPTION</description>
 		</project-facet>
 		
-		<project-facet-version facet="jbt.bpel.facet.core" version="2.0">
+		<project-facet-version facet="bpel.facet.core" version="2.0">
           <group-member
                id="modules">
           </group-member>
@@ -83,19 +88,65 @@
           </constraint>
         </project-facet-version>
                 
-        <action facet="jbt.bpel.facet.core" version="2.0" type="INSTALL" id="bpel.facet.core.install">
+        <action facet="bpel.facet.core" version="2.0" type="INSTALL" id="bpel.facet.core.install">
                <delegate class="org.jboss.tools.bpel.runtimes.facets.BPELCoreFacetInstallDelegate"/>
                <config-factory class="org.jboss.tools.bpel.runtimes.facets.BPELFacetInstallDataModelProvider"/>
         </action>
 
-			
+        <action facet="bpel.facet.core" version="2.0" type="UNINSTALL" id="bpel.facet.core.uninstall">
+               <delegate class="org.jboss.tools.bpel.runtimes.facets.BPELCoreFacetUninstallDelegate"/>
+        </action>
+
 		<category id="bpel.category">
 		  <label>%BPEL_FACET_CATEGORY_LABEL</label>
-		  <description>%bpelCoreFacetDescription</description>
+		  <description>%BPEL_CORE_FACET_DESCRIPTION</description>
 		</category>
 		
 		<template id="jbt.template.bpel.core">
     		<label>%BPEL_FACET_TEMPLATE_LABEL</label>
+       		<fixed facet="bpel.facet.core"/>
+	   </template>
+    	
+	</extension>
+
+	<!--
+	This facet is has been deprecated, but retained for backward compatibility
+	with JBoss 5.1.0 and SOA-P 5.1 and earlier
+	-->
+	<extension point="org.eclipse.wst.common.project.facet.core.facets">
+		
+		<project-facet id="jbt.bpel.facet.core">
+		  <label>%OLD_BPEL_CORE_FACET_LABEL</label>
+		  <description>%OLD_BPEL_CORE_FACET_DESCRIPTION</description>
+		</project-facet>
+		
+		<project-facet-version facet="jbt.bpel.facet.core" version="2.0">
+          <group-member
+               id="modules">
+          </group-member>
+          <constraint>
+            <and>
+               <conflicts group="modules"/>
+            </and>
+          </constraint>
+        </project-facet-version>
+        
+		<category id="bpel.category">
+		  <label>%OLD_BPEL_FACET_CATEGORY_LABEL</label>
+		  <description>%OLD_BPEL_CORE_FACET_DESCRIPTION</description>
+		</category>
+                
+        <action facet="jbt.bpel.facet.core" version="2.0" type="INSTALL" id="jbt.bpel.facet.core.install">
+               <delegate class="org.jboss.tools.bpel.runtimes.facets.BPELCoreFacetInstallDelegate"/>
+               <config-factory class="org.jboss.tools.bpel.runtimes.facets.JBT_BPELFacetInstallDataModelProvider"/>
+        </action>
+
+        <action facet="jbt.bpel.facet.core" version="2.0" type="UNINSTALL" id="jbt.bpel.facet.core.uninstall">
+               <delegate class="org.jboss.tools.bpel.runtimes.facets.BPELCoreFacetUninstallDelegate"/>
+        </action>
+		
+		<template id="jbt.template.bpel.core">
+    		<label>%OLD_BPEL_FACET_TEMPLATE_LABEL</label>
        		<fixed facet="jbt.bpel.facet.core"/>
 	   </template>
     	
@@ -108,7 +159,7 @@
     <extension
          point="org.eclipse.wst.common.modulecore.componentimpl">
       <componentimpl
-            typeID="jbt.bpel.facet.core"
+            typeID="bpel.facet.core"
             class="org.jboss.tools.bpel.runtimes.facets.BPELVirtualComponent">
       </componentimpl>
    </extension>
@@ -119,7 +170,7 @@
 <!--=========================================================================-->		
 			
 	<extension point="org.eclipse.wst.common.project.facet.ui.images">
-    	<image facet="jbt.bpel.facet.core" path="icons/obj16/bpelfacet.gif"/>
+    	<image facet="bpel.facet.core" path="icons/obj16/bpelfacet.gif"/>
     </extension>
 
 <!--=========================================================================-->
@@ -279,7 +330,7 @@
         <runtime-component
          	id="org.jboss.ide.eclipse.as.runtime.stripped.component"
          	version="1.0"/>
-       <facet id="jbt.bpel.facet.core" version="1.2,2.0"/>
+       <facet id="bpel.facet.core" version="1.2,2.0"/>
      </supported>
  </extension>
 
@@ -293,7 +344,7 @@
         		<runtime-component
          			id="org.jboss.ide.eclipse.eap.runtime.component"
          			version="5.0"/>
-                <facet id="jbt.bpel.facet.core" version="1.2,2.0"/>
+                <facet id="bpel.facet.core" version="1.2,2.0"/>
      		</supported>
    </extension>
 		
@@ -309,22 +360,29 @@
       <runtime-component-version
             type="org.jboss.ide.eclipse.as.runtime.component"
             version="7.0"/>
+
       <supported>
         <runtime-component version="5.1"
          	id="org.jboss.ide.eclipse.as.runtime.component"/>
+        <facet id="bpel.facet.core" version="1.2,2.0"/>
+     </supported>
+
+      <supported>
+        <runtime-component version="5.1"
+         	id="org.jboss.ide.eclipse.as.runtime.component"/>
         <facet id="jbt.bpel.facet.core" version="1.2,2.0"/>
      </supported>
 
       <supported>
         <runtime-component version="6.0"
          	id="org.jboss.ide.eclipse.as.runtime.component"/>
-        <facet id="jbt.bpel.facet.core" version="1.2,2.0"/>
+        <facet id="bpel.facet.core" version="1.2,2.0"/>
      </supported>
 
       <supported>
         <runtime-component version="7.0"
          	id="org.jboss.ide.eclipse.as.runtime.component"/>
-        <facet id="jbt.bpel.facet.core" version="1.2,2.0"/>
+        <facet id="bpel.facet.core" version="1.2,2.0"/>
      </supported>
 
    </extension>

Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/IBPELModuleFacetConstants.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/IBPELModuleFacetConstants.java	2011-04-05 01:26:19 UTC (rev 30319)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/IBPELModuleFacetConstants.java	2011-04-05 15:14:04 UTC (rev 30320)
@@ -32,7 +32,9 @@
 	public final static String BPEL20_FACET_TEMPLATE = "jbt.template.bpel.core";  //$NON-NLS-1$
 	
 	// facet
-	public final static String BPEL_PROJECT_FACET = "jbt.bpel.facet.core"; //$NON-NLS-1$ 
+	// this facet has been deprecated
+	public final static String JBT_BPEL_PROJECT_FACET = "jbt.bpel.facet.core"; //$NON-NLS-1$ 
+	public final static String BPEL_PROJECT_FACET = "bpel.facet.core"; //$NON-NLS-1$ 
 	
 	// bpel file extension
 	public final static String BPEL_FILE_EXTENSION = "bpel";  //$NON-NLS-1$

Added: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/facets/BPELCoreFacetUninstallDelegate.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/facets/BPELCoreFacetUninstallDelegate.java	                        (rev 0)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/facets/BPELCoreFacetUninstallDelegate.java	2011-04-05 15:14:04 UTC (rev 30320)
@@ -0,0 +1,22 @@
+package org.jboss.tools.bpel.runtimes.facets;
+
+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.WtpUtils;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+
+/*
+ * Added to support deprecated jbt.bpel.facet.core
+ * https://issues.jboss.org/browse/JBIDE-8533
+ */
+public class BPELCoreFacetUninstallDelegate implements IDelegate {
+
+	@Override
+	public void execute(IProject project, IProjectFacetVersion fv, Object config, IProgressMonitor monitor)
+			throws CoreException {
+		WtpUtils.removeNatures(project);
+	}
+
+}

Added: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/facets/JBT_BPELFacetInstallDataModelProvider.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/facets/JBT_BPELFacetInstallDataModelProvider.java	                        (rev 0)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/facets/JBT_BPELFacetInstallDataModelProvider.java	2011-04-05 15:14:04 UTC (rev 30320)
@@ -0,0 +1,34 @@
+package org.jboss.tools.bpel.runtimes.facets;
+
+import java.util.Set;
+
+import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+import org.jboss.tools.bpel.runtimes.IBPELModuleFacetConstants;
+
+/*
+ * Added to support deprecated jbt.bpel.facet.core
+ * https://issues.jboss.org/browse/JBIDE-8533
+ */
+public class JBT_BPELFacetInstallDataModelProvider extends
+		FacetInstallDataModelProvider implements IActionConfigFactory, IFacetDataModelProperties, IBPELModuleFacetConstants {
+	
+	@Override
+	public Set getPropertyNames() {
+		Set names = super.getPropertyNames();
+		names.add(FACET_PROJECT_NAME);
+		names.add(FACET_ID);
+		names.add(BPEL_CONTENT_FOLDER);
+		return names;
+	}
+
+	@Override
+	public Object getDefaultProperty(String propertyName) {
+		if (propertyName.equals(FACET_ID)) {
+			return IBPELModuleFacetConstants.JBT_BPEL_PROJECT_FACET;
+		}
+		return super.getDefaultProperty(propertyName);
+	}
+
+}

Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELDeployableArtifactUtil.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELDeployableArtifactUtil.java	2011-04-05 01:26:19 UTC (rev 30319)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELDeployableArtifactUtil.java	2011-04-05 15:14:04 UTC (rev 30320)
@@ -94,6 +94,15 @@
 				
 				return facetedProject.getInstalledVersion(projectFacet).getVersionString();
 			}
+			// https://issues.jboss.org/browse/JBIDE-8533
+			// Added to support deprecated jbt.bpel.facet.core
+			if (facetedProject != null 
+					&& ProjectFacetsManager.isProjectFacetDefined(IBPELModuleFacetConstants.JBT_BPEL_PROJECT_FACET)) 
+			{
+				IProjectFacet projectFacet = ProjectFacetsManager.getProjectFacet(IBPELModuleFacetConstants.JBT_BPEL_PROJECT_FACET);
+				
+				return facetedProject.getInstalledVersion(projectFacet).getVersionString();
+			}
 		} catch (Exception e) {
 			Logger.getLogger().write(e);
 		}

Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELModuleFactoryDelegate.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELModuleFactoryDelegate.java	2011-04-05 01:26:19 UTC (rev 30319)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/BPELModuleFactoryDelegate.java	2011-04-05 15:14:04 UTC (rev 30320)
@@ -93,7 +93,10 @@
 	}
 
 	protected boolean canHandleProject(IProject p) {
-		return FacetedProjectUtilities.isProjectOfType(p, IBPELModuleFacetConstants.BPEL_PROJECT_FACET);
+		// https://issues.jboss.org/browse/JBIDE-8533
+		// Added support for deprecated jbt.bpel.facet.core
+		return FacetedProjectUtilities.isProjectOfType(p, IBPELModuleFacetConstants.BPEL_PROJECT_FACET) ||
+			FacetedProjectUtilities.isProjectOfType(p, IBPELModuleFacetConstants.JBT_BPEL_PROJECT_FACET);
 	}
 	
 	protected IModule[] createModuleDelegates(IVirtualComponent component) {



More information about the jbosstools-commits mailing list