Author: scabanovich
Date: 2012-03-16 20:34:57 -0400 (Fri, 16 Mar 2012)
New Revision: 39597
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamValidatorFactory.java
Log:
JBIDE-11228
https://issues.jboss.org/browse/JBIDE-11228
Validation in new seam project wizard improved for a invalid connection profile.
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java 2012-03-17
00:09:58 UTC (rev 39596)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/SeamCoreMessages.java 2012-03-17
00:34:57 UTC (rev 39597)
@@ -305,6 +305,8 @@
public static String VALIDATOR_FACTORY_CONNECTION_PROFILE_IS_NOT_SELECTED;
public static String
VALIDATOR_FACTORY_DRIVER_CLASS_PROPERTY_IS_EMPTY_FOR_SELECTED_CONNECTION_PROFILE;
+
+ public static String
VALIDATOR_FACTORY_DRIVER_CLASS_PROPERTY_IS_NOT_FOUND_FOR_SELECTED_CONNECTION_PROFILE;
public static String
VALIDATOR_FACTORY_HOME_FOLDER_POINTS_TO_LOCATION_THAT_DOES_NOT_LOOK_LIKE_SEAM_HOME_FOLDER;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties 2012-03-17
00:09:58 UTC (rev 39596)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/messages.properties 2012-03-17
00:34:57 UTC (rev 39597)
@@ -122,6 +122,7 @@
VALIDATOR_FACTORY_PRJ_NOT_SELECTED=Project is not selected
VALIDATOR_FACTORY_CONNECTION_PROFILE_IS_NOT_SELECTED=Connection profile is not selected
VALIDATOR_FACTORY_DRIVER_CLASS_PROPERTY_IS_EMPTY_FOR_SELECTED_CONNECTION_PROFILE=Driver
Class property is empty for selected ''{0}'' connection profile
+VALIDATOR_FACTORY_DRIVER_CLASS_PROPERTY_IS_NOT_FOUND_FOR_SELECTED_CONNECTION_PROFILE=Driver
Class is not found for selected ''{0}'' connection profile
VALIDATOR_FACTORY_SEAM_RT_SOURCE_TEMPLATES_DIR_DOES_NOT_EXIST=Seam Runtime
''{0}'' source templates directory doesn't exist for selected Seam Web
Project
VALIDATOR_FACTORY_SEAM_RUNTIME_IS_NOT_SELECTED=Seam Runtime is not selected
VALIDATOR_FACTORY_SEAM_RT_VIEW_DIR_IS_MISSING=Seam Runtime ''{0}'' view
templates directory doesn't exist
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2012-03-17
00:09:58 UTC (rev 39596)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2012-03-17
00:34:57 UTC (rev 39597)
@@ -18,6 +18,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.datatools.connectivity.drivers.DriverInstance;
import org.eclipse.datatools.connectivity.drivers.DriverManager;
import org.eclipse.osgi.util.NLS;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
@@ -95,13 +96,12 @@
? "" :
props.get("org.eclipse.datatools.connectivity.db.URL").toString());
//$NON-NLS-1$ //$NON-NLS-2$
if(props.get("org.eclipse.datatools.connectivity.driverDefinitionID")!=null)
{
- model.setProperty(
- ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH,
- DriverManager
- .getInstance()
- .getDriverInstanceByID(
- props.get(
- "org.eclipse.datatools.connectivity.driverDefinitionID").toString()).getJarListAsArray());
//$NON-NLS-1$
+ DriverInstance i = DriverManager.getInstance().getDriverInstanceByID(props.get(
+ "org.eclipse.datatools.connectivity.driverDefinitionID").toString());
//$NON-NLS-1$
+ if(i != null) {
+ model.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH,
+ i.getJarListAsArray());
+ }
}
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamValidatorFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamValidatorFactory.java 2012-03-17
00:09:58 UTC (rev 39596)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamValidatorFactory.java 2012-03-17
00:34:57 UTC (rev 39597)
@@ -22,6 +22,8 @@
import org.eclipse.core.runtime.Status;
import org.eclipse.datatools.connectivity.IConnectionProfile;
import org.eclipse.datatools.connectivity.ProfileManager;
+import org.eclipse.datatools.connectivity.drivers.DriverInstance;
+import org.eclipse.datatools.connectivity.drivers.DriverManager;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
@@ -328,6 +330,17 @@
NLS.bind(SeamCoreMessages.VALIDATOR_FACTORY_DRIVER_CLASS_PROPERTY_IS_EMPTY_FOR_SELECTED_CONNECTION_PROFILE,
value)));
}
+ if(props.get("org.eclipse.datatools.connectivity.driverDefinitionID")!=null)
{
+ DriverInstance i = DriverManager.getInstance().getDriverInstanceByID(props.get(
+ "org.eclipse.datatools.connectivity.driverDefinitionID").toString());
//$NON-NLS-1$
+ if(i == null) {
+ return createErrormessage(
+ ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE,
+ new Status(IStatus.WARNING, SeamCorePlugin.PLUGIN_ID,
+ NLS.bind(SeamCoreMessages.VALIDATOR_FACTORY_DRIVER_CLASS_PROPERTY_IS_NOT_FOUND_FOR_SELECTED_CONNECTION_PROFILE,
+ value)));
+ }
+ }
}
return NO_ERRORS;
}