[jbosstools-commits] JBoss Tools SVN: r43789 - in trunk: as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules and 12 other directories.
jbosstools-commits at lists.jboss.org
jbosstools-commits at lists.jboss.org
Tue Sep 18 06:15:59 EDT 2012
Author: rob.stryker at jboss.com
Date: 2012-09-18 06:15:59 -0400 (Tue, 18 Sep 2012)
New Revision: 43789
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/LocalExploreBehavior.java
Removed:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedJSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/OSGiPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java
trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/defect/PublishWeb2DeletesWeb1LibsTest.java
trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java
trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java
Log:
JBIDE-12613 adding api to IDeployableServer because it otherwise lived inside an internal utility class
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/plugin.xml 2012-09-18 10:15:59 UTC (rev 43789)
@@ -51,56 +51,9 @@
</nodeContribution>
</extension>
- <!--
- * With these actions removed, if they never return, a large
- portion of this plugin and it's classes can be deprecated
- and eventually removed *
-
<extension
- point="org.jboss.ide.eclipse.archives.ui.newArchiveActions">
- <newPackageAction
- class="org.jboss.ide.eclipse.archives.webtools.ui.NewWARAction"
- icon="$nl$/icons/war.gif"
- id="org.jboss.ide.eclipse.packages.ui.newWARAction"
- label="%newPackageAction.label.war"/>
- <newPackageAction
- class="org.jboss.ide.eclipse.archives.webtools.ui.NewEJBJARAction"
- icon="$nl$/icons/EJBJar.gif"
- id="org.jboss.ide.eclipse.packages.ui.newEJBJarAction"
- label="%newPackageAction.label.ejbJar"/>
- <newPackageAction
- class="org.jboss.ide.eclipse.archives.webtools.ui.NewEARAction"
- icon="$nl$/icons/ear.gif"
- id="org.jboss.ide.eclipse.packages.ui.newEARAction"
- label="%newPackageAction.label.ear"/>
- </extension>
-
- -->
-
- <extension
point="org.jboss.ide.eclipse.as.core.publishers">
- <!--
<publisher
- class="org.jboss.ide.eclipse.archives.webtools.modules.PackagesPublisher"
- priority="5">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.archives.webtools.modules.WTPZippedPublisher"
- priority="2"
- zipDelegate="true">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.archives.webtools.modules.SingleFolderZippedPublisher"
- priority="2"
- zipDelegate="true">
- </publisher>
- <publisher
- class="org.jboss.ide.eclipse.archives.webtools.modules.AltMethodZippedFolderPublisher"
- priority="8"
- zipDelegate="true">
- </publisher>
- -->
- <publisher
class="org.jboss.ide.eclipse.archives.webtools.modules.AltMethodZippedJSTPublisher"
priority="3"
zipDelegate="true">
@@ -112,8 +65,6 @@
</publisher>
</extension>
-
-
<extension
point="org.eclipse.ui.navigator.navigatorContent">
<navigatorContent
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedJSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedJSTPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/AltMethodZippedJSTPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -18,6 +18,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.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.wst.server.core.IModule;
@@ -26,11 +27,13 @@
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
import org.eclipse.wst.server.core.util.ModuleFile;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+import org.jboss.ide.eclipse.as.core.Trace;
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.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
+import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.internal.v7.DeploymentMarkerUtils;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
@@ -40,7 +43,85 @@
* It extends the functionality of the local zipped publishing class
* by uploading the file after building it in a temporary directory
*/
-public class AltMethodZippedJSTPublisher extends WTPZippedPublisher {
+public class AltMethodZippedJSTPublisher implements IJBossServerPublisher {
+
+ private int moduleState = IServer.PUBLISH_STATE_NONE;
+ private boolean requiresTransfer = true;
+
+ public boolean accepts(String method, IServer server, IModule[] module) {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ return ds != null && (module == null || ds.zipsWTPDeployments());
+ }
+
+ public int getPublishState() {
+ return moduleState;
+ }
+ public boolean requiresTransfer() {
+ return requiresTransfer;
+ }
+
+ protected IStatus localTempPublishModule(
+ IJBossServerPublishMethod method,
+ IServer server, IModule[] module,
+ int publishType, IModuleResourceDelta[] delta,
+ IProgressMonitor monitor) throws CoreException {
+ // Build all parts together at once.
+ // When a call for [ear, childWar] comes in, ignore it.
+ IStatus status = Status.OK_STATUS;
+
+ if( module.length > 1 )
+ return null;
+
+ if( DeploymentMarkerUtils.supportsJBoss7MarkerDeployment(server)) {
+ requiresTransfer = false;
+ status = handleJBoss7Deployment(method, server, module, publishType, delta, monitor);
+ } else {
+ Trace.trace(Trace.STRING_FINER, "Using as<=6 publishModule logic in WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
+ requiresTransfer = true;
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ String deployRoot = getDeployRoot(module, ds);
+ LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
+ status = util.publishModule(server, deployRoot, module, publishType, delta, monitor);
+ Trace.trace(Trace.STRING_FINER, "Zipping complete for module " + module[module.length-1].getName() ); //$NON-NLS-1$ monitor.done();
+ }
+ return status;
+ }
+
+ public IStatus handleJBoss7Deployment(
+ IJBossServerPublishMethod method,
+ IServer server, IModule[] module,
+ int publishType, IModuleResourceDelta[] delta,
+ IProgressMonitor monitor) throws CoreException {
+ IDeployableServer ds = ServerConverter.getDeployableServer(server);
+ String deployRoot = getDeployRoot(module, ds);
+ if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
+ Trace.trace(Trace.STRING_FINER, "Removing .dodeploy marker in WTPZippedPublisher to undeploy module " + module[module.length-1].getName() ); //$NON-NLS-1$
+ DeploymentMarkerUtils.removeDeployedMarkerIfExists(method, ds, module, monitor);
+ } else {
+ Trace.trace(Trace.STRING_FINER, "Zipping module in WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
+ LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
+ IStatus s = util.publishModule(server, deployRoot, module, publishType, delta, monitor);
+ IPath outPath = util.getOutputFilePath();
+ if( util.hasBeenChanged()) {
+ Trace.trace(Trace.STRING_FINER, "Output zip changed. Copying file to destination. WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
+
+ // Copy out file
+ IPath depPath = ds.getDeploymentLocation(module, true);
+ IPath folder = depPath.removeLastSegments(1);
+ IPublishCopyCallbackHandler callback = method.getCallbackHandler(folder, server);
+ IModuleFile mf = new ModuleFile(outPath.toFile(), "", new Path("/")); //$NON-NLS-1$ //$NON-NLS-2$
+ callback.copyFile(mf, new Path(depPath.lastSegment()), monitor);
+
+ // Add marker
+ DeploymentMarkerUtils.addDoDeployMarker(method, ds, module, new NullProgressMonitor());
+ }
+ monitor.done();
+ return s;
+ }
+ monitor.done();
+ return Status.OK_STATUS;
+ }
+
/**
* 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
@@ -56,33 +137,34 @@
private IServer server;
private IJBossServerPublishMethod method;
- @Override
public IStatus publishModule(
IJBossServerPublishMethod method,
IServer server, IModule[] module,
int publishType, IModuleResourceDelta[] delta,
IProgressMonitor monitor) throws CoreException {
+
+ this.module = module;
+ this.server = server;
+ this.method = method;
+
+ String taskName = "Publishing " + module[0].getName(); //$NON-NLS-1$
+ monitor.beginTask(taskName, 200);
+ monitor.setTaskName(taskName);
+ if( module.length > 1 ) {
+ // Skip any module of length > 1, since a zip does it
+ // all in one attempt.
+ return null;
+ }
+
+ monitor.setTaskName("Publishing to remote server " + server.getName()); //$NON-NLS-1$
+
try {
- this.module = module;
- this.server = server;
- this.method = method;
- String taskName = "Publishing " + module[0].getName(); //$NON-NLS-1$
- monitor.beginTask(taskName, 200);
- monitor.setTaskName(taskName);
- if( module.length > 1 ) {
- return null;
- }
-
- monitor.setTaskName("Publishing to remote server " + server.getName()); //$NON-NLS-1$
-
-
-
// set up needed vars
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
- IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot, server2);
- IPath destination = PublishUtil.getDeployPath(method, module, server2);
+ IPath sourcePath = PublishUtil.getModuleNestedDeployPath(module, remoteTempDeployRoot, server2);
+ IPath destination = server2.getDeploymentLocation(module, true);
String name = sourcePath.lastSegment();
IStatus result = null;
@@ -122,12 +204,12 @@
IProgressMonitor monitor) throws CoreException {
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
- IPath sourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot, server2);
- IPath destination = PublishUtil.getDeployPath(method, module, server2);
+ IPath sourcePath = PublishUtil.getModuleNestedDeployPath(module, remoteTempDeployRoot, server2);
+ IPath destination = server2.getDeploymentLocation(module, true);
String name = sourcePath.lastSegment();
// Locally zip it up into the remote tmp folder
- IStatus result = super.publishModule(method, server, module, publishType, delta, monitor);
+ IStatus result = localTempPublishModule(method, server, module, publishType, delta, monitor);
if( result.isOK() && requiresTransfer()) { // It seems the superclass already transfers it upstream for as7 :|
result = remoteFullPublish(sourcePath, destination.removeLastSegments(1), name,
AbstractServerToolsPublisher.getSubMon(monitor, 150));
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/LocalZippedPublisherUtil.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -385,7 +385,7 @@
public IPath getOutputFilePath(IServer server, IModule[] module, String deployRoot) {
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- return getDeployPath(module, deployRoot, ds);
+ return getModuleNestedDeployPath(module, deployRoot, ds);
}
public boolean hasBeenChanged() {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/OSGiPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/OSGiPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/OSGiPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -38,12 +38,12 @@
IProgressMonitor monitor) throws CoreException {
IDeployableServer server2 = ServerConverter.getDeployableServer(server);
- IPath destination = PublishUtil.getDeployPath(method, module, server2);
+ IPath destination = server2.getDeploymentLocation(module, true);
String remoteTempDeployRoot = getDeployRoot(module, ServerConverter.getDeployableServer(server));
if( new Path(remoteTempDeployRoot).toFile().exists())
new Path(remoteTempDeployRoot).toFile().mkdirs();
- IPath presumedSourcePath = PublishUtil.getDeployPath(module, remoteTempDeployRoot, server2);
+ IPath presumedSourcePath = PublishUtil.getModuleNestedDeployPath(module, remoteTempDeployRoot, server2);
String name = presumedSourcePath.lastSegment();
IPath realSourcePathFolder = presumedSourcePath.removeLastSegments(1).append("plugins"); //$NON-NLS-1$
IProject project = module[module.length-1].getProject();
Deleted: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/modules/WTPZippedPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * 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
- *
- * TODO: Logging and Progress Monitors
- ******************************************************************************/
-package org.jboss.ide.eclipse.archives.webtools.modules;
-
-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.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.model.IModuleFile;
-import org.eclipse.wst.server.core.model.IModuleResourceDelta;
-import org.eclipse.wst.server.core.util.ModuleFile;
-import org.jboss.ide.eclipse.as.core.Trace;
-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.IJBossServerPublishMethod;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
-import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
-import org.jboss.ide.eclipse.as.core.server.internal.v7.DeploymentMarkerUtils;
-import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
-
-public class WTPZippedPublisher implements IJBossServerPublisher {
- private int moduleState = IServer.PUBLISH_STATE_NONE;
- private boolean requiresTransfer = true;
-
- public boolean accepts(String method, IServer server, IModule[] module) {
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- return ds != null && (module == null || ds.zipsWTPDeployments());
- }
-
- public int getPublishState() {
- return moduleState;
- }
- public boolean requiresTransfer() {
- return requiresTransfer;
- }
-
- protected String getDeployRoot(IModule[] module, IDeployableServer ds) {
- return PublishUtil.getDeployRootFolder(
- module, ds, ds.getDeployFolder(),
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- }
-
- public IStatus publishModule(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
- // Build all parts together at once.
- // When a call for [ear, childWar] comes in, ignore it.
- IStatus status = Status.OK_STATUS;
-
- if( module.length > 1 )
- return null;
-
- if( DeploymentMarkerUtils.supportsJBoss7MarkerDeployment(server)) {
- requiresTransfer = false;
- status = handleJBoss7Deployment(method, server, module, publishType, delta, monitor);
- } else {
- Trace.trace(Trace.STRING_FINER, "Using as<=6 publishModule logic in WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
- requiresTransfer = true;
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- String deployRoot = getDeployRoot(module, ds);
- LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
- status = util.publishModule(server, deployRoot, module, publishType, delta, monitor);
- Trace.trace(Trace.STRING_FINER, "Zipping complete for module " + module[module.length-1].getName() ); //$NON-NLS-1$ monitor.done();
- }
- return status;
- }
-
- public IStatus handleJBoss7Deployment(
- IJBossServerPublishMethod method,
- IServer server, IModule[] module,
- int publishType, IModuleResourceDelta[] delta,
- IProgressMonitor monitor) throws CoreException {
- IDeployableServer ds = ServerConverter.getDeployableServer(server);
- String deployRoot = getDeployRoot(module, ds);
- if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
- Trace.trace(Trace.STRING_FINER, "Removing .dodeploy marker in WTPZippedPublisher to undeploy module " + module[module.length-1].getName() ); //$NON-NLS-1$
- DeploymentMarkerUtils.removeDeployedMarkerIfExists(method, ds, module, monitor);
- } else {
- Trace.trace(Trace.STRING_FINER, "Zipping module in WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
- LocalZippedPublisherUtil util = new LocalZippedPublisherUtil();
- IStatus s = util.publishModule(server, deployRoot, module, publishType, delta, monitor);
- IPath outPath = util.getOutputFilePath();
- if( util.hasBeenChanged()) {
- Trace.trace(Trace.STRING_FINER, "Output zip changed. Copying file to destination. WTPZippedPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
-
- // Copy out file
- IPath depPath = PublishUtil.getDeployPath(method, module, ds);
- IPath folder = depPath.removeLastSegments(1);
- IPublishCopyCallbackHandler callback = method.getCallbackHandler(folder, server);
- IModuleFile mf = new ModuleFile(outPath.toFile(), "", new Path("/")); //$NON-NLS-1$ //$NON-NLS-2$
- callback.copyFile(mf, new Path(depPath.lastSegment()), monitor);
-
- // Add marker
- DeploymentMarkerUtils.addDoDeployMarker(method, ds, module, new NullProgressMonitor());
- }
- monitor.done();
- return s;
- }
- monitor.done();
- return Status.OK_STATUS;
- }
-}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/AbstractServerToolsPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -120,11 +120,11 @@
* @return
*/
protected IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
- return PublishUtil.getDeployPath(publishMethod, moduleTree, server);
+ return server.getDeploymentLocation(moduleTree, true);
}
protected IPath getTempDeployPath(IModule[] moduleTree, IDeployableServer server) {
- return PublishUtil.getTempDeployPath(publishMethod, moduleTree, server);
+ return server.getTempDeploymentLocation(moduleTree, true);
}
@@ -143,7 +143,7 @@
}
if( tree2.length == 0 )
return new Path(publishMethod.getPublishDefaultRootFolder(server.getServer()));
- return PublishUtil.getDeployPath(publishMethod, tree2, server);
+ return server.getDeploymentLocation(moduleTree, true);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/LocalPublishMethod.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -16,15 +16,12 @@
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IPublishCopyCallbackHandler;
import org.jboss.ide.eclipse.as.core.server.xpl.LocalCopyCallback;
+import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
public class LocalPublishMethod extends AbstractPublishMethod {
- /**
- * TODO: refactor to "LOCAL" since we have local publishing and local
- * launching/stopping which both have to be mapped in equal ways
- */
- public static final String LOCAL_PUBLISH_METHOD = "local"; //$NON-NLS-1$
+ public static final String LOCAL_PUBLISH_METHOD = IJBossToolingConstants.DEFAULT_DEPLOYMENT_METHOD_TYPE;
public String getPublishMethodId() {
return LOCAL_PUBLISH_METHOD;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PublishUtil.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -44,25 +44,24 @@
*
* This API should be renamed, as it actually gets a value stored at a property key
*
- * @param moduleTree
- * @param server
- * @param defaultFolder
- * @param moduleProperty
+ * Practically, this method will find the deploy root folder or
+ * the temp deploy root folder for a given module by checking
+ * the override model
+ *
+ * @param moduleTree the module
+ * @param server the server
+ * @param defaultFolder the default folder if per-module settings DNE
+ * @param moduleProperty key representing folder or temp folder
* @return
*/
- public static String getDeployRootFolder(IModule[] moduleTree,
- IDeployableServer server, String defaultFolder, String moduleProperty) {
- return getDeployRootFolder(moduleTree, "local", //$NON-NLS-1$
- server, defaultFolder, moduleProperty);
- }
-
/* This api should be renamed */
- public static String getDeployRootFolder(IModule[] moduleTree, String publishMethod,
+ private static String getDeployRootFolder(IModule[] moduleTree,
IDeployableServer server, String defaultFolder, String moduleProperty) {
String folder = defaultFolder;
// TODO bug 286699
DeploymentPreferences prefs = DeploymentPreferenceLoader.loadPreferencesFromServer(server.getServer());
- DeploymentTypePrefs typePrefs = prefs.getOrCreatePreferences(publishMethod);
+ DeploymentTypePrefs typePrefs = prefs.getOrCreatePreferences(
+ IJBossToolingConstants.DEFAULT_DEPLOYMENT_METHOD_TYPE);
DeploymentModulePrefs modPrefs = typePrefs.getModulePrefs(moduleTree[0]);
if( modPrefs != null ) {
String loc = modPrefs.getProperty(moduleProperty);
@@ -78,33 +77,45 @@
}
return folder;
}
-
- public static IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
- String folder = getDeployRootFolder(
- moduleTree, server,
- server.getDeployFolder(),
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return getDeployPath(moduleTree, folder, server);
- }
- public static IPath getDeployRootFolder(IModule[] moduleTree, IDeployableServer server) {
- String folder = getDeployRootFolder(
- moduleTree, server,
- server.getDeployFolder(),
+ public static boolean DEEP = true;
+ public static boolean ROOT = false;
+ public static IPath getDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree, IDeployableServer server, boolean deep) {
+ String defaultFolder = method.getPublishDefaultRootFolder(server.getServer());
+ String folder = PublishUtil.getDeployRootFolder(
+ moduleTree, server, defaultFolder,
IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return new Path(folder);
+ if( deep == ROOT )
+ return new Path(folder);
+ return getModuleNestedDeployPath(moduleTree, folder, server);
}
- public static IPath getTempDeployFolder(IModule[] moduleTree, IDeployableServer server) {
- String folder = getDeployRootFolder(
- moduleTree, server,
- server.getTempDeployFolder(),
+ public static IPath getTempDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree,
+ IDeployableServer server, boolean deep) {
+ String defaultFolder = method.getPublishDefaultRootTempFolder(server.getServer());
+ String folder = PublishUtil.getDeployRootFolder(
+ moduleTree, server, defaultFolder,
IJBossToolingConstants.LOCAL_DEPLOYMENT_TEMP_LOC);
- return new Path(folder);
+ if( deep == ROOT )
+ return new Path(folder);
+ return getModuleNestedDeployPath(moduleTree, folder, server);
}
+
- public static IPath getDeployPath(IModule[] moduleTree, String deployFolder, IDeployableServer server) {
- IPath root = new Path( deployFolder );
+ /**
+ * Given a folder to deploy this module, append the various
+ * subparts of this module[] into the name. For example, if we
+ * know that this specific module should be published to
+ * /home/user/custom/path, then append the module names to yield
+ * a return value of /home/user/custom/path/some.ear/some.war
+ *
+ * @param moduleTree
+ * @param deployFolder
+ * @param server
+ * @return
+ */
+ public static IPath getModuleNestedDeployPath(IModule[] moduleTree, String rootFolder, IDeployableServer server) {
+ IPath root = new Path( rootFolder );
String type, modName, name, uri, suffixedName;
for( int i = 0; i < moduleTree.length; i++ ) {
boolean found = false;
@@ -136,22 +147,6 @@
return root;
}
- public static IPath getDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree, IDeployableServer server) {
- String defaultFolder = method.getPublishDefaultRootFolder(server.getServer());
- String folder = PublishUtil.getDeployRootFolder(
- moduleTree, server, defaultFolder,
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
- return PublishUtil.getDeployPath(moduleTree, folder, server);
- }
-
- public static IPath getTempDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree, IDeployableServer server) {
- String defaultFolder = method.getPublishDefaultRootTempFolder(server.getServer());
- String folder = PublishUtil.getDeployRootFolder(
- moduleTree, server, defaultFolder,
- IJBossToolingConstants.LOCAL_DEPLOYMENT_TEMP_LOC);
- return PublishUtil.getDeployPath(moduleTree, folder, server);
- }
-
public static String getSuffix(String type) {
// TODO
// VirtualReferenceUtilities.INSTANCE. has utility methods to help!!
@@ -275,4 +270,36 @@
}
}
}
+
+ /* Deprecated */
+ @Deprecated
+ public static IPath getLocalDeployPath(IModule[] moduleTree, IDeployableServer server) {
+ return server.getDeploymentLocation(moduleTree, true);
+ }
+
+ @Deprecated
+ public static IPath getLocalDeployRootFolder(IModule[] moduleTree, IDeployableServer server) {
+ return server.getDeploymentLocation(moduleTree, false);
+ }
+
+ @Deprecated
+ public static IPath getLocalTempDeployPath(IModule[] moduleTree, IDeployableServer server) {
+ return server.getTempDeploymentLocation(moduleTree, true);
+ }
+
+ @Deprecated
+ public static IPath getLocalTempDeployRootFolder(IModule[] moduleTree, IDeployableServer server) {
+ return server.getTempDeploymentLocation(moduleTree, false);
+ }
+
+ @Deprecated
+ public static IPath getDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree, IDeployableServer server) {
+ return server.getDeploymentLocation(moduleTree, true);
+ }
+
+ @Deprecated
+ public static IPath getTempDeployPath(IJBossServerPublishMethod method, IModule[] moduleTree,
+ IDeployableServer server) {
+ return server.getTempDeploymentLocation(moduleTree, true);
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IDeployableServer.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -13,6 +13,8 @@
import java.util.regex.Pattern;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
import org.jboss.ide.eclipse.as.core.server.internal.ServerAttributeHelper;
@@ -42,7 +44,10 @@
public boolean zipsWTPDeployments();
public void setZipWTPDeployments(boolean val);
+ public IPath getDeploymentLocation(IModule[] module, boolean deep);
+ public IPath getTempDeploymentLocation(IModule[] module, boolean deep);
+
public String getConfigDirectory();
public ServerAttributeHelper getAttributeHelper();
public IServer getServer();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DelegatingServerBehavior.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -187,7 +187,7 @@
return;
IJBossServerPublishMethod method = createPublishMethod();
- IPath depPath = PublishUtil.getDeployPath(method, module, ds);
+ IPath depPath = ds.getDeploymentLocation(module, true);
if( ServerModelUtilities.isBinaryModule(module[module.length-1]) || ds.zipsWTPDeployments()) {
// touch the file
method.getCallbackHandler(depPath.removeLastSegments(1), getServer())
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -16,6 +16,7 @@
import java.util.regex.PatternSyntaxException;
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.Path;
@@ -28,10 +29,14 @@
import org.eclipse.wst.server.core.ServerPort;
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
+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.IDeployableServerBehaviour;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.server.IMultiModuleURLProvider;
import org.jboss.ide.eclipse.as.core.util.RuntimeUtils;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.core.util.ServerUtil;
import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
@@ -222,5 +227,18 @@
} catch( MalformedURLException murle) { return null; }
}
-
+ protected IJBossServerPublishMethod createPublishMethod() {
+ IDeployableServerBehaviour beh = ServerConverter.getDeployableServerBehavior(getServer());
+ if( beh != null ) {
+ IJBossServerPublishMethod method = ((DeployableServerBehavior)beh).createPublishMethod();
+ return method;
+ }
+ return null;
+ }
+ public IPath getDeploymentLocation(IModule[] module, boolean deep) {
+ return PublishUtil.getDeployPath(createPublishMethod(), module, this, deep);
+ }
+ public IPath getTempDeploymentLocation(IModule[] module, boolean deep) {
+ return PublishUtil.getTempDeployPath(createPublishMethod(), module, this, deep);
+ }
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DelegatingJBoss7ServerBehavior.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -119,7 +119,7 @@
return;
IJBossServerPublishMethod method = createPublishMethod();
- IPath depPath = PublishUtil.getDeployPath(method, module, ds);
+ IPath depPath = ds.getDeploymentLocation(module, true);
createDoDeployMarker(method, Arrays.asList(new IPath[]{depPath}), monitor);
setModuleState(module, IServer.STATE_STARTING);
ServerExtendedProperties props = (ServerExtendedProperties)getServer()
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/DeploymentMarkerUtils.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -67,7 +67,7 @@
*/
public static IStatus addDoDeployMarker(IJBossServerPublishMethod method, IDeployableServer server,
IModule[] moduleTree, IProgressMonitor monitor) throws CoreException {
- IPath depPath = PublishUtil.getDeployPath(method, moduleTree, server);
+ IPath depPath = server.getDeploymentLocation(moduleTree, true);
return addDoDeployMarker(method, server.getServer(), depPath, monitor);
}
@@ -138,7 +138,7 @@
public static IStatus removeDeployedMarkerIfExists(IJBossServerPublishMethod method, IServer server,
IModule[] module, IProgressMonitor monitor) throws CoreException {
IDeployableServer deployableServer = ServerConverter.getDeployableServer(server);
- IPath deployPath = PublishUtil.getDeployPath(method, module, deployableServer);
+ IPath deployPath = deployableServer.getDeploymentLocation(module, true);
return removeDeployedMarkerIfExists(method, server, deployPath, monitor);
}
@@ -156,7 +156,7 @@
public static IStatus removeDeployedMarkerIfExists(IJBossServerPublishMethod method, IDeployableServer jbServer,
IModule[] moduleTree, IProgressMonitor monitor)
throws CoreException {
- IPath deployPath = PublishUtil.getDeployPath(method, moduleTree, jbServer);
+ IPath deployPath = jbServer.getDeploymentLocation(moduleTree, true);
return removeDeployedMarkerIfExists(method, jbServer.getServer(), deployPath, monitor);
}
@@ -198,7 +198,7 @@
public static IStatus removeDeployFailedMarkerIfExists(IJBossServerPublishMethod method, IServer server,
IModule[] module, IProgressMonitor monitor) throws CoreException {
IDeployableServer deployableServer = ServerConverter.getDeployableServer(server);
- IPath deployPath = PublishUtil.getDeployPath(method, module, deployableServer);
+ IPath deployPath = deployableServer.getDeploymentLocation(module, true);
return removeFile(FAILED_DEPLOY, server, deployPath, method, monitor);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7JSTPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -50,7 +50,7 @@
Trace.trace(Trace.STRING_FINER, "Using AS7 publishModule logic in JBoss7JSTPublisher for module " + module[module.length-1].getName() ); //$NON-NLS-1$
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- DeploymentMarkerUtils.removeDeployFailedMarker(method, server, PublishUtil.getDeployPath(method, module, ds), monitor);
+ DeploymentMarkerUtils.removeDeployFailedMarker(method, server, ds.getDeploymentLocation(module, true), monitor);
if( publishType == IJBossServerPublisher.REMOVE_PUBLISH) {
IStatus s = DeploymentMarkerUtils.removeDeployedMarkerIfExists(method, ds, module, monitor);
@@ -85,7 +85,7 @@
private void doDeployRequired(IJBossServerPublishMethod method,IDeployableServer server,
IModule[] moduleTree, IProgressMonitor monitor ) throws CoreException {
- IPath p = PublishUtil.getDeployPath(method, moduleTree, server);
+ IPath p = server.getDeploymentLocation(moduleTree, true);
Trace.trace(Trace.STRING_FINER, "Marking path " + p + " as requiring a .dodeploy marker, but NOT creating the file yet"); //$NON-NLS-1$ //$NON-NLS-2$
DelegatingJBoss7ServerBehavior beh = ServerConverter.getJBoss7ServerBehavior(server.getServer());
beh.markDoDeploy(p);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/JBoss7ModuleStateVerifier.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -73,7 +73,8 @@
private boolean isRootModuleStarted(IServer server, IModule root, IProgressMonitor monitor) throws Exception {
JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server, JBoss7Server.class);
IJBoss7ManagerService service = JBoss7ManagerUtil.getService(server);
- IPath deployPath = PublishUtil.getDeployPath(new IModule[]{root}, jbossServer);
+ // TODO does this need to change??
+ IPath deployPath = jbossServer.getDeploymentLocation(new IModule[]{root}, true);
return isRootModuleStarted(server, root, service, deployPath, monitor);
}
@@ -94,7 +95,8 @@
try {
JBoss7Server jbossServer = ServerConverter.checkedGetJBossServer(server, JBoss7Server.class);
IJBoss7ManagerService service = JBoss7ManagerUtil.getService(server);
- IPath deployPath = PublishUtil.getDeployPath(new IModule[]{module[0]}, jbossServer);
+ // TODO DOES THIS NEED TO CHANGE?
+ IPath deployPath = jbossServer.getDeploymentLocation(new IModule[]{module[0]}, true);
boolean waitedOnce = false;
while (!monitor.isCanceled()) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/v7/LocalJBoss7DeploymentScannerAdditions.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -166,7 +166,7 @@
IModule[] module = new IModule[] { modules2[i] };
IStatus status = server.canModifyModules(module, null, null);
if (status != null && status.getSeverity() != IStatus.ERROR) {
- String tempFolder = PublishUtil.getDeployRootFolder(module, ds).toString();
+ String tempFolder = ds.getDeploymentLocation(module, false).toString();
if( !folders.contains(tempFolder))
folders.add(tempFolder);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/IJBossToolingConstants.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -146,6 +146,8 @@
public static final String EXPOSE_MANAGEMENT_SERVICE = "org.jboss.ide.eclipse.as.core.server.EXPOSE_MANAGEMENT_SERVICE"; //$NON-NLS-1$
+ public static final String DEFAULT_DEPLOYMENT_METHOD_TYPE = "local"; //$NON-NLS-1$
+
public static final String LOCAL_DEPLOYMENT_NAME = "name"; //$NON-NLS-1$
public static final String LOCAL_DEPLOYMENT_LOC = "location"; //$NON-NLS-1$
public static final String LOCAL_DEPLOYMENT_TEMP_LOC = "tempLocation"; //$NON-NLS-1$
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.rse.ui/src/org/jboss/ide/eclipse/as/rse/ui/RSEDeploymentPreferenceUI.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -100,7 +100,7 @@
RSEPublishMethod method = (RSEPublishMethod)type.createPublishMethod();
method.setBehaviour(ServerConverter.getDeployableServerBehavior(server));
if( module != null ) {
- remoteFolder = PublishUtil.getDeployPath(method, module, ds);
+ remoteFolder = ds.getDeploymentLocation(module, true);
}
try {
method.getFileService();
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/actions/ExploreUtils.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -26,9 +26,12 @@
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.JBossServerUIPlugin;
import org.jboss.ide.eclipse.as.ui.Messages;
-import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
/**
+ *
+ * The utilities in this class are only useful for
+ * exploring LOCALLY.
+ *
* @author snjeza
*
*/
@@ -129,7 +132,7 @@
public static boolean canExplore(IServer server, IModule[] modules) {
IDeployableServer ds = ServerConverter.getDeployableServer(server);
if( ds != null ) {
- IPath p = PublishUtil.getDeployRootFolder(modules, ds);
+ IPath p = ds.getDeploymentLocation(modules, false);
if (p == null || !p.toFile().exists() || ExploreUtils.getExploreCommand() == null)
return false;
return true;
@@ -178,16 +181,4 @@
}
}
}
-
- public static IPath getDeployPath(IDeployableServer server,IModule[] moduleTree) {
- IPath fullPath = PublishUtil.getDeployPath(moduleTree, server);
- if (Platform.getOS().equals(Platform.OS_WIN32)) {
- return fullPath;
- }
- if( !ServerModelUtilities.isBinaryModule(moduleTree)) {
- return fullPath;
- }
- return fullPath.removeLastSegments(1);
- }
-
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/ExploreActionProvider.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -10,10 +10,8 @@
******************************************************************************/
package org.jboss.tools.as.wst.server.ui.xpl;
-import java.io.File;
import java.util.HashMap;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IContributionItem;
import org.eclipse.jface.action.IMenuManager;
@@ -32,7 +30,6 @@
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
import org.jboss.ide.eclipse.as.core.publishers.LocalPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
import org.jboss.ide.eclipse.as.ui.actions.ExploreUtils;
import org.jboss.ide.eclipse.as.ui.views.server.extensions.CommonActionProviderUtils;
@@ -43,41 +40,9 @@
}
public static HashMap<String, IExploreBehavior> exploreBehaviorMap = new HashMap<String, IExploreBehavior>();
static {
- exploreBehaviorMap.put(LocalPublishMethod.LOCAL_PUBLISH_METHOD, new IExploreBehavior() {
- public boolean canExplore(IServer server, IModule[] module) {
- if( module != null )
- return ExploreUtils.canExplore(server, module);
- return ExploreUtils.canExplore(server);
- }
- public void openExplorer(IServer server, IModule[] module) {
- if( module != null )
- runExploreModuleServer(server, module);
- else
- runExploreServer(server);
- }
- public void runExploreServer(IServer server) {
- String deployDirectory = ExploreUtils.getDeployDirectory(server);
- if (deployDirectory != null && deployDirectory.length() > 0) {
- ExploreUtils.explore(deployDirectory);
- }
- }
-
- public void runExploreModuleServer(IServer server, IModule[] module) {
- IPath path = getModuleDeployPath(server, module);
- if (path != null) {
- File file = path.toFile();
- if (file.exists()) {
- ExploreUtils.explore(file.getAbsolutePath());
- }
- }
- }
- private IPath getModuleDeployPath(IServer server, IModule[] module) {
- IDeployableServer deployableServer = ServerConverter.getDeployableServer(server);
- if( deployableServer != null )
- return ExploreUtils.getDeployPath(deployableServer, module);
- return null;
- }
- });
+ exploreBehaviorMap.put(
+ LocalPublishMethod.LOCAL_PUBLISH_METHOD,
+ new LocalExploreBehavior());
}
Added: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/LocalExploreBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/LocalExploreBehavior.java (rev 0)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/tools/as/wst/server/ui/xpl/LocalExploreBehavior.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -0,0 +1,62 @@
+package org.jboss.tools.as.wst.server.ui.xpl;
+
+import java.io.File;
+
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.wst.server.core.IModule;
+import org.eclipse.wst.server.core.IServer;
+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.ServerConverter;
+import org.jboss.ide.eclipse.as.ui.actions.ExploreUtils;
+import org.jboss.ide.eclipse.as.wtp.core.util.ServerModelUtilities;
+import org.jboss.tools.as.wst.server.ui.xpl.ExploreActionProvider.IExploreBehavior;
+
+public class LocalExploreBehavior implements IExploreBehavior {
+ public boolean canExplore(IServer server, IModule[] module) {
+ if( module != null )
+ return ExploreUtils.canExplore(server, module);
+ return ExploreUtils.canExplore(server);
+ }
+ public void openExplorer(IServer server, IModule[] module) {
+ if( module != null )
+ runExploreModuleServer(server, module);
+ else
+ runExploreServer(server);
+ }
+ public void runExploreServer(IServer server) {
+ String deployDirectory = ExploreUtils.getDeployDirectory(server);
+ if (deployDirectory != null && deployDirectory.length() > 0) {
+ ExploreUtils.explore(deployDirectory);
+ }
+ }
+
+ public void runExploreModuleServer(IServer server, IModule[] module) {
+ IPath path = getModuleDeployPath(server, module);
+ if (path != null) {
+ File file = path.toFile();
+ if (file.exists()) {
+ ExploreUtils.explore(file.getAbsolutePath());
+ }
+ }
+ }
+ private IPath getModuleDeployPath(IServer server, IModule[] module) {
+ IDeployableServer deployableServer = ServerConverter.getDeployableServer(server);
+ if( deployableServer != null )
+ return getDeployPath(deployableServer, module);
+ return null;
+ }
+
+ private static IPath getDeployPath(IDeployableServer server,IModule[] moduleTree) {
+ IPath fullPath = server.getDeploymentLocation(moduleTree, true);
+ if (Platform.getOS().equals(Platform.OS_WIN32)) {
+ return fullPath;
+ }
+ if( !ServerModelUtilities.isBinaryModule(moduleTree)) {
+ return fullPath;
+ }
+ return fullPath.removeLastSegments(1);
+ }
+
+}
Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/AbstractPublishingTest.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -324,7 +324,7 @@
}
protected IPath getLocalPublishMethodDeployRoot() {
DeployableServer ds = (DeployableServer)server.loadAdapter(DeployableServer.class, new NullProgressMonitor());
- IPath path = PublishUtil.getDeployPath(new LocalPublishMethod(), new IModule[]{primaryModule}, ds);
+ IPath path = ds.getDeploymentLocation(new IModule[]{primaryModule}, true);
return path;
}
Modified: trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/defect/PublishWeb2DeletesWeb1LibsTest.java
===================================================================
--- trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/defect/PublishWeb2DeletesWeb1LibsTest.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/as/tests/org.jboss.tools.as.test.core/src/org/jboss/tools/as/test/core/parametized/server/publishing/defect/PublishWeb2DeletesWeb1LibsTest.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -97,14 +97,14 @@
private void verifyEJBAndJarExist() {
// Make sure ejb and libs exist
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- IPath fullPath = PublishUtil.getDeployPath(findArrayForProject("UserForum1EJB1"), ds);
+ IPath fullPath = ds.getDeploymentLocation(findArrayForProject("UserForum1EJB1"), true);
assertTrue(fullPath.toFile().exists());
assertTrue(fullPath.append("UserForum1Util1.jar").toFile().exists());
}
private void verifyWeb1AndLibsExist() {
// Make sure ejb and libs exist
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- IPath fullPath = PublishUtil.getDeployPath(findArrayForProject("UserForum1Web1"), ds);
+ IPath fullPath = ds.getDeploymentLocation(findArrayForProject("UserForum1Web1"), true);
assertTrue(fullPath.toFile().exists());
assertTrue(fullPath.append("WEB-INF").append("lib").append("UserForum1Util1.jar").toFile().exists());
assertTrue(fullPath.append("WEB-INF").append("lib").append("UserForum1Util2.jar").toFile().exists());
@@ -112,7 +112,7 @@
private void verifyWeb2AndLibsExist() {
// Make sure ejb and libs exist
IDeployableServer ds = ServerConverter.getDeployableServer(server);
- IPath fullPath = PublishUtil.getDeployPath(findArrayForProject("UserForum1Web2"), ds);
+ IPath fullPath = ds.getDeploymentLocation(findArrayForProject("UserForum1Web2"), true);
assertTrue(fullPath.toFile().exists());
assertTrue(fullPath.append("WEB-INF").append("lib").append("UserForum1Util1.jar").toFile().exists());
assertTrue(fullPath.append("WEB-INF").append("lib").append("UserForum1Util2.jar").toFile().exists());
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 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/bpel/plugins/org.jboss.tools.bpel.runtimes/src/org/jboss/tools/bpel/runtimes/module/JBTBPELPublisher.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -38,8 +38,6 @@
import org.jboss.ide.eclipse.archives.webtools.modules.LocalZippedPublisherUtil;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
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;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublishMethod;
import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
@@ -48,6 +46,7 @@
import org.jboss.ide.eclipse.as.core.util.FileUtil;
import org.jboss.ide.eclipse.as.core.util.IJBossToolingConstants;
import org.jboss.ide.eclipse.as.core.util.IWTPConstants;
+import org.jboss.ide.eclipse.as.core.util.ModuleResourceUtil;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.tools.bpel.runtimes.IBPELModuleFacetConstants;
import org.jboss.tools.jmx.core.IMemento;
@@ -70,7 +69,7 @@
}
public boolean accepts(String method, IServer server, IModule[] module) {
- if( LocalPublishMethod.LOCAL_PUBLISH_METHOD.equals(method)
+ if(IJBossToolingConstants.DEFAULT_DEPLOYMENT_METHOD_TYPE.equals(method)
&& module != null && module.length > 0
&& module[module.length-1] != null
&& (
@@ -128,8 +127,8 @@
IDeployableServer ds = ServerConverter.getDeployableServer(server);
IModule last = moduleTree[moduleTree.length -1];
IPath deployPath = getDeployPath(moduleTree, ds);
- IPath tempDeployPath = PublishUtil.getTempDeployFolder(moduleTree, ds);
- IModuleResource[] members = PublishUtil.getResources(last, new NullProgressMonitor());
+ IPath tempDeployPath = ds.getTempDeploymentLocation(moduleTree, false);
+ IModuleResource[] members = ModuleResourceUtil.getResources(last, new NullProgressMonitor());
// https://issues.jboss.org/browse/JBDS-1573
// make sure the project has a deploy.xml (bpel-deploy.xml for backward compatibility).
boolean hasDeployXML = false;
@@ -147,16 +146,14 @@
return ms;
}
if( shouldZip() ) {
- String deployRoot = PublishUtil.getDeployRootFolder(
- moduleTree, ds, ds.getDeployFolder(),
- IJBossToolingConstants.LOCAL_DEPLOYMENT_LOC);
+ IPath deployRoot = ds.getDeploymentLocation(moduleTree, false);
BPELZippedPublisherUtil util = new BPELZippedPublisherUtil(deployPath);
- IStatus ret = util.publishModule(server, deployRoot, moduleTree, publishType, delta, monitor);
+ IStatus ret = util.publishModule(server, deployRoot.toString(), moduleTree, publishType, delta, monitor);
resultList.add(ret);
} else {
LocalCopyCallback handler = new LocalCopyCallback(server, deployPath, tempDeployPath);
PublishCopyUtil util = new PublishCopyUtil(handler);
- resultList.addAll(Arrays.asList(util.initFullPublish(members, monitor)));
+ resultList.addAll(Arrays.asList(util.initFullPublish(members, null, monitor)));
}
addDeployedPathToDescriptor(server, last.getProject(), deployPath); // persist it
pruneList(resultList);
@@ -185,7 +182,7 @@
}
public static IPath getDeployPath(IModule[] moduleTree, IDeployableServer server) {
- IPath path = PublishUtil.getDeployPath(moduleTree, server);
+ IPath path = server.getDeploymentLocation(moduleTree, true);
path = path.removeLastSegments(1).append(getNewLastSegment(moduleTree));
return path;
}
Modified: trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java
===================================================================
--- trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java 2012-09-18 09:11:55 UTC (rev 43788)
+++ trunk/openshift/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/core/behaviour/ExpressBinaryPublishMethod.java 2012-09-18 10:15:59 UTC (rev 43789)
@@ -53,8 +53,7 @@
return 0;
IDeployableServer depServ = ServerConverter.getDeployableServer(behaviour.getServer());
- IPath dest = PublishUtil.getDeployRootFolder(module, depServ);
- //PublishUtil.getDeployPath(this, module, depServ);
+ IPath dest = depServ.getDeploymentLocation(module, false);
if( module.length == 0 ) return IServer.PUBLISH_STATE_NONE;
int modulePublishState = behaviour.getServer().getModulePublishState(module);
More information about the jbosstools-commits
mailing list