Author: dazarov
Date: 2011-09-02 19:44:57 -0400 (Fri, 02 Sep 2011)
New Revision: 34507
Modified:
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.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/Seam2FacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.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/SeamFacetInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
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/messages.properties
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
Log:
There should be an option to/not to copy the libraries when user create New Seam Project.
https://issues.jboss.org/browse/JBIDE-2927
Modified:
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.base.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -201,6 +201,7 @@
config.setStringProperty(ISeamFacetDataModelProperties.SEAM_CONNECTION_PROFILE,
"noop-connection");
config.setProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH, new String[] {
"noop-driver.jar" });
config.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING,
true);
+ config.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_TEMPLATES_AND_LIBRARIES_COPYING,
true);
return config;
}
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 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -311,4 +311,13 @@
* Can be "true" or "false".
*/
String SEAM_RUNTIME_LIBRARIES_COPYING = "seam.runtime.libraries.copying";
//$NON-NLS-1$
+
+ /**
+ * This flag indicates that we should copy Seam templates and libraries from Seam
Runtime to projects.
+ * Can be "true" or "false".
+ */
+ String SEAM_TEMPLATES_AND_LIBRARIES_COPYING = "seam.templates.copying";
//$NON-NLS-1$
+
+ String SEAM_LIBRARY_PROVIDER = "seam.runtime.library.provider"; //$NON-NLS-1$
+
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -113,7 +113,7 @@
IDataModel model, IProgressMonitor monitor) throws CoreException {
super.doExecuteForEjb(project, fv, model, monitor);
IResource src = getSrcFolder(project);
- if(src!=null && seamHomeFolder!=null &&
shouldCopySeamRuntimeLibraries(model)) {
+ if(src!=null && seamHomeFolder!=null &&
shouldCopyLibrariesAndTemplates(model)) {
File srcFile = src.getLocation().toFile();
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "security.drl"),
srcFile, false); //$NON-NLS-1$
}
@@ -126,24 +126,24 @@
@Override
protected void copyFilesToWarProject(final IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
- if(!shouldCopySeamRuntimeLibraries(model))
+ if(!shouldCopyLibrariesAndTemplates(model))
return;
super.copyFilesToWarProject(project, fv, model, monitor);
final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
if(isWarConfiguration(model)) {
- if (!SeamCorePlugin.getDefault().hasM2Facet(project)) {
+ if (!SeamCorePlugin.getDefault().hasM2Facet(project) &&
shouldCopyLibraries(model)) {
AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamHomeFolder)));
AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamLibFolder)));
}
final IContainer source = warActionSrcRootFolder.getUnderlyingFolder();
File actionsSrc = new File(project.getLocation().toFile(),
source.getFullPath().removeFirstSegments(1).toString());
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "seam.properties"),
actionsSrc, true); //$NON-NLS-1$
- if (!SeamCorePlugin.getDefault().hasM2Facet(project)) {
+ if (!SeamCorePlugin.getDefault().hasM2Facet(project) &&
shouldCopyLibraries(model)) {
AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(droolsLibFolder)));
}
} else {
- if (!SeamCorePlugin.getDefault().hasM2Facet(project)) {
+ if (!SeamCorePlugin.getDefault().hasM2Facet(project) &&
shouldCopyLibraries(model)) {
AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamHomeFolder)));
AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamLibFolder)));
AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(droolsLibFolder)));
@@ -157,15 +157,17 @@
*/
@Override
protected void fillEarContents(IProject project, IDataModel model) {
- if(!shouldCopySeamRuntimeLibraries(model))
+ if(!shouldCopyLibrariesAndTemplates(model))
return;
if (!SeamCorePlugin.getDefault().hasM2Facet(project)) {
final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)), false);
- AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)), false);
- AntCopyUtils.copyFiles(seamLibFolder, earLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_LIB).dir(seamLibFolder)), false);
- AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)), false);
+ if(shouldCopyLibraries(model)){
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)), false);
+ AntCopyUtils.copyFiles(seamLibFolder, earLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_LIB).dir(seamLibFolder)), false);
+ AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)), false);
+ }
AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamGenResFolder)), false);
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2ProjectCreator.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -90,7 +90,7 @@
@Override
protected void createEarProject() {
super.createEarProject();
- if (!SeamCorePlugin.getDefault().hasM2Facet(seamWebProject) &&
shouldCopySeamRuntimeLibraries(model)) {
+ if (!SeamCorePlugin.getDefault().hasM2Facet(seamWebProject) &&
shouldCopyLibrariesAndTemplates(model) && shouldCopyLibraries(model)) {
File earContentsFolder = new File(earProjectFolder, "EarContent");
//$NON-NLS-1$
File earLibFolder = new File(earContentsFolder, "lib"); //$NON-NLS-1$
AntCopyUtils.copyFiles(seamLibFolder, earLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(Seam2FacetInstallDelegate.JBOSS_EAR_LIB).dir(seamLibFolder)));
@@ -99,7 +99,7 @@
@Override
protected boolean createTestProject() {
- if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING) ||
!shouldCopySeamRuntimeLibraries(model))
+ if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING) ||
!shouldCopyLibrariesAndTemplates(model))
return false;
File testProjectDir = new
File(seamWebProject.getLocation().removeLastSegments(1).toFile(), testProjectName);
//$NON-NLS-1$
@@ -228,7 +228,7 @@
}
}
- if (!SeamCorePlugin.getDefault().hasM2Facet(seamWebProject)) {
+ if (!SeamCorePlugin.getDefault().hasM2Facet(seamWebProject) &&
shouldCopyLibraries(model)) {
AntCopyUtils.copyFiles(new File(seamRuntime.getHomeDir(), "lib"),
//$NON-NLS-1$
testLibDir, new AntCopyUtils.FileSetFileFilter(includeLibs));
@@ -245,7 +245,7 @@
protected void createEjbProject() {
super.createEjbProject();
// Copy security.drl to source folder
- if(shouldCopySeamRuntimeLibraries(model))
+ if(shouldCopyLibrariesAndTemplates(model))
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder, "security.drl"),
new File(ejbProjectFolder, "ejbModule/"), true); //$NON-NLS-1$ //$NON-NLS-2$
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -399,7 +399,7 @@
protected void copyFilesToWarProject(IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
- if(!shouldCopySeamRuntimeLibraries(model))
+ if(!shouldCopyLibrariesAndTemplates(model))
return;
final AntCopyUtils.FileSet viewFileSet = new
AntCopyUtils.FileSet(VIEW_FILESET).dir(seamGenViewSource);
@@ -567,7 +567,7 @@
FilterSet earFilterSet = new FilterSet();
earFilterSet.addFilter("projectName", project.getName() + ".ear");
//$NON-NLS-1$ //$NON-NLS-2$
- if(shouldCopySeamRuntimeLibraries(model)){
+ if(shouldCopyLibrariesAndTemplates(model)){
AntCopyUtils.copyFileToFolder(
new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
metaInfFolder, new FilterSetCollection(earFilterSet), false);
@@ -577,7 +577,7 @@
configureApplicationXml(project, monitor);
}
- if(shouldCopySeamRuntimeLibraries(model)){
+ if(shouldCopyLibrariesAndTemplates(model)){
// Copy configuration files from template
try {
AntCopyUtils.copyFilesAndFolders(
@@ -590,7 +590,7 @@
fillEarContents(project, model);
- if(shouldCopySeamRuntimeLibraries(model)){
+ if(shouldCopyLibrariesAndTemplates(model)){
File resources = new File(earProjectFolder, "resources"); //$NON-NLS-1$
AntCopyUtils.copyFileToFile(
dataSourceDsFile, new File(resources, project.getName() + "-ds.xml"),
//$NON-NLS-1$
@@ -683,7 +683,7 @@
viewFilterSetCollection.addFilterSet(projectFilterSet);
File srcFile = src.getLocation().toFile();
- if(shouldCopySeamRuntimeLibraries(model)){
+ if(shouldCopyLibrariesAndTemplates(model)){
// Copy sources to EJB project in case of EAR configuration
AntCopyUtils.copyFileToFile(
new File(seamGenHomeFolder, "src/Authenticator.java"), //$NON-NLS-1$
@@ -692,7 +692,7 @@
}
File persistentXml = new File(srcFile, "META-INF/persistence.xml");
//$NON-NLS-1$
- if(!persistentXml.exists() && shouldCopySeamRuntimeLibraries(model)) {
+ if(!persistentXml.exists() && shouldCopyLibrariesAndTemplates(model)) {
AntCopyUtils.copyFileToFile(persistenceFile, new File(srcFile,
"META-INF/persistence.xml"), //$NON-NLS-1$
viewFilterSetCollection, false);
} else {
@@ -705,12 +705,12 @@
}
AntCopyUtils.FileSet ejbSrcResourcesSet = new
AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
- if(shouldCopySeamRuntimeLibraries(model)){
+ if(shouldCopyLibrariesAndTemplates(model)){
AntCopyUtils.copyFilesAndFolders(seamGenResFolder, srcFile, new
AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), viewFilterSetCollection, false);
}
File ejbJarXml = new File(srcFile, "META-INF/ejb-jar.xml"); //$NON-NLS-1$
- if(!ejbJarXml.exists() && shouldCopySeamRuntimeLibraries(model)) {
+ if(!ejbJarXml.exists() && shouldCopyLibrariesAndTemplates(model)) {
AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,
"META-INF/ejb-jar.xml"), //$NON-NLS-1$
new File(srcFile, "META-INF"), viewFilterSetCollection, false);
//$NON-NLS-1$
} else {
@@ -718,7 +718,7 @@
}
}
- if(shouldCopySeamRuntimeLibraries(model)){
+ if(shouldCopyLibrariesAndTemplates(model)){
AntCopyUtils.copyFileToFile(
hibernateConsoleLaunchFile,
new File(ejbProjectFolder, getLaunchCfgName(ejbProjectFolder.getName()) +
".launch"), //$NON-NLS-1$
@@ -1305,7 +1305,11 @@
protected abstract SeamProjectCreator getProjectCreator(IDataModel model, IProject
project);
- protected boolean shouldCopySeamRuntimeLibraries(IDataModel model){
+ protected boolean shouldCopyLibrariesAndTemplates(IDataModel model){
+ return
model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_TEMPLATES_AND_LIBRARIES_COPYING);
+ }
+
+ protected boolean shouldCopyLibraries(IDataModel model){
return
model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING);
}
}
\ No newline at end of file
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 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -93,6 +93,8 @@
names.add(CONFIGURE_DEFAULT_SEAM_RUNTIME);
names.add(CONFIGURE_WAR_PROJECT);
names.add(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING);
+ names.add(ISeamFacetDataModelProperties.SEAM_TEMPLATES_AND_LIBRARIES_COPYING);
+ names.add(ISeamFacetDataModelProperties.SEAM_LIBRARY_PROVIDER);
return names;
}
@@ -133,6 +135,10 @@
return Boolean.TRUE;
} else if (SEAM_RUNTIME_LIBRARIES_COPYING.equals(propertyName)) {
return Boolean.TRUE;
+ } else if (SEAM_TEMPLATES_AND_LIBRARIES_COPYING.equals(propertyName)) {
+ return Boolean.TRUE;
+ } else if (SEAM_LIBRARY_PROVIDER.equals(propertyName)) {
+ return null;
}
return super.getDefaultProperty(propertyName);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -132,19 +132,21 @@
protected void copyFilesToWarProject(final IProject project, IProjectFacetVersion fv,
IDataModel model, IProgressMonitor monitor) throws CoreException {
- if(!shouldCopySeamRuntimeLibraries(model))
+ if(!shouldCopyLibrariesAndTemplates(model))
return;
super.copyFilesToWarProject(project, fv, model, monitor);
final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
- if (isWarConfiguration(model)) {
- AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamHomeFolder)));
- AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamLibFolder)));
- AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(droolsLibFolder)));
- } else {
- AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamHomeFolder)));
- AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamLibFolder)));
- AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(droolsLibFolder)));
+ if(shouldCopyLibraries(model)){
+ if (isWarConfiguration(model)) {
+ AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_WAR_CONFIG).dir(droolsLibFolder)));
+ } else {
+ AntCopyUtils.copyFiles(seamHomeFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(droolsLibFolder, webLibFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_WAR_LIB_FILESET_EAR_CONFIG).dir(droolsLibFolder)));
+ }
}
}
@@ -154,13 +156,15 @@
*/
@Override
protected void fillEarContents(IProject project, IDataModel model) {
- if(!shouldCopySeamRuntimeLibraries(model))
+ if(!shouldCopyLibrariesAndTemplates(model))
return;
final File droolsLibFolder = new File(seamHomePath, DROOLS_LIB_SEAM_RELATED_PATH);
- AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)), false);
- AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)), false);
- AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)), false);
+ if(shouldCopyLibraries(model)){
+ AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)), false);
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)), false);
+ AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)), false);
+ }
AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamGenResFolder)), false);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamProjectCreator.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -287,7 +287,7 @@
manifestFilterWar.addFilter("earLibs", earJarsStrWar.toString());
//$NON-NLS-1$
manifestFilterColWar.addFilterSet(manifestFilterWar);
- if(shouldCopySeamRuntimeLibraries(model))
+ if(shouldCopyLibrariesAndTemplates(model))
AntCopyUtils.copyFileToFolder(new
File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),
"war/META-INF/MANIFEST.MF"), webMetaInf, manifestFilterColWar, true);
//$NON-NLS-1$
FilterSetCollection manifestFilterColEjb = new
FilterSetCollection(projectFilterSet);
@@ -295,7 +295,7 @@
manifestFilterEjb.addFilter("earClasspath", earJarsStrEjb.toString());
//$NON-NLS-1$
manifestFilterColEjb.addFilterSet(manifestFilterEjb);
- if(shouldCopySeamRuntimeLibraries(model))
+ if(shouldCopyLibrariesAndTemplates(model))
AntCopyUtils.copyFileToFolder(new
File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),
"ejb/ejbModule/META-INF/MANIFEST.MF"), ejbMetaInf, manifestFilterColEjb, true);
//$NON-NLS-1$
} catch (IOException e) {
SeamCorePlugin.getPluginLog().logError(e);
@@ -456,7 +456,7 @@
* Creates test project for given seam web project.
*/
protected boolean createTestProject() {
- if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING) ||
!shouldCopySeamRuntimeLibraries(model))
+ if(!(Boolean)model.getProperty(ISeamFacetDataModelProperties.TEST_PROJECT_CREATING) ||
!shouldCopyLibrariesAndTemplates(model))
return false;
File testProjectDir = new
File(seamWebProject.getLocation().removeLastSegments(1).toFile(), testProjectName);
//$NON-NLS-1$
@@ -514,10 +514,12 @@
embededEjbDir,
new AntCopyUtils.FileSetFileFilter(excludeCvsSvn));
- AntCopyUtils.copyFiles(
- new File(seamRuntime.getHomeDir(), "lib"), //$NON-NLS-1$
- testLibDir,
- new AntCopyUtils.FileSetFileFilter(includeLibs));
+ if(shouldCopyLibraries(model)){
+ AntCopyUtils.copyFiles(
+ new File(seamRuntime.getHomeDir(), "lib"), //$NON-NLS-1$
+ testLibDir,
+ new AntCopyUtils.FileSetFileFilter(includeLibs));
+ }
SeamFacetAbstractInstallDelegate.createComponentsProperties(testSrcDir, "",
Boolean.TRUE); //$NON-NLS-1$
return true;
@@ -548,7 +550,7 @@
}
protected void createEjbProject() {
- if(!shouldCopySeamRuntimeLibraries(model))
+ if(!shouldCopyLibrariesAndTemplates(model))
return;
ejbProjectFolder.mkdir();
@@ -612,7 +614,7 @@
}
protected void createEarProject() {
- if(!shouldCopySeamRuntimeLibraries(model))
+ if(!shouldCopyLibrariesAndTemplates(model))
return;
earProjectFolder.mkdir();
@@ -642,7 +644,7 @@
// Fill ear contents
AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(getJbossEarContent()).dir(seamHomeFolder)));
- if (!SeamCorePlugin.getDefault().hasM2Facet(seamWebProject)) {
+ if (!SeamCorePlugin.getDefault().hasM2Facet(seamWebProject) &&
shouldCopyLibraries(model)) {
AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(getJbossEarContent()).dir(seamLibFolder)));
AntCopyUtils.copyFiles(droolsLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(getJbossEarContent()).dir(droolsLibFolder)));
}
@@ -704,7 +706,11 @@
// Do nothing special for Seam 1.2
}
- protected boolean shouldCopySeamRuntimeLibraries(IDataModel model){
+ protected boolean shouldCopyLibrariesAndTemplates(IDataModel model){
+ return
model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_TEMPLATES_AND_LIBRARIES_COPYING);
+ }
+
+ protected boolean shouldCopyLibraries(IDataModel model){
return
model.getBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING);
}
}
\ No newline at end of file
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/SeamUIMessages.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -136,6 +136,12 @@
public static String SEAM_INSTALL_WIZARD_PAGE_SESSION_BEAN_PACKAGE_NAME;
public static String SEAM_INSTALL_WIZARD_PAGE_TEST_PACKAGE_NAME;
+
+ public static String SEAM_INSTALL_WIZARD_PAGE_LIBRARIES;
+
+ public static String SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES;
+
+ public static String SEAM_INSTALL_WIZARD_PAGE_CONFIGURE_LATER;
public static String SEAM_OPEN_ACTION_OPEN;
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 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -109,6 +109,8 @@
SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_EAR_PROJECT_NAME,
""); //$NON-NLS-1$
+ private IFieldEditor libraryListEditor;
+
private IFieldEditor jBossAsDeployAsEditor = IFieldEditorFactory.INSTANCE
.createRadioEditor(
ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS,
@@ -311,7 +313,9 @@
SeamProjectPreferences.JBOSS_AS_DEFAULT_DEPLOY_AS,
this.jBossAsDeployAsEditor.getValueAsString());
- model.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING,
isNewProjectWizard());
+ model.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_TEMPLATES_AND_LIBRARIES_COPYING,
isNewProjectWizard());
+
+ model.setBooleanProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_LIBRARIES_COPYING,
libraryListEditor.getValueAsString().equals(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES)
&& isNewProjectWizard());
}
/*
@@ -411,6 +415,18 @@
registerEditor(earProjectNameditor, generalGroup, 3);
earProjectNameditor.setEnabled(getDeployAsDefaultValue().equals(ISeamFacetDataModelProperties.DEPLOY_AS_EAR));
+ List<String> providers = new ArrayList<String>();
+ providers.add(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES);
+ providers.add(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_CONFIGURE_LATER);
+
+ libraryListEditor = IFieldEditorFactory.INSTANCE.createComboEditor(
+ ISeamFacetDataModelProperties.SEAM_LIBRARY_PROVIDER,
+ SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_LIBRARIES,
+ providers,
+ providers.get(0));
+
+ registerEditor(libraryListEditor, generalGroup, 3);
+
jBossAsDeployAsEditor.addPropertyChangeListener(new PropertyChangeListener(){
public void propertyChange(PropertyChangeEvent arg0) {
Boolean value = jBossAsDeployAsEditor.getValue() ==
ISeamFacetDataModelProperties.DEPLOY_AS_EAR;
@@ -510,8 +526,6 @@
ISeamFacetDataModelProperties.SEAM_TEST_PROJECT));
}
-
-
Dialog.applyDialogFont(parent);
initDefaultWizardProperties();
Object parentDm = model
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/messages.properties 2011-09-02
23:44:57 UTC (rev 34507)
@@ -66,6 +66,9 @@
SEAM_RUNTIME_LIST_FIELD_EDITOR_NAME=Name
SEAM_RUNTIME_LIST_FIELD_EDITOR_PATH=Path
SEAM_INSTALL_WIZARD_PAGE_GENERAL=General
+SEAM_INSTALL_WIZARD_PAGE_LIBRARIES=Libraries:
+SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES=Copy Libraries From Seam Runtime
+SEAM_INSTALL_WIZARD_PAGE_CONFIGURE_LATER=Configure Later
SEAM_GENERATE_ENTITIES_WIZARD_54=org.hibernate.eclipse.launch.SeamUtil
SEAM_WIZARD_FACTORY_SEAM_PROJECT=Seam Project:
SEAM_INSTALL_WIZARD_PAGE_DATABASE=Database
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2011-09-02
23:44:39 UTC (rev 34506)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamProjectWizard.java 2011-09-02
23:44:57 UTC (rev 34507)
@@ -418,7 +418,9 @@
String[] driverJars = (String[])
model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
if(driverJars!=null) {
String configFolder = jbs.getConfigDirectory();
- AntCopyUtils.copyFiles(driverJars, new File(configFolder, "lib"), false);
+ if(model.getStringProperty(ISeamFacetDataModelProperties.SEAM_LIBRARY_PROVIDER).equals(SeamUIMessages.SEAM_INSTALL_WIZARD_PAGE_COPY_LIBRARIES)){
+ AntCopyUtils.copyFiles(driverJars, new File(configFolder, "lib"),
false);
+ }
}
}
@@ -433,7 +435,7 @@
dsJob.schedule();
}
}
-
+
private void provideClassPath(List<IProject> projects, IProject ejbProject)
throws CoreException {
if(ejbProject == null) return;
int k = 0;