Author: dennyxu
Date: 2009-02-25 04:04:27 -0500 (Wed, 25 Feb 2009)
New Revision: 13789
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
Log:
JBIDE-3858:There is no warning message that the specified target runtime does not contain
a valid ESB runtime for ESB version 4.5 in New JBoss ESB Project wizard.
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-02-25
08:42:53 UTC (rev 13788)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.core/src/org/jboss/tools/esb/core/runtime/JBossRuntimeManager.java 2009-02-25
09:04:27 UTC (rev 13789)
@@ -20,6 +20,7 @@
import java.util.Map;
import java.util.Set;
+import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.Path;
@@ -416,31 +417,35 @@
runtimes = converter.getMap(runtimeListString);
}
- public static boolean isValidESBServer(String path){
- File resttaJar = getResttaJar(path, "");
- return resttaJar != null && resttaJar.exists() ||
isValidSoapContainedESBRuntime(path);
+ public static boolean isValidESBServer(String path, String version){
+ return getResttaJar(path, "" , version) ||
isValidSoapContainedESBRuntime(path, version);
}
- private static boolean isValidSoapContainedESBRuntime(String path){
- File resttaJar = getResttaJar(path, SOAP_AS_LOCATION);
- return resttaJar != null && resttaJar.exists();
+ private static boolean isValidSoapContainedESBRuntime(String path, String version){
+ return getResttaJar(path, SOAP_AS_LOCATION, version);
}
- public static File getResttaJar(String path, String asFoldername){
+ public static boolean getResttaJar(String path, String asFoldername, String version){
IPath serverLocation = new Path(path);
if(asFoldername != null && !"".equals(asFoldername)){
serverLocation = serverLocation.append(asFoldername);
}
-
- String rosettaJar = "server" + File.separator + "default"
+ IPath sarLocation = serverLocation.append( "server" + File.separator +
"default"
+ File.separator + "deploy" + File.separator
- + "jbossesb.sar" + File.separator + "lib" + File.separator +
"jbossesb-rosetta.jar";
- IPath esbLocation = serverLocation.append(rosettaJar);
+ + "jbossesb.sar");
+ IPath rosettaJar = sarLocation.append("lib" + File.separator +
"jbossesb-rosetta.jar");
- return esbLocation.toFile();
+ try{
+ double versionNumber = Double.valueOf(version);
+ if(versionNumber >= 4.5){
+ return isVersion45(sarLocation);
+ }
+ }catch(NumberFormatException e){
+ }
+ return rosettaJar.toFile().exists();
}
- public static boolean isValidESBStandaloneRuntimeDir(String path) {
+ public static boolean isValidESBStandaloneRuntimeDir(String path, String version) {
IPath location = new Path(path);
IPath esblocation = location.append("lib").append("jbossesb.esb");
IPath sarLocation = location.append("lib").append("jbossesb.sar");
@@ -450,9 +455,23 @@
if (!sarLocation.toFile().isDirectory()) {
return false;
}
+
+ try{
+ double versionNumber = Double.valueOf(version);
+ if(versionNumber >= 4.5){
+ return isVersion45(sarLocation);
+ }
+ }catch(NumberFormatException e){
+ }
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:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2009-02-25
08:42:53 UTC (rev 13788)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/messages/JBossESBUI.properties 2009-02-25
09:04:27 UTC (rev 13789)
@@ -1,4 +1,4 @@
-Label_JBoss_Runtime_Load_Error=Error occurred while loading JBoss ESB runtime. Please
select a correct JBoss ESB runtime or JBoss ESB server location
+Label_JBoss_Runtime_Load_Error=Error occurred while loading JBoss ESB {0} runtime .
Please select a correct JBoss ESB runtime or JBoss ESB server location
Error_JBoss_Basic_Editor_Composite=Parent control should be Composite
Error_JBoss_Basic_Editor_Support=Editor supports only grid layout
@@ -47,7 +47,7 @@
ESBFacetInstallationPage_Default_SRC_Folder=src
ESBFacetInstallationPage_Description=Configure project structure and classpath
ESBFacetInstallationPage_Error_Message_Have_Not_Set_Target_Runtime=Please specify the
project primary target runtime
-ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime=The specified target runtime
does not contain a valid ESB runtime.
+ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime=The specified target runtime
does not contain a valid ESB {0} runtime .
ESBFacetInstallationPage_Error_Message_No_Target_Runtime=No target runtime was
specified.
ESBFacetInstallationPage_Error_Message_Specify_Content_Folder=Please specify a valid
content folder.
ESBFacetInstallationPage_Error_Message_Specify_ESB_Runtime=Please specify a ESB runtime
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-02-25
08:42:53 UTC (rev 13788)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/preference/controls/JBossRuntimeListFieldEditor.java 2009-02-25
09:04:27 UTC (rev 13789)
@@ -555,8 +555,8 @@
return;
}
- if (!runtimeExist(homeDir.getValueAsString())) {
- setErrorMessage(JBossESBUIMessages.Label_JBoss_Runtime_Load_Error);
+ if (!runtimeExist(homeDir.getValueAsString(), (String)version.getValue())) {
+ setErrorMessage(NLS.bind(JBossESBUIMessages.Label_JBoss_Runtime_Load_Error,
version.getValue()));
setPageComplete(false);
return;
}
@@ -655,14 +655,14 @@
};
}
- private boolean runtimeExist(String path) {
+ private boolean runtimeExist(String path, String version) {
File jbosswsHomeDir = new File(path);
if (!jbosswsHomeDir.isDirectory())
return false;
- if(!JBossRuntimeManager.isValidESBStandaloneRuntimeDir(path)
- && !JBossRuntimeManager.isValidESBServer(path)){
+ if(!JBossRuntimeManager.isValidESBStandaloneRuntimeDir(path, version)
+ && !JBossRuntimeManager.isValidESBServer(path, version)){
return false;
}
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-02-25
08:42:53 UTC (rev 13788)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/ESBFacetInstallationPage.java 2009-02-25
09:04:27 UTC (rev 13789)
@@ -20,13 +20,13 @@
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.dialogs.Dialog;
import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.jst.common.project.facet.JavaFacetUtils;
import org.eclipse.jst.common.project.facet.core.JavaFacetInstallConfig;
+import org.eclipse.osgi.util.NLS;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
@@ -360,9 +360,9 @@
org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
.findRuntime(runtime.getProperty("id")); //$NON-NLS-1$
if (!JBossRuntimeManager.isValidESBServer(serverRuntime
- .getLocation().toOSString())) {
+ .getLocation().toOSString(), getSelectedESBVersion().getVersionString())) {
hasRuntime = true;
- setMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime,
WARNING);
+ setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime,
getSelectedESBVersion().getVersionString()), WARNING);
setPageComplete(isPageComplete());
return true;
}
@@ -384,8 +384,8 @@
org.eclipse.wst.server.core.IRuntime serverRuntime = ServerCore
.findRuntime(runtime.getProperty("id"));
if (!JBossRuntimeManager.isValidESBServer(serverRuntime
- .getLocation().toOSString())) {
- setMessage(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime,
WARNING);
+ .getLocation().toOSString(), getSelectedESBVersion().getVersionString())) {
+ setMessage(NLS.bind(JBossESBUIMessages.ESBFacetInstallationPage_Error_Message_Invalid_ESB_Runtime,
getSelectedESBVersion().getVersionString()), WARNING);
hasRuntime = true;
setPageComplete(isPageComplete());
return true;
Modified:
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-02-25
08:42:53 UTC (rev 13788)
+++
trunk/esb/plugins/org.jboss.tools.esb.project.ui/src/org/jboss/tools/esb/project/ui/wizards/pages/JBossESBRuntimeContainerPage.java 2009-02-25
09:04:27 UTC (rev 13789)
@@ -165,7 +165,7 @@
Object element) {
if(element instanceof IRuntime){
IPath location = ((IRuntime)element).getLocation();
- return JBossRuntimeManager.isValidESBServer(location.toOSString());
+ return JBossRuntimeManager.isValidESBServer(location.toOSString(), "");
}
return true;
}