Author: akazakov
Date: 2008-10-16 13:20:52 -0400 (Thu, 16 Oct 2008)
New Revision: 10898
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
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/SeamFacetAbstractInstallDelegate.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java
Log:
https://jira.jboss.org/jira/browse/JBIDE-2731
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-10-16 17:02:09 UTC (rev
10897)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2008-10-16 17:20:52 UTC (rev
10898)
@@ -51,6 +51,10 @@
<constraint>
<or>
<requires
+ facet="jst.ear"
+ version="[5.0">
+ </requires>
+ <requires
facet="jst.ejb"
version="[3.0">
</requires>
@@ -77,6 +81,10 @@
<constraint>
<or>
<requires
+ facet="jst.ear"
+ version="[5.0">
+ </requires>
+ <requires
facet="jst.ejb"
version="[3.0">
</requires>
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 2008-10-16
17:02:09 UTC (rev 10897)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2008-10-16
17:20:52 UTC (rev 10898)
@@ -80,16 +80,6 @@
/*
* (non-Javadoc)
- * @see
org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEar(org.eclipse.core.resources.IProject,
org.eclipse.wst.common.project.facet.core.IProjectFacetVersion,
org.eclipse.wst.common.frameworks.datamodel.IDataModel,
org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected void doExecuteForEar(final IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException {
- // TODO
- }
-
- /*
- * (non-Javadoc)
* @see
org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEjb(org.eclipse.core.resources.IProject,
org.eclipse.wst.common.project.facet.core.IProjectFacetVersion,
org.eclipse.wst.common.frameworks.datamodel.IDataModel,
org.eclipse.core.runtime.IProgressMonitor)
*/
@Override
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 2008-10-16
17:02:09 UTC (rev 10897)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetAbstractInstallDelegate.java 2008-10-16
17:20:52 UTC (rev 10898)
@@ -444,9 +444,63 @@
* @param monitor
* @throws CoreException
*/
- protected abstract void doExecuteForEar(IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException;
+ protected void doExecuteForEar(IProject project, IProjectFacetVersion fv,
+ IDataModel model, IProgressMonitor monitor) throws CoreException {
+/*
+ if(seamHomePath==null) {
+ return;
+ }
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT, project.getName());
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualFolder rootVirtFolder = component.getRootFolder().getFolder(new
Path("/")); //$NON-NLS-1$
+ IContainer earContentsContainer = rootVirtFolder.getUnderlyingFolder();
+ File earContentsFolder = earContentsFolder.getAbsoluteFile();
+ File earProjectFolder = project.getLocation().toFile();
+
+ File ejbTemplateDir;
+ AntCopyUtils.FileSet excludeCvsSvn;
+
+ try {
+ ejbTemplateDir = new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),
"ejb");
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ excludeCvsSvn = new
AntCopyUtils.FileSet(SeamFacetAbstractInstallDelegate.CVS_SVN).dir(ejbTemplateDir);
+
+ FilterSet earFilterSet = new FilterSet();
+ earFilterSet.addFilter("projectName", project.getName() + ".ear");
//$NON-NLS-1$ //$NON-NLS-2$
+
+ AntCopyUtils.copyFileToFolder(
+ new File(seamGenResFolder, "META-INF/jboss-app.xml"), //$NON-NLS-1$
+ new File(earContentsFolder, "META-INF"), //$NON-NLS-1$
+ new FilterSetCollection(earFilterSet), false);
+
+ // Copy configuration files from template
+ try {
+ AntCopyUtils.copyFilesAndFolders(
+ new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(), "ear"),
//$NON-NLS-1$
+ earProjectFolder, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
+ new FilterSetCollection(ejbFilterSet), true);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+
+ // Fill ear contents
+ AntCopyUtils.copyFiles(seamHomeFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(getJbossEarContent()).dir(seamHomeFolder)));
+ 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)));
+ AntCopyUtils.copyFiles(seamLibFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(getJbossEarContent()).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(seamGenResFolder, earContentsFolder, new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(getJbossEarContent()).dir(seamGenResFolder)));
+
+ File resources = new File(earProjectFolder, "resources");
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new File(resources, seamWebProject.getName() + "-ds.xml"), //$NON-NLS-1$
//$NON-NLS-2$
+ viewFilterSetCollection, true);
+*/
+ }
+
protected IResource getSrcFolder(IProject project) throws JavaModelException {
IJavaProject javaProject = EclipseResourceUtil.getJavaProject(project);
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 2008-10-16
17:02:09 UTC (rev 10897)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegate.java 2008-10-16
17:20:52 UTC (rev 10898)
@@ -105,16 +105,6 @@
/*
* (non-Javadoc)
- * @see
org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#doExecuteForEar(org.eclipse.core.resources.IProject,
org.eclipse.wst.common.project.facet.core.IProjectFacetVersion,
org.eclipse.wst.common.frameworks.datamodel.IDataModel,
org.eclipse.core.runtime.IProgressMonitor)
- */
- @Override
- protected void doExecuteForEar(final IProject project, IProjectFacetVersion fv,
- IDataModel model, IProgressMonitor monitor) throws CoreException {
- // TODO
- }
-
- /*
- * (non-Javadoc)
* @see
org.jboss.tools.seam.internal.core.project.facet.SeamFacetAbstractInstallDelegate#copyFilesToWarProject(org.eclipse.core.resources.IProject,
org.eclipse.wst.common.project.facet.core.IProjectFacetVersion,
org.eclipse.wst.common.frameworks.datamodel.IDataModel,
org.eclipse.core.runtime.IProgressMonitor)
*/
@Override