Author: dennyxu
Date: 2009-12-08 01:12:57 -0500 (Tue, 08 Dec 2009)
New Revision: 19093
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
Log:
JBIDE-5108: JBossRuntimeManager has hard-coded the configuration to default
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/META-INF/MANIFEST.MF 2009-12-08
06:12:57 UTC (rev 19093)
@@ -30,7 +30,8 @@
org.eclipse.wst.common.emfworkbench.integration,
org.eclipse.emf.ecore,
org.jboss.ide.eclipse.as.classpath.core,
- org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0"
+ org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0",
+ org.jboss.ide.eclipse.as.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %providerName
Export-Package: org.jboss.tools.esb.core,
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/plugin.xml 2009-12-08
06:12:57 UTC (rev 19093)
@@ -200,7 +200,7 @@
projects="true">
<moduleType
types="jst.jboss.esb"
- versions="4.2,4.3,4.4,4.5,4.6">
+ versions="4.2,4.3,4.4,4.5,4.6,4.7">
</moduleType>
</moduleFactory>
</extension>
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/AbstractESBRuntimeResolver.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -14,13 +14,18 @@
protected final static String SOAP_AS_LOCATION = "jboss-as"; //$NON-NLS-1$
protected final static String ROSETTA_JAR = "jbossesb-rosetta.jar";
//$NON-NLS-1$
- public List<IPath> getJarDirectories(String runtimeLocation) {
+ public List<IPath> getJarDirectories(String runtimeLocation, String configuration)
{
+
+ if("".equals(configuration)){
+ configuration = "default";
+ }
+
List<IPath> directories = new ArrayList<IPath>();
IPath rtHome = new Path(runtimeLocation);
IPath soapDeployPath =
rtHome.append(SOAP_AS_LOCATION).append("server").append("default").append(
"deploy");
- IPath deployPath =
rtHome.append("server").append("default").append(
+ IPath deployPath = rtHome.append("server").append(configuration).append(
"deploy");
IPath esbPath = deployPath.append(JBOSSESB_ESB);
@@ -39,10 +44,10 @@
return directories;
}
- public List<File> getAllRuntimeJars(String runtimeLocation) {
+ public List<File> getAllRuntimeJars(String runtimeLocation, String configuration)
{
List<File> jarList = new ArrayList<File>();
- for(IPath dir : getJarDirectories(runtimeLocation)){
+ for(IPath dir : getJarDirectories(runtimeLocation, configuration)){
List<File> tmpJarList = new ArrayList<File>();
if(dir.toFile().exists()){
tmpJarList = getJarsOfFolder(dir.toFile());
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_42.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -13,10 +13,10 @@
private final static String CONFIG_MODEL_JAR =
"jbossesb-config-model-1.1.0.jar";
- public boolean isValidESBRuntime(String location, String version){
+ public boolean isValidESBRuntime(String location, String version, String
configuration){
List<String> jarNames = new ArrayList<String>();
- for(File file : getAllRuntimeJars(location)){
+ for(File file : getAllRuntimeJars(location, configuration)){
jarNames.add(file.getName());
}
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/ESBRuntimeResolver_47.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -14,10 +14,10 @@
private final static String CONFIG_MODEL_JAR_12 =
"jbossesb-config-model-1.2.0.jar";
- public boolean isValidESBRuntime(String location, String version){
+ public boolean isValidESBRuntime(String location, String version, String
configuration){
List<String> jarNames = new ArrayList<String>();
- for(File file : getAllRuntimeJars(location)){
+ for(File file : getAllRuntimeJars(location, configuration)){
jarNames.add(file.getName());
}
@@ -27,8 +27,8 @@
}
- public List<IPath> getJarDirectories(String runtimeLocation) {
- List<IPath> directories = super.getJarDirectories(runtimeLocation);
+ public List<IPath> getJarDirectories(String runtimeLocation, String configuration)
{
+ List<IPath> directories = super.getJarDirectories(runtimeLocation,
configuration);
IPath rtHome = new Path(runtimeLocation);
IPath soapDeployPath =
rtHome.append(SOAP_AS_LOCATION).append("server").append("default").append(
"deployers").append("esb.deployer").append("lib");
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/IESBRuntimeResolver.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -8,9 +8,9 @@
public interface IESBRuntimeResolver {
- public boolean isValidESBRuntime(String location, String version);
+ public boolean isValidESBRuntime(String location, String version, String
configuration);
- public List<IPath> getJarDirectories(String runtimeLocation);
+ public List<IPath> getJarDirectories(String runtimeLocation, String
configuration);
- public List<File> getAllRuntimeJars(String runtimeLocation);
+ public List<File> getAllRuntimeJars(String runtimeLocation, String
configuration);
}
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntime.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -24,6 +24,8 @@
String homeDir = null;
String version = null;
+
+ String configuration = "";
boolean defaultRt = false;
@@ -55,6 +57,16 @@
public String getHomeDir() {
return homeDir;
}
+
+
+ /**
+ * Get jboss server configuration
+ *
+ * @return JBoss configuration as string
+ */
+ public String getConfiguration(){
+ return configuration;
+ }
/**
* Set JBossWSRuntime name
@@ -75,6 +87,18 @@
public void setHomeDir(String homeDir) {
this.homeDir = homeDir;
}
+
+
+
+ /**
+ * Set JBoss server configuration, it is only for jboss AS contained ESB runtime
+ *
+ * @param configuration
+ * new JBossWSRuntime's configuration
+ */
+ public void setConfiguration(String configuration){
+ this.configuration = configuration;
+ }
/**
* Mark runtime as default
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeClassPathInitializer.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -16,6 +16,7 @@
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.jdt.core.IAccessRule;
import org.eclipse.jdt.core.IClasspathAttribute;
@@ -23,17 +24,12 @@
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.ServerCore;
import org.jboss.ide.eclipse.as.classpath.core.jee.AbstractClasspathContainer;
import
org.jboss.ide.eclipse.as.classpath.core.jee.AbstractClasspathContainerInitializer;
import org.jboss.ide.eclipse.as.classpath.core.xpl.ClasspathDecorations;
-import org.jboss.tools.esb.core.ESBProjectCorePlugin;
-import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.tools.esb.core.messages.JBossFacetCoreMessages;
/**
@@ -146,8 +142,10 @@
unbound = false;
String runtimeLocation = serverRuntime.getLocation()
.toOSString();
+ IJBossServerRuntime jbossRuntime =
(IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
+
jars = JBossRuntimeManager.getInstance().getAllRuntimeJars(
- runtimeLocation, serverRuntime.getRuntimeType().getId());
+ runtimeLocation, serverRuntime.getRuntimeType().getId(),
jbossRuntime.getJBossConfiguration());
} else {
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeListConverter.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -36,6 +36,7 @@
private static final String DEFAULT = "default";
private static final String HOME_DIR = "homeDir";
private static final String VERSION = "version";
+ private static final String CONFIGURATION = "configuration";
private static final String NAME = "name";
private static final String USER_CONFIG_CLASSPATH = "userConfig";
private static final String LIBRARY = "libraries";
@@ -71,7 +72,9 @@
rt.setHomeDir(value);
} else if (VERSION.equals(name)) {
rt.setVersion(value);
- } else if (DEFAULT.equals(name)) {
+ }else if (CONFIGURATION.equals(name)) {
+ rt.setConfiguration(value);
+ }else if (DEFAULT.equals(name)) {
rt.setDefault(Boolean.parseBoolean(value));
}else if(USER_CONFIG_CLASSPATH.equals(name)){
rt.setUserConfigClasspath(Boolean.parseBoolean(value));
@@ -134,6 +137,9 @@
buffer.append(FIELD_SEPARATOR).append(HOME_DIR).append(
FIELD_SEPARATOR);
buffer.append(runtimes[i].getHomeDir());
+ buffer.append(FIELD_SEPARATOR).append(CONFIGURATION).append(
+ FIELD_SEPARATOR);
+ buffer.append(runtimes[i].getConfiguration());
buffer.append(FIELD_SEPARATOR).append(DEFAULT).append(
FIELD_SEPARATOR);
buffer.append(runtimes[i].isDefault());
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -23,8 +23,6 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.QualifiedName;
import org.eclipse.core.runtime.Status;
@@ -169,14 +167,14 @@
} else {
- jarList = getAllRuntimeJars(rt.getHomeDir(), esbVersion);
+ jarList = getAllRuntimeJars(rt.getHomeDir(), esbVersion, rt.getConfiguration());
}
}
return jarList;
}
- public List<String> getAllRuntimeJars(String runtimeLocation, String esbVersion)
{
+ public List<String> getAllRuntimeJars(String runtimeLocation, String esbVersion,
String configuration) {
List<String> jarList = new ArrayList<String>();
IESBRuntimeResolver resolver = null;
if(parserMap.get(esbVersion) != null){
@@ -184,7 +182,7 @@
}
if( resolver != null){
- List<File> jars = resolver.getAllRuntimeJars(runtimeLocation);
+ List<File> jars = resolver.getAllRuntimeJars(runtimeLocation, configuration);
for(File file : jars){
jarList.add(file.getAbsolutePath());
}
@@ -357,9 +355,9 @@
runtimes = converter.getMap(runtimeListString);
}
- public static boolean isValidESBServer(String path, String version){
+ public static boolean isValidESBServer(String path, String version, String
configuration){
- return isValidESBStandaloneRuntimeDir(path, version);
+ return isValidESBStandaloneRuntimeDir(path, version, configuration);
}
// private static boolean isValidSoapContainedESBRuntime(String path, String version){
@@ -367,21 +365,21 @@
// }
@Deprecated
- public static boolean getResttaJar(String path, String asFoldername, String version){
- return isValidESBStandaloneRuntimeDir(path, version);
+ public static boolean getResttaJar(String path, String asFoldername, String version,
String configuration){
+ return isValidESBStandaloneRuntimeDir(path, version, configuration);
}
- public static boolean isValidESBStandaloneRuntimeDir(String path, String version) {
+ public static boolean isValidESBStandaloneRuntimeDir(String path, String version, String
configuration) {
IESBRuntimeResolver resolver = null;
if( parserMap.get(version) != null){
resolver = (IESBRuntimeResolver)parserMap.get(version);
}
if(resolver != null){
- return resolver.isValidESBRuntime(path, version);
+ return resolver.isValidESBRuntime(path, version, configuration);
}
else{
ESBProjectCorePlugin.log("No ESB runtime resolver defined for ESB "+
version, null, Status.WARNING);
@@ -410,11 +408,6 @@
// return true;
}
- private static boolean isVersion45(IPath sarLocation){
- IPath libPath = sarLocation.append("lib");
- File jbossesbConfigModel110 =
libPath.append("jbossesb-config-model-1.1.0.jar").toFile();
- return jbossesbConfigModel110 != null && jbossesbConfigModel110.exists();
- }
public String getESBVersionNumber(File rosettaJar){
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/META-INF/MANIFEST.MF 2009-12-08
06:12:57 UTC (rev 19093)
@@ -33,7 +33,8 @@
org.jboss.tools.esb.project.core;bundle-version="1.0.0",
org.eclipse.jdt.ui;bundle-version="3.4.1",
org.jboss.ide.eclipse.as.ui;bundle-version="1.0.0",
- org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0"
+ org.jboss.ide.eclipse.as.wtp.core;bundle-version="1.0.0",
+ org.jboss.ide.eclipse.as.core;bundle-version="1.0.0"
Bundle-ActivationPolicy: lazy
Bundle-Vendor: %Bundle-Vendor.0
Export-Package: org.jboss.tools.esb.project.ui
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2009-12-08
06:12:57 UTC (rev 19093)
@@ -4,7 +4,8 @@
Error_JBoss_Basic_Editor_Support=Editor supports only grid layout
Error_JBoss_Basic_Editor_Different=Parent for label is different
JBoss_Runtime_List_Field_Editor_Name=Name
-JBoss_Runtime_List_Field_Editor_Version=Version
+JBoss_Runtime_List_Field_Editor_Version=Version:
+JBoss_Runtime_List_Field_Editor_Configuration=Configuration:
JBoss_Runtime_List_Field_Editor_Path=Path
JBoss_Runtime_List_Field_Editor_Inputelement_Must_Be_List=inputElement must be an
instance of List<JBossRuntime>.
JBoss_Runtime_Delete_Confirm_Title=Confirm Runtime Delete
@@ -13,6 +14,7 @@
JBoss_Runtime_List_Field_Editor_Edit_Runtime=Edit JBoss ESB Runtime
JBoss_Runtime_List_Field_Editor_Modify_Runtime=Input new values
JBoss_Runtime_List_Field_Editor_New_Runtime=New JBoss ESB Runtime
+JBoss_Runtime_List_Field_Editor_Configuration_Description=Only for JBoss AS contained ESB
runtime
Error_JBoss_Runtime_List_Field_Editor_Path_To_Home_Diretory_Cannot_Be_Empty=Path to JBoss
ESB runtime home directory cannot be empty
JBoss_Runtime_List_Field_Editor_Runtime_Already_Exists=JBoss ESB Runtime
''{0}'' already exists
JBoss_Runtime_List_Field_Editor_Runtime=JBoss ESB Runtime
@@ -72,4 +74,4 @@
ESBExportWizard_NotValidProject=Project "{0}" is not a valid ESB Project
ESBExportWizard_Title=ESB Export
ESBExportWizard_Description=Export an ESB project to the local file system.
-ESBExportWizard_ESBProject=ESB Project:
\ No newline at end of file
+ESBExportWizard_ESBProject=ESB Project\:
\ No newline at end of file
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUIMessages.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -37,6 +37,7 @@
public static String JBoss_Runtime_Delete_Confirm_Title;
public static String JBoss_Runtime_Delete_Used_Confirm;
public static String JBoss_Runtime_Delete_Not_Used_Confirm;
+ public static String JBoss_Runtime_List_Field_Editor_Configuration_Description;
public static String JBoss_Runtime_List_Field_Editor_Edit_Runtime;
public static String JBoss_Runtime_List_Field_Editor_Modify_Runtime;
public static String JBoss_Runtime_List_Field_Editor_New_Runtime;
@@ -51,6 +52,7 @@
public static String JBoss_Composite_Editor_This_Method_Can_Be_Invoked;
public static String JBoss_Button_Field_Editor_Browse;
public static String JBoss_ESBRuntime_Classpath_Container_5;
+ public static String JBoss_Runtime_List_Field_Editor_Configuration;
public static String JBoss_ESBRuntime_Classpath_Container_Description;
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossESBRuntimePreferencePage.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -99,6 +99,7 @@
JBossRuntime o = changed.get(c);
o.setHomeDir(c.getHomeDir());
o.setVersion(c.getVersion());
+ o.setConfiguration(c.getConfiguration());
String oldName = o.getName();
String newName = c.getName();
if (!oldName.equals(newName)) {
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -43,6 +43,8 @@
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.graphics.Image;
@@ -52,10 +54,12 @@
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.DirectoryDialog;
import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.TableColumn;
import org.eclipse.wst.common.project.facet.core.IProjectFacet;
import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
@@ -424,6 +428,10 @@
IFieldEditor version = createComboEditor(SRT_VERSION,
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Version, getESBFacetVersions(),
""); //$NON-NLS-1$
+
+// IFieldEditor configuration = createComboEditor(SRT_CONFIGURATION,
+// JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Configuration,
getESBFacetVersions(), ""); //$NON-NLS-1$
+ Combo configuration;
IFieldEditor homeDir = createBrowseFolderEditor(
SRT_HOMEDIR,
@@ -431,16 +439,17 @@
""); //$NON-NLS-1$
JBossRuntime current = null;
-
+ JBossRuntime source = null;
IFieldEditor jars = null;
- public JBossWSRuntimeWizardPage(List<JBossRuntime> editedList) {
+ public JBossWSRuntimeWizardPage(List<JBossRuntime> editedList, JBossRuntime
source) {
super(
JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
setMessage(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Create_A_Runtime);
setTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Runtime);
value = editedList;
+ this.source = source;
}
/**
@@ -464,12 +473,32 @@
version.addPropertyChangeListener(this);
homeDir.doFillIntoGrid(root);
homeDir.addPropertyChangeListener(this);
+
+ new Label(root,
SWT.NONE).setText(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Configuration);
+ Composite cfgComposite = new Composite(root, SWT.NONE);
+ cfgComposite.setLayout(new GridLayout(2, false));
+ cfgComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ configuration = new Combo(cfgComposite, SWT.READ_ONLY);
+ GridData gd = new GridData();
+ gd.widthHint = 150;
+ configuration.setLayoutData(gd);
+ new Label(cfgComposite,
SWT.NONE).setText(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Configuration_Description);
+ configuration.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent e) {
+ checkPageComplete();
+ }
+ });
+
+
jars = new JBossLibraryListFieldEditor("", "", current);
//$NON-NLS-1$ //$NON-NLS-2$
jars.doFillIntoGrid(root);
jars.addPropertyChangeListener(this);
setPageComplete(false);
setControl(root);
+
+ updateConfigrations(homeDir.getValueAsString());
}
/**
@@ -491,7 +520,13 @@
}
name.setValue(homeDirName);
}
+ updateConfigrations(homeDir.getValueAsString());
}
+
+ checkPageComplete();
+ }
+
+ private void checkPageComplete(){
if (name.getValueAsString() == null || "".equals(//$NON-NLS-1$
name.getValueAsString().toString().trim())) {
@@ -532,6 +567,7 @@
&& current.getVersion().equals(version.getValueAsString())
&& current.isUserConfigClasspath() == jarJbws
.isUserConfigClasspath()
+ && current.getConfiguration().equals(configuration.getText())
&& (!jarJbws.isUserConfigClasspath() || hasSameLibraies(
current.getLibraries(), jarJbws.getLibraries()))) {
@@ -554,7 +590,7 @@
return;
}
- if (!runtimeExist(homeDir.getValueAsString(), (String)version.getValue())) {
+ if (!runtimeExist(homeDir.getValueAsString(), (String)version.getValue(),
configuration.getText())) {
setErrorMessage(NLS.bind(JBossESBUIMessages.Label_JBoss_Runtime_Load_Error,
version.getValue()));
setPageComplete(false);
return;
@@ -584,6 +620,59 @@
return versions;
}
+
+
+ private List<String> updateConfigrations(String location){
+
+ ArrayList<String> configList = new ArrayList<String>();
+ IPath locationPath = new Path(location);
+ IPath asPath = locationPath.append("jboss-as").append("server");
+ if(!asPath.toFile().exists()){
+ asPath = locationPath.append("server");
+ }
+
+// IPath asPath = locationPath.append("server");
+ File serverDirectory = asPath.toFile();
+
+ if (serverDirectory.exists()) {
+
+ File types[] = serverDirectory.listFiles();
+ for (int i = 0; i < types.length; i++) {
+ File serviceDescriptor = new File(types[i]
+ .getAbsolutePath()
+ + File.separator
+ + "conf" //$NON-NLS-1$
+ + File.separator
+ + "jboss-service.xml"); //$NON-NLS-1$
+
+ if (types[i].isDirectory() && serviceDescriptor.exists()) {
+ String configuration = types[i].getName();
+ configList.add(configuration);
+ }
+ }
+
+ if (configList.size() > 0) {
+ getControl().setEnabled(true);
+ }
+ }
+
+ if(configuration != null && !configuration.isDisposed()){
+ configuration.removeAll();
+
+ for(String config : configList){
+ configuration.add(config);
+ if("default".equals(config)){
+ configuration.select(configList.indexOf(config));
+ }
+ }
+ if(source != null && source.getConfiguration() != null){
+ configuration.setText(source.getConfiguration());
+ }
+ }
+
+ return configList;
+
+ }
/**
* Return JBossWS Runtime instance initialized by user input
*
@@ -594,6 +683,7 @@
newRt.setName(name.getValueAsString());
newRt.setVersion(version.getValueAsString());
newRt.setHomeDir(homeDir.getValueAsString());
+ newRt.setConfiguration(configuration.getText());
JBossRuntime rt = (JBossRuntime) jars.getValue();
newRt.setLibraries(rt.getLibraries());
newRt.setUserConfigClasspath(rt.isUserConfigClasspath());
@@ -654,14 +744,14 @@
};
}
- private boolean runtimeExist(String path, String version) {
+ private boolean runtimeExist(String path, String version, String configuration) {
File jbosswsHomeDir = new File(path);
if (!jbosswsHomeDir.isDirectory())
return false;
- if(!JBossRuntimeManager.isValidESBStandaloneRuntimeDir(path, version)
- && !JBossRuntimeManager.isValidESBServer(path, version)){
+ if(!JBossRuntimeManager.isValidESBStandaloneRuntimeDir(path, version, configuration)
+ && !JBossRuntimeManager.isValidESBServer(path, version, configuration)){
return false;
}
@@ -689,7 +779,7 @@
List<JBossRuntime> added) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_New_Runtime);
- page1 = new JBossWSRuntimeWizardPage(exist);
+ page1 = new JBossWSRuntimeWizardPage(exist, null);
addPage(page1);
this.value = exist;
this.added = added;
@@ -745,7 +835,7 @@
Map<JBossRuntime, JBossRuntime> changed) {
super();
setWindowTitle(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Edit_Runtime);
- page1 = new JBossWSRuntimeWizardPage(existing);
+ page1 = new JBossWSRuntimeWizardPage(existing, source);
page1
.setMessage(JBossESBUIMessages.JBoss_Runtime_List_Field_Editor_Modify_Runtime);
page1
@@ -774,6 +864,7 @@
source.setName(rt.getName());
source.setHomeDir(rt.getHomeDir());
source.setVersion(rt.getVersion());
+ source.setConfiguration(rt.getConfiguration());
source.setUserConfigClasspath(rt.isUserConfigClasspath());
source.setLibraries(rt.getLibraries());
} else {
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -20,6 +20,7 @@
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.Dialog;
@@ -56,6 +57,7 @@
import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
import org.eclipse.wst.server.core.ServerCore;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.tools.esb.core.ESBProjectConstant;
import org.jboss.tools.esb.core.facet.IJBossESBFacetDataModelProperties;
import org.jboss.tools.esb.core.runtime.JBossRuntime;
@@ -364,8 +366,10 @@
org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
.findRuntime(runtime.getProperty("id")); //$NON-NLS-1$
+ IJBossServerRuntime jbossRuntime =
(IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
+
if (!JBossRuntimeManager.isValidESBServer(serverRuntime
- .getLocation().toOSString(), getSelectedESBVersion().getVersionString())) {
+ .getLocation().toOSString(), getSelectedESBVersion().getVersionString(),
jbossRuntime.getJBossConfiguration())) {
hasRuntime = true;
setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime,
getSelectedESBVersion().getVersionString()), WARNING);
setPageComplete(isPageComplete());
@@ -388,8 +392,10 @@
}
org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
.findRuntime(runtime.getProperty("id"));
+ IJBossServerRuntime jbossRuntime =
(IJBossServerRuntime)serverRuntime.loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
+
if (!JBossRuntimeManager.isValidESBServer(serverRuntime
- .getLocation().toOSString(), getSelectedESBVersion().getVersionString())) {
+ .getLocation().toOSString(), getSelectedESBVersion().getVersionString(),
jbossRuntime.getJBossConfiguration())) {
setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime,
getSelectedESBVersion().getVersionString()), WARNING);
hasRuntime = true;
setPageComplete(isPageComplete());
Modified:
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
===================================================================
---
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-08
06:10:44 UTC (rev 19092)
+++
branches/jbosstools-3.1.0.RC1/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-12-08
06:12:57 UTC (rev 19093)
@@ -15,6 +15,7 @@
import java.util.List;
import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.core.runtime.Path;
import org.eclipse.jdt.core.IClasspathEntry;
import org.eclipse.jdt.core.JavaCore;
@@ -44,6 +45,7 @@
import org.eclipse.wst.server.core.IRuntime;
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.ui.ServerUICore;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntime;
import org.jboss.tools.esb.core.runtime.JBossRuntimeClassPathInitializer;
import org.jboss.tools.esb.core.runtime.JBossRuntimeManager;
@@ -167,8 +169,9 @@
IPath location = ((IRuntime)element).getLocation();
String runtimeType = ((IRuntime)element).getRuntimeType().getId();
if(location == null) return false;
-
- return JBossRuntimeManager.isValidESBServer(location.toOSString(), runtimeType);
+ IJBossServerRuntime jbossRuntime =
(IJBossServerRuntime)((IRuntime)element).loadAdapter(IJBossServerRuntime.class, new
NullProgressMonitor());
+
+ return JBossRuntimeManager.isValidESBServer(location.toOSString(), runtimeType,
jbossRuntime.getJBossConfiguration());
}
return true;
}