Author: rob.stryker(a)jboss.com
Date: 2008-12-08 17:43:41 -0500 (Mon, 08 Dec 2008)
New Revision: 12479
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
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.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java
Log:
JBIDE-3368
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 2008-12-08
21:02:14 UTC (rev 12478)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServer.java 2008-12-08
22:43:41 UTC (rev 12479)
@@ -39,6 +39,7 @@
import org.eclipse.wst.server.core.model.ServerDelegate;
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
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.IJBossServerRuntime;
import org.jboss.ide.eclipse.as.core.util.ModuleUtil;
@@ -109,13 +110,41 @@
public String getDeployFolder() {
+ String type = getDeployLocationType();
+ if( type.equals(DEPLOY_CUSTOM))
+ return makeGlobal(getRuntime(), new Path(getAttribute(DEPLOY_DIRECTORY,
""))).toString();
+ if( type.equals(DEPLOY_METADATA)) {
+ return IJBossServerConstants.PLUGIN_LOCATION.append(getServer().getId().replace('
', '_')).
+ append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
+ } else if( type.equals(DEPLOY_SERVER)){
+ IJBossServerRuntime jbsrt = getRuntime();
+ String config = jbsrt.getJBossConfiguration();
+ return new Path(IJBossServerConstants.SERVER)
+ .append(config)
+ .append(IJBossServerConstants.DEPLOY).makeRelative().toString();
+ }
return makeGlobal(getRuntime(), new Path(getAttribute(DEPLOY_DIRECTORY,
""))).toString();
}
+
public void setDeployFolder(String folder) {
setAttribute(DEPLOY_DIRECTORY, makeRelative(getRuntime(), new
Path(folder)).toString());
}
public String getTempDeployFolder() {
+ String type = getDeployLocationType();
+ if( type.equals(DEPLOY_CUSTOM))
+ return makeGlobal(getRuntime(), new Path(getAttribute(TEMP_DEPLOY_DIRECTORY,
""))).toString();
+ if( type.equals(DEPLOY_METADATA)) {
+ return IJBossServerConstants.PLUGIN_LOCATION.append(getServer().getId().replace('
', '_')).
+ append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
+ } else if( type.equals(DEPLOY_SERVER)){
+ IJBossServerRuntime jbsrt = getRuntime();
+ String config = jbsrt.getJBossConfiguration();
+ return new Path(IJBossServerConstants.SERVER)
+ .append(config)
+ .append(IJBossServerConstants.TMP)
+ .append(IJBossServerConstants.JBOSSTOOLS_TMP).makeRelative().toString();
+ }
return makeGlobal(getRuntime(), new Path(getAttribute(TEMP_DEPLOY_DIRECTORY,
""))).toString();
}
public void setTempDeployFolder(String folder) {
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/util/ServerUtil.java 2008-12-08
22:43:41 UTC (rev 12479)
@@ -0,0 +1,5 @@
+package org.jboss.ide.eclipse.as.core.util;
+
+public class ServerUtil {
+
+}
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java 2008-12-08
21:02:14 UTC (rev 12478)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploySection.java 2008-12-08
22:43:41 UTC (rev 12479)
@@ -320,12 +320,12 @@
private Button newSelection, oldSelection;
private String oldDir, newDir;
private String oldTemp, newTemp;
- private String name;
+ private String id;
public RadioClickedCommand(Button clicked, Button previous) {
super(DeploySection.this.server, Messages.EditorSetRadioClicked);
newSelection = clicked;
oldSelection = previous;
- name = DeploySection.this.server.getName();
+ id = DeploySection.this.server.getId();
}
public void execute() {
boolean custom = newSelection == customRadio;
@@ -340,9 +340,9 @@
if( newSelection == metadataRadio ) {
- newDir = IJBossServerConstants.PLUGIN_LOCATION.append(name).
+ newDir = IJBossServerConstants.PLUGIN_LOCATION.append(id.replace(' ',
'_')).
append(IJBossServerConstants.DEPLOY).makeAbsolute().toString();
- newTemp = IJBossServerConstants.PLUGIN_LOCATION.append(name).
+ newTemp = IJBossServerConstants.PLUGIN_LOCATION.append(id.replace(' ',
'_')).
append(IJBossServerConstants.TEMP_DEPLOY).makeAbsolute().toString();
type = IDeployableServer.DEPLOY_METADATA;
new File(newDir).mkdirs();
Show replies by date