JBoss Tools SVN: r29284 - trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template.
by jbosstools-commits@lists.jboss.org
Author: dmaliarevich
Date: 2011-02-23 09:12:55 -0500 (Wed, 23 Feb 2011)
New Revision: 29284
Modified:
trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
Log:
https://issues.jboss.org/browse/JBIDE-8467 , debug message was removed.
Modified: trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java
===================================================================
--- trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2011-02-22 23:56:36 UTC (rev 29283)
+++ trunk/jsf/plugins/org.jboss.tools.jsf.vpe.richfaces/src/org/jboss/tools/jsf/vpe/richfaces/template/RichFacesInplaceSelectTemplate.java 2011-02-23 14:12:55 UTC (rev 29284)
@@ -174,9 +174,6 @@
+ Constants.WHITE_SPACE + HTML.ATTR_WIDTH + Constants.COLON
+this.sourceListWidth + Constants.SEMICOLON;
- System.out.println(" dropDownListSizesStyle = " //$NON-NLS-1$
- + dropDownListSizesStyle);
-
table.setAttribute(HTML.ATTR_STYLE, dropDownListSizesStyle);
listScrollDiv.setAttribute(HTML.ATTR_CLASS, "rich-inplace-select-list-scroll"); //$NON-NLS-1$
listScrollDiv.setAttribute(HTML.ATTR_STYLE, dropDownListSizesStyle);
13 years, 10 months
JBoss Tools SVN: r29283 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-22 18:56:36 -0500 (Tue, 22 Feb 2011)
New Revision: 29283
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
Log:
JBIDE-8398 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-02-22 23:56:23 UTC (rev 29282)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-02-22 23:56:36 UTC (rev 29283)
@@ -12,130 +12,32 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core.archives;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.rse.services.clientserver.messages.SystemElementNotFoundException;
-import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.jboss.ide.eclipse.archives.webtools.modules.WTPZippedPublisher;
-import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-import org.jboss.ide.eclipse.as.core.publishers.AbstractServerToolsPublisher;
-import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
+import org.jboss.ide.eclipse.as.core.modules.SingleDeployableFactory;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
+import org.jboss.ide.eclipse.as.wtp.core.modules.IJBTModule;
/**
- * This class is in charge of RSE zipped publishing for flexible projects.
- * It extends the functionality of the local zipped publishing class
- * by uploading the file after building it in a temporary directory
+ * This class is in charge of RSE zipped publishing for deployable folders
*/
-public class RSEZippedJSTPublisher extends WTPZippedPublisher {
-
- protected String getPublishMethod() {
- return RSEPublishMethod.RSE_ID;
- }
-
- /**
- * Here we put the deployment first in a temporary remote deploy folder
- * Then during the publishModule call, we'll also upload it to remote machine
- */
- protected String getDeployRoot(IModule[] module, IDeployableServer ds) {
- IPath deployRoot = JBossServerCorePlugin.getServerStateLocation(ds.getServer()).
- append(IJBossServerConstants.TEMP_REMOTE_DEPLOY).makeAbsolute();
- deployRoot.toFile().mkdirs();
- return deployRoot.toString();
- }
-
- @Override
- public IStatus publishModule(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
+public class RSEZippedFolderPublisher extends RSEZippedJSTPublisher {
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ if( !RSEPublishMethod.RSE_ID.equals(method))
+ return false;
- String taskName = "Publishing " + module[0].getName();
- monitor.beginTask(taskName, 200); //$NON-NLS-1$
- monitor.setTaskName(taskName);
- if( module.length > 1 ) {
- monitor.done();
- return null;
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ if( module != null && module.length > 0
+ && module[module.length-1] != null
+ && module[module.length-1].getModuleType().getId().equals(SingleDeployableFactory.MODULE_TYPE)) {
+ IModule mod = module[module.length-1];
+ IJBTModule del = (IJBTModule)mod.loadAdapter(IJBTModule.class, new NullProgressMonitor());
+ if( del != null && !del.isBinary())
+ return ds != null && ds.zipsWTPDeployments();; // we have a folder
}
-
- monitor.setTaskName("Publishing to remote server " + server.getName());
-
- // set up needed vars
- IDeployableServer server2 = ServerConverter.getDeployableServer(server);
- String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
- IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot);
- IModule lastMod = module[module.length-1];
- RSEPublishMethod method2 = (RSEPublishMethod)method;
- IPath destFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteRootFolder());
- //IPath tempDestFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteTemporaryFolder());
- String name = sourcePath.lastSegment();
- IStatus result = null;
-
-
- // Am I a removal? If yes, remove me, and return
- if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
- result = removeRemoteDeployment(method2, sourcePath, destFolder, name, monitor);
- } else {
- // Locally zip it up into the remote tmp folder
- result = super.publishModule(method, server, module, publishType, delta,
- AbstractServerToolsPublisher.getSubMon(monitor, 50));
- if( !result.isOK() ) {
- monitor.done();
- } else {
- result = remoteFullPublish(method, sourcePath, destFolder, name,
- AbstractServerToolsPublisher.getSubMon(monitor, 150));
- }
- }
-
- monitor.done();
- if( result != null ) {
- return result;
- }
-
- return Status.OK_STATUS;
+ return false;
}
-
- private IStatus remoteFullPublish( IJBossServerPublishMethod method, IPath sourcePath,
- IPath destFolder, String name, IProgressMonitor monitor) {
- // Now transfer the file to RSE
- RSEPublishMethod method2 = (RSEPublishMethod)method;
- try {
- method2.getFileService().upload(sourcePath.toFile(), destFolder.toString(), name, true, null, null,
- AbstractServerToolsPublisher.getSubMon(monitor, 150));
- } catch( SystemElementNotFoundException senfe ) {
- /* Ignore intentionally... file already does not exist on remote server */
- return Status.OK_STATUS;
- } catch( SystemMessageException sme ) {
- return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
- } catch(CoreException ce) {
- return ce.getStatus();
- }
- return Status.OK_STATUS;
- }
-
- private IStatus removeRemoteDeployment( IJBossServerPublishMethod method, IPath sourcePath,
- IPath destFolder, String name, IProgressMonitor monitor) {
- // Now transfer the file to RSE
- RSEPublishMethod method2 = (RSEPublishMethod)method;
- try {
- method2.getFileService().delete(destFolder.toString(), name, monitor);
- } catch( SystemMessageException sme ) {
- return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
- } catch(CoreException ce) {
- return ce.getStatus();
- }
- return Status.OK_STATUS;
- }
}
13 years, 10 months
JBoss Tools SVN: r29282 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-22 18:56:23 -0500 (Tue, 22 Feb 2011)
New Revision: 29282
Modified:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
Log:
JBIDE-8398 to 3.2.1 maintenance
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-02-22 23:37:46 UTC (rev 29281)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-02-22 23:56:23 UTC (rev 29282)
@@ -16,6 +16,7 @@
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
import org.eclipse.rse.services.clientserver.messages.SystemElementNotFoundException;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
@@ -87,7 +88,7 @@
// Am I a removal? If yes, remove me, and return
if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
result = removeRemoteDeployment(method2, sourcePath, destFolder, name, monitor);
- } else {
+ } else if( publishType != IJBossServerPublisher.NO_PUBLISH ){
// Locally zip it up into the remote tmp folder
result = super.publishModule(method, server, module, publishType, delta,
AbstractServerToolsPublisher.getSubMon(monitor, 50));
@@ -112,11 +113,9 @@
// Now transfer the file to RSE
RSEPublishMethod method2 = (RSEPublishMethod)method;
try {
+ removeRemoteDeployment(method2, sourcePath, destFolder, name, new NullProgressMonitor());
method2.getFileService().upload(sourcePath.toFile(), destFolder.toString(), name, true, null, null,
AbstractServerToolsPublisher.getSubMon(monitor, 150));
- } catch( SystemElementNotFoundException senfe ) {
- /* Ignore intentionally... file already does not exist on remote server */
- return Status.OK_STATUS;
} catch( SystemMessageException sme ) {
return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
} catch(CoreException ce) {
@@ -131,6 +130,9 @@
RSEPublishMethod method2 = (RSEPublishMethod)method;
try {
method2.getFileService().delete(destFolder.toString(), name, monitor);
+ } catch( SystemElementNotFoundException senfe ) {
+ /* Ignore intentionally... file already does not exist on remote server */
+ return Status.OK_STATUS;
} catch( SystemMessageException sme ) {
return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
} catch(CoreException ce) {
13 years, 10 months
JBoss Tools SVN: r29281 - trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-22 18:37:46 -0500 (Tue, 22 Feb 2011)
New Revision: 29281
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
Log:
JBIDE-8449 to trunk
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-02-22 23:37:13 UTC (rev 29280)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-02-22 23:37:46 UTC (rev 29281)
@@ -12,32 +12,24 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core.archives;
-import java.util.ArrayList;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
+import org.eclipse.rse.services.clientserver.messages.SystemElementNotFoundException;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.services.files.IFileService;
-import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
-import org.eclipse.wst.common.project.facet.core.util.internal.ProgressMonitorUtil;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.jboss.ide.eclipse.archives.webtools.modules.WTPZippedPublisher;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-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.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
@@ -78,51 +70,72 @@
return null;
}
- // Locally zip it up into the remote tmp folder
- IStatus sup = super.publishModule(method, server, module, publishType, delta,
- AbstractServerToolsPublisher.getSubMon(monitor, 50));
- if( !sup.isOK() ) {
- monitor.done();
- return sup;
- }
+ monitor.setTaskName("Publishing to remote server " + server.getName());
- monitor.setTaskName("Publishing to remote server (dummy)");
-
// set up needed vars
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
- RSEPublishMethod method2 = (RSEPublishMethod)method;
IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot);
IModule lastMod = module[module.length-1];
+ RSEPublishMethod method2 = (RSEPublishMethod)method;
IPath destFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteRootFolder());
//IPath tempDestFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteTemporaryFolder());
String name = sourcePath.lastSegment();
+ IStatus result = null;
+
+ // Am I a removal? If yes, remove me, and return
+ if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
+ result = removeRemoteDeployment(method2, sourcePath, destFolder, name, monitor);
+ } else {
+ // Locally zip it up into the remote tmp folder
+ result = super.publishModule(method, server, module, publishType, delta,
+ AbstractServerToolsPublisher.getSubMon(monitor, 50));
+ if( !result.isOK() ) {
+ monitor.done();
+ } else {
+ result = remoteFullPublish(method, sourcePath, destFolder, name,
+ AbstractServerToolsPublisher.getSubMon(monitor, 150));
+ }
+ }
+
+ monitor.done();
+ if( result != null ) {
+ return result;
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ private IStatus remoteFullPublish( IJBossServerPublishMethod method, IPath sourcePath,
+ IPath destFolder, String name, IProgressMonitor monitor) {
// Now transfer the file to RSE
- IFileService fs = method2.getFileService();
- IFileServiceSubSystem system = method2.getFileServiceSubSystem();
- ArrayList<IStatus> results = new ArrayList<IStatus>();
- if( !sup.isOK())
- results.add(sup);
-
+ RSEPublishMethod method2 = (RSEPublishMethod)method;
try {
method2.getFileService().upload(sourcePath.toFile(), destFolder.toString(), name, true, null, null,
AbstractServerToolsPublisher.getSubMon(monitor, 150));
+ } catch( SystemElementNotFoundException senfe ) {
+ /* Ignore intentionally... file already does not exist on remote server */
+ return Status.OK_STATUS;
} catch( SystemMessageException sme ) {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
- results.add(s);
+ return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
+ } catch(CoreException ce) {
+ return ce.getStatus();
}
+ return Status.OK_STATUS;
+ }
- monitor.done();
- if( results != null && results.size() > 0 ) {
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_INC_FAIL,
- NLS.bind(Messages.IncrementalPublishFail, module[0].getName()), null);
- IStatus[] results2 = results.toArray(new IStatus[results.size()]);
- for( int i = 0; i < results.size(); i++ )
- ms.add(results2[i]);
- return ms;
+ private IStatus removeRemoteDeployment( IJBossServerPublishMethod method, IPath sourcePath,
+ IPath destFolder, String name, IProgressMonitor monitor) {
+ // Now transfer the file to RSE
+ RSEPublishMethod method2 = (RSEPublishMethod)method;
+ try {
+ method2.getFileService().delete(destFolder.toString(), name, monitor);
+ } catch( SystemMessageException sme ) {
+ return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
+ } catch(CoreException ce) {
+ return ce.getStatus();
}
-
- return sup;
+ return Status.OK_STATUS;
}
}
13 years, 10 months
JBoss Tools SVN: r29280 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-22 18:37:13 -0500 (Tue, 22 Feb 2011)
New Revision: 29280
Modified:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
Log:
JBIDE-8449 to branch
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-02-22 22:35:34 UTC (rev 29279)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/archives/RSEZippedJSTPublisher.java 2011-02-22 23:37:13 UTC (rev 29280)
@@ -12,32 +12,24 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core.archives;
-import java.util.ArrayList;
-
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.MultiStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Status;
-import org.eclipse.osgi.util.NLS;
+import org.eclipse.rse.services.clientserver.messages.SystemElementNotFoundException;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
-import org.eclipse.rse.services.files.IFileService;
-import org.eclipse.rse.subsystems.files.core.servicesubsystem.IFileServiceSubSystem;
-import org.eclipse.wst.common.project.facet.core.util.internal.ProgressMonitorUtil;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.jboss.ide.eclipse.archives.webtools.modules.WTPZippedPublisher;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
-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.AbstractServerToolsPublisher;
import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerConstants;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.rse.core.RSEPublishMethod;
@@ -78,51 +70,72 @@
return null;
}
- // Locally zip it up into the remote tmp folder
- IStatus sup = super.publishModule(method, server, module, publishType, delta,
- AbstractServerToolsPublisher.getSubMon(monitor, 50));
- if( !sup.isOK() ) {
- monitor.done();
- return sup;
- }
+ monitor.setTaskName("Publishing to remote server " + server.getName());
- monitor.setTaskName("Publishing to remote server (dummy)");
-
// set up needed vars
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
- RSEPublishMethod method2 = (RSEPublishMethod)method;
IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot);
IModule lastMod = module[module.length-1];
+ RSEPublishMethod method2 = (RSEPublishMethod)method;
IPath destFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteRootFolder());
//IPath tempDestFolder = RSEPublishMethod.findModuleFolderWithDefault(lastMod, server2, method2.getRemoteTemporaryFolder());
String name = sourcePath.lastSegment();
+ IStatus result = null;
+
+ // Am I a removal? If yes, remove me, and return
+ if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
+ result = removeRemoteDeployment(method2, sourcePath, destFolder, name, monitor);
+ } else {
+ // Locally zip it up into the remote tmp folder
+ result = super.publishModule(method, server, module, publishType, delta,
+ AbstractServerToolsPublisher.getSubMon(monitor, 50));
+ if( !result.isOK() ) {
+ monitor.done();
+ } else {
+ result = remoteFullPublish(method, sourcePath, destFolder, name,
+ AbstractServerToolsPublisher.getSubMon(monitor, 150));
+ }
+ }
+
+ monitor.done();
+ if( result != null ) {
+ return result;
+ }
+
+ return Status.OK_STATUS;
+ }
+
+ private IStatus remoteFullPublish( IJBossServerPublishMethod method, IPath sourcePath,
+ IPath destFolder, String name, IProgressMonitor monitor) {
// Now transfer the file to RSE
- IFileService fs = method2.getFileService();
- IFileServiceSubSystem system = method2.getFileServiceSubSystem();
- ArrayList<IStatus> results = new ArrayList<IStatus>();
- if( !sup.isOK())
- results.add(sup);
-
+ RSEPublishMethod method2 = (RSEPublishMethod)method;
try {
method2.getFileService().upload(sourcePath.toFile(), destFolder.toString(), name, true, null, null,
AbstractServerToolsPublisher.getSubMon(monitor, 150));
+ } catch( SystemElementNotFoundException senfe ) {
+ /* Ignore intentionally... file already does not exist on remote server */
+ return Status.OK_STATUS;
} catch( SystemMessageException sme ) {
- IStatus s = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
- results.add(s);
+ return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
+ } catch(CoreException ce) {
+ return ce.getStatus();
}
+ return Status.OK_STATUS;
+ }
- monitor.done();
- if( results != null && results.size() > 0 ) {
- MultiStatus ms = new MultiStatus(JBossServerCorePlugin.PLUGIN_ID, IEventCodes.JST_PUB_INC_FAIL,
- NLS.bind(Messages.IncrementalPublishFail, module[0].getName()), null);
- IStatus[] results2 = results.toArray(new IStatus[results.size()]);
- for( int i = 0; i < results.size(); i++ )
- ms.add(results2[i]);
- return ms;
+ private IStatus removeRemoteDeployment( IJBossServerPublishMethod method, IPath sourcePath,
+ IPath destFolder, String name, IProgressMonitor monitor) {
+ // Now transfer the file to RSE
+ RSEPublishMethod method2 = (RSEPublishMethod)method;
+ try {
+ method2.getFileService().delete(destFolder.toString(), name, monitor);
+ } catch( SystemMessageException sme ) {
+ return new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, sme.getMessage(), sme);
+ } catch(CoreException ce) {
+ return ce.getStatus();
}
-
- return sup;
+ return Status.OK_STATUS;
}
}
13 years, 10 months
JBoss Tools SVN: r29279 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-22 17:35:34 -0500 (Tue, 22 Feb 2011)
New Revision: 29279
Added:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java
Modified:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
Log:
JBIDE-8469 to branch
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java 2011-02-22 22:23:35 UTC (rev 29278)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEBehaviourDelegate.java 2011-02-22 22:35:34 UTC (rev 29279)
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010 Red Hat, Inc.
+ * Copyright (c) 2011 Red Hat, Inc.
* Distributed under license by Red Hat, Inc. All rights reserved.
* This program is made available under the terms of the
* Eclipse Public License v1.0 which accompanies this distribution,
@@ -12,9 +12,13 @@
******************************************************************************/
package org.jboss.ide.eclipse.as.rse.core;
+import org.jboss.ide.eclipse.as.core.Messages;
+import org.jboss.ide.eclipse.as.core.server.IServerStatePoller;
import org.jboss.ide.eclipse.as.core.server.internal.AbstractJBossBehaviourDelegate;
+import org.jboss.ide.eclipse.as.core.server.internal.PollThread;
public class RSEBehaviourDelegate extends AbstractJBossBehaviourDelegate {
+ private PollThread pollThread = null;
public String getBehaviourTypeId() {
return RSEPublishMethod.RSE_ID;
}
@@ -27,4 +31,22 @@
}
RSELaunchDelegate.launchStopServerCommand(getActualBehavior());
}
+
+ public void serverStarting() {
+ pollServer(IServerStatePoller.SERVER_UP);
+ }
+
+ public void serverStopping() {
+ getActualBehavior().setServerStopping();
+ pollServer(IServerStatePoller.SERVER_DOWN);
+ }
+
+ protected void pollServer(final boolean expectedState) {
+ if( this.pollThread != null ) {
+ pollThread.cancel();
+ }
+ this.pollThread = new PollThread(Messages.ServerPollerThreadName, expectedState, getActualBehavior());
+ pollThread.start();
+ }
+
}
Added: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java (rev 0)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSEHostShellModel.java 2011-02-22 22:35:34 UTC (rev 29279)
@@ -0,0 +1,177 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ *
+ ******************************************************************************/
+package org.jboss.ide.eclipse.as.rse.core;
+
+import java.util.HashMap;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.rse.core.RSECorePlugin;
+import org.eclipse.rse.core.model.IHost;
+import org.eclipse.rse.core.subsystems.ISubSystem;
+import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
+import org.eclipse.rse.services.shells.IHostShell;
+import org.eclipse.rse.services.shells.IShellService;
+import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
+import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
+import org.jboss.ide.eclipse.as.rse.core.xpl.ConnectAllSubsystemsUtil;
+
+public class RSEHostShellModel {
+
+ private static RSEHostShellModel instance;
+ public static RSEHostShellModel getInstance() {
+ if( instance == null )
+ instance = new RSEHostShellModel();
+ return instance;
+ }
+
+
+ private HashMap<String, ServerShellModel> map =
+ new HashMap<String, ServerShellModel>();
+ RSEHostShellModel() {
+
+ }
+
+ public ServerShellModel getModel(IServer server) {
+ if( map.get(server.getId()) == null ) {
+ map.put(server.getId(), new ServerShellModel(server.getId()));
+ }
+ return map.get(server.getId());
+ }
+
+ public static class ServerShellModel {
+ private String serverId;
+ private IHostShell startupShell;
+ private IHostShell singleUseShell;
+ public ServerShellModel(String id) {
+ this.serverId = id;
+ }
+ public IHostShell getStartupShell() {
+ return startupShell;
+ }
+ public void resetStartupShell() {
+ if( startupShell != null && startupShell.isActive()) {
+ startupShell.exit();
+ startupShell = null;
+ }
+ }
+ public IHostShell createStartupShell(
+ String initialWorkingDirectory, String command,
+ String[] environment, IProgressMonitor monitor)
+ throws CoreException, SystemMessageException {
+ resetStartupShell();
+ IServer s = ServerCore.findServer(serverId);
+ IShellService service = findShellService(s);
+ try {
+ IHostShell hs = service.runCommand(initialWorkingDirectory,
+ command, environment, monitor);
+ startupShell = hs;
+ return hs;
+ } catch(RuntimeException re) {
+ throw new CoreException(new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID,
+ re.getMessage(), re));
+ }
+ }
+
+ public void executeRemoteCommand(
+ String initialWorkingDirectory, String command,
+ String[] environment, IProgressMonitor monitor)
+ throws CoreException {
+ IServer s = ServerCore.findServer(serverId);
+ IShellService service = findShellService(s);
+ try {
+ if( singleUseShell == null || !singleUseShell.isActive()) {
+ singleUseShell = service.launchShell(initialWorkingDirectory, environment, monitor);
+ } else {
+ singleUseShell.writeToShell("cd " + initialWorkingDirectory);
+ }
+ singleUseShell.writeToShell(command);
+ } catch(RuntimeException re) {
+ String className = service.getClass().getName();
+ if(className.endsWith(".DStoreShellService")) {
+ throw new CoreException(new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID,
+ "no remote daemon installed. Please install a remote daemon or use an RSE server configured for ssh rather than dstore"));
+ }
+ } catch( SystemMessageException sme) {
+ Status s2 = new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID, sme.getMessage(), sme);
+ throw new CoreException(s2);
+ }
+ }
+
+ public void executeRemoteCommand(
+ String initialWorkingDirectory, String command,
+ String[] environment, IProgressMonitor monitor,
+ int delay, boolean exit)
+ throws CoreException {
+ executeRemoteCommand(initialWorkingDirectory, command, environment, monitor);
+ delay(delay);
+ if( exit ) {
+ singleUseShell.exit();
+ singleUseShell = null;
+ }
+ }
+
+ }
+
+ public static void delay(int delay /* in ms */) {
+ int x = 0;
+ while( x < delay) {
+ x+=200;
+ try {
+ Thread.sleep(200);
+ } catch(InterruptedException ie) {
+ }
+ }
+ }
+
+ private static DeployableServerBehavior getBehaviour(String serverId) {
+ IServer s = ServerCore.findServer(serverId);
+ return s == null ? null : ServerConverter.getDeployableServerBehavior(s);
+ }
+
+ public static IShellService findShellService(JBossServerBehavior behaviour) throws CoreException {
+ return findShellService(behaviour.getServer());
+ }
+
+ public static IShellService findShellService(IServer server) throws CoreException {
+ RSEUtils.waitForFullInit();
+ if( server != null ) {
+ String connectionName = RSEUtils.getRSEConnectionName(server);
+ IHost host = RSEUtils.findHost(connectionName);
+ if( host == null ) {
+ throw new CoreException(new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID,
+ "Host not found. Host may have been deleted or RSE model may not be completely loaded"));
+ }
+
+ // ensure connections
+ new ConnectAllSubsystemsUtil(host).run(new NullProgressMonitor());
+
+ ISubSystem[] systems = RSECorePlugin.getTheSystemRegistry().getSubSystems(host);
+ for( int i = 0; i < systems.length; i++ ) {
+ if( systems[i] instanceof IShellServiceSubSystem) {
+ IShellService service = ((IShellServiceSubSystem)systems[i]).getShellService();
+ return service;
+ }
+ }
+ }
+ throw new CoreException(new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID,
+ "No Shell Service Found"));
+ }
+}
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-02-22 22:23:35 UTC (rev 29278)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.rse.core/src/org/jboss/ide/eclipse/as/rse/core/RSELaunchDelegate.java 2011-02-22 22:35:34 UTC (rev 29279)
@@ -23,30 +23,28 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.rse.core.RSECorePlugin;
-import org.eclipse.rse.core.model.IHost;
-import org.eclipse.rse.core.subsystems.ISubSystem;
import org.eclipse.rse.services.clientserver.messages.SystemMessageException;
import org.eclipse.rse.services.shells.IHostOutput;
import org.eclipse.rse.services.shells.IHostShell;
import org.eclipse.rse.services.shells.IHostShellChangeEvent;
import org.eclipse.rse.services.shells.IHostShellOutputListener;
-import org.eclipse.rse.services.shells.IShellService;
-import org.eclipse.rse.subsystems.shells.core.subsystems.servicesubsystem.IShellServiceSubSystem;
import org.eclipse.wst.server.core.IServer;
+import org.jboss.ide.eclipse.as.core.extensions.events.ServerLogger;
import org.jboss.ide.eclipse.as.core.extensions.polling.WebPortPoller;
+import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.launch.AbstractJBossLaunchConfigType;
import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration;
-import org.jboss.ide.eclipse.as.core.server.internal.launch.StopLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.IStartLaunchSetupParticipant;
import org.jboss.ide.eclipse.as.core.server.internal.launch.JBossServerStartupLaunchConfiguration.StartLaunchDelegate;
import org.jboss.ide.eclipse.as.core.server.internal.launch.LocalJBossServerStartupLaunchUtil;
+import org.jboss.ide.eclipse.as.core.server.internal.launch.StopLaunchConfiguration;
import org.jboss.ide.eclipse.as.core.util.ArgsUtil;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeConstants;
import org.jboss.ide.eclipse.as.core.util.IJBossRuntimeResourceConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-import org.jboss.ide.eclipse.as.rse.core.xpl.ConnectAllSubsystemsUtil;
+import org.jboss.ide.eclipse.as.rse.core.RSEHostShellModel.ServerShellModel;
public class RSELaunchDelegate implements StartLaunchDelegate, IStartLaunchSetupParticipant {
@@ -63,82 +61,47 @@
JBossServerBehavior beh = LocalJBossServerStartupLaunchUtil.getServerBehavior(configuration);
beh.setServerStarting();
String command = configuration.getAttribute(RSE_STARTUP_COMMAND, (String)null);
- IShellService service = null;
try {
- service = findShellService(beh);
- } catch(CoreException ce) {
- beh.setServerStopped();
- throw ce;
- }
- IHostShell hs = null;
+ ServerShellModel model = RSEHostShellModel.getInstance().getModel(beh.getServer());
+ IHostShell shell = model.createStartupShell("/", command, new String[]{}, new NullProgressMonitor());
+ addShellOutputListener(shell);
+ launchPingThread(beh);
+ } catch(SystemMessageException sme) {
+ beh.setServerStopped(); // Not sure when this comes, but we should try to keep track
+ throw new CoreException(new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID,
+ sme.getMessage(), sme));
+ }
+ }
+
+ private void launchPingThread(DeployableServerBehavior beh) {
+ // TODO do it properly here
+ RSEHostShellModel.delay(30000);
+ beh.setServerStarted();
+ }
+
+
+ // Only for debugging
+ private void addShellOutputListener(IHostShell shell) {
IHostShellOutputListener listener = null;
listener = new IHostShellOutputListener(){
public void shellOutputChanged(IHostShellChangeEvent event) {
IHostOutput[] out = event.getLines();
for(int i = 0; i < out.length; i++ ) {
// TODO listen here for obvious exceptions or failures
- System.out.println(out[i]);
+ // System.out.println(out[i]);
}
}
};
-
- try {
- hs = service.runCommand("/", command, new String[]{}, new NullProgressMonitor());
- hs.addOutputListener(listener);
- delay(30);
-
- // Now launch ping thread
- } catch(SystemMessageException sme) {
- sme.printStackTrace();
- } catch(RuntimeException re) {
- String className = service.getClass().getName();
- if(re instanceof NullPointerException && className.endsWith(".DStoreShellService")) {
- beh.setServerStopped();
- throw new CoreException(new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID,
- "no remote daemon installed. Please install a remote daemon or use an RSE server configured for ssh rather than dstore"));
- }
- }
-
- // Exiting the shell cancels the process. PROBLEM!!!
-// if( hs != null ) {
-// hs.exit();
-// }
- beh.setServerStarted();
+ //shell.addOutputListener(listener);
}
-
- private static void delay(int delay) {
- int x = 1;
- while( x < (delay)) {
- x+=1;
- try {
- Thread.sleep(1000);
- } catch(InterruptedException ie) {
- }
- }
- }
-
public static void launchCommandNoResult(JBossServerBehavior behaviour, int delay, String command) {
- IShellService service = null;
try {
- service = findShellService(behaviour);
- } catch(CoreException ce) {
- // TODO log and return
- return;
+ ServerShellModel model = RSEHostShellModel.getInstance().getModel(behaviour.getServer());
+ model.executeRemoteCommand("/", command, new String[]{}, new NullProgressMonitor(), delay, true);
+ } catch( CoreException ce ) {
+ ServerLogger.getDefault().log(behaviour.getServer(), ce.getStatus());
}
- try {
- final IHostShell hs = service.runCommand("/", command, new String[]{}, new NullProgressMonitor());
- if( hs != null ) {
- delay(delay/1000);
- hs.exit();
- }
- } catch( SystemMessageException sme) {
- // TODO
- sme.printStackTrace();
- } catch( RuntimeException re ) {
- // TODO
- re.printStackTrace();
- }
}
public static void launchStopServerCommand(JBossServerBehavior behaviour) {
@@ -146,72 +109,19 @@
String command2 = "";
try {
config = behaviour.getServer().getLaunchConfiguration(false, new NullProgressMonitor());
- String rseHome = behaviour.getServer().getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, (String)null);
- if( rseHome == null ) {
- RSECorePlugin.getDefault().getLog().log(
- new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
- "Remote Server Home not set."));
- return;
- }
- String defaultCmd = getDefaultStopCommand(behaviour.getServer());
+ String defaultCmd = getDefaultStopCommand(behaviour.getServer(), true);
command2 = config == null ? defaultCmd :
config.getAttribute(RSE_SHUTDOWN_COMMAND, defaultCmd);
+ behaviour.setServerStopping();
+ ServerShellModel model = RSEHostShellModel.getInstance().getModel(behaviour.getServer());
+ model.executeRemoteCommand("/", command2, new String[]{}, new NullProgressMonitor(), 10000, true);
+ if( model.getStartupShell() != null && model.getStartupShell().isActive())
+ model.getStartupShell().writeToShell("exit");
+ behaviour.setServerStopped();
} catch(CoreException ce) {
+ behaviour.setServerStarted();
+ ServerLogger.getDefault().log(behaviour.getServer(), ce.getStatus());
}
-
- behaviour.setServerStopping();
- final JBossServerBehavior behaviour2 = behaviour;
- final String command = command2;
- IShellService service = null;
- try {
- service = findShellService(behaviour);
- } catch(CoreException ce) {
- // TODO log and return
- return;
- }
-
- final boolean[] saving = new boolean[1];
- saving[0] = false;
- final String[] output = new String[1];
- output[0] = null;
- try {
- final IHostShell hs = service.runCommand("/", command, new String[]{}, new NullProgressMonitor());
- hs.addOutputListener(new IHostShellOutputListener(){
- public void shellOutputChanged(IHostShellChangeEvent event) {
- IHostOutput[] out = event.getLines();
- for(int i = 0; i < out.length; i++ ) {
- if( saving[0] ) {
- output[0] = out[i].getString();
- saving[0] = false;
- delay(10);
- behaviour2.setServerStopped();
- hs.exit();
- return;
- }
- /*
- * This is an extreme hack, because for some reason,
- * when the command line comes back, there's an extra space
- * "shutdown .sh"
- */
- System.out.println(out[i]);
- String outNoSpace = out[i].getString().replaceAll(" ", "");
- String commandNoSpace = command.replaceAll(" ", "");
- boolean contains = outNoSpace.contains(commandNoSpace);
- if(!saving[0] && contains)
- saving[0] = true;
- }
- }
- });
-
- } catch( SystemMessageException sme) {
- // TODO
- behaviour.setServerStarted(); // unable to stop the server
- } catch( RuntimeException re ) {
- if( re instanceof NullPointerException && service.getClass().getName().equals("DStoreShellService")) {
- // remote server has no dstore shell service
- behaviour.setServerStopped(); // behaviour.setServerStarted(); // failed
- }
- }
}
@@ -268,7 +178,20 @@
}
public static String getDefaultStopCommand(IServer server) {
- String rseHome = server.getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, "");
+ try {
+ return getDefaultStopCommand(server, false);
+ } catch(CoreException ce) {/* ignore, INTENTIONAL */}
+ return null;
+ }
+
+ public static String getDefaultStopCommand(IServer server, boolean errorOnFail) throws CoreException {
+ String rseHome = server.getAttribute(RSEUtils.RSE_SERVER_HOME_DIR, (String)null);
+ if( errorOnFail && rseHome == null ) {
+ IStatus s = new Status(IStatus.ERROR, RSECorePlugin.PLUGIN_ID,
+ "Remote Server Home not set.");
+ throw new CoreException(s);
+ }
+ rseHome = rseHome == null ? "" : rseHome;
JBossServer jbs = ServerConverter.getJBossServer(server);
@@ -312,25 +235,4 @@
IJBossRuntimeConstants.START_MAIN_TYPE + IJBossRuntimeConstants.SPACE + currentArgs + "&";
return cmd;
}
-
- protected static IShellService findShellService(JBossServerBehavior behaviour) throws CoreException {
- RSEUtils.waitForFullInit();
- String connectionName = RSEUtils.getRSEConnectionName(behaviour.getServer());
- IHost host = RSEUtils.findHost(connectionName);
- if( host == null ) {
- throw new CoreException(new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID,
- "Host not found. Host may have been deleted or RSE model may not be completely loaded"));
- }
-
- // ensure connections
- new ConnectAllSubsystemsUtil(host).run(new NullProgressMonitor());
-
- ISubSystem[] systems = RSECorePlugin.getTheSystemRegistry().getSubSystems(host);
- for( int i = 0; i < systems.length; i++ ) {
- if( systems[i] instanceof IShellServiceSubSystem)
- return ((IShellServiceSubSystem)systems[i]).getShellService();
- }
- throw new CoreException(new Status(IStatus.ERROR, org.jboss.ide.eclipse.as.rse.core.RSECorePlugin.PLUGIN_ID, "No Shell Service Found"));
- }
-
}
13 years, 10 months
JBoss Tools SVN: r29278 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-22 17:23:35 -0500 (Tue, 22 Feb 2011)
New Revision: 29278
Modified:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java
Log:
JBIDE-7997 to branch / maintenance
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java 2011-02-22 22:19:58 UTC (rev 29277)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/extensions/ModuleActionProvider.java 2011-02-22 22:23:35 UTC (rev 29278)
@@ -14,6 +14,7 @@
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.swt.widgets.Shell;
+import org.eclipse.ui.IWorkbenchCommandConstants;
import org.eclipse.ui.navigator.CommonActionProvider;
import org.eclipse.ui.navigator.ICommonActionExtensionSite;
import org.eclipse.ui.navigator.ICommonViewerSite;
@@ -25,7 +26,6 @@
import org.eclipse.wst.server.core.internal.PublishServerJob;
import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-import org.jboss.ide.eclipse.as.core.publishers.PublishUtil;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.util.ModuleUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -73,8 +73,10 @@
}
menu.insertBefore(ServerActionProvider.CONTROL_MODULE_SECTION_END_SEPARATOR, incrementalPublishModuleAction);
menu.insertBefore(ServerActionProvider.CONTROL_MODULE_SECTION_END_SEPARATOR, fullPublishModuleAction);
- if( selection.size() > 1 )
+ if( selection.size() > 1 ) {
+ deleteModuleAction.setActionDefinitionId(IWorkbenchCommandConstants.EDIT_DELETE);
menu.insertBefore(ServerActionProvider.CONTROL_MODULE_SECTION_END_SEPARATOR, deleteModuleAction);
+ }
if (selection.size() == 1) {
ModuleServer moduleServer = (ModuleServer) selection.getFirstElement();
IServer server = moduleServer.getServer();
@@ -110,7 +112,7 @@
deleteModuleAction.setText(Messages.DeleteModuleText);
deleteModuleAction.setDescription(Messages.DeleteModuleDescription);
deleteModuleAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.UNPUBLISH_IMAGE));
-
+
fullPublishModuleAction = new Action() {
public void run() {
actionPublish(IServer.PUBLISH_STATE_FULL);
13 years, 10 months
JBoss Tools SVN: r29277 - branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-22 17:19:58 -0500 (Tue, 22 Feb 2011)
New Revision: 29277
Modified:
branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
Log:
JBIDE-8329 to maintenance
Modified: branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java
===================================================================
--- branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2011-02-22 22:17:34 UTC (rev 29276)
+++ branches/jbosstools-3.2.x/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/XPathDialogs.java 2011-02-22 22:19:58 UTC (rev 29277)
@@ -202,6 +202,7 @@
this.rootDir = original.getBaseDir();
this.category = original.getCategory();
this.xpath = original.getXpathPattern();
+ this.attribute = original.getAttribute();
}
if( this.xpath == null ) this.xpath = "//server/mbean"; //$NON-NLS-1$
if( this.filePattern == null ) this.filePattern = "**/*.xml"; //$NON-NLS-1$
13 years, 10 months
JBoss Tools SVN: r29276 - in branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui: preferences and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2011-02-22 17:17:34 -0500 (Tue, 22 Feb 2011)
New Revision: 29276
Modified:
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
Log:
JBIDE-8304 to branch
Modified: branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java
===================================================================
--- branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2011-02-22 21:57:14 UTC (rev 29275)
+++ branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.java 2011-02-22 22:17:34 UTC (rev 29276)
@@ -109,6 +109,7 @@
public static String ShowAllProjects;
public static String FilesetPreferences;
public static String EnableDefaultExcludes;
+ public static String ConfigureWorkspacePrefs;
static {
NLS.initializeMessages("org.jboss.ide.eclipse.archives.ui.ArchivesUIMessages", ArchivesUIMessages.class); //$NON-NLS-1$
Modified: branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties
===================================================================
--- branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2011-02-22 21:57:14 UTC (rev 29275)
+++ branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/ArchivesUIMessages.properties 2011-02-22 22:17:34 UTC (rev 29276)
@@ -91,4 +91,5 @@
ShowRootProject=Show project at the root
ShowAllProjects=Show all projects that contain packages
FilesetPreferences=Fileset Preferences
-EnableDefaultExcludes=Enable Default Excludes
\ No newline at end of file
+EnableDefaultExcludes=Enable Default Excludes
+ConfigureWorkspacePrefs=Configure Workspace Preferences...
\ No newline at end of file
Modified: branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java
===================================================================
--- branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2011-02-22 21:57:14 UTC (rev 29275)
+++ branches/jbosstools-3.2.x/archives/plugins/org.jboss.ide.eclipse.archives.ui/src/main/org/jboss/ide/eclipse/archives/ui/preferences/MainPreferencePage.java 2011-02-22 22:17:34 UTC (rev 29276)
@@ -16,7 +16,6 @@
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
@@ -26,9 +25,11 @@
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Link;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.dialogs.PreferencesUtil;
import org.eclipse.ui.dialogs.PropertyPage;
import org.jboss.ide.eclipse.archives.core.ArchivesCore;
import org.jboss.ide.eclipse.archives.core.asf.DirectoryScanner;
@@ -53,8 +54,8 @@
private Text defaultExcludes;
private Group corePrefGroup, viewPrefGroup, packageExplorerGroup, filesetGroup;
private Composite overrideComp;
+ private Link fChangeWorkspaceSettings;
-
public MainPreferencePage() {
super();
setTitle(ArchivesUIMessages.PreferencePageTitle);
@@ -63,8 +64,9 @@
protected Control createContents(Composite parent) {
Composite main = new Composite(parent, SWT.NONE);
- main.setLayout(new GridLayout(1, false));
-
+ GridLayout gl = new GridLayout(1, false);
+ main.setLayout(gl);
+
createOverridePrefs(main);
createCorePrefs(main);
createViewPrefs(main);
@@ -112,7 +114,9 @@
protected void createOverridePrefs(Composite main) {
if( getResourceLocationIfExists() != null ) {
overrideComp = new Composite(main, SWT.NONE);
- overrideComp.setLayout(new FillLayout());
+ overrideComp.setLayout(new FormLayout());
+ overrideComp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+
overrideButton = new Button(overrideComp, SWT.CHECK);
overrideButton.setText(ArchivesUIMessages.ProjectSpecificSettings);
@@ -124,9 +128,44 @@
setWidgetsEnabled(overrideButton.getSelection());
}
});
+ FormData fd = new FormData();
+ fd.top = new FormAttachment(0,5);
+ fd.left = new FormAttachment(0,5);
+ overrideButton.setLayoutData(fd);
+
+ fd = new FormData();
+ fd.top = new FormAttachment(0,0);
+ fd.left = new FormAttachment(overrideButton,5);
+ fd.right = new FormAttachment(100,-5);
+ fd.right.alignment = SWT.RIGHT;
+ Composite tmp = new Composite(overrideComp, SWT.NONE);
+ tmp.setLayoutData(fd);
+ tmp.setLayout(new GridLayout(1,true));
+ fChangeWorkspaceSettings= createLink(tmp, "Configure Workspace Settings..."); //$NON-NLS-1$
+ fChangeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));
}
}
+ private void openGlobalPrefs() {
+ String id= "org.jboss.ide.eclipse.archives.ui.archivesPreferencePage"; //$NON-NLS-1$
+ PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[] { id }, getElement()).open();
+ }
+
+ private Link createLink(Composite composite, String text) {
+ Link link= new Link(composite, SWT.BORDER);
+ link.setFont(composite.getFont());
+ link.setText("<A>" + text + "</A>"); //$NON-NLS-1$//$NON-NLS-2$
+ link.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ openGlobalPrefs();
+ }
+ public void widgetDefaultSelected(SelectionEvent e) {
+ openGlobalPrefs();
+ }
+ });
+ return link;
+ }
+
protected void setWidgetsEnabled(boolean val) {
showPackageOutputPath.setEnabled(val);
showProjectRoot.setEnabled(val);
@@ -137,6 +176,7 @@
showErrorDialog.setEnabled(val);
enableDefaultExcludes.setEnabled(val);
defaultExcludes.setEnabled(val);
+ showNodeOnAllProjects.setEnabled(val);
}
protected void createCorePrefs(Composite main) {
13 years, 10 months
JBoss Tools SVN: r29275 - in workspace/bbrodt/bpel/plugins: org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: bbrodt
Date: 2011-02-22 16:57:14 -0500 (Tue, 22 Feb 2011)
New Revision: 29275
Modified:
workspace/bbrodt/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.properties
workspace/bbrodt/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeServerRuntime.java
workspace/bbrodt/bpel/plugins/org.eclipse.bpel.ui/META-INF/MANIFEST.MF
workspace/bbrodt/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/WSDLCustomPage.java
Log:
missed some changes from working copy
Modified: workspace/bbrodt/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.properties
===================================================================
--- workspace/bbrodt/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.properties 2011-02-22 21:55:30 UTC (rev 29274)
+++ workspace/bbrodt/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/plugin.properties 2011-02-22 21:57:14 UTC (rev 29275)
@@ -2,4 +2,6 @@
providerName = JBoss by Red Hat
odeHome = ODE's home directory:
tomcatHome = Tomcat's home directory:
-port = Port:
\ No newline at end of file
+serverAddress = Server address:
+port = Port:
+vmArguments = VM Arguments:
Modified: workspace/bbrodt/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeServerRuntime.java
===================================================================
--- workspace/bbrodt/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeServerRuntime.java 2011-02-22 21:55:30 UTC (rev 29274)
+++ workspace/bbrodt/bpel/plugins/org.eclipse.bpel.apache.ode.runtime/src/org/eclipse/bpel/apache/ode/runtime/OdeServerRuntime.java 2011-02-22 21:57:14 UTC (rev 29275)
@@ -8,9 +8,20 @@
public class OdeServerRuntime extends GenericServerRuntime implements IBPELRuntimeDelegate {
+ public String getServerAddress()
+ {
+ Map m = getAttribute("generic_server_instance_properties", new HashMap());
+ return (String)m.get("serverAddress");
+ }
+
public String getPort()
{
- Map m = getAttribute("generic_server_attributes", new HashMap());
+ Map m = getAttribute("generic_server_instance_properties", new HashMap());
return (String)m.get("port");
}
+
+ public String getDeployDir()
+ {
+ return "/ode/processes";
+ }
}
Modified: workspace/bbrodt/bpel/plugins/org.eclipse.bpel.ui/META-INF/MANIFEST.MF
===================================================================
--- workspace/bbrodt/bpel/plugins/org.eclipse.bpel.ui/META-INF/MANIFEST.MF 2011-02-22 21:55:30 UTC (rev 29274)
+++ workspace/bbrodt/bpel/plugins/org.eclipse.bpel.ui/META-INF/MANIFEST.MF 2011-02-22 21:57:14 UTC (rev 29275)
@@ -72,4 +72,5 @@
org.eclipse.bpel.ui.util.marker,
org.eclipse.bpel.ui.wizards
Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Import-Package: org.eclipse.bpel.validator
+Import-Package: org.eclipse.bpel.runtimes,
+ org.eclipse.bpel.validator
Modified: workspace/bbrodt/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/WSDLCustomPage.java
===================================================================
--- workspace/bbrodt/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/WSDLCustomPage.java 2011-02-22 21:55:30 UTC (rev 29274)
+++ workspace/bbrodt/bpel/plugins/org.eclipse.bpel.ui/src/org/eclipse/bpel/ui/wizards/WSDLCustomPage.java 2011-02-22 21:57:14 UTC (rev 29275)
@@ -4,13 +4,12 @@
import java.util.Map;
import org.eclipse.bpel.runtimes.IBPELModuleFacetConstants;
+import org.eclipse.bpel.runtimes.IBPELRuntimeDelegate;
import org.eclipse.bpel.ui.BPELUIPlugin;
import org.eclipse.bpel.ui.IBPELUIConstants;
import org.eclipse.bpel.ui.Templates;
import org.eclipse.bpel.ui.Templates.Template;
-import org.eclipse.bpel.runtimes.IBPELRuntimeDelegate;
import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
@@ -28,7 +27,6 @@
import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
import org.eclipse.wst.server.core.IRuntimeType;
-import org.eclipse.wst.server.core.IRuntimeWorkingCopy;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.model.RuntimeDelegate;
13 years, 10 months