JBoss Tools SVN: r3782 - trunk/documentation/development/usecases/en/modules.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-09-25 03:16:29 -0400 (Tue, 25 Sep 2007)
New Revision: 3782
Modified:
trunk/documentation/development/usecases/en/modules/seam.xml
Log:
ignore bin
Modified: trunk/documentation/development/usecases/en/modules/seam.xml
===================================================================
--- trunk/documentation/development/usecases/en/modules/seam.xml 2007-09-25 07:16:08 UTC (rev 3781)
+++ trunk/documentation/development/usecases/en/modules/seam.xml 2007-09-25 07:16:29 UTC (rev 3782)
@@ -322,6 +322,11 @@
the various places. the only thing not done by seam-gen is the seperation
of the test code/libs.</para>
+ <para>I've added a projectexample dir next to this document that has an
+ working EAR project structure including test project. Note this layout is
+ just an example of what works - I have e.g. not verifed that all relevant
+ libs are included, just that it runs with the basic setup.</para>
+
<section>
<title>War</title>
17 years, 3 months
JBoss Tools SVN: r3781 - trunk/as/tests/org.jboss.ide.eclipse.as.test.
by jbosstools-commits@lists.jboss.org
Author: max.andersen(a)jboss.com
Date: 2007-09-25 03:16:08 -0400 (Tue, 25 Sep 2007)
New Revision: 3781
Modified:
trunk/as/tests/org.jboss.ide.eclipse.as.test/
Log:
ignore bin
Property changes on: trunk/as/tests/org.jboss.ide.eclipse.as.test
___________________________________________________________________
Name: svn:ignore
+ bin
17 years, 3 months
JBoss Tools SVN: r3780 - trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-24 21:04:51 -0400 (Mon, 24 Sep 2007)
New Revision: 3780
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
Log:
fix for http://jira.jboss.com/jira/browse/JBIDE-917 and http://jira.jboss.com/jira/browse/JBIDE-937
user can create any kind of DB connection
validation forprofile driver class attribute added, to check press Edit... show driver properties and clean driver class name attribute
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-09-25 01:04:48 UTC (rev 3779)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-09-25 01:04:51 UTC (rev 3780)
@@ -20,9 +20,13 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.datatools.connectivity.ConnectionProfileException;
import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.IProfileListener;
import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.datatools.connectivity.db.generic.IDBConnectionProfileConstants;
import org.eclipse.datatools.connectivity.db.generic.ui.NewConnectionProfileWizard;
+import org.eclipse.datatools.connectivity.internal.ConnectionProfileManager;
+import org.eclipse.datatools.connectivity.internal.ui.wizards.NewCPWizard;
+import org.eclipse.datatools.connectivity.internal.ui.wizards.NewCPWizardCategoryFilter;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
import org.eclipse.jface.resource.ImageDescriptor;
@@ -67,131 +71,88 @@
IFacetWizardPage, IDataModelListener {
public static final String PAGE_DESCRIPTION = "Configure Seam Facet Settings";
+
/**
*
*/
- boolean seamHomeRequiresSave = SeamFacetPreference.getStringPreference(
- SeamFacetPreference.SEAM_RUNTIME_NAME).equals("");
- /**
- *
- */
- DriverClassHelpers HIBERNATE_HELPER = new DriverClassHelpers();
+ private DriverClassHelpers HIBERNATE_HELPER = new DriverClassHelpers();
/**
*
*/
- IDataModel model = null;
+ private IDataModel model = null;
/**
*
*/
- DataModelValidatorDelegate validatorDelegate;
+ private DataModelValidatorDelegate validatorDelegate;
- final IFieldEditor jBossSeamHomeEditor = IFieldEditorFactory.INSTANCE
+ private IFieldEditor jBossSeamHomeEditor = IFieldEditorFactory.INSTANCE
.createComboWithButton(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME,
"Seam Runtime", getRuntimeNames(),
- ("".equals(SeamFacetPreference
- .getStringPreference(SeamFacetPreference.SEAM_RUNTIME_NAME)) ?
- (SeamRuntimeManager.getInstance().getDefaultRuntime()==null?
- "":SeamRuntimeManager.getInstance().getDefaultRuntime().getName()) :
- SeamFacetPreference
- .getStringPreference(SeamFacetPreference.SEAM_RUNTIME_NAME)),
+ getSeamRuntimeDefaultValue(),
true, new NewSeamRuntimeAction(), (IValidator)null);
-// IFieldEditor jBossSeamHomeEditor = IFieldEditorFactory.INSTANCE
-// .createBrowseFolderEditor(
-// ISeamFacetDataModelProperties.JBOSS_SEAM_HOME,
-// "JBoss Seam Home Folder:",
-// SeamFacetPreference
-// .getStringPreference(SeamFacetPreference.SEAM_HOME_FOLDER));
- IFieldEditor jBossAsDeployAsEditor = IFieldEditorFactory.INSTANCE
+ private IFieldEditor jBossAsDeployAsEditor = IFieldEditorFactory.INSTANCE
.createComboEditor(
ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
"Deploy as:", Arrays.asList(new String[] { "war", "ear" }),
- "war", true);
+ getDeployAsDefaultValue(), true);
String lastCreatedCPName = "";
// Database group
- IFieldEditor connProfileSelEditor = IFieldEditorFactory.INSTANCE
+ private IFieldEditor connProfileSelEditor = IFieldEditorFactory.INSTANCE
.createComboWithTwoButtons(
ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE,
"Connection profile:",
getProfileNameList(),
- ("".equals(SeamCorePlugin.getDefault().getPluginPreferences()
- .getString((SeamFacetPreference.SEAM_DEFAULT_CONNECTION_PROFILE))) ?
- (getProfileNameList().contains("DefaultDS")?"DefaultDS":""):
- SeamCorePlugin.getDefault().getPluginPreferences()
- .getString((SeamFacetPreference.SEAM_DEFAULT_CONNECTION_PROFILE))),
- true, new EditConnectionProfileAction(),
+ getConnectionProfileDefaultValue(),
+ false, new EditConnectionProfileAction(),
new NewConnectionProfileAction(),
ValidatorFactory.NO_ERRORS_VALIDATOR);
- IFieldEditor jBossAsDbTypeEditor = IFieldEditorFactory.INSTANCE
+
+ private IFieldEditor jBossHibernateDbTypeEditor = IFieldEditorFactory.INSTANCE
.createComboEditor(ISeamFacetDataModelProperties.DB_TYPE,
"Database Type:", Arrays.asList(HIBERNATE_HELPER
- .getDialectNames()), "HSQL", true);
- IFieldEditor jBossHibernateDialectEditor = IFieldEditorFactory.INSTANCE
+ .getDialectNames()), getDefaultDbType(), false);
+
+ private IFieldEditor jBossHibernateDialectEditor = IFieldEditorFactory.INSTANCE
.createUneditableTextEditor(
ISeamFacetDataModelProperties.HIBERNATE_DIALECT,
"Hibernate Dialect:", HIBERNATE_HELPER
- .getDialectClass("HSQL"));
+ .getDialectClass(getDefaultDbType()));
- ITaggedFieldEditor jdbcDriverClassname = IFieldEditorFactory.INSTANCE
- .createComboEditor(
- ISeamFacetDataModelProperties.JDBC_DRIVER_CLASS_NAME,
- "JDBC Driver Class for Your Database:", Arrays
- .asList(HIBERNATE_HELPER
- .getDriverClasses(HIBERNATE_HELPER
- .getDialectClass("HSQL"))),
- HIBERNATE_HELPER.getDriverClasses(HIBERNATE_HELPER
- .getDialectClass("HSQL"))[0]);
- ITaggedFieldEditor jdbcUrlForDb = IFieldEditorFactory.INSTANCE
- .createComboEditor(ISeamFacetDataModelProperties.JDBC_URL_FOR_DB,
- "JDBC Url for Your Database:",
- Arrays.asList(HIBERNATE_HELPER
- .getConnectionURLS(HIBERNATE_HELPER
- .getDriverClasses(HIBERNATE_HELPER
- .getDialectClass("HSQL"))[0])),
- HIBERNATE_HELPER.getConnectionURLS(HIBERNATE_HELPER
- .getDriverClasses(HIBERNATE_HELPER
- .getDialectClass("HSQL"))[0])[0].replace(
- "<", "").replace(">", ""));
- IFieldEditor dbUserName = IFieldEditorFactory.INSTANCE.createTextEditor(
- ISeamFacetDataModelProperties.DB_USER_NAME, "Database User Name:",
- "username");
- IFieldEditor dbUserPassword = IFieldEditorFactory.INSTANCE
- .createTextEditor(ISeamFacetDataModelProperties.DB_USERP_PASSWORD,
- "User Password:", "password");
- IFieldEditor dbSchemaName = IFieldEditorFactory.INSTANCE.createTextEditor(
+ private IFieldEditor dbSchemaName = IFieldEditorFactory.INSTANCE.createTextEditor(
ISeamFacetDataModelProperties.DB_SCHEMA_NAME,
"Database Schema Name:", "");
- IFieldEditor dbCatalogName = IFieldEditorFactory.INSTANCE.createTextEditor(
+
+ private IFieldEditor dbCatalogName = IFieldEditorFactory.INSTANCE.createTextEditor(
ISeamFacetDataModelProperties.DB_CATALOG_NAME,
"Database Catalog Name:", "");
- IFieldEditor dbTablesExists = IFieldEditorFactory.INSTANCE
+
+ private IFieldEditor dbTablesExists = IFieldEditorFactory.INSTANCE
.createCheckboxEditor(
ISeamFacetDataModelProperties.DB_ALREADY_EXISTS,
"DB Tables already exists in database:", false);
- IFieldEditor recreateTablesOnDeploy = IFieldEditorFactory.INSTANCE
+
+ private IFieldEditor recreateTablesOnDeploy = IFieldEditorFactory.INSTANCE
.createCheckboxEditor(
ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY,
"Recreate database tables and data on deploy:", false);
- IFieldEditor pathToJdbcDriverJar = IFieldEditorFactory.INSTANCE
- .createBrowseFileEditor(
- ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH,
- "JDBC Driver jar:", "");
- // Code generation group
- IFieldEditor sessionBeanPkgNameditor = IFieldEditorFactory.INSTANCE
+ private IFieldEditor sessionBeanPkgNameditor = IFieldEditorFactory.INSTANCE
.createTextEditor(
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
"Session Bean Package Name:", "");
- IFieldEditor entityBeanPkgNameditor = IFieldEditorFactory.INSTANCE
+
+ private IFieldEditor entityBeanPkgNameditor = IFieldEditorFactory.INSTANCE
.createTextEditor(
ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME,
"Entity Bean Package Name:",
"com.mydomain.projectname.entity");
- IFieldEditor testsPkgNameditor = IFieldEditorFactory.INSTANCE
+
+ private IFieldEditor testsPkgNameditor = IFieldEditorFactory.INSTANCE
.createTextEditor(
ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME,
"Test Package Name:", "com.mydomain.projectname.test");
@@ -208,8 +169,47 @@
}
/**
+ * @return
+ */
+ private String getDefaultDbType() {
+ // TODO Auto-generated method stub
+ return SeamFacetPreference.getStringPreference(
+ SeamFacetPreference.HIBERNATE_DEFAULT_DB_TYPE);
+ }
+
+ /**
+ * @return
+ */
+ private Object getDeployAsDefaultValue() {
+ return SeamFacetPreference.getStringPreference(
+ SeamFacetPreference.JBOSS_AS_DEFAULT_DEPLOY_AS);
+ }
+
+ /**
+ * @return
+ */
+ private Object getConnectionProfileDefaultValue() {
+ String defaultDs = SeamFacetPreference.getStringPreference(
+ SeamFacetPreference.SEAM_DEFAULT_CONNECTION_PROFILE);
+ return getProfileNameList().contains(defaultDs)?defaultDs:"";
+ }
+
+ /**
*
+ * @return
*/
+ private Object getSeamRuntimeDefaultValue() {
+ return ("".equals(SeamFacetPreference
+ .getStringPreference(SeamFacetPreference.SEAM_DEFAULT_RUNTIME_NAME)) ?
+ (SeamRuntimeManager.getInstance().getDefaultRuntime()==null?
+ "":SeamRuntimeManager.getInstance().getDefaultRuntime().getName()) :
+ SeamFacetPreference
+ .getStringPreference(SeamFacetPreference.SEAM_DEFAULT_RUNTIME_NAME));
+ }
+
+ /**
+ *
+ */
private DataModelSynchronizer sync;
/**
@@ -233,18 +233,23 @@
* Finish has been pressed.
*/
public void transferStateToConfig() {
- if (seamHomeRequiresSave) {
+
SeamCorePlugin.getDefault().getPluginPreferences().setValue(
- SeamFacetPreference.SEAM_RUNTIME_NAME,
+ SeamFacetPreference.SEAM_DEFAULT_RUNTIME_NAME,
jBossSeamHomeEditor.getValueAsString());
- }
- if ("".equals(SeamCorePlugin.getDefault().getPluginPreferences()
- .getString(
- (SeamFacetPreference.SEAM_DEFAULT_CONNECTION_PROFILE)))) {
+
SeamCorePlugin.getDefault().getPluginPreferences().setValue(
SeamFacetPreference.SEAM_DEFAULT_CONNECTION_PROFILE,
connProfileSelEditor.getValueAsString());
- }
+
+ SeamCorePlugin.getDefault().getPluginPreferences().setValue(
+ SeamFacetPreference.JBOSS_AS_DEFAULT_DEPLOY_AS,
+ this.jBossAsDeployAsEditor.getValueAsString());
+
+ SeamCorePlugin.getDefault().getPluginPreferences().setValue(
+ SeamFacetPreference.HIBERNATE_DEFAULT_DB_TYPE,
+ this.jBossHibernateDbTypeEditor.getValueAsString());
+
}
/**
@@ -306,7 +311,7 @@
databaseGroup.setText("Database");
gridLayout = new GridLayout(4, false);
databaseGroup.setLayout(gridLayout);
- registerEditor(jBossAsDbTypeEditor, databaseGroup, 4);
+ registerEditor(jBossHibernateDbTypeEditor, databaseGroup, 4);
registerEditor(jBossHibernateDialectEditor, databaseGroup, 4);
registerEditor(connProfileSelEditor, databaseGroup, 4);
registerEditor(dbSchemaName, databaseGroup, 4);
@@ -342,7 +347,7 @@
ValidatorFactory.JBOSS_SEAM_HOME_IS_NOT_SELECTED);
validatorDelegate.addValidatorForProperty(connProfileSelEditor
.getName(),
- ValidatorFactory.CONNECTION_PROFILE_IS_NOT_SELECTED);
+ ValidatorFactory.CONNECTION_PROFILE_VALIDATOR);
validatorDelegate.addValidatorForProperty(testsPkgNameditor
.getName(), new PackageNameValidator(testsPkgNameditor
.getName(), "tests"));
@@ -354,13 +359,14 @@
sessionBeanPkgNameditor.getName(), "session beans"));
}
- jBossAsDbTypeEditor
+ jBossHibernateDbTypeEditor
.addPropertyChangeListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
jBossHibernateDialectEditor.setValue(HIBERNATE_HELPER
.getDialectClass(evt.getNewValue().toString()));
}
- });
+ }
+ );
}
/**
@@ -375,15 +381,12 @@
}
}
- public static final String GENERIC_JDBC_PROVIDER_ID
- = "org.eclipse.datatools.connectivity.db.generic.connectionProfile";
-
/*
*
*/
private List<String> getProfileNameList() {
IConnectionProfile[] profiles = ProfileManager.getInstance()
- .getProfileByProviderID(GENERIC_JDBC_PROVIDER_ID);
+ .getProfilesByCategory("org.eclipse.datatools.connectivity.db.category");
List<String> names = new ArrayList<String>();
for (IConnectionProfile connectionProfile : profiles) {
names.add(connectionProfile.getName());
@@ -428,6 +431,7 @@
.toArray(new String[0]));
oldName = selectedProfile.getName();
}
+ validate();
}
};
@@ -449,7 +453,12 @@
@Override
public void run() {
- NewConnectionProfileWizard wizard = new NewConnectionProfileWizard() {
+ IProfileListener listener = new ConnectionProfileChangeListener();
+
+ ProfileManager.getInstance().addProfileListener(listener);
+ NewCPWizardCategoryFilter filter = new NewCPWizardCategoryFilter("org.eclipse.datatools.connectivity.db.category");
+ NewCPWizard wizard = new NewCPWizard(filter, null);
+ new NewConnectionProfileWizard() {
public boolean performFinish() {
// create profile only
try {
@@ -471,23 +480,13 @@
return true;
}
};
- wizard
- .initProviderID(IDBConnectionProfileConstants.CONNECTION_PROFILE_ID);
WizardDialog wizardDialog = new WizardDialog(Display.getCurrent()
.getActiveShell(), wizard);
wizardDialog.open();
-
- if (wizardDialog.getReturnCode() != WizardDialog.CANCEL) {
- getFieldEditor().setValue(lastCreatedCPName);
- ((ITaggedFieldEditor) ((CompositeEditor) connProfileSelEditor)
- .getEditors().get(1)).setTags(getProfileNameList()
- .toArray(new String[0]));
- }
+ ProfileManager.getInstance().removeProfileListener(listener);
}
}
-
-
/**
* It is overridden to fill Code Generation group with the default package
* names
@@ -510,13 +509,20 @@
.getProperty(IFacetDataModelProperties.FACET_PROJECT_NAME)
+ ".test");
if (visible) {
- String message = validatorDelegate.getFirstValidationError();
- this.setPageComplete(message == null);
- this.setMessage(message);
+ validate();
}
super.setVisible(visible);
};
+ /**
+ *
+ */
+ private void validate() {
+ String message = validatorDelegate.getFirstValidationError();
+ this.setPageComplete(message == null);
+ this.setErrorMessage(message);
+ }
+
public class PackageNameValidator implements IValidator {
String fieldName;
@@ -573,4 +579,35 @@
}
}
}
+
+ public class ConnectionProfileChangeListener implements IProfileListener {
+
+
+ /* (non-Javadoc)
+ * @see org.eclipse.datatools.connectivity.IProfileListener#profileAdded(org.eclipse.datatools.connectivity.IConnectionProfile)
+ */
+ public void profileAdded(IConnectionProfile profile) {
+ // TODO Auto-generated method stub
+ connProfileSelEditor.setValue(profile.getName());
+ ((ITaggedFieldEditor) ((CompositeEditor) connProfileSelEditor)
+ .getEditors().get(1)).setTags(getProfileNameList()
+ .toArray(new String[0]));
+ validate();
+
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.datatools.connectivity.IProfileListener#profileChanged(org.eclipse.datatools.connectivity.IConnectionProfile)
+ */
+ public void profileChanged(IConnectionProfile profile) {
+ profileAdded(profile);
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.datatools.connectivity.IProfileListener#profileDeleted(org.eclipse.datatools.connectivity.IConnectionProfile)
+ */
+ public void profileDeleted(IConnectionProfile profile) {
+ // this event never happens
+ }
+ };
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-09-25 01:04:48 UTC (rev 3779)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-09-25 01:04:51 UTC (rev 3780)
@@ -28,6 +28,8 @@
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Path;
+import org.eclipse.datatools.connectivity.IConnectionProfile;
+import org.eclipse.datatools.connectivity.ProfileManager;
import org.eclipse.jdt.core.IJavaProject;
import org.eclipse.jdt.core.JavaConventions;
import org.eclipse.jdt.core.JavaCore;
@@ -158,25 +160,6 @@
}
};
-
- public static void main(String[] args) {
- ZipFile seamJar;
- try {
- seamJar = new ZipFile(new File("C:\\jboss-eap.rc1\\seam", "jboss-seam.jar"));
-
- ZipFileStructureProvider provider = new ZipFileStructureProvider(seamJar);
- ZipEntry entry = seamJar.getEntry("META-INF/MANIFEST.MF");
- InputStream str = provider.getContents(entry);
-
- Properties manifest = new Properties();
- manifest.load(str);
-
- System.out.println(manifest.get("Seam-Version"));
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
/**
*
*/
@@ -347,13 +330,26 @@
}
};
- public static IValidator CONNECTION_PROFILE_IS_NOT_SELECTED =
+ public static IValidator CONNECTION_PROFILE_VALIDATOR =
new IValidator() {
public Map<String, String> validate(Object value, Object context) {
if (value == null || "".equals(value.toString().trim())) {
return createErrormessage(
ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE,
"Connection profile is not selected");
+ } else {
+ IConnectionProfile connProfile
+ = ProfileManager.getInstance().getProfileByName(value.toString());
+ Properties props = connProfile.getBaseProperties();
+ Object driverClass
+ = props.get("org.eclipse.datatools.connectivity.db.driverClass");
+
+ if(driverClass==null || "".equals(driverClass)) {
+ return createErrormessage(
+ ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE,
+ "Driver Class proberty is empty for selected '"
+ + value + "' connection profile");
+ }
}
return NO_ERRORS;
}
17 years, 3 months
JBoss Tools SVN: r3779 - in trunk/seam/plugins/org.jboss.tools.seam.core: src/org/jboss/tools/seam/internal/core/project/facet and 2 other directories.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-24 21:04:48 -0400 (Mon, 24 Sep 2007)
New Revision: 3779
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
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/SeamFacetPreferenceInitializer.java
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project
trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
Log:
fix for http://jira.jboss.com/jira/browse/JBIDE-917 and http://jira.jboss.com/jira/browse/JBIDE-937
user can create any kind of DB connection
validation forprofile driver class attribute added, to check press Edit... show driver properties and clean driver class name attribute
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java 2007-09-24 22:00:03 UTC (rev 3778)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/project/facet/SeamFacetPreference.java 2007-09-25 01:04:48 UTC (rev 3779)
@@ -18,13 +18,21 @@
*
*/
public class SeamFacetPreference {
- public static final String SEAM_RUNTIME_NAME = SeamCorePlugin.PLUGIN_ID + ".project.facet.runtime.name";
- public static final String SEAM_DEFAULT_CONNECTION_PROFILE = SeamCorePlugin.PLUGIN_ID + ".project.facet.default.conn.profile";
- public static final String RUNTIME_CONFIG_FORMAT_VERSION = SeamCorePlugin.PLUGIN_ID + ".runtime.config.format.version";
- public static final String RUNTIME_LIST = SeamCorePlugin.PLUGIN_ID+".runtime.list";
- public static final String RUNTIME_DEFAULT = SeamCorePlugin.PLUGIN_ID+".runtime.default";
+ public static final String SEAM_DEFAULT_RUNTIME_NAME
+ = SeamCorePlugin.PLUGIN_ID + ".project.facet.default.runtime.name";
+ public static final String SEAM_DEFAULT_CONNECTION_PROFILE
+ = SeamCorePlugin.PLUGIN_ID + ".project.facet.default.conn.profile";
+ public static final String RUNTIME_CONFIG_FORMAT_VERSION
+ = SeamCorePlugin.PLUGIN_ID + ".runtime.config.format.version";
+ public static final String RUNTIME_LIST
+ = SeamCorePlugin.PLUGIN_ID+".runtime.list";
+ public static final String RUNTIME_DEFAULT
+ = SeamCorePlugin.PLUGIN_ID+".runtime.default";
+ public static final String JBOSS_AS_DEFAULT_DEPLOY_AS
+ = SeamCorePlugin.PLUGIN_ID + ".project.default.deployment.type";
+ public static final String HIBERNATE_DEFAULT_DB_TYPE
+ = SeamCorePlugin.PLUGIN_ID + ".hibernate.default.db.type";
-
public static String getStringPreference(final String name) {
return SeamCorePlugin.getDefault().getPreferenceStore().getString(name);
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-09-24 22:00:03 UTC (rev 3778)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-09-25 01:04:48 UTC (rev 3779)
@@ -42,7 +42,7 @@
public static final String DB_USER_NAME = "hibernate.connection.username";
- public static final String DB_USERP_PASSWORD = "hibernate.connection.password";
+ public static final String DB_USER_PASSWORD = "hibernate.connection.password";
public static final String DB_SCHEMA_NAME = "schema.property";
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2007-09-24 22:00:03 UTC (rev 3778)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2007-09-25 01:04:48 UTC (rev 3779)
@@ -61,7 +61,7 @@
names.add(ISeamFacetDataModelProperties.JDBC_URL_FOR_DB);
names.add(ISeamFacetDataModelProperties.DB_USER_NAME);
- names.add(ISeamFacetDataModelProperties.DB_USERP_PASSWORD);
+ names.add(ISeamFacetDataModelProperties.DB_USER_PASSWORD);
names.add(ISeamFacetDataModelProperties.DB_SCHEMA_NAME);
names.add(ISeamFacetDataModelProperties.DB_CATALOG_NAME);
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 2007-09-24 22:00:03 UTC (rev 3778)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreInstallDelegate.java 2007-09-25 01:04:48 UTC (rev 3779)
@@ -44,7 +44,7 @@
props.get("org.eclipse.datatools.connectivity.db.driverClass")==null
?"":props.get("org.eclipse.datatools.connectivity.db.driverClass").toString());
- model.setProperty(ISeamFacetDataModelProperties.DB_USERP_PASSWORD,
+ model.setProperty(ISeamFacetDataModelProperties.DB_USER_PASSWORD,
props.get("org.eclipse.datatools.connectivity.db.password")==null
?"":props.get("org.eclipse.datatools.connectivity.db.password").toString());
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2007-09-24 22:00:03 UTC (rev 3778)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetPreferenceInitializer.java 2007-09-25 01:04:48 UTC (rev 3779)
@@ -23,6 +23,7 @@
import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.core.runtime.preferences.IScopeContext;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.SeamPreferences;
import org.jboss.tools.seam.core.project.facet.SeamFacetPreference;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeListConverter1;
@@ -47,6 +48,9 @@
IScopeContext context = new DefaultScope();
IEclipsePreferences node = context.getNode(SeamCorePlugin.PLUGIN_ID);
node.put(SeamFacetPreference.RUNTIME_CONFIG_FORMAT_VERSION, RUNTIME_CONFIG_FORMAT_VERSION);
+ node.put(SeamFacetPreference.SEAM_DEFAULT_CONNECTION_PROFILE, "DefaultDS");
+ node.put(SeamFacetPreference.JBOSS_AS_DEFAULT_DEPLOY_AS, "war");
+ node.put(SeamFacetPreference.HIBERNATE_DEFAULT_DB_TYPE, "HSQL");
initializeDefault(node,getSeamGenBuildPath());
}
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project 2007-09-24 22:00:03 UTC (rev 3778)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ear/.project 2007-09-25 01:04:48 UTC (rev 3779)
@@ -17,14 +17,8 @@
<arguments>
</arguments>
</buildCommand>
- <buildCommand>
- <name>org.jboss.ide.eclipse.archives.core.archivesBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
</buildSpec>
<natures>
- <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
</natures>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project 2007-09-24 22:00:03 UTC (rev 3778)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/templates/ejb/.project 2007-09-25 01:04:48 UTC (rev 3779)
@@ -27,7 +27,6 @@
</buildCommand>
</buildSpec>
<natures>
- <nature>org.jboss.ide.eclipse.archives.core.archivesNature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
17 years, 3 months
JBoss Tools SVN: r3778 - in trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers: events and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-24 18:00:03 -0400 (Mon, 24 Sep 2007)
New Revision: 3778
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java
trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
Log:
Change allowing children to be seen in view
UI enhancement actions changed to accomodate
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java 2007-09-24 21:59:38 UTC (rev 3777)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/ModuleViewProvider.java 2007-09-24 22:00:03 UTC (rev 3778)
@@ -24,7 +24,11 @@
import java.util.Properties;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.dialogs.MessageDialog;
@@ -41,10 +45,10 @@
import org.eclipse.wst.server.core.ServerCore;
import org.eclipse.wst.server.core.ServerEvent;
import org.eclipse.wst.server.core.ServerUtil;
+import org.eclipse.wst.server.core.internal.PublishServerJob;
import org.eclipse.wst.server.core.model.ServerBehaviourDelegate;
import org.eclipse.wst.server.ui.ServerUICore;
import org.eclipse.wst.server.ui.internal.view.servers.ModuleServer;
-import org.jboss.ide.eclipse.as.core.server.internal.DeployableServerBehavior;
import org.jboss.ide.eclipse.as.core.server.internal.JBossServer;
import org.jboss.ide.eclipse.as.core.util.ServerConverter;
import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
@@ -77,8 +81,10 @@
IServerWorkingCopy server = selection.server.createWorkingCopy();
if( ServerConverter.getDeployableServer(selection.server) != null ) {
+ ServerUtil.modifyModules(server, new IModule[0], selection.module, new NullProgressMonitor());
+ IServer server2 = server.save(true, null);
ServerConverter.getDeployableServerBehavior(selection.server)
- .publishOneModule(IServer.PUBLISH_FULL, selection.module, ServerBehaviourDelegate.REMOVED, new NullProgressMonitor());
+ .publishOneModule(IServer.PUBLISH_INCREMENTAL, selection.module, ServerBehaviourDelegate.REMOVED, new NullProgressMonitor());
} else {
ServerUtil.modifyModules(server, new IModule[0], selection.module, new NullProgressMonitor());
IServer server2 = server.save(true, null);
@@ -116,14 +122,20 @@
incrementalPublishModuleAction.setImageDescriptor(JBossServerUISharedImages.getImageDescriptor(JBossServerUISharedImages.PUBLISH_IMAGE));
}
- protected void actionPublish(int type) {
- try {
+ protected void actionPublish(final int type) {
+ try {
if( ServerConverter.getDeployableServer(selection.server) != null ) {
- ServerConverter.getDeployableServerBehavior(selection.server)
- .publishOneModule(type, selection.module,
- ServerBehaviourDelegate.CHANGED, new NullProgressMonitor());
+ new Job("Publish One Module To Server") {
+ protected IStatus run(IProgressMonitor monitor) {
+ ServerConverter.getDeployableServerBehavior(selection.server)
+ .publishOneModule(type, selection.module,
+ ServerBehaviourDelegate.CHANGED, new NullProgressMonitor());
+ return Status.OK_STATUS;
+ }
+ }.schedule();
} else {
- selection.server.publish(IServer.PUBLISH_INCREMENTAL, new NullProgressMonitor());
+ // can't do anything special here, sadly
+ new PublishServerJob(selection.server, type, true).schedule();
}
} catch( Exception e ) {
// ignore
@@ -134,7 +146,8 @@
public void fillContextMenu(Shell shell, IMenuManager menu, Object selection) {
if( selection instanceof ModuleServer) {
this.selection = (ModuleServer)selection;
- menu.add(deleteModuleAction);
+ if( this.selection.module.length == 1 )
+ menu.add(deleteModuleAction);
menu.add(fullPublishModuleAction);
menu.add(incrementalPublishModuleAction);
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-09-24 21:59:38 UTC (rev 3777)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/views/server/providers/events/PackagesPublishLabelProvider.java 2007-09-24 22:00:03 UTC (rev 3778)
@@ -58,12 +58,14 @@
String type = item.getSpecificType();
if( type.equals(PublisherEventLogger.MULTIPLE_MODULE_TOP_EVENT) || type.equals(PublisherEventLogger.SINGLE_MODULE_TOP_EVENT)) {
- int deltaKind = ((Integer)item.getProperty(PublisherEventLogger.DELTA_KIND)).intValue();
- Image unpubIcon = JBossServerUISharedImages.getImage(JBossServerUISharedImages.UNPUBLISH_IMAGE);
- Image pubIcon = JBossServerUISharedImages.getImage(JBossServerUISharedImages.PUBLISH_IMAGE);
- if( deltaKind == ServerBehaviourDelegate.REMOVED )
- return unpubIcon;
- return pubIcon;
+ try {
+ int deltaKind = ((Integer)item.getProperty(PublisherEventLogger.DELTA_KIND)).intValue();
+ Image unpubIcon = JBossServerUISharedImages.getImage(JBossServerUISharedImages.UNPUBLISH_IMAGE);
+ Image pubIcon = JBossServerUISharedImages.getImage(JBossServerUISharedImages.PUBLISH_IMAGE);
+ if( deltaKind == ServerBehaviourDelegate.REMOVED )
+ return unpubIcon;
+ return pubIcon;
+ } catch( NullPointerException npe ) { return null; }
}
if( type.equals(PublisherEventLogger.FILE_COPPIED_EVENT))
return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJ_FILE);
17 years, 3 months
JBoss Tools SVN: r3777 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-24 17:59:38 -0400 (Mon, 24 Sep 2007)
New Revision: 3777
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
Log:
Change allowing children to be seen in view
UI enhancement actions changed to accomodate
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-09-24 19:38:28 UTC (rev 3776)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-09-24 21:59:38 UTC (rev 3777)
@@ -1,6 +1,7 @@
package org.jboss.ide.eclipse.as.core.server.internal;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.List;
import org.eclipse.core.runtime.CoreException;
@@ -145,14 +146,21 @@
// Basically stolen from RunOnServerActionDelegate
public IStatus publishOneModule(int kind, IModule[] module, int deltaKind, IProgressMonitor monitor) {
+ return publishOneModule(module, kind, deltaKind, true, monitor);
+ }
+
+ /*
+ * hack for eclipse bug 169570
+ */
+ public IStatus publishOneModule(IModule[] module, int kind, int deltaKind, boolean recurse, IProgressMonitor monitor) {
+
// add it to the server first
- addAndRemoveModules(module, deltaKind);
+ if( module.length == 1 )
+ addAndRemoveModules(module, deltaKind);
ArrayList moduleList = new ArrayList();
ArrayList deltaKindList = new ArrayList();
- moduleList.add(module);
- deltaKindList.add(new Integer(deltaKind));
-
+ fillPublishOneModuleLists(module, moduleList, deltaKindList, deltaKind, recurse);
try {
((Server)getServer()).getServerPublishInfo().startCaching();
@@ -189,6 +197,20 @@
return Status.CANCEL_STATUS;
}
+ protected void fillPublishOneModuleLists(IModule[] module, ArrayList moduleList, ArrayList deltaKindList, int deltaKind, boolean recurse) {
+ if( recurse ) {
+ ArrayList tmp = new ArrayList();
+ IModule[] children = getServer().getChildModules(module, new NullProgressMonitor());
+ for( int i = 0; i < children.length; i++ ) {
+ tmp.addAll(Arrays.asList(module));
+ tmp.add(children[i]);
+ fillPublishOneModuleLists((IModule[]) tmp.toArray(new IModule[tmp.size()]), moduleList, deltaKindList, deltaKind, recurse);
+ }
+ }
+ moduleList.add(module);
+ deltaKindList.add(new Integer(deltaKind));
+ }
+
protected void addAndRemoveModules(IModule[] module, int deltaKind) {
if( getServer() == null ) return;
boolean contains = ServerUtil.containsModule(getServer(), module[0], new NullProgressMonitor());
17 years, 3 months
JBoss Tools SVN: r3776 - trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb.
by jbosstools-commits@lists.jboss.org
Author: dgolovin
Date: 2007-09-24 15:38:28 -0400 (Mon, 24 Sep 2007)
New Revision: 3776
Modified:
trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbPlugin.java
Log:
fix for http://jira.jboss.com/jira/browse/JBIDE-790
for logging the code was using wrong method to get KB plugin instance.
Switched to KbPlugin.getDefault() to obtain Plagin activator instance
Modified: trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbPlugin.java
===================================================================
--- trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbPlugin.java 2007-09-24 19:28:00 UTC (rev 3775)
+++ trunk/common/plugins/org.jboss.tools.common.kb/src/org/jboss/tools/common/kb/KbPlugin.java 2007-09-24 19:38:28 UTC (rev 3776)
@@ -97,21 +97,11 @@
static class KbPluginHolder {
static KbPlugin INSTANCE = (KbPlugin)Platform.getPlugin(PLUGIN_ID);
}
-
+
/**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static KbPlugin getDefaultPlugin() {
- return plugin;
- }
-
- /**
* @return IPluginLog object
*/
public static IPluginLog getPluginLog() {
- return getDefaultPlugin();
+ return getDefault();
}
-
}
\ No newline at end of file
17 years, 3 months
JBoss Tools SVN: r3775 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-24 15:28:00 -0400 (Mon, 24 Sep 2007)
New Revision: 3775
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
Log:
Change allowing children to be seen in view
WTP Publishing re-written to accomodate change
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2007-09-24 17:06:34 UTC (rev 3774)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/JBossServer.java 2007-09-24 19:28:00 UTC (rev 3775)
@@ -85,25 +85,24 @@
}
public IModule[] getChildModules(IModule[] module) {
- if (module[0] != null && module[0].getModuleType() != null) {
- if (module.length == 1) {
- IModuleType moduleType = module[0].getModuleType();
- if (moduleType != null && "jst.ear".equals(moduleType.getId())) { //$NON-NLS-1$
- IEnterpriseApplication enterpriseApplication = (IEnterpriseApplication) module[0]
- .loadAdapter(IEnterpriseApplication.class, null);
- if (enterpriseApplication != null) {
- IModule[] earModules = enterpriseApplication.getModules();
- if ( earModules != null) {
- return earModules;
- }
+ int last = module.length-1;
+ if (module[last] != null && module[last].getModuleType() != null) {
+ IModuleType moduleType = module[last].getModuleType();
+ if("jst.ear".equals(moduleType.getId())) { //$NON-NLS-1$
+ IEnterpriseApplication enterpriseApplication = (IEnterpriseApplication) module[0]
+ .loadAdapter(IEnterpriseApplication.class, null);
+ if (enterpriseApplication != null) {
+ IModule[] earModules = enterpriseApplication.getModules();
+ if ( earModules != null) {
+ return earModules;
}
}
- else if (moduleType != null && "jst.web".equals(moduleType.getId())) { //$NON-NLS-1$
- IWebModule webModule = (IWebModule) module[0].loadAdapter(IWebModule.class, null);
- if (webModule != null) {
- IModule[] modules = webModule.getModules();
- return modules;
- }
+ }
+ else if ("jst.web".equals(moduleType.getId())) { //$NON-NLS-1$
+ IWebModule webModule = (IWebModule) module[last].loadAdapter(IWebModule.class, null);
+ if (webModule != null) {
+ IModule[] modules = webModule.getModules();
+ return modules;
}
}
}
17 years, 3 months
JBoss Tools SVN: r3774 - trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-24 13:06:34 -0400 (Mon, 24 Sep 2007)
New Revision: 3774
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java
Log:
Change allowing children to be seen in view
WTP Publishing re-written to accomodate change
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java 2007-09-24 17:05:58 UTC (rev 3773)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/IJBossServerPublisher.java 2007-09-24 17:06:34 UTC (rev 3774)
@@ -29,7 +29,7 @@
public interface IJBossServerPublisher {
public IStatus publishModule(int kind, int deltaKind, int modulePublishState,
- IModule module, IProgressMonitor monitor)
+ IModule[] module, IProgressMonitor monitor)
throws CoreException;
public int getPublishState();
public void setDelta(IModuleResourceDelta[] delta);
17 years, 3 months
JBoss Tools SVN: r3773 - in trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core: server/internal and 1 other directory.
by jbosstools-commits@lists.jboss.org
Author: rob.stryker(a)jboss.com
Date: 2007-09-24 13:05:58 -0400 (Mon, 24 Sep 2007)
New Revision: 3773
Modified:
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
Log:
Change allowing children to be seen in view
WTP Publishing re-written to accomodate change
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-09-24 17:05:07 UTC (rev 3772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/JstPublisher.java 2007-09-24 17:05:58 UTC (rev 3773)
@@ -23,7 +23,6 @@
import java.io.File;
import java.io.IOException;
-import java.util.ArrayList;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.runtime.CoreException;
@@ -33,11 +32,8 @@
import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Status;
import org.eclipse.jst.server.core.IEnterpriseApplication;
-import org.eclipse.jst.server.core.IWebModule;
import org.eclipse.wst.server.core.IModule;
import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.internal.DeletedModule;
-import org.eclipse.wst.server.core.internal.Server;
import org.eclipse.wst.server.core.model.IModuleFolder;
import org.eclipse.wst.server.core.model.IModuleResource;
import org.eclipse.wst.server.core.model.IModuleResourceDelta;
@@ -48,9 +44,10 @@
import org.jboss.ide.eclipse.as.core.JBossServerCorePlugin;
import org.jboss.ide.eclipse.as.core.extensions.events.EventLogModel.EventLogTreeItem;
import org.jboss.ide.eclipse.as.core.server.IDeployableServer;
-import org.jboss.ide.eclipse.as.core.server.internal.NestedPublishInfo;
+import org.jboss.ide.eclipse.as.core.server.IJBossServerPublisher;
import org.jboss.ide.eclipse.as.core.server.xpl.ModulePackager;
import org.jboss.ide.eclipse.as.core.util.FileUtil;
+import org.jboss.ide.eclipse.as.core.util.ServerConverter;
/**
* This class provides a default implementation for packaging different types of
@@ -58,266 +55,105 @@
*
* @author rob.stryker(a)jboss.com
*/
-public class JstPublisher extends PackagesPublisher {
+public class JstPublisher implements IJBossServerPublisher {
public static final int BUILD_FAILED_CODE = 100;
public static final int PACKAGE_UNDETERMINED_CODE = 101;
protected IModuleResourceDelta[] delta;
+ protected IDeployableServer server;
+ protected EventLogTreeItem eventRoot;
- public JstPublisher(IServer server, EventLogTreeItem context) {
- super(server, context);
- }
+ public JstPublisher(IDeployableServer server, EventLogTreeItem context) {
+ this.server = server;
+ eventRoot = context;
+ }
+ public JstPublisher(IServer server, EventLogTreeItem eventContext) {
+ this( ServerConverter.getDeployableServer(server), eventContext);
+ }
public void setDelta(IModuleResourceDelta[] delta) {
this.delta = delta;
}
public IStatus publishModule(int kind, int deltaKind,
- int modulePublishState, IModule module, IProgressMonitor monitor)
+ int modulePublishState, IModule[] module, IProgressMonitor monitor)
throws CoreException {
IStatus status = null;
- IPath root = new Path(server.getDeployDirectory());
if (ServerBehaviourDelegate.REMOVED == deltaKind) {
status = unpublish(server, module, monitor);
} else if (kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN) {
- status = fullPublishPackIntoFolder(new ArrayList<IModule>(), root, module, monitor);
- } else if (kind == IServer.PUBLISH_INCREMENTAL) {
- status = incrementalPublish(new ArrayList<IModule>(), root, module, monitor);
+ status = fullPublish(module, module[module.length-1], monitor);
+ } else if (kind == IServer.PUBLISH_INCREMENTAL || kind == IServer.PUBLISH_AUTO) {
+ status = incrementalPublish(module, module[module.length-1], monitor);
}
return status;
}
- protected IStatus fullPublishPackIntoFolder(ArrayList<IModule> moduleTree, IPath root, IModule module, IProgressMonitor monitor) throws CoreException {
- if( module.getModuleType().getId().equals("jst.ear")) {
- fullEarPublish(moduleTree, module, root, monitor);
- } else if( module.getModuleType().getId().equals("jst.web")) {
- fullWebPublish(moduleTree, module, root, monitor);
- } else if( module.getModuleType().getId().equals("jst.ejb")) {
- // This should be an ejb. Utility projects should not be published in a folder
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IModuleResource[] members = md.members();
- IPath moduleDeployPath = root.append(module.getProject().getName() + ".jar");
- FileUtil.safeDelete(moduleDeployPath.toFile());
- PublishUtil.publishSmart(members, moduleDeployPath, monitor);
+ protected IStatus fullPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
+ IPath deployPath = getDeployPath(moduleTree);
+ ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
+ IModuleResource[] members = md.members();
+ FileUtil.safeDelete(deployPath.toFile());
+ if( !deployPackaged(moduleTree))
+ PublishUtil.publishFull(members, deployPath, monitor);
+ else
+ packModuleIntoJar(moduleTree[moduleTree.length-1], getDeployPath(moduleTree));
- // if we're nested, save our resources
- if( moduleTree.size() > 1 )
- NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getPublishInfo(moduleTree, module).setResources(md.members());
-
- // can ejb jars have children? I don't know
- // TODO: FIND OUT!
- }
return null;
}
-
-
- /*
- * Full publish methods are here
- */
-
- protected void fullEarPublish(ArrayList<IModule> moduleTree, IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
- if( module instanceof DeletedModule ) {
- // TODO FIX ME
- return;
- }
+ protected IStatus incrementalPublish(IModule[] moduleTree, IModule module, IProgressMonitor monitor) throws CoreException {
+ if( !deployPackaged(moduleTree))
+ PublishUtil.publishDelta(delta, getDeployPath(moduleTree), monitor);
+ else if( delta.length > 0 )
+ packModuleIntoJar(moduleTree[moduleTree.length-1], getDeployPath(moduleTree));
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IModuleResource[] members = md.members();
- IEnterpriseApplication earModule = (IEnterpriseApplication)module.loadAdapter(IEnterpriseApplication.class, monitor);
- IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
- FileUtil.safeDelete(moduleDeployPath.toFile());
- PublishUtil.publishFull(members, moduleDeployPath, monitor);
-
- // Add this module to the tree, so that when we get to the war or ejb
- // child, it knows it is the child of an ear and not a root deployment
- ArrayList<IModule> newTree = new ArrayList<IModule>();
- newTree.addAll(moduleTree);
- newTree.add(module);
-
- // if we're not the root (unlikely), save our resources
- boolean isRoot = moduleTree.size() == 1;
- if( !isRoot ) {
- NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getPublishInfo(newTree, module).setResources(md.members());
- }
-
- // now lets fully publish the children
- IModule[] childModules = earModule.getModules();
- for (int i = 0; i < childModules.length; i++) {
- IModule module2 = childModules[i];
- String uri = earModule.getURI(module2);
- if(uri==null){
- IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0, "unable to assemble module null uri",null ); //$NON-NLS-1$
- throw new CoreException(status);
- }
- if( module2.getModuleType().getId().equals("jst.utility")) {
- // utility gets packed into a jar
- packModuleIntoJar(module2, uri, moduleDeployPath);
- } else {
- // otherwise it's an ejb, a war, etc, and gets sent exploded
- fullPublishPackIntoFolder(newTree, moduleDeployPath, module2, monitor);
- }
- }
- }
-
-
-
- protected void fullWebPublish(ArrayList<IModule> moduleTree, IModule module, IPath root, IProgressMonitor monitor ) throws CoreException {
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IModuleResource[] members = md.members();
- IWebModule webmodule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IPath moduleDeployPath = root.append(webmodule.getContextRoot() + ".war");
- FileUtil.safeDelete(moduleDeployPath.toFile());
- PublishUtil.publishSmart(members, moduleDeployPath, monitor);
-
- // save our resources if we're not a top level deployment
- if( moduleTree.size() != 1 )
- NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getPublishInfo(moduleTree, module).setResources(md.members());
-
-
- IWebModule webModule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IModule[] childModules = webModule.getModules();
- for (int i = 0; i < childModules.length; i++) {
- IModule module2 = childModules[i];
- packModuleIntoJar(module, webModule.getURI(module2), moduleDeployPath);
- }
- }
-
-
- /*
- * Entry point for incremental publishing
- */
-
- protected IStatus incrementalPublish(ArrayList<IModule> moduleTree, IPath root, IModule module, IProgressMonitor monitor) throws CoreException {
- if( module.getModuleType().getId().equals("jst.ear")) {
- incrementalEarPublish(moduleTree, module, root, monitor);
- } else if( module.getModuleType().getId().equals("jst.web")) {
- incrementalWarPublish(moduleTree, module, root, monitor);
- } else if( module.getModuleType().getId().equals("jst.ejb")){
- ArrayList newTree = new ArrayList(); newTree.addAll(moduleTree); newTree.add(module);
- IModuleResourceDelta[] deltas = getDelta(module, newTree);
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IPath moduleDeployPath = root.append(module.getProject().getName() + ".jar");
- PublishUtil.publishDelta(deltas, moduleDeployPath, monitor);
-
- if( moduleTree.size() > 1 ) {
- NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getPublishInfo(newTree, module).setResources(md.members());
- }
-
- // Can ears have libs in them? DO NOT KNOW
- // TODO: FIGURE IT OUT
- } else {
- // cannot incrementally publish something unknown
- // just package it normal
- packModuleIntoJar(module, module.getName() + ".jar", root);
- }
return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
IStatus.OK, "", null);
}
- protected void incrementalEarPublish(ArrayList<IModule> moduleTree, IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
- ArrayList<IModule> newTree = new ArrayList<IModule>();
- newTree.addAll(moduleTree);
- newTree.add(module);
-
- IModuleResourceDelta[] deltas = getDelta(module, newTree);
- IEnterpriseApplication earModule = (IEnterpriseApplication)module.loadAdapter(IEnterpriseApplication.class, monitor);
- IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
- PublishUtil.publishDelta(deltas, moduleDeployPath, monitor);
-
- // if not root, save child data
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- if( moduleTree.size() > 1 )
- NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getPublishInfo(newTree, module).setResources(md.members());
-
- IModule[] childModules = earModule.getModules();
- for (int i = 0; i < childModules.length; i++) {
- IModule childModule = childModules[i];
- String uri = earModule.getURI(childModule);
- if(uri==null){
- IStatus status = new Status(IStatus.ERROR, JBossServerCorePlugin.PLUGIN_ID, 0, "unable to assemble module null uri",null ); //$NON-NLS-1$
- throw new CoreException(status);
- }
-
- incrementalPublish(newTree, moduleDeployPath, childModule, monitor);
- }
-
- }
-
- protected void incrementalWarPublish(ArrayList<IModule> moduleTree, IModule module, IPath root, IProgressMonitor monitor) throws CoreException {
- ArrayList<IModule> newTree = new ArrayList<IModule>();
- newTree.addAll(moduleTree); newTree.add(module);
-
- IModuleResourceDelta[] deltas = getDelta(module, newTree);
- ModuleDelegate md = (ModuleDelegate)module.loadAdapter(ModuleDelegate.class, monitor);
- IWebModule webmodule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IPath moduleDeployPath = root.append(webmodule.getContextRoot() + ".war");
- PublishUtil.publishDelta(deltas, moduleDeployPath, monitor);
-
- if( moduleTree.size() > 1 )
- NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getPublishInfo(newTree, module).setResources(md.members());
-
-
- IWebModule webModule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IModule[] childModules = webModule.getModules();
- for (int i = 0; i < childModules.length; i++) {
- IModule module2 = childModules[i];
- // if a lib .jar needs to be repacked, repack the whole thing
- if( hasDelta(module2, newTree))
- packModuleIntoJar(module, webModule.getURI(module2), moduleDeployPath);
- }
- }
-
- protected IStatus unpublish(IDeployableServer jbServer, IModule module,
+ protected IStatus unpublish(IDeployableServer jbServer, IModule[] module,
IProgressMonitor monitor) throws CoreException {
-
- IPath root = new Path(jbServer.getDeployDirectory());
- if( module.getModuleType().getId().equals("jst.web")) {
- // copy the module first
- IWebModule webmodule = (IWebModule)module.loadAdapter(IWebModule.class, monitor);
- IPath moduleDeployPath = root.append(webmodule.getContextRoot() + ".war");
- FileUtil.completeDelete(moduleDeployPath.toFile());
- } else if( module.getModuleType().getId().equals("jst.ear")) {
- IPath moduleDeployPath = root.append(module.getProject().getName() + ".ear");
- FileUtil.completeDelete(moduleDeployPath.toFile());
- }
-
+ IPath path = getDeployPath(module);
+ FileUtil.completeDelete(path.toFile());
return new Status(IStatus.OK, JBossServerCorePlugin.PLUGIN_ID,
IStatus.OK, "", null);
}
-
- /*
- *
- * Utility Methods
- *
- *
- */
-
- private boolean hasDelta( IModule module, ArrayList<IModule> moduleTree ) {
- return getDelta(module, moduleTree).length > 0;
- }
-
- public IModuleResourceDelta[] getDelta(IModule module, ArrayList<IModule> moduleTree) {
- IModuleResourceDelta[] deltas;
- if( moduleTree.size() == 1 ) {
- final IModule[] modules ={module};
- deltas = ((Server)server.getServer()).getPublishedResourceDelta( modules );
- } else {
- deltas = NestedPublishInfo.getDefault().getServerPublishInfo(server.getServer()).getDelta(moduleTree, module);
+ protected IPath getDeployPath(IModule[] moduleTree) {
+ IPath root = new Path( server.getDeployDirectory() );
+ String type;
+ for( int i = 0; i < moduleTree.length; i++ ) {
+ type = moduleTree[i].getModuleType().getId();
+ if( "jst.ear".equals(type))
+ root = root.append(moduleTree[i].getProject().getName() + ".ear");
+ else if( "jst.web".equals(type))
+ root = root.append(moduleTree[i].getProject().getName() + ".war");
+ else if( "jst.utility".equals(type) && i >= 1 && "jst.web".equals(moduleTree[i-1].getModuleType().getId()))
+ root = root.append("WEB-INF").append("lib").append(moduleTree[i].getProject().getName() + ".jar");
+ else
+ root = root.append(moduleTree[i].getProject().getName() + ".jar");
}
- return deltas;
+ return root;
}
+ protected boolean deployPackaged(IModule[] moduleTree) {
+ if( moduleTree[moduleTree.length-1].getModuleType().getId().equals("jst.utility")) return true;
+ return false;
+ }
+ public int getPublishState() {
+ return IServer.PUBLISH_STATE_NONE;
+ }
+
/*
* Just package into a jar raw. Don't think about it, just do it
*/
- protected void packModuleIntoJar(IModule module, String deploymentUnitName, IPath destination)throws CoreException {
- String dest = destination.append(deploymentUnitName).toString();
+ protected void packModuleIntoJar(IModule module, IPath destination)throws CoreException {
+ String dest = destination.toString();
ModulePackager packager = null;
try {
packager = new ModulePackager(dest, false);
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java 2007-09-24 17:05:07 UTC (rev 3772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/NullPublisher.java 2007-09-24 17:05:58 UTC (rev 3773)
@@ -40,13 +40,11 @@
}
public IStatus publishModule(int kind, int deltaKind, int modulePublishState,
- IModule module, IProgressMonitor monitor) throws CoreException {
+ IModule[] module, IProgressMonitor monitor) throws CoreException {
return null;
}
public void setDelta(IModuleResourceDelta[] delta) {
- // TODO Auto-generated method stub
-
}
}
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-09-24 17:05:07 UTC (rev 3772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/PackagesPublisher.java 2007-09-24 17:05:58 UTC (rev 3773)
@@ -73,16 +73,17 @@
}
public IStatus publishModule(int kind, int deltaKind, int modulePublishState,
- IModule module, IProgressMonitor monitor) throws CoreException {
+ IModule[] module, IProgressMonitor monitor) throws CoreException {
try {
+ IModule module2 = module[0];
// if it's being removed
if( deltaKind == ServerBehaviourDelegate.REMOVED ) {
- removeModule(module, kind, deltaKind, monitor);
+ removeModule(module2, kind, deltaKind, monitor);
return null;
}
if( deltaKind == ServerBehaviourDelegate.ADDED || deltaKind == ServerBehaviourDelegate.CHANGED) {
- publishModule(module, kind, deltaKind, modulePublishState, monitor);
+ publishModule(module2, kind, deltaKind, modulePublishState, monitor);
return null;
}
}catch(Exception e) {
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-09-24 17:05:07 UTC (rev 3772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/publishers/SingleFilePublisher.java 2007-09-24 17:05:58 UTC (rev 3773)
@@ -29,18 +29,19 @@
}
public IStatus publishModule(int kind, int deltaKind,
- int modulePublishState, IModule module, IProgressMonitor monitor)
+ int modulePublishState, IModule[] module, IProgressMonitor monitor)
throws CoreException {
+ IModule module2 = module[0];
IStatus status = null;
if(ServerBehaviourDelegate.REMOVED == deltaKind){
- status = unpublish(server, module, kind, deltaKind, modulePublishState, monitor);
+ status = unpublish(server, module2, kind, deltaKind, modulePublishState, monitor);
} else if( ServerBehaviourDelegate.NO_CHANGE != deltaKind || kind == IServer.PUBLISH_FULL || kind == IServer.PUBLISH_CLEAN ){
// if there's no change, do nothing. Otherwise, on change or add, re-publish
- status = publish(server, module, kind, deltaKind, modulePublishState, monitor);
+ status = publish(server, module2, kind, deltaKind, modulePublishState, monitor);
} else if( ServerBehaviourDelegate.NO_CHANGE != deltaKind && kind == IServer.PUBLISH_INCREMENTAL ){
- status = publish(server, module, kind, deltaKind, modulePublishState, monitor);
+ status = publish(server, module2, kind, deltaKind, modulePublishState, monitor);
}
return status;
Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-09-24 17:05:07 UTC (rev 3772)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.core/jbosscore/org/jboss/ide/eclipse/as/core/server/internal/DeployableServerBehavior.java 2007-09-24 17:05:58 UTC (rev 3773)
@@ -43,14 +43,12 @@
public void setupLaunchConfiguration(ILaunchConfigurationWorkingCopy workingCopy, IProgressMonitor monitor) throws CoreException {
workingCopy.setAttribute(DeployableLaunchConfiguration.ACTION_KEY, DeployableLaunchConfiguration.START);
}
-
-
-// public IModuleResourceDelta[] getPublishedResourceDelta(IModule[] module) {
-// return ((Server)getServer()).getPublishedResourceDelta(module);
-// }
-
- private void print(int kind, int deltaKind, String name) {
+ private void print(int kind, int deltaKind, IModule[] module) {
+ String name = "";
+ for( int i = 0; i < module.length; i++ )
+ name += module[i].getName();
+
System.out.print("publishing module (" + name + "): ");
switch( kind ) {
case IServer.PUBLISH_INCREMENTAL: System.out.print("incremental, "); break;
@@ -66,12 +64,21 @@
}
System.out.println(" to server " + getServer().getName() + "(" + getServer().getId() + ")");
}
+
+ /*
+ * The module is a list of module trail points, from parent to child
+ * Thus:
+ * {ear, war} for the war portion, {ear, ejb} for the ejb portion
+ *
+ * (non-Javadoc)
+ * @see org.eclipse.wst.server.core.model.ServerBehaviourDelegate#publishModule(int, int, org.eclipse.wst.server.core.IModule[], org.eclipse.core.runtime.IProgressMonitor)
+ */
protected void publishModule(int kind, int deltaKind, IModule[] module, IProgressMonitor monitor) throws CoreException {
// kind = [incremental, full, auto, clean] = [1,2,3,4]
// delta = [no_change, added, changed, removed] = [0,1,2,3]
if( module.length == 0 ) return;
IJBossServerPublisher publisher;
- print(kind, deltaKind, module[0].getName());
+ print(kind, deltaKind, module);
int modulePublishState = getServer().getModulePublishState(module) + 0;
EventLogTreeItem root = EventLogModel.getModel(getServer()).getRoot();
@@ -79,22 +86,24 @@
root = PublisherEventLogger.createMultipleModuleTopLevelEvent(root, module.length);
}
- for( int i = 0; i < module.length; i++ ) {
+ if( module.length > 0 ) {
+ IModule lastMod = module[module.length -1];
try {
- if( isJstModule(module[i]) ) {
+ if( isJstModule(lastMod) ) {
publisher = new JstPublisher(getServer(), root);
- } else if( isPackagesTypeModule(module[i]) ) {
+ } else if( isPackagesTypeModule(lastMod) ) {
publisher = new PackagesPublisher(getServer(), root);
- } else if( module[i].getModuleType().getId().equals("jboss.singlefile")){
+ } else if( lastMod.getModuleType().getId().equals("jboss.singlefile")){
publisher = new SingleFilePublisher(getServer());
} else {
publisher = new NullPublisher();
}
publisher.setDelta(getPublishedResourceDelta(module));
- publisher.publishModule(kind, deltaKind, modulePublishState, module[0], monitor);
+ publisher.publishModule(kind, deltaKind, modulePublishState, module, monitor);
setModulePublishState(module, publisher.getPublishState());
+ } catch( Throwable e ) {
+ e.printStackTrace();
}
- catch( Throwable e ) {e.printStackTrace();}
}
}
@@ -104,8 +113,8 @@
// TODO: Change to if it is a flex project. Don't know how to do that yet.
protected boolean isJstModule(IModule mod) {
String type = mod.getModuleType().getId();
- if( type.equals("jst.ejb") || type.equals("jst.client")
- || type.equals("jst.web") || type.equals("jst.ear"))
+ if( type.equals("jst.ejb") || type.equals("jst.web") ||
+ type.equals("jst.ear") || type.equals("jst.utility"))
return true;
return false;
}
17 years, 3 months