Author: rob.stryker(a)jboss.com
Date: 2009-10-28 21:10:48 -0400 (Wed, 28 Oct 2009)
New Revision: 18345
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/ui/editor/SSHDeploymentModuleTab.java
Log:
JBIDE-5048 - step something, trying to get project archives to publish remotely
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml 2009-10-29 00:14:48 UTC (rev
18344)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/plugin.xml 2009-10-29 01:10:48 UTC (rev
18345)
@@ -78,6 +78,11 @@
priority="3"
zipDelegate="false">
</publisher>
+ <publisher
+ class="org.jboss.ide.eclipse.as.ssh.server.SSHPackagesPublisher"
+ priority="3"
+ zipDelegate="false">
+ </publisher>
</extension>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPackagesPublisher.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPackagesPublisher.java 2009-10-29
00:14:48 UTC (rev 18344)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/server/SSHPackagesPublisher.java 2009-10-29
01:10:48 UTC (rev 18345)
@@ -71,6 +71,7 @@
statuses.addAll(Arrays.asList(publishModule(module2, true, monitor)));
}
}catch(Exception e) {
+ e.printStackTrace();
IStatus status = new Status(IStatus.ERROR, IntegrationPlugin.PLUGIN_ID,
NLS.bind(Messages.ErrorDuringPublish, module2.getName()), e);
return status;
@@ -115,16 +116,17 @@
IPath remoteRoot = new Path(remoteContainer).append(sourcePath.lastSegment());
try {
- if( incremental ) {
- IModuleResource[] members = PublishUtil.getResources(module);
- SSHCopyCallback callback = new SSHCopyCallback(remoteRoot, method);
- PublishCopyUtil util = new PublishCopyUtil(callback);
- return util.publishDelta(delta, monitor);
+ if( !pack.isExploded() ) {
+ // copy the output file
+ SSHZippedJSTPublisher.launchCommand(method.getSession(), "rm -rf " +
remoteRoot.toString(), monitor);
+ SSHZippedJSTPublisher.launchCopyCommand(method.getSession(), sourcePath.toOSString(),
remoteRoot.toString(), monitor);
} else {
- if( !pack.isExploded() ) {
- // copy the output file
- SSHZippedJSTPublisher.launchCopyCommand(method.getSession(),
sourcePath.toOSString(), remoteRoot.toString(), monitor);
+ if( incremental ) {
+ SSHCopyCallback callback = new SSHCopyCallback(remoteRoot, method);
+ PublishCopyUtil util = new PublishCopyUtil(callback);
+ return util.publishDelta(delta, monitor);
} else {
+ SSHZippedJSTPublisher.launchCommand(method.getSession(), "rm -rf " +
remoteRoot.toString(), monitor);
IModuleResource[] members = PublishUtil.getResources(module);
SSHCopyCallback callback = new SSHCopyCallback(remoteRoot, method);
PublishCopyUtil util = new PublishCopyUtil(callback);
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/ui/editor/SSHDeploymentModuleTab.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/ui/editor/SSHDeploymentModuleTab.java 2009-10-29
00:14:48 UTC (rev 18344)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ssh/src/org/jboss/ide/eclipse/as/ssh/ui/editor/SSHDeploymentModuleTab.java 2009-10-29
01:10:48 UTC (rev 18345)
@@ -64,8 +64,6 @@
}
public Control createControl(Composite parent) {
- helper = new ServerAttributeHelper(page.getServer().getOriginal(), page.getServer());
-
Composite random = new Composite(parent, SWT.NONE);
GridData randomData = new GridData(GridData.FILL_BOTH);
random.setLayoutData(randomData);
@@ -82,7 +80,6 @@
private Text userText, passText, deployText, hostsFileText;
private ModifyListener userListener, passListener, deployListener, hostsListener;
- private ServerAttributeHelper helper;
private Button zipDeployWTPProjects, browseHostsFileButton;
private SelectionListener zipListener, browseHostsButtonListener;
@@ -241,6 +238,10 @@
}
}
+ protected ServerAttributeHelper getHelper() {
+ return new ServerAttributeHelper(page.getServer().getOriginal(), page.getServer());
+ }
+
public class SetPropertyCommand extends ServerCommand {
protected String oldDir;
protected String newDir;
@@ -253,15 +254,15 @@
this.newDir = text.getText();
this.listener = listener;
this.attribute = attribute;
- this.oldDir = helper.getAttribute(attribute, ""); //$NON-NLS-1$
+ this.oldDir = getHelper().getAttribute(attribute, ""); //$NON-NLS-1$
}
public void execute() {
- helper.setAttribute(attribute, newDir);
+ getHelper().setAttribute(attribute, newDir);
page.getSaveStatus();
}
public void undo() {
text.removeModifyListener(listener);
- helper.setAttribute(attribute, oldDir);
+ getHelper().setAttribute(attribute, oldDir);
text.setText(oldDir);
text.addModifyListener(listener);
page.getSaveStatus();
@@ -301,17 +302,17 @@
boolean newVal;
public SetZipCommand() {
super(page.getServer(), Messages.EditorZipDeployments);
- oldVal = helper.getAttribute(ISSHDeploymentConstants.ZIP_DEPLOYMENTS_PREF, false);
+ oldVal = getHelper().getAttribute(ISSHDeploymentConstants.ZIP_DEPLOYMENTS_PREF,
false);
newVal = zipDeployWTPProjects.getSelection();
}
public void execute() {
- helper.setAttribute(ISSHDeploymentConstants.ZIP_DEPLOYMENTS_PREF, newVal);
+ getHelper().setAttribute(ISSHDeploymentConstants.ZIP_DEPLOYMENTS_PREF, newVal);
page.getSaveStatus();
}
public void undo() {
zipDeployWTPProjects.removeSelectionListener(zipListener);
zipDeployWTPProjects.setSelection(oldVal);
- helper.setAttribute(ISSHDeploymentConstants.ZIP_DEPLOYMENTS_PREF, oldVal);
+ getHelper().setAttribute(ISSHDeploymentConstants.ZIP_DEPLOYMENTS_PREF, oldVal);
zipDeployWTPProjects.addSelectionListener(zipListener);
page.getSaveStatus();
}
@@ -320,7 +321,7 @@
private boolean getZipsSSHDeployments() {
- return helper.getAttribute(ISSHDeploymentConstants.ZIP_DEPLOYMENTS_PREF, false);
+ return getHelper().getAttribute(ISSHDeploymentConstants.ZIP_DEPLOYMENTS_PREF, false);
}
private IDeployableServer getServer() {