[jbosstools-commits] JBoss Tools SVN: r30277 - trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Mon Apr 4 13:36:43 EDT 2011


Author: bbrodt
Date: 2011-04-04 13:36:43 -0400 (Mon, 04 Apr 2011)
New Revision: 30277

Modified:
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/Messages.java
   trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/messages.properties
Log:
https://issues.jboss.org/browse/JBDS-1573
added a warning dialog if the project doesn't have a deploy.xml in the bpel content folder


Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java	2011-04-04 16:53:11 UTC (rev 30276)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java	2011-04-04 17:36:43 UTC (rev 30277)
@@ -27,14 +27,16 @@
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.MultiStatus;
 import org.eclipse.core.runtime.Status;
+import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.osgi.util.NLS;
+import org.eclipse.swt.widgets.Display;
 import org.eclipse.wst.server.core.IModule;
 import org.eclipse.wst.server.core.IServer;
 import org.eclipse.wst.server.core.model.IModuleResource;
 import org.eclipse.wst.server.core.model.IModuleResourceDelta;
 import org.jboss.ide.eclipse.archives.webtools.modules.LocalZippedPublisherUtil;
 import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.Messages;
+//import org.jboss.ide.eclipse.as.core.Messages;
 import org.jboss.ide.eclipse.as.core.extensions.events.IEventCodes;
 import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
 import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
@@ -97,6 +99,20 @@
         	// Do nothing. This is intentional
         	publishState = IServer.PUBLISH_STATE_INCREMENTAL;
         }
+        // https://issues.jboss.org/browse/JBDS-1573
+        // hack: display a warning dialog.
+        // Deployment validation should really be handled as a WizardFragment invoked from
+        // org.eclipse.wst.server.ui.internal.wizard.ModifyModulesWizard
+        // but there is no WizardFragment extension point for this class...
+        // 
+		if (status!=null) {
+			final IStatus s = status;
+			Display.getDefault().syncExec( new Runnable() {
+				public void run() {
+					MessageDialog.openWarning(Display.getDefault().getActiveShell(), Messages.DeployError, s.getMessage());
+				}
+			});
+		}
 		return status == null ? Status.OK_STATUS : status;
 	}
 	
@@ -109,6 +125,22 @@
 		IPath deployPath = getDeployPath(moduleTree, ds);
 		IPath tempDeployPath = PublishUtil.getTempDeployFolder(moduleTree, ds);
 		IModuleResource[] members = PublishUtil.getResources(last);
+		// https://issues.jboss.org/browse/JBDS-1573
+		// make sure the project has a deploy.xml (bpel-deploy.xml for backward compatibility).
+		boolean hasDeployXML = false;
+		for (int i=0; i<members.length; ++i) {
+			IModuleResource res = members[i];
+			String name = res.getName();
+			if ("deploy.xml".equals(name) || "bpel-deploy.xml".equals(name)) {
+				hasDeployXML = true;
+				break;
+			}
+		}
+		if (!hasDeployXML) {
+			MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_FAIL, 
+					NLS.bind(Messages.MissingDeployXML, last.getName()), null);
+			return ms;
+		}
 		if( shouldZip() ) {
 			String deployRoot = PublishUtil.getDeployRootFolder(
 					moduleTree, ds, ds.getDeployFolder(),
@@ -125,7 +157,7 @@
 		pruneList(resultList);
 		if( resultList.size() > 0 ) {
 			MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_FULL_FAIL, 
-					NLS.bind(Messages.FullPublishFail, last.getName()), null);
+					NLS.bind(org.jboss.ide.eclipse.as.core.Messages.FullPublishFail, last.getName()), null);
 			for( int i = 0; i < resultList.size(); i++ )
 				ms.add(resultList.get(i));
 			return ms;

Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/Messages.java
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/Messages.java	2011-04-04 16:53:11 UTC (rev 30276)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/Messages.java	2011-04-04 17:36:43 UTC (rev 30277)
@@ -31,4 +31,8 @@
 	
 	// module validation
 	public static String InvalidFileExtension;
+    // https://issues.jboss.org/browse/JBDS-1573
+	// added for error dialog
+	public static String MissingDeployXML;
+	public static String DeployError;
 }

Modified: trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/messages.properties
===================================================================
--- trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/messages.properties	2011-04-04 16:53:11 UTC (rev 30276)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/messages.properties	2011-04-04 17:36:43 UTC (rev 30277)
@@ -1 +1,3 @@
 InvalidFileExtension=BPEL module file resource must end with bpel file extension. 
+MissingDeployXML=The project {0} does not have a BPEL deployment descriptor file (deploy.xml)" 
+DeployError=Deployment Error
\ No newline at end of file



More information about the jbosstools-commits mailing list