Author: rob.stryker(a)jboss.com
Date: 2009-07-31 17:25:13 -0400 (Fri, 31 Jul 2009)
New Revision: 16934
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/ConfigNameResolver.java
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.32
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.40
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.42
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.50
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.51
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.eap.43
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.eap.50
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
Log:
JBIDE-4680 - more changes as per max
Modified: trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF 2009-07-31
20:18:26 UTC (rev 16933)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/META-INF/MANIFEST.MF 2009-07-31
21:25:13 UTC (rev 16934)
@@ -20,7 +20,8 @@
org.jboss.ide.eclipse.as.ui;bundle-version="1.0.0",
org.eclipse.core.filesystem;bundle-version="1.2.0",
org.eclipse.ui.navigator;bundle-version="3.3.100",
- org.jboss.tools.jmx.core;bundle-version="0.2.1"
+ org.jboss.tools.jmx.core;bundle-version="0.2.1",
+ org.eclipse.core.variables;bundle-version="3.2.200"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Export-Package: org.jboss.ide.eclipse.archives.webtools,
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.32
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.32 2009-07-31
20:18:26 UTC (rev 16933)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.32 2009-07-31
21:25:13 UTC (rev 16934)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<filesets>
-<fileset excludes="" folder="server/${config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
+<fileset excludes="" folder="server/${jboss_config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
</filesets>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.40
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.40 2009-07-31
20:18:26 UTC (rev 16933)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.40 2009-07-31
21:25:13 UTC (rev 16934)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<filesets>
-<fileset excludes="" folder="server/${config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
+<fileset excludes="" folder="server/${jboss_config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
</filesets>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.42
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.42 2009-07-31
20:18:26 UTC (rev 16933)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.42 2009-07-31
21:25:13 UTC (rev 16934)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<filesets>
-<fileset excludes="" folder="server/${config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
+<fileset excludes="" folder="server/${jboss_config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
</filesets>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.50
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.50 2009-07-31
20:18:26 UTC (rev 16933)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.50 2009-07-31
21:25:13 UTC (rev 16934)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<filesets>
-<fileset excludes="" folder="server/${config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
+<fileset excludes="" folder="server/${jboss_config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
</filesets>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.51
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.51 2009-07-31
20:18:26 UTC (rev 16933)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.51 2009-07-31
21:25:13 UTC (rev 16934)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<filesets>
-<fileset excludes="" folder="server/${config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
+<fileset excludes="" folder="server/${jboss_config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
</filesets>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.eap.43
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.eap.43 2009-07-31
20:18:26 UTC (rev 16933)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.eap.43 2009-07-31
21:25:13 UTC (rev 16934)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<filesets>
-<fileset excludes="" folder="server/${config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
+<fileset excludes="" folder="server/${jboss_config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
</filesets>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.eap.50
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.eap.50 2009-07-31
20:18:26 UTC (rev 16933)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/filesetdata/org.jboss.ide.eclipse.as.eap.50 2009-07-31
21:25:13 UTC (rev 16934)
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<filesets>
-<fileset excludes="" folder="server/${config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
+<fileset excludes="" folder="server/${jboss_config}/conf"
includes="jboss-log4j.xml" name="Log4j.xml"/>
</filesets>
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java 2009-07-31
20:18:26 UTC (rev 16933)
+++
trunk/as/plugins/org.jboss.ide.eclipse.archives.webtools/src/org/jboss/ide/eclipse/archives/webtools/filesets/Fileset.java 2009-07-31
21:25:13 UTC (rev 16934)
@@ -10,11 +10,12 @@
******************************************************************************/
package org.jboss.ide.eclipse.archives.webtools.filesets;
+import org.eclipse.core.internal.variables.StringSubstitutionEngine;
+import org.eclipse.core.internal.variables.StringVariableManager;
+import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.wst.server.core.IServer;
-import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
public class Fileset implements Cloneable {
@@ -49,17 +50,17 @@
*/
public String getFolder() {
String tmp = folder == null ? "" : folder; //$NON-NLS-1$
-
- // TODO do the string replacement! perhaps use variables plugin
- IJBossServerRuntime ajbsrt = (IJBossServerRuntime) server.getRuntime()
- .loadAdapter(IJBossServerRuntime.class,
- new NullProgressMonitor());
- String config = null;
- if( ajbsrt != null )
- config = ajbsrt.getJBossConfiguration();
- if( config != null )
- tmp = tmp.replace("${config}", config); //$NON-NLS-1$
-
+ tmp = tmp.replace("${jboss_config_dir}", //$NON-NLS-1$
+ "${jboss_config_dir:" + server.getName() + "}"); //$NON-NLS-1$
//$NON-NLS-2$
+ tmp = tmp.replace("${jboss_config}", //$NON-NLS-1$
+ "${jboss_config:" + server.getName() + "}"); //$NON-NLS-1$
//$NON-NLS-2$
+
+ try {
+ StringSubstitutionEngine engine = new StringSubstitutionEngine();
+ tmp = engine.performStringSubstitution(tmp, true,
+ true, StringVariableManager.getDefault());
+ } catch( CoreException ce ) {}
+
IPath p = new Path(tmp);
if( !p.isAbsolute() && server != null ) {
if( server.getRuntime() != null )
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2009-07-31
20:18:26 UTC (rev 16933)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/META-INF/MANIFEST.MF 2009-07-31
21:25:13 UTC (rev 16934)
@@ -14,7 +14,8 @@
org.eclipse.jst.j2ee,
org.eclipse.wst.xml.core,
org.apache.ant,
- org.jboss.tools.jmx.core;bundle-version="0.2.1"
+ org.jboss.tools.jmx.core;bundle-version="0.2.1",
+ org.eclipse.core.variables;bundle-version="3.2.200"
Eclipse-LazyStart: true
Export-Package: org.jboss.ide.eclipse.as.core,
org.jboss.ide.eclipse.as.core.extensions.descriptors,
Added:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/ConfigNameResolver.java
===================================================================
---
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/ConfigNameResolver.java
(rev 0)
+++
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/resolvers/ConfigNameResolver.java 2009-07-31
21:25:13 UTC (rev 16934)
@@ -0,0 +1,54 @@
+package org.jboss.ide.eclipse.as.core.resolvers;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.variables.IDynamicVariable;
+import org.eclipse.core.variables.IDynamicVariableResolver;
+import org.eclipse.wst.server.core.IServer;
+import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
+
+public class ConfigNameResolver implements IDynamicVariableResolver {
+
+ public String resolveValue(IDynamicVariable variable, String argument)
+ throws CoreException {
+ if( variable.getName().equals("jboss_config")) //$NON-NLS-1$
+ return handleConfig(variable, argument);
+ if( variable.getName().equals("jboss_config_dir")) //$NON-NLS-1$
+ return handleConfigDir(variable, argument);
+ return null;
+ }
+
+ protected String handleConfig(IDynamicVariable variable, String argument) {
+ IServer[] servers = ServerCore.getServers();
+ for( int i = 0; i < servers.length; i++ ) {
+ if( servers[i].getName().equals(argument)) {
+ IJBossServerRuntime ajbsrt = (IJBossServerRuntime) servers[i].getRuntime()
+ .loadAdapter(IJBossServerRuntime.class,
+ new NullProgressMonitor());
+ String config = null;
+ if( ajbsrt != null )
+ config = ajbsrt.getJBossConfiguration();
+ if( config != null )
+ return config;
+ }
+ }
+ return null;
+ }
+ protected String handleConfigDir(IDynamicVariable variable, String argument) {
+ IServer[] servers = ServerCore.getServers();
+ for( int i = 0; i < servers.length; i++ ) {
+ if( servers[i].getName().equals(argument)) {
+ IJBossServerRuntime ajbsrt = (IJBossServerRuntime) servers[i].getRuntime()
+ .loadAdapter(IJBossServerRuntime.class,
+ new NullProgressMonitor());
+ String config = null;
+ if( ajbsrt != null )
+ config =
ajbsrt.getConfigLocationFullPath().append(ajbsrt.getJBossConfiguration()).toString();
+ if( config != null )
+ return config;
+ }
+ }
+ return null;
+ }
+}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-07-31 20:18:26 UTC (rev
16933)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/plugin.xml 2009-07-31 21:25:13 UTC (rev
16934)
@@ -905,4 +905,19 @@
id="org.jboss.ide.eclipse.as.core.server.internal.launch.serverClasspathProvider">
</classpathProvider>
</extension>
+ <extension
+ point="org.eclipse.core.variables.dynamicVariables">
+ <variable
+ name="jboss_config"
+ description="Returns the configuration name for the server
who's name matches the variable"
+
resolver="org.jboss.ide.eclipse.as.core.resolvers.ConfigNameResolver"
+ supportsArgument="true">
+ </variable>
+ <variable
+ name="jboss_config_dir"
+ description="Returns the full path of the configuration folder for the
server who's name matches the variable"
+
resolver="org.jboss.ide.eclipse.as.core.resolvers.ConfigNameResolver"
+ supportsArgument="true">
+ </variable>
+ </extension>
</plugin>