Author: max.andersen(a)jboss.com
Date: 2007-10-21 02:33:02 -0400 (Sun, 21 Oct 2007)
New Revision: 4396
Added:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java
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/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetFilterSetFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
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
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegateTest.java
Log:
http://jira.jboss.org/jira/browse/JBIDE-1107 Seam 2 support
+Seam 2 facet
+Seam 2 installdelegate (copy of Seam 1 installdelegate to avoid "hurting" seam
1 functionallity)
+Allow users to have a seam 2 runtime
+Fixed a couple of spellingerrors
-Generated Test project is not 100% yet
-There is no filtering of Seam version in the wizard page
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-10-21 06:24:01 UTC (rev
4395)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-10-21 06:33:02 UTC (rev
4396)
@@ -1,72 +1,72 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<plugin>
-
- <extension
- id="seambuilder"
- name="Seam Builder"
- point="org.eclipse.core.resources.builders">
- <builder
- hasNature="false">
- <run
- class="org.jboss.tools.seam.core.SeamCoreBuilder">
- </run>
- </builder>
- </extension>
- <extension
- id="seamnature"
- name="Seam Project Nature"
- point="org.eclipse.core.resources.natures">
- <runtime>
- <run
- class="org.jboss.tools.seam.internal.core.SeamProject">
- </run>
- </runtime>
- <builder
- id="org.jboss.tools.seam.core.seambuilder">
- </builder>
- </extension>
-
- <extension point="org.eclipse.core.runtime.preferences">
- <initializer
class="org.jboss.tools.seam.internal.core.SeamPreferenceInitializer"/>
- <initializer
-
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreferenceInitializer">
- </initializer>
- </extension>
-
- <extension
- point="org.eclipse.wst.common.project.facet.core.facets">
- <project-facet
- id="jst.seam">
- <label>
- Seam
- </label>
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+
+ <extension
+ id="seambuilder"
+ name="Seam Builder"
+ point="org.eclipse.core.resources.builders">
+ <builder
+ hasNature="false">
+ <run
+ class="org.jboss.tools.seam.core.SeamCoreBuilder">
+ </run>
+ </builder>
+ </extension>
+ <extension
+ id="seamnature"
+ name="Seam Project Nature"
+ point="org.eclipse.core.resources.natures">
+ <runtime>
+ <run
+ class="org.jboss.tools.seam.internal.core.SeamProject">
+ </run>
+ </runtime>
+ <builder
+ id="org.jboss.tools.seam.core.seambuilder">
+ </builder>
+ </extension>
+
+ <extension point="org.eclipse.core.runtime.preferences">
+ <initializer
class="org.jboss.tools.seam.internal.core.SeamPreferenceInitializer"/>
+ <initializer
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreferenceInitializer">
+ </initializer>
+ </extension>
+
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.facets">
+ <project-facet
+ id="jst.seam">
+ <label>
+ Seam
+ </label>
<description>
- Enables the project to work with JBoss Seam
- </description>
- </project-facet>
- <project-facet-version
- facet="jst.seam"
- version="1.2">
- <constraint>
- <and>
- <requires
- facet="jst.web"
- version="[2.4">
- </requires>
- <requires
- facet="jst.jsf"
- version="[1.2">
- </requires>
- <requires
- facet="jst.java"
- version="[5.0">
- </requires>
- </and>
- </constraint>
- </project-facet-version>
- <!--<project-facet-version
+ Enables the project to work with JBoss Seam
+ </description>
+ </project-facet>
+ <project-facet-version
facet="jst.seam"
+ version="1.2">
+ <constraint>
+ <and>
+ <requires
+ facet="jst.web"
+ version="[2.4">
+ </requires>
+ <requires
+ facet="jst.jsf"
+ version="[1.2">
+ </requires>
+ <requires
+ facet="jst.java"
+ version="[5.0">
+ </requires>
+ </and>
+ </constraint>
+ </project-facet-version>
+ <project-facet-version
+ facet="jst.seam"
version="2.0">
<constraint>
<and>
@@ -84,20 +84,19 @@
</requires>
</and>
</constraint>
- </project-facet-version>-->
- <action
- facet="jst.seam"
- id="jst.seam.1.2.install"
- type="install"
- version="1.2">
- <delegate
-
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegate">
- </delegate>
- <config-factory
-
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider">
- </config-factory>
+ </project-facet-version>
+ <action
+ facet="jst.seam"
+ id="jst.seam.1.2.install"
+ type="install"
+ version="1.2">
+ <delegate
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegate">
+ </delegate>
+ <config-factory
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider">
+ </config-factory>
</action>
- <!--
<action
facet="jst.seam"
id="jst.seam.2.0.install"
@@ -109,154 +108,189 @@
<config-factory
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider">
</config-factory>
- </action> -->
- <action
- facet="jst.seam"
- id="jst.seam.1.2.uninstall"
- type="uninstall"
- version="1.2">
- <delegate
-
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetUninstallDelegate">
- </delegate>
- </action>
- <event-handler
- facet="jst.seam"
- type="POST_INSTALL"
- version="[1.2">
- <delegate
-
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetPostInstallDelegate">
- </delegate>
- </event-handler>
- <event-handler
- facet="jst.seam"
- type="PRE_INSTALL"
- version="[1.2">
- <delegate
-
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreInstallDelegate">
- </delegate>
- </event-handler>
- <template
- id="template.jst.seam">
- <label>
- Seam Web Project
- </label>
- <fixed
- facet="jst.java"/>
- <fixed
- facet="jst.web"/>
- <fixed
- facet="jst.seam"/>
- <fixed
- facet="jst.jsf"/>
- <preset
- id="jst.seam.preset">
- </preset>
- </template>
- <preset
- id="jst.seam.preset">
- <label>
- Dynamic Web Project with Seam 1.2
- </label>
- <facet
- id="jst.java"
- version="5.0"/>
- <facet
- id="jst.web"
- version="2.5"/>
- <facet
- id="jst.jsf"
- version="1.2"/>
- <facet
- id="jst.seam"
- version="1.2"/>
- </preset>
- </extension>
- <extension
- point="org.eclipse.wst.common.project.facet.core.runtimes">
- <supported>
- <runtime-component
- id="org.jboss.ide.eclipse.as.runtime.component"
- version="4.0">
- </runtime-component>
- <runtime-component
- id="org.jboss.ide.eclipse.as.runtime.component"
- version="4.2">
- </runtime-component>
- <facet
- id="jst.seam"
- version="1.2">
- </facet>
- </supported>
- </extension>
-
- <extension
- point="org.eclipse.wst.validation.validator"
- id="SeamValidator"
- name="Seam Validator">
- <validator>
- <projectNature id="org.jboss.tools.seam.core.seamnature" />
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.java"/>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.xml"/>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.xhtml"/>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jsp">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jspf">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jsf">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jsv">
- </filter>
- <filter
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="*.jtpl">
- </filter>
- <contentTypeBinding
contentTypeId="org.eclipse.jst.jsp.core.jspsource"/>
- <contentTypeBinding
contentTypeId="org.eclipse.jst.jsp.core.jspfragmentsource"/>
- <contentTypeBinding
contentTypeId="org.eclipse.jst.jsp.core.tagsource"/>
- <markerId
- markerIdValue="seamProblem">
- </markerId>
- <helper
- class="org.jboss.tools.seam.internal.core.validation.SeamValidationHelper">
- </helper>
- <run
-
class="org.jboss.tools.seam.internal.core.validation.SeamValidatorManager"
- incremental="true"
- fullBuild="true"
- />
- <dependentValidator
- depValValue="true">
- </dependentValidator>
- </validator>
- </extension>
-
- <extension
- id="seamProblem"
- name="Seam Problem"
- point="org.eclipse.core.resources.markers">
- <super type="org.eclipse.wst.validation.problemmarker"/>
- <persistent
- value="true">
- </persistent>
- </extension>
-
- <extension point="org.jboss.tools.common.model.classes">
- <xclass id="org.jboss.tools.seam.internal.core.el.SeamPromptingProvider"
- class="org.jboss.tools.seam.internal.core.el.SeamPromptingProvider"/>
- </extension>
-
-</plugin>
+ </action>
+ <action
+ facet="jst.seam"
+ id="jst.seam.1.2.uninstall"
+ type="uninstall"
+ version="1.2">
+ <delegate
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetUninstallDelegate">
+ </delegate>
+ </action>
+ <event-handler
+ facet="jst.seam"
+ type="POST_INSTALL"
+ version="[1.2">
+ <delegate
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetPostInstallDelegate">
+ </delegate>
+ </event-handler>
+ <event-handler
+ facet="jst.seam"
+ type="PRE_INSTALL"
+ version="[1.2">
+ <delegate
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetPreInstallDelegate">
+ </delegate>
+ </event-handler>
+ <template
+ id="template.jst.seam">
+ <label>
+ Seam Web Project
+ </label>
+ <fixed
+ facet="jst.java"/>
+ <fixed
+ facet="jst.web"/>
+ <fixed
+ facet="jst.seam"/>
+ <fixed
+ facet="jst.jsf"/>
+ <preset
+ id="jst.seam.preset">
+ </preset>
+ </template>
+ <preset
+ id="jst.seam.preset">
+ <label>
+ Dynamic Web Project with Seam 1.2
+ </label>
+ <facet
+ id="jst.java"
+ version="5.0"/>
+ <facet
+ id="jst.web"
+ version="2.5"/>
+ <facet
+ id="jst.jsf"
+ version="1.2"/>
+ <facet
+ id="jst.seam"
+ version="1.2"/>
+ </preset>
+ <template
+ id="template.jst.seam2">
+ <label>
+ Seam 2 Web Project
+ </label>
+ <fixed
+ facet="jst.java"/>
+ <fixed
+ facet="jst.web"/>
+ <fixed
+ facet="jst.seam"/>
+ <fixed
+ facet="jst.jsf"/>
+ <preset
+ id="jst.seam2.preset">
+ </preset>
+ </template>
+ <preset
+ id="jst.seam2.preset">
+ <label>
+ Dynamic Web Project with Seam 2.0 (technology preview)
+ </label>
+ <facet
+ id="jst.java"
+ version="5.0"/>
+ <facet
+ id="jst.web"
+ version="2.5"/>
+ <facet
+ id="jst.jsf"
+ version="1.2"/>
+ <facet
+ id="jst.seam"
+ version="2.0"/>
+ </preset>
+ </extension>
+ <extension
+ point="org.eclipse.wst.common.project.facet.core.runtimes">
+ <supported>
+ <runtime-component
+ id="org.jboss.ide.eclipse.as.runtime.component"
+ version="4.0">
+ </runtime-component>
+ <runtime-component
+ id="org.jboss.ide.eclipse.as.runtime.component"
+ version="4.2">
+ </runtime-component>
+ <facet
+ id="jst.seam"
+ version="[1.2">
+ </facet>
+ </supported>
+ </extension>
+
+ <extension
+ point="org.eclipse.wst.validation.validator"
+ id="SeamValidator"
+ name="Seam Validator">
+ <validator>
+ <projectNature id="org.jboss.tools.seam.core.seamnature" />
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.java"/>
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.xml"/>
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.xhtml"/>
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.jsp">
+ </filter>
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.jspf">
+ </filter>
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.jsf">
+ </filter>
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.jsv">
+ </filter>
+ <filter
+ objectClass="org.eclipse.core.resources.IFile"
+ nameFilter="*.jtpl">
+ </filter>
+ <contentTypeBinding
contentTypeId="org.eclipse.jst.jsp.core.jspsource"/>
+ <contentTypeBinding
contentTypeId="org.eclipse.jst.jsp.core.jspfragmentsource"/>
+ <contentTypeBinding
contentTypeId="org.eclipse.jst.jsp.core.tagsource"/>
+ <markerId
+ markerIdValue="seamProblem">
+ </markerId>
+ <helper
+ class="org.jboss.tools.seam.internal.core.validation.SeamValidationHelper">
+ </helper>
+ <run
+
class="org.jboss.tools.seam.internal.core.validation.SeamValidatorManager"
+ incremental="true"
+ fullBuild="true"
+ />
+ <dependentValidator
+ depValValue="true">
+ </dependentValidator>
+ </validator>
+ </extension>
+
+ <extension
+ id="seamProblem"
+ name="Seam Problem"
+ point="org.eclipse.core.resources.markers">
+ <super type="org.eclipse.wst.validation.problemmarker"/>
+ <persistent
+ value="true">
+ </persistent>
+ </extension>
+
+ <extension point="org.jboss.tools.common.model.classes">
+ <xclass id="org.jboss.tools.seam.internal.core.el.SeamPromptingProvider"
+ class="org.jboss.tools.seam.internal.core.el.SeamPromptingProvider"/>
+ </extension>
+
+</plugin>
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-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -1,87 +1,90 @@
-/*******************************************************************************
- * Copyright (c) 2007 Red Hat, Inc.
- * Distributed under license by Red Hat, Inc. All rights reserved.
- * This program is made available under the terms of the
- * Eclipse Public License v1.0 which accompanies this distribution,
- * and is available at
http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.seam.internal.core.project.facet;
-
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-
-/**
- * Seam facet properties
- * @author eskimo
- *
- */
-public interface ISeamFacetDataModelProperties extends IActionConfigFactory {
-
- public static final String SEAM_PROJECT_NAME = "project.name"; //$NON-NLS-1$
-
- public static final String SEAM_PROJECT_INSTANCE = "seam.project.instance";
//$NON-NLS-1$
-
- public static final String SEAM_CONNECTION_PROFILE =
"seam.project.connection.profile"; //$NON-NLS-1$
-
- public static final String SEAM_RUNTIME_NAME = "seam.runtime.name";
//$NON-NLS-1$
-
- public static final String JBOSS_AS_HOME = "jboss.home"; //$NON-NLS-1$
-
- public static final String JBOSS_AS_DEPLOY_AS =
"seam.project.deployment.type"; //$NON-NLS-1$
-
- public static final String DB_TYPE = "database.type"; //$NON-NLS-1$
-
- public static final String HIBERNATE_DIALECT = "hibernate.dialect";
//$NON-NLS-1$
-
- public static final String JDBC_DRIVER_CLASS_NAME =
"hibernate.connection.driver_class"; //$NON-NLS-1$
-
- public static final String JDBC_URL_FOR_DB = "hibernate.connection.url";
//$NON-NLS-1$
-
- public static final String DB_USER_NAME = "hibernate.connection.username";
//$NON-NLS-1$
-
- public static final String DB_USER_PASSWORD = "hibernate.connection.password";
//$NON-NLS-1$
-
- public static final String DB_SCHEMA_NAME = "schema.property"; //$NON-NLS-1$
-
- public static final String DB_CATALOG_NAME = "catalog.property";
//$NON-NLS-1$
-
- public static final String DB_ALREADY_EXISTS = "database.exists";
//$NON-NLS-1$
-
- public static final String RECREATE_TABLES_AND_DATA_ON_DEPLOY =
"database.drop"; //$NON-NLS-1$
-
- public static final String HIBERNATE_HBM2DDL_AUTO = "hibernate.hbm2ddl.auto";
//$NON-NLS-1$
-
- public static final String JDBC_DRIVER_JAR_PATH = "driver.file";
//$NON-NLS-1$
-
- public static final String SESION_BEAN_PACKAGE_NAME = "action.package";
//$NON-NLS-1$
-
- public static final String SESION_BEAN_PACKAGE_PATH = "action.package.path";
//$NON-NLS-1$
-
- public static final String ENTITY_BEAN_PACKAGE_NAME = "model.package";
//$NON-NLS-1$
-
- public static final String ENTITY_BEAN_PACKAGE_PATH = "model.package.path";
//$NON-NLS-1$
-
- public static final String TEST_CASES_PACKAGE_NAME = "test.package";
//$NON-NLS-1$
-
- public static final String TEST_CASES_PACKAGE_PATH = "test.package.path";
//$NON-NLS-1$
-
- public static final String JBOSS_SEAM_HOME = "seam.home.folder";
//$NON-NLS-1$
-
- public static final String WEB_CONTENTS_FOLDER =
"seam.project.web.root.folder"; //$NON-NLS-1$
-
- public static final String SEAM_EJB_PROJECT = "seam.ejb.project";
//$NON-NLS-1$
-
- public static final String SEAM_TEST_PROJECT = "seam.test.project";
//$NON-NLS-1$
-
- public static final String SEAM_EAR_PROJECT = "seam.ear.project";
//$NON-NLS-1$
-
- public static final String DEPLOY_AS_WAR = "war"; //$NON-NLS-1$
-
- public static final String DEPLOY_AS_EAR = "ear"; //$NON-NLS-1$
-
- public static final String JBOSS_AS_TARGET_SERVER =
"seam.project.deployment.target"; //$NON-NLS-1$
- public static final String JBOSS_AS_TARGET_RUNTIME =
"seam.project.deployment.runtime"; //$NON-NLS-1$
-}
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.seam.internal.core.project.facet;
+
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+
+/**
+ * Seam facet properties
+ * @author eskimo
+ *
+ */
+public interface ISeamFacetDataModelProperties extends IActionConfigFactory {
+
+ public static final String SEAM_PROJECT_NAME = "project.name"; //$NON-NLS-1$
+
+ public static final String SEAM_PROJECT_INSTANCE = "seam.project.instance";
//$NON-NLS-1$
+
+ public static final String SEAM_CONNECTION_PROFILE =
"seam.project.connection.profile"; //$NON-NLS-1$
+
+ public static final String SEAM_RUNTIME_NAME = "seam.runtime.name";
//$NON-NLS-1$
+
+ public static final String JBOSS_AS_HOME = "jboss.home"; //$NON-NLS-1$
+
+ public static final String JBOSS_AS_DEPLOY_AS =
"seam.project.deployment.type"; //$NON-NLS-1$
+
+ public static final String DB_TYPE = "database.type"; //$NON-NLS-1$
+
+ public static final String HIBERNATE_DIALECT = "hibernate.dialect";
//$NON-NLS-1$
+
+ public static final String JDBC_DRIVER_CLASS_NAME =
"hibernate.connection.driver_class"; //$NON-NLS-1$
+
+ public static final String JDBC_URL_FOR_DB = "hibernate.connection.url";
//$NON-NLS-1$
+
+ public static final String DB_USER_NAME = "hibernate.connection.username";
//$NON-NLS-1$
+
+ public static final String DB_USER_PASSWORD = "hibernate.connection.password";
//$NON-NLS-1$
+
+ public static final String DB_SCHEMA_NAME = "schema.property"; //$NON-NLS-1$
+
+ public static final String DB_CATALOG_NAME = "catalog.property";
//$NON-NLS-1$
+
+ public static final String DB_ALREADY_EXISTS = "database.exists";
//$NON-NLS-1$
+
+ public static final String RECREATE_TABLES_AND_DATA_ON_DEPLOY =
"database.drop"; //$NON-NLS-1$
+
+ public static final String HIBERNATE_HBM2DDL_AUTO = "hibernate.hbm2ddl.auto";
//$NON-NLS-1$
+
+ public static final String JDBC_DRIVER_JAR_PATH = "driver.file";
//$NON-NLS-1$
+
+ public static final String SESION_BEAN_PACKAGE_NAME = "action.package";
//$NON-NLS-1$
+
+ // why is this a property when it is always derivable from sesion_bean_package_name ?
+ public static final String SESION_BEAN_PACKAGE_PATH = "action.package.path";
//$NON-NLS-1$
+
+ public static final String ENTITY_BEAN_PACKAGE_NAME = "model.package";
//$NON-NLS-1$
+
+ // why is this a property when it is always derivable from entity_bean_package_name ?
+ public static final String ENTITY_BEAN_PACKAGE_PATH = "model.package.path";
//$NON-NLS-1$
+
+ public static final String TEST_CASES_PACKAGE_NAME = "test.package";
//$NON-NLS-1$
+
+ // why is this a property when it is always derivable from test_package_path ?
+ public static final String TEST_CASES_PACKAGE_PATH = "test.package.path";
//$NON-NLS-1$
+
+ public static final String JBOSS_SEAM_HOME = "seam.home.folder";
//$NON-NLS-1$
+
+ public static final String WEB_CONTENTS_FOLDER =
"seam.project.web.root.folder"; //$NON-NLS-1$
+
+ public static final String SEAM_EJB_PROJECT = "seam.ejb.project";
//$NON-NLS-1$
+
+ public static final String SEAM_TEST_PROJECT = "seam.test.project";
//$NON-NLS-1$
+
+ public static final String SEAM_EAR_PROJECT = "seam.ear.project";
//$NON-NLS-1$
+
+ public static final String DEPLOY_AS_WAR = "war"; //$NON-NLS-1$
+
+ public static final String DEPLOY_AS_EAR = "ear"; //$NON-NLS-1$
+
+ public static final String JBOSS_AS_TARGET_SERVER =
"seam.project.deployment.target"; //$NON-NLS-1$
+ public static final String JBOSS_AS_TARGET_RUNTIME =
"seam.project.deployment.runtime"; //$NON-NLS-1$
+}
Added:
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
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/Seam2FacetInstallDelegate.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -0,0 +1,676 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Red Hat, Inc.
+ * Distributed under license by Red Hat, Inc. All rights reserved.
+ * This program is made available under the terms of the
+ * Eclipse Public License v1.0 which accompanies this distribution,
+ * and is available at
http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.project.facet;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FilenameFilter;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Properties;
+
+import org.apache.tools.ant.types.FilterSet;
+import org.apache.tools.ant.types.FilterSetCollection;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.IWorkspaceRoot;
+import org.eclipse.core.resources.ProjectScope;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
+import org.eclipse.core.runtime.preferences.IScopeContext;
+import org.eclipse.jdt.core.IClasspathEntry;
+import org.eclipse.jdt.core.IJavaProject;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.core.JavaModelException;
+import org.eclipse.jst.common.project.facet.core.ClasspathHelper;
+import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.ModuleCoreNature;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
+import org.eclipse.wst.common.project.facet.core.IDelegate;
+import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
+import org.eclipse.wst.common.uriresolver.internal.URI;
+import org.jboss.tools.common.model.util.EclipseResourceUtil;
+import org.jboss.tools.common.util.ResourcesUtils;
+import org.jboss.tools.seam.core.ISeamProject;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.core.project.facet.SeamRuntime;
+import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.osgi.service.prefs.BackingStoreException;
+
+// TODO: why not just *one* global filter set to avoid any missing names ? (assert for it
in our unittests!
+public class Seam2FacetInstallDelegate extends Object implements
IDelegate,ISeamFacetDataModelProperties {
+
+ public static String DEV_WAR_PROFILE = "dev-war"; //$NON-NLS-1$
+ public static String DEV_EAR_PROFILE = "dev"; //$NON-NLS-1$
+ public static String TEST_WAR_PROFILE = "test-war"; //$NON-NLS-1$
+ public static String TEST_EAR_PROFILE = "test"; //$NON-NLS-1$
+
+
+ public static AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_WAR_CONFIG = new
AntCopyUtils.FileSet()
+ .include("ajax4jsf.*\\.jar") //$NON-NLS-1$
+ .include("richfaces.*\\.jar")
+ .include("antlr.*\\.jar") //$NON-NLS-1$
+ .include("commons-beanutils.*\\.jar") //$NON-NLS-1$
+ .include("commons-collections.*\\.jar") //$NON-NLS-1$
+ .include("commons-digester.*\\.jar") //$NON-NLS-1$
+ .include("commons-jci-core.*\\.jar") //$NON-NLS-1$
+ .include("commons-jci-janino.*\\.jar") //$NON-NLS-1$
+ .include("drools-compiler.*\\.jar") //$NON-NLS-1$
+ .include("drools-core.*\\.jar") //$NON-NLS-1$
+ .include("janino.*\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-debug\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-ioc\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-mail\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-pdf\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-remoting\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-ui\\.jar") //$NON-NLS-1$
+ .include("jboss-seam\\.jar") //$NON-NLS-1$
+ .include("jbpm.*\\.jar") //$NON-NLS-1$
+ .include("jsf-facelets\\.jar") //$NON-NLS-1$
+ .include("oscache.*\\.jar") //$NON-NLS-1$
+ .include("stringtemplate.*\\.jar") //$NON-NLS-1$
+ .include("mvel14.jar") //$NON-NLS-1$
+ .include("jboss-el.jar"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet JBOSS_TEST_LIB_FILESET = new AntCopyUtils.FileSet()
+ .include("testng-.*-jdk15\\.jar") //$NON-NLS-1$
+ .include("myfaces-api-.*\\.jar") //$NON-NLS-1$
+ .include("myfaces-impl-.*\\.jar") //$NON-NLS-1$
+ .include("servlet-api\\.jar") //$NON-NLS-1$
+ .include("hibernate-all\\.jar") //$NON-NLS-1$
+ .include("jboss-ejb3-all\\.jar") //$NON-NLS-1$
+ .include("thirdparty-all\\.jar") //$NON-NLS-1$
+ .include("el-api\\.jar") //$NON-NLS-1$
+ .include("el-ri\\.jar") //$NON-NLS-1$
+ .exclude(".*/CVS") //$NON-NLS-1$
+ .exclude(".*/\\.svn"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet JBOSS_WAR_LIB_FILESET_EAR_CONFIG = new
AntCopyUtils.FileSet()
+ .include("ajax4jsf.*\\.jar") //$NON-NLS-1$
+ .include("richfaces.*\\.jar") //$NON-NLS-1$
+ .include("commons-beanutils.*\\.jar") //$NON-NLS-1$
+ .include("commons-digester.*\\.jar") //$NON-NLS-1$
+ .include("commons-collections.*\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-debug\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-ioc\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-mail\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-pdf\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-remoting\\.jar") //$NON-NLS-1$
+ .include("jboss-seam-ui\\.jar") //$NON-NLS-1$
+ .include("jsf-facelets\\.jar") //$NON-NLS-1$
+ .include("oscache.*\\.jar"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet JBOSS_EAR_CONTENT = new AntCopyUtils.FileSet()
+ .include("antlr.*\\.jar") //$NON-NLS-1$
+ .include("drools-compiler.*\\.jar") //$NON-NLS-1$
+ .include("drools-core.*\\.jar") //$NON-NLS-1$
+ .include("jboss-seam.jar") //$NON-NLS-1$
+ .include("jboss-el.*.jar") //$NON-NLS-1$
+ .include("mvel14.*.jar") //$NON-NLS-1$
+ .include("jbpm-jpdl.*\\.jar") //$NON-NLS-1$
+ .include("richfaces-api.*\\.jar") //$NON-NLS-1$
+ .include("security\\.drl"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet JBOSS_EAR_CONTENT_META_INF = new
AntCopyUtils.FileSet()
+ .include("META-INF/application\\.xml") //$NON-NLS-1$
+ .include("META-INF/jboss-app\\.xml"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet VIEW_FILESET = new AntCopyUtils.FileSet()
+ .include("home\\.xhtml") //$NON-NLS-1$
+ .include("error\\.xhtml") //$NON-NLS-1$
+ .include("login\\.xhtml") //$NON-NLS-1$
+ .include("login\\.page.xml") //$NON-NLS-1$
+ .include("index\\.html") //$NON-NLS-1$
+ .include("layout") //$NON-NLS-1$
+ .include("layout/.*") //$NON-NLS-1$
+ .include("stylesheet") //$NON-NLS-1$
+ .include("stylesheet/.*") //$NON-NLS-1$
+ .include("img/.*") //$NON-NLS-1$
+ .include("img") //$NON-NLS-1$
+ .exclude(".*/.*\\.ftl") //$NON-NLS-1$
+ .exclude(".*/CVS") //$NON-NLS-1$
+ .exclude(".*/\\.svn"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet CVS_SVN = new AntCopyUtils.FileSet()
+ .include(".*") //$NON-NLS-1$
+ .exclude(".*/CVS") //$NON-NLS-1$
+ .exclude("CVS") //$NON-NLS-1$
+ .exclude(".*\\.svn") //$NON-NLS-1$
+ .exclude(".*/\\.svn"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet JBOOS_WAR_WEBINF_SET = new AntCopyUtils.FileSet()
+ .include("WEB-INF") //$NON-NLS-1$
+ .include("WEB-INF/web\\.xml") //$NON-NLS-1$
+ .include("WEB-INF/pages\\.xml") //$NON-NLS-1$
+ .include("WEB-INF/jboss-web\\.xml") //$NON-NLS-1$
+ .include("WEB-INF/faces-config\\.xml") //$NON-NLS-1$
+ .include("WEB-INF/componets\\.xml"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet JBOOS_WAR_WEB_INF_CLASSES_SET = new
AntCopyUtils.FileSet()
+ .include("import\\.sql") //$NON-NLS-1$
+ .include("security\\.drl") //$NON-NLS-1$
+ .include("seam\\.properties") //$NON-NLS-1$
+ .include("messages_en\\.properties"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet JBOOS_EJB_WEB_INF_CLASSES_SET = new
AntCopyUtils.FileSet()
+ .include("import\\.sql") //$NON-NLS-1$
+ .include("seam\\.properties")
+ .exclude(".*/WEB-INF"); //$NON-NLS-1$
+
+ public static AntCopyUtils.FileSet JBOSS_EAR_META_INF_SET = new AntCopyUtils.FileSet()
+ .include("META-INF/jboss-app\\.xml"); //$NON-NLS-1$
+
+ public static String DROOLS_LIB_SEAM_RELATED_PATH = "lib"; //$NON-NLS-1$
+
+ public static String SEAM_LIB_RELATED_PATH = "lib"; //$NON-NLS-1$
+
+ public static String WEB_LIBRARIES_RELATED_PATH = "WEB-INF/lib";
//$NON-NLS-1$
+
+ public void execute(final IProject project, IProjectFacetVersion fv,
+ Object config, IProgressMonitor monitor) throws CoreException {
+ final IDataModel model = (IDataModel)config;
+
+ // get WebContents folder path from DWP model
+ IVirtualComponent component = ComponentCore.createComponent(project);
+ IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new
Path("/")); //$NON-NLS-1$
+ final IVirtualFolder srcRootFolder = component.getRootFolder().getFolder(new
Path("/WEB-INF/classes")); //$NON-NLS-1$
+ IContainer webRootFolder = webRootVirtFolder.getUnderlyingFolder();
+
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_TEST_PROJECT,
project.getName()+"-test"); //$NON-NLS-1$
+
+ Boolean dbExists =
(Boolean)model.getProperty(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
+ Boolean dbRecreate =
(Boolean)model.getProperty(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
+ if(!dbExists && !dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO,"update");
//$NON-NLS-1$
+ } else if(dbExists && !dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO,"validate");
//$NON-NLS-1$
+ } else if(dbRecreate) {
+ model.setProperty(ISeamFacetDataModelProperties.HIBERNATE_HBM2DDL_AUTO,"create-drop");
//$NON-NLS-1$
+ }
+
+ final File webContentFolder = webRootFolder.getLocation().toFile();
+ final File webInfFolder = new File(webContentFolder,"WEB-INF");
//$NON-NLS-1$
+ final File webInfClasses = new File(webInfFolder,"classes"); //$NON-NLS-1$
+ final File webInfClassesMetaInf = new File(webInfClasses, "META-INF");
//$NON-NLS-1$
+ webInfClassesMetaInf.mkdirs();
+ final File webLibFolder = new File(webContentFolder,WEB_LIBRARIES_RELATED_PATH);
+ final File srcFolder = isWarConfiguration(model)?new
File(srcRootFolder.getUnderlyingFolder().getLocation().toFile(),"model"):srcRootFolder.getUnderlyingFolder().getLocation().toFile();
//$NON-NLS-1$
+ final File webMetaInf = new File(webContentFolder, "META-INF");
//$NON-NLS-1$
+ final SeamRuntime selectedRuntime =
SeamRuntimeManager.getInstance().findRuntimeByName(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).toString());
+
+ final String seamHomePath = selectedRuntime.getHomeDir();
+
+ final File seamHomeFolder = new File(seamHomePath);
+ final File seamLibFolder = new File(seamHomePath,SEAM_LIB_RELATED_PATH);
+ final File seamGenResFolder = new File(seamHomePath,"seam-gen/resources");
//$NON-NLS-1$
+ final File seamGenResMetainfFolder = new File(seamGenResFolder,"META-INF");
//$NON-NLS-1$
+
+ final File droolsLibFolder = new File(seamHomePath,DROOLS_LIB_SEAM_RELATED_PATH);
+ final File seamGenHomeFolder = new File(seamHomePath,"seam-gen");
//$NON-NLS-1$
+ final File seamGenViewSource = new File(seamGenHomeFolder,"view");
//$NON-NLS-1$
+ final File dataSourceDsFile = new File(seamGenResFolder,
"datasource-ds.xml"); //$NON-NLS-1$
+ final File componentsFile = new
File(seamGenResFolder,"WEB-INF/components"+(isWarConfiguration(model)?"-war":"")+".xml");
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ //$NON-NLS-4$
+
+ final File hibernateConsoleLaunchFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.launch"); //$NON-NLS-1$
+ final File hibernateConsolePropsFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.properties"); //$NON-NLS-1$
+ final File hibernateConsolePref = new File(seamGenHomeFolder,
"hibernatetools/.settings/org.hibernate.eclipse.console.prefs"); //$NON-NLS-1$
+ final File persistenceFile = new
File(seamGenResFolder,"META-INF/persistence-" +
(isWarConfiguration(model)?DEV_WAR_PROFILE:DEV_EAR_PROFILE) + ".xml");
//$NON-NLS-1$ //$NON-NLS-2$
+
+ final File applicationFile = new
File(seamGenResFolder,"META-INF/application.xml"); //$NON-NLS-1$
+
+ final FilterSet jdbcFilterSet = SeamFacetFilterSetFactory.createJdbcFilterSet(model);
+ final FilterSet projectFilterSet =
SeamFacetFilterSetFactory.createProjectFilterSet(model);
+ final FilterSet filtersFilterSet =
SeamFacetFilterSetFactory.createFiltersFilterSet(model);
+
+ // ****************************************************************
+ // Copy view folder from seam-gen installation to WebContent folder
+ // ****************************************************************
+ final AntCopyUtils.FileSet viewFileSet = new
AntCopyUtils.FileSet(VIEW_FILESET).dir(seamGenViewSource);
+ final FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
+ viewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ viewFilterSetCollection.addFilterSet(projectFilterSet);
+ viewFilterSetCollection.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
+
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenViewSource,
+ webContentFolder,
+ new AntCopyUtils.FileSetFileFilter(viewFileSet),
+ viewFilterSetCollection,
+ true);
+
+ // *******************************************************************
+ // Copy manifest and configuration resources the same way as view
+ // *******************************************************************
+ AntCopyUtils.FileSet webInfSet = new
AntCopyUtils.FileSet(JBOOS_WAR_WEBINF_SET).dir(seamGenResFolder);
+
+ AntCopyUtils.copyFileToFile(
+ componentsFile,
+ new File(webInfFolder,"components.xml"), //$NON-NLS-1$
+ new FilterSetCollection(projectFilterSet), true);
+
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder,webContentFolder,new AntCopyUtils.FileSetFileFilter(webInfSet),
viewFilterSetCollection, true);
+
+
+ final FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
+ hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
+ hibernateDialectFilterSet.addFilterSet(projectFilterSet);
+ hibernateDialectFilterSet.addFilterSet(SeamFacetFilterSetFactory.createHibernateDialectFilterSet(model));
+
+
+ createTestProject(model,project,selectedRuntime);
+
+ //
********************************************************************************************
+ // Handle WAR/EAR configurations
+ //
********************************************************************************************
+ if(isWarConfiguration(model)) {
+
+ AntCopyUtils.FileSet webInfClassesSet = new
AntCopyUtils.FileSet(JBOOS_WAR_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder,srcFolder,new AntCopyUtils.FileSetFileFilter(webInfClassesSet),
viewFilterSetCollection, true);
+
+ createComponentsProperties(srcFolder,
isWarConfiguration(model)?"":project.getName()+"-ear", false);
//$NON-NLS-1$ //$NON-NLS-2$
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePref,
+ new File(project.getLocation().toFile(),".settings"), //$NON-NLS-1$
+ new FilterSetCollection(projectFilterSet), true);
+
+ // In case of WAR configuration
+ 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)));
+
+ //
********************************************************************************************
+ // Copy seam project indicator
+ //
********************************************************************************************
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"),
srcFolder, true); //$NON-NLS-1$
+ final IContainer source = srcRootFolder.getUnderlyingFolder();
+
+ IPath actionSrcPath = new
Path(source.getFullPath().lastSegment()+"/action"); //$NON-NLS-1$
+ IPath modelSrcPath = new Path(source.getFullPath().lastSegment()+"/model");
//$NON-NLS-1$
+
+ srcRootFolder.delete(IVirtualFolder.FORCE, monitor);
+ WtpUtils.createSourceFolder(project, actionSrcPath, new
Path(source.getFullPath().lastSegment()), new
Path(webRootFolder.getLocation().lastSegment()+"/WEB-INF/dev")); //$NON-NLS-1$
+ WtpUtils.createSourceFolder(project, modelSrcPath, new
Path(source.getFullPath().lastSegment()), null);
+
+ srcRootFolder.createLink(actionSrcPath, 0, null);
+ srcRootFolder.createLink(modelSrcPath, 0, null);
+
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder,"src/Authenticator.java"), //$NON-NLS-1$
+ new
File(project.getLocation().toFile(),source.getFullPath().lastSegment()+"/action/"
+
model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.',
'/')+"/"+"Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ new FilterSetCollection(filtersFilterSet), true);
+
+ AntCopyUtils.copyFileToFile(
+ persistenceFile,
+ new File(srcFolder,"META-INF/persistence.xml"), //$NON-NLS-1$
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new File(srcFolder,project.getName()+"-ds.xml"), //$NON-NLS-1$
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFile(
+ hibernateConsoleLaunchFile,
+ new File(project.getLocation().toFile(),project.getName()+".launch"),
//$NON-NLS-1$
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePropsFile,
+ project.getLocation().toFile(),
+ hibernateDialectFilterSet, true);
+
+ WtpUtils.setClasspathEntryAsExported(project, new
Path("org.eclipse.jst.j2ee.internal.web.container"), monitor); //$NON-NLS-1$
+
+ Job create = new DataSourceXmlDeployer(project);
+ create.setUser(true);
+ create.setRule(ResourcesPlugin.getWorkspace().getRoot());
+ create.schedule();
+
+ } else {
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_EJB_PROJECT,
project.getName()+"-ejb"); //$NON-NLS-1$
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_EAR_PROJECT,
project.getName()+"-ear"); //$NON-NLS-1$
+
+ // In case of EAR configuration
+ 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)));
+ AntCopyUtils.copyFileToFolder(new
File(seamGenResFolder,"messages_en.properties"),srcFolder, true); //$NON-NLS-1$
+
+ File ear = new
File(project.getLocation().removeLastSegments(1).toFile(),model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ear");
//$NON-NLS-1$
+ File ejb = new
File(project.getLocation().removeLastSegments(1).toFile(),model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME)+"-ejb");
//$NON-NLS-1$
+ ear.mkdir();
+ ejb.mkdir();
+
+ try {
+ FilterSet filterSet = new FilterSet();
+ filterSet.addFilter("projectName", project.getName()); //$NON-NLS-1$
+ filterSet.addFilter("runtimeName", WtpUtils.getServerRuntimeName(project));
//$NON-NLS-1$
+ if(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH)!=null) {
+ File driver = new
File(((String[])model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH))[0]);
+ filterSet.addFilter("driverJar"," " + driver.getName() +
"\n"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+ } else {
+ filterSet.addFilter("driverJar",""); //$NON-NLS-1$
//$NON-NLS-2$
+ }
+ AntCopyUtils.FileSet excludeCvsSvn = new
AntCopyUtils.FileSet(CVS_SVN).dir(seamGenResFolder);
+
+ AntCopyUtils.copyFilesAndFolders(
+ new File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ejb"),
//$NON-NLS-1$
+ ejb, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
+ new FilterSetCollection(filterSet), true);
+
+ //
*******************************************************************************************
+ // Copy sources to ejb project in case of EAR configuration
+ //
*******************************************************************************************
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder,"src/Authenticator.java"), //$NON-NLS-1$
+ new File(ejb,"ejbModule/" +
model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.',
'/')+"/"+"Authenticator.java"), //$NON-NLS-1$ //$NON-NLS-2$
//$NON-NLS-3$
+ new FilterSetCollection(filtersFilterSet), true);
+ AntCopyUtils.copyFileToFile(
+ persistenceFile,
+ new File(ejb,"ejbModule/META-INF/persistence.xml"), //$NON-NLS-1$
+ viewFilterSetCollection, true);
+
+ createComponentsProperties(new File(ejb,"ejbModule"),
isWarConfiguration(model)?"":project.getName()+"-ear", false);
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+
+ AntCopyUtils.FileSet ejbSrcResourcesSet = new
AntCopyUtils.FileSet(JBOOS_EJB_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder,new File(ejb,"ejbModule"),new
AntCopyUtils.FileSetFileFilter(ejbSrcResourcesSet), viewFilterSetCollection, true);
//$NON-NLS-1$
+
+
+ //
********************************************************************************************
+ // Copy seam project indicator
+ //
********************************************************************************************
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"),
new File(ejb,"ejbModule/"), true); //$NON-NLS-1$ //$NON-NLS-2$
+
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new File(ejb,"ejbModule/"+project.getName()+"-ds.xml"),
//$NON-NLS-1$ //$NON-NLS-2$
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(
+ new File(seamGenResFolder,"META-INF/ejb-jar.xml"), //$NON-NLS-1$
+ new File(ejb,"ejbModule/META-INF/"), //$NON-NLS-1$
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePref,
+ new File(ejb,".settings"), //$NON-NLS-1$
+ new FilterSetCollection(projectFilterSet), true);
+
+ FilterSet ejbFilterSet = new FilterSet();
+ ejbFilterSet.addFilter("projectName",ejb.getName()); //$NON-NLS-1$
+
+ AntCopyUtils.copyFileToFile(
+ hibernateConsoleLaunchFile,
+ new File(ejb,ejb.getName()+".launch"), //$NON-NLS-1$
+ new FilterSetCollection(ejbFilterSet), true);
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePropsFile,
+ ejb,
+ hibernateDialectFilterSet, true);
+
+ File earContentsFolder = new File(ear,"EarContent"); //$NON-NLS-1$
+
+ FilterSet earFilterSet = new FilterSet();
+ earFilterSet.addFilter("projectName",ear.getName()+".ear");
//$NON-NLS-1$ //$NON-NLS-2$
+
+ /* jboss-app.xml not needed anymore AntCopyUtils.copyFileToFolder(
+ new File(seamGenResFolder,"META-INF/jboss-app.xml"), //$NON-NLS-1$
+ new File(earContentsFolder,"META-INF"), //$NON-NLS-1$
+ new FilterSetCollection(earFilterSet),true);*/
+
+ // Copy configuration files from template
+ AntCopyUtils.copyFilesAndFolders(
+ new
File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ear-seam2"),
//$NON-NLS-1$
+ ear, new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
+ new FilterSetCollection(filterSet), true);
+
+ // Fill ear contents
+ AntCopyUtils.copyFiles(seamHomeFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamHomeFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(droolsLibFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(droolsLibFolder)));
+ AntCopyUtils.copyFiles(seamLibFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamLibFolder)));
+ AntCopyUtils.copyFiles(seamGenResFolder,earContentsFolder,new
AntCopyUtils.FileSetFileFilter(new
AntCopyUtils.FileSet(JBOSS_EAR_CONTENT).dir(seamGenResFolder)));
+
+ try {
+
+ File[] earJars = earContentsFolder.listFiles(new FilenameFilter() {
+ /* (non-Javadoc)
+ * @see java.io.FilenameFilter#accept(java.io.File, java.lang.String)
+ */
+ public boolean accept(File dir, String name) {
+ if(name.lastIndexOf(".jar")>0) return true; //$NON-NLS-1$
+ return false;
+ }
+ });
+ String earJarsStr = ""; //$NON-NLS-1$
+ for (File file : earJars) {
+ earJarsStr +=" " + file.getName() +" \n"; //$NON-NLS-1$
//$NON-NLS-2$
+ }
+
+ FilterSetCollection manifestFilterCol = new FilterSetCollection(projectFilterSet);
+ FilterSet manifestFilter = new FilterSet();
+ manifestFilter.addFilter("earLibs",earJarsStr); //$NON-NLS-1$
+ manifestFilterCol.addFilterSet(manifestFilter);
+ AntCopyUtils.copyFileToFolder(new
File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"war/META-INF/MANIFEST.MF"),
webMetaInf, manifestFilterCol, true); //$NON-NLS-1$
+ File ejbMetaInf = new File(ejb,"ejbModule/META-INF"); //$NON-NLS-1$
+ AntCopyUtils.copyFileToFolder(new
File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"ejb/ejbModule/META-INF/MANIFEST.MF"),
ejbMetaInf, manifestFilterCol, true); //$NON-NLS-1$
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+
+ ClasspathHelper.addClasspathEntries(project, fv);
+
+ createSeamProjectPreferenes(project, model);
+
+
+ EclipseResourceUtil.addNatureToProject(project, ISeamProject.NATURE_ID);
+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ String wsPath = project.getLocation().removeLastSegments(1)
+ .toFile().getAbsoluteFile().getPath();
+
+ IWorkspaceRoot wsRoot = ResourcesPlugin.getWorkspace().getRoot();
+
+ if(!isWarConfiguration(model)) {
+
+ IProject ejbProjectToBeImported =
wsRoot.getProject(project.getName()+"-ejb");
+ ResourcesUtils.importExistingProject(ejbProjectToBeImported,
wsPath+"/"+project.getName()+"-ejb",
project.getName()+"-ejb");
+
+ IProject earProjectToBeImported =
wsRoot.getProject(project.getName()+"-ear");
+ ResourcesUtils.importExistingProject(earProjectToBeImported,
wsPath+"/"+project.getName()+"-ear",
project.getName()+"-ear");
+ }
+
+ IProject testProjectToBeImported =
wsRoot.getProject(project.getName()+"-test");
+ ResourcesUtils.importExistingProject(testProjectToBeImported,
wsPath+"/"+project.getName()+"-test",
project.getName()+"-test");
+
+ }
+
+
+
+ public static boolean isWarConfiguration(IDataModel model) {
+ return
"war".equals(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS));
//$NON-NLS-1$
+ }
+
+
+ /**
+ * @param project
+ * @param model
+ */
+ private void createSeamProjectPreferenes(final IProject project,
+ final IDataModel model) {
+ IScopeContext projectScope = new ProjectScope(project);
+ IEclipsePreferences prefs = projectScope.getNode(SeamCorePlugin.PLUGIN_ID);
+
+ prefs.put(JBOSS_AS_DEPLOY_AS, model.getProperty(JBOSS_AS_DEPLOY_AS).toString());
+
+ prefs.put(SEAM_RUNTIME_NAME, model.getProperty(SEAM_RUNTIME_NAME).toString());
+
+ prefs.put(SEAM_CONNECTION_PROFILE,model.getProperty(SEAM_CONNECTION_PROFILE).toString());
+
+ prefs.put(SESION_BEAN_PACKAGE_NAME,
model.getProperty(SESION_BEAN_PACKAGE_NAME).toString());
+
+ prefs.put(ENTITY_BEAN_PACKAGE_NAME,
model.getProperty(ENTITY_BEAN_PACKAGE_NAME).toString());
+
+ prefs.put(TEST_CASES_PACKAGE_NAME,
model.getProperty(TEST_CASES_PACKAGE_NAME).toString());
+
+ prefs.put(SEAM_TEST_PROJECT,
+ model.getProperty(SEAM_TEST_PROJECT)==null?
+ "":model.getProperty(SEAM_TEST_PROJECT).toString()); //$NON-NLS-1$
+
+ if(DEPLOY_AS_EAR.equals(model.getProperty(JBOSS_AS_DEPLOY_AS))) {
+ prefs.put(SEAM_EJB_PROJECT,
+ model.getProperty(SEAM_EJB_PROJECT)==null?
+ "":model.getProperty(SEAM_EJB_PROJECT).toString()); //$NON-NLS-1$
+
+ prefs.put(SEAM_EAR_PROJECT,
+ model.getProperty(SEAM_EAR_PROJECT)==null?
+ "":model.getProperty(SEAM_EAR_PROJECT).toString()); //$NON-NLS-1$
+ }
+
+ try {
+ prefs.flush();
+ } catch (BackingStoreException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+
+ private void createTestProject(IDataModel model, IProject seamWebProject, SeamRuntime
seamRuntime) {
+ String projectName =
model.getProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME).toString();
+ File testProjectDir = new
File(seamWebProject.getLocation().removeLastSegments(1).toFile(),projectName+"-test");
//$NON-NLS-1$
+ testProjectDir.mkdir();
+
+ IVirtualComponent component = ComponentCore.createComponent(seamWebProject);
+ IVirtualFolder webRootVirtFolder = component.getRootFolder().getFolder(new
Path("/")); //$NON-NLS-1$
+
+ File testLibDir = new File(testProjectDir,"lib"); //$NON-NLS-1$
+ File embededEjbDir = new File(testProjectDir,"bootstrap"); //$NON-NLS-1$
+ File testSrcDir = new File(testProjectDir,"test-src"); //$NON-NLS-1$
+ String seamGenResFolder = seamRuntime.getResourceTemplatesDir();
+ File persistenceFile = new File(seamGenResFolder ,"META-INF/persistence-" +
(isWarConfiguration(model)?TEST_WAR_PROFILE:TEST_EAR_PROFILE) + ".xml");
//$NON-NLS-1$ //$NON-NLS-2$
+ File jbossBeansFile = new File(seamGenResFolder
,"META-INF/jboss-beans.xml"); //$NON-NLS-1$
+ FilterSet filterSet = new FilterSet();
+ filterSet.addFilter("projectName", projectName); //$NON-NLS-1$
+ filterSet.addFilter("runtimeName",
WtpUtils.getServerRuntimeName(seamWebProject)); //$NON-NLS-1$
+ filterSet.addFilter("webRootFolder",webRootVirtFolder.getUnderlyingFolder().getLocation().lastSegment());
//$NON-NLS-1$
+
+ final SeamRuntime selectedRuntime =
SeamRuntimeManager.getInstance().findRuntimeByName(model.getProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME).toString());
+ final String seamHomePath = selectedRuntime.getHomeDir();
+
+ AntCopyUtils.FileSet includeLibs
+ = new AntCopyUtils.FileSet(JBOSS_TEST_LIB_FILESET)
+ .dir(new File(seamRuntime.getHomeDir(),"lib")); //$NON-NLS-1$
+ File[] libs = includeLibs.getDir().listFiles(new
AntCopyUtils.FileSetFileFilter(includeLibs));
+ StringBuffer testLibraries = new StringBuffer();
+
+ for (File file : libs) {
+ testLibraries.append("\t<classpathentry kind=\"lib\"
path=\"lib/" + file.getName() + "\"/>\n"); //$NON-NLS-1$
//$NON-NLS-2$
+ }
+
+ StringBuffer requiredProjects = new StringBuffer();
+ requiredProjects.append(
+ "\t<classpathentry combineaccessrules=\"false\"
kind=\"src\" path=\"/" + seamWebProject.getName() +
"\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
+ if(!isWarConfiguration(model)) {
+ requiredProjects.append(
+ "\n\t<classpathentry combineaccessrules=\"false\"
kind=\"src\" path=\"/" + seamWebProject.getName() +
"-ejb\"/>"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+ filterSet.addFilter("testLibraries",testLibraries.toString());
//$NON-NLS-1$
+ filterSet.addFilter("requiredProjects",requiredProjects.toString());
//$NON-NLS-1$
+ File testTemplateDir = null;
+ try {
+ testTemplateDir = new
File(SeamFacetInstallDataModelProvider.getTemplatesFolder(),"test");
//$NON-NLS-1$
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ return;
+ }
+ AntCopyUtils.FileSet excludeCvsSvn
+ = new AntCopyUtils.FileSet(CVS_SVN).dir(testTemplateDir);
+
+ AntCopyUtils.copyFilesAndFolders(
+ testTemplateDir,
+ testProjectDir,
+ new AntCopyUtils.FileSetFileFilter(excludeCvsSvn),
+ new FilterSetCollection(filterSet), true);
+
+ excludeCvsSvn.dir(new File(seamRuntime.getHomeDir(),"bootstrap"));
//$NON-NLS-1$
+ AntCopyUtils.copyFilesAndFolders(
+ new File(seamRuntime.getHomeDir(),"bootstrap"), //$NON-NLS-1$
+ embededEjbDir,
+ new AntCopyUtils.FileSetFileFilter(excludeCvsSvn), new FilterSetCollection(),
true);
+
+ AntCopyUtils.copyFileToFile(
+ persistenceFile,
+ new File(testProjectDir,"test-src/META-INF/persistence.xml"),
//$NON-NLS-1$
+ new FilterSetCollection(filterSet), true);
+
+ AntCopyUtils.copyFileToFolder(
+ jbossBeansFile,
+ new File(testProjectDir,"test-src/META-INF"), //$NON-NLS-1$
+ new FilterSetCollection(filterSet), true);
+
+ AntCopyUtils.copyFiles(
+ new File(seamRuntime.getHomeDir(),"lib"), //$NON-NLS-1$
+ testLibDir,
+ new AntCopyUtils.FileSetFileFilter(includeLibs));
+
+ createComponentsProperties(testSrcDir, "", Boolean.TRUE); //$NON-NLS-1$
+ }
+
+ /**
+ * @param seamGenResFolder
+ */
+ private void createComponentsProperties(final File seamGenResFolder, String projectName,
Boolean embedded) {
+ Properties components = new Properties();
+ String prefix =
"".equals(projectName)?"":projectName+"/"; //$NON-NLS-1$
//$NON-NLS-2$ //$NON-NLS-3$
+ components.put("embeddedEjb", embedded.toString()); //$NON-NLS-1$
+ components.put("jndiPattern", prefix+"#{ejbName}/local");
//$NON-NLS-1$ //$NON-NLS-2$
+ File componentsProps = new File(seamGenResFolder,"components.properties");
//$NON-NLS-1$
+ try {
+ componentsProps.createNewFile();
+ components.store(new FileOutputStream(componentsProps), ""); //$NON-NLS-1$
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.wst.common.project.facet.core.IActionConfigFactory#create()
+ */
+ public Object create() throws CoreException {
+ // TODO Auto-generated method stub
+ return null;
+ }
+}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetFilterSetFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetFilterSetFactory.java 2007-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetFilterSetFactory.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -42,7 +42,9 @@
PROJECT_TEMPLATE.addFilter("hbm2ddl","${hibernate.hbm2ddl.auto}");
//$NON-NLS-1$ //$NON-NLS-2$
PROJECT_TEMPLATE.addFilter("driverJar","${driver.file}");
//$NON-NLS-1$ //$NON-NLS-2$
PROJECT_TEMPLATE.addFilter("debug","true"); //$NON-NLS-1$
//$NON-NLS-2$
-
+ //todo: keep this local for seam2 ?
+ PROJECT_TEMPLATE.addFilter("skin","blueSky"); //$NON-NLS-1$
//$NON-NLS-2$
+
FILTERS_TEMPLATE = new FilterSet();
FILTERS_TEMPLATE.addFilter("interfaceName","${interface.name}");
//$NON-NLS-1$ //$NON-NLS-2$
FILTERS_TEMPLATE.addFilter("beanName","${bean.name}");
//$NON-NLS-1$ //$NON-NLS-2$
@@ -57,31 +59,32 @@
FILTERS_TEMPLATE.addFilter("listName","${component.name}List");
//$NON-NLS-1$ //$NON-NLS-2$
FILTERS_TEMPLATE.addFilter("homeName","${component.name}Home");
//$NON-NLS-1$ //$NON-NLS-2$
FILTERS_TEMPLATE.addFilter("query","${query.text}"); //$NON-NLS-1$
//$NON-NLS-2$
+
HIBERNATE_DIALECT_TEMPLATE = new FilterSet();
HIBERNATE_DIALECT_TEMPLATE.addFilter("hibernate.dialect","${hibernate.dialect}");
//$NON-NLS-1$ //$NON-NLS-2$
}
public static FilterSet createJdbcFilterSet(IDataModel values) {
- return aplayProperties((FilterSet)JDBC_TEMPLATE.clone(), values);
+ return applyProperties((FilterSet)JDBC_TEMPLATE.clone(), values);
}
public static FilterSet createProjectFilterSet(IDataModel values){
- return aplayProperties((FilterSet)PROJECT_TEMPLATE.clone(), values);
+ return applyProperties((FilterSet)PROJECT_TEMPLATE.clone(), values);
}
public static FilterSet createFiltersFilterSet(IDataModel values) {
- return aplayProperties((FilterSet)FILTERS_TEMPLATE.clone(), values);
+ return applyProperties((FilterSet)FILTERS_TEMPLATE.clone(), values);
}
public static FilterSet createHibernateDialectFilterSet(IDataModel values) {
- return aplayProperties((FilterSet)HIBERNATE_DIALECT_TEMPLATE.clone(), values);
+ return applyProperties((FilterSet)HIBERNATE_DIALECT_TEMPLATE.clone(), values);
}
public static FilterSet createFiltersFilterSet(Map values) {
- return aplayProperties((FilterSet)FILTERS_TEMPLATE.clone(), values);
+ return applyProperties((FilterSet)FILTERS_TEMPLATE.clone(), values);
}
- private static FilterSet aplayProperties(FilterSet template,IDataModel values) {
+ private static FilterSet applyProperties(FilterSet template,IDataModel values) {
FilterSet result = new FilterSet();
for (Object filter : template.getFilterHash().keySet()) {
String value = template.getFilterHash().get(filter).toString();
@@ -96,7 +99,7 @@
return result;
}
- private static FilterSet aplayProperties(FilterSet template,Map values) {
+ private static FilterSet applyProperties(FilterSet template,Map values) {
FilterSet result = new FilterSet();
for (Object filter : template.getFilterHash().keySet()) {
String value = template.getFilterHash().get(filter).toString();
Modified: trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-10-21 06:24:01 UTC (rev
4395)
+++ trunk/seam/plugins/org.jboss.tools.seam.ui/plugin.xml 2007-10-21 06:33:02 UTC (rev
4396)
@@ -96,6 +96,9 @@
point="org.eclipse.wst.common.project.facet.ui.wizardPages">
<wizard-pages action="jst.seam.1.2.install">
<page
class="org.jboss.tools.seam.ui.internal.project.facet.SeamInstallWizardPage"/>
+ </wizard-pages>
+ <wizard-pages action="jst.seam.2.0.install">
+ <page
class="org.jboss.tools.seam.ui.internal.project.facet.SeamInstallWizardPage"/>
</wizard-pages>
</extension>
<extension
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-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -34,6 +34,7 @@
import org.eclipse.jface.wizard.IWizard;
import org.eclipse.jface.wizard.Wizard;
import org.eclipse.jface.wizard.WizardDialog;
+import org.eclipse.jst.j2ee.internal.ejb.provider.HomeInterfaceProviderHelper;
import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
import org.eclipse.swt.SWT;
import org.eclipse.swt.layout.GridData;
@@ -283,7 +284,7 @@
}
public List<String> getRuntimeNames() {
- SeamRuntime[] rts =
SeamRuntimeManager.getInstance().getRuntimes(SeamVersion.SEAM_1_2);
+ SeamRuntime[] rts =
SeamRuntimeManager.getInstance().getRuntimes(/*SeamVersion.SEAM_1_2*/);
List<String> result = new ArrayList<String>();
for(SeamRuntime seamRuntime : rts) {
result.add(seamRuntime.getName());
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-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -38,6 +38,7 @@
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.ui.SeamUIMessages;
@@ -147,13 +148,26 @@
SeamUIMessages.VALIDATOR_FACTORY_SEAM_HOME_FOLDER_DOES_NOT_EXISTS);
return errors;
}
- File seamJarFile = new File(value.toString(), "jboss-seam.jar");
//$NON-NLS-1$
- if (!seamJarFile.isFile()) {
- errors = createErrorMap();
- errors.put(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME,
- SeamUIMessages.VALIDATOR_FACTORY_HOME_FOLDER_POINTS_TO +
- SeamUIMessages.VALIDATOR_FACTORY_LOCATION_THAT_DOES_NOT_LOOK_LIKE_SEAM_HOME_FOLDER);
- }
+ String version = (String) context;
+
+ if(version.startsWith("2.0")) {
+ File seamJarFile = new File(value.toString(), "lib/jboss-seam.jar");
//$NON-NLS-1$
+ if (!seamJarFile.isFile()) {
+ errors = createErrorMap();
+ errors.put(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME,
+ SeamUIMessages.VALIDATOR_FACTORY_HOME_FOLDER_POINTS_TO +
+ SeamUIMessages.VALIDATOR_FACTORY_LOCATION_THAT_DOES_NOT_LOOK_LIKE_SEAM_HOME_FOLDER);
+ }
+ } else {
+ File seamJarFile = new File(value.toString(), "jboss-seam.jar");
//$NON-NLS-1$
+ if (!seamJarFile.isFile()) {
+ errors = createErrorMap();
+ errors.put(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME,
+ SeamUIMessages.VALIDATOR_FACTORY_HOME_FOLDER_POINTS_TO +
+ SeamUIMessages.VALIDATOR_FACTORY_LOCATION_THAT_DOES_NOT_LOOK_LIKE_SEAM_HOME_FOLDER);
+ }
+ }
+
return errors;
}
};
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2007-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -319,7 +319,7 @@
IFieldEditor version = IFieldEditorFactory.INSTANCE.createComboEditor(
"version", SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_VERSION2,
Arrays.asList( //$NON-NLS-1$
- new Object[]{SeamVersion.SEAM_1_2.toString()}),
+ new String[]{SeamVersion.SEAM_1_2.toString(), SeamVersion.SEAM_2_0.toString()}),
SeamVersion.SEAM_1_2.toString(), false);
IFieldEditor homeDir = IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
@@ -393,13 +393,6 @@
return;
}
- Map errors = ValidatorFactory.JBOSS_SEAM_HOME_FOLDER_VALIDATOR.validate(
- homeDir.getValueAsString(), null);
- if( errors != ValidatorFactory.NO_ERRORS) {
- setErrorMessage(errors.get(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString());
- setPageComplete(false);
- return;
- }
String seamVersion = getSeamVersion(homeDir.getValueAsString());
if("".equals(seamVersion)) { //$NON-NLS-1$
setErrorMessage(SeamUIMessages.SEAM_RUNTIME_LIST_FIELD_EDITOR_CANNOT_OBTAIN_SEAM_VERSION_NUMBER);
@@ -411,12 +404,24 @@
return;
}
+ Map errors = ValidatorFactory.JBOSS_SEAM_HOME_FOLDER_VALIDATOR.validate(
+ homeDir.getValueAsString(), seamVersion);
+ if( errors != ValidatorFactory.NO_ERRORS) {
+ setErrorMessage(errors.get(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString());
+ setPageComplete(false);
+ return;
+ }
+
+
setErrorMessage(null);
setPageComplete(true);
}
public static String getSeamVersion(String path) {
File seamJarFile = new File(path, "jboss-seam.jar"); //$NON-NLS-1$
+ if(!seamJarFile.exists()) {
+ seamJarFile = new File(path, "lib/jboss-seam.jar"); // hack to make it work
for seam2
+ }
InputStream str=null;
ZipFile seamJar;
try {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2007-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseOperation.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -118,7 +118,7 @@
vars.put(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME, entityFolder);
List<String[]> fileMapping = getFileMappings(vars);
- List<String[]> fileMappingCopy = applayVariables(fileMapping,vars);
+ List<String[]> fileMappingCopy = applyVariables(fileMapping,vars);
FilterSetCollection filters = getFilterSetCollection(vars);
final File[] file = new File[fileMappingCopy.size()];
int index=0;
@@ -159,7 +159,7 @@
* @param vars
* @return
*/
- public static List<String[]> applayVariables(List<String[]> fileMapping,
+ public static List<String[]> applyVariables(List<String[]> fileMapping,
Map<String, Object> vars) {
List<String[]> result = new ArrayList<String[]>();
for (String[] filter : fileMapping) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizard.java 2007-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamBaseWizard.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -74,8 +74,10 @@
result = operationHistory.execute(operation, monitor, (IAdaptable)getPages()[0]);
} catch (ExecutionException e) {
result = new Status(IStatus.ERROR,SeamGuiPlugin.PLUGIN_ID,e.getMessage(),e);
+ SeamCorePlugin.getPluginLog().logError(e);
+ ErrorDialog.openError(Display.getCurrent().getActiveShell(), "Seam wizard
error", result.getMessage(), result);
}
-// ErrorDialog.openError(Display.getCurrent().getActiveShell(),
SeamUIMessages.SeamBaseWizard_0, result.getMessage(), result);
+ //ErrorDialog.openError(Display.getCurrent().getActiveShell(),
SeamUIMessages.SeamBaseWizard_0, result.getMessage(), result);
}
});
} catch (InvocationTargetException e) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2007-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -24,6 +24,7 @@
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.preferences.IEclipsePreferences;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
@@ -31,10 +32,12 @@
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.INewWizard;
import org.hibernate.eclipse.launch.HibernateLaunchConstants;
+import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamProjectsSet;
import org.jboss.tools.seam.core.SeamCorePlugin;
import org.jboss.tools.seam.core.project.facet.SeamRuntime;
import org.jboss.tools.seam.core.project.facet.SeamRuntimeManager;
+import org.jboss.tools.seam.core.project.facet.SeamVersion;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.ui.SeamUIMessages;
@@ -214,12 +217,27 @@
// destdir="${project.home}/src"
// foreach="entity"/>
+ IEclipsePreferences seamFacetPrefs = SeamCorePlugin.getSeamPreferences(project);
+ final String actionpackage =
seamFacetPrefs.get(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME, "");
+ final String actionDir = actionpackage.replace('.','/');
+
+ ISeamProject sprj = (ISeamProject)project.getNature(ISeamProject.NATURE_ID);
+ boolean seam2 = sprj.getRuntime().getVersion().equals(SeamVersion.SEAM_2_0);
+
hbmtemplateAttributes = new HashMap<String, String>();
- hbmtemplateAttributes.put("file_pattern",
"{package-name}/{class-name}List.java"); //$NON-NLS-1$ //$NON-NLS-2$
+
+ if(seam2) {
+ //Seam2: <property key="actionPackage"
value="${action.package}" />
+ hbmtemplateAttributes.put("actionPackage",actionpackage); //$NON-NLS-1$
//$NON-NLS-2$
+ hbmtemplateAttributes.put("file_pattern", actionDir +
"/{class-name}List.java"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ hbmtemplateAttributes.put("file_pattern",
"{package-name}/{class-name}List.java"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
hbmtemplateAttributes.put("template_name",
"src/EntityList.java.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
hbmtemplateAttributes.put("outputdir",seamProjectsSet.getActionsFolder().getFullPath().toString());
//$NON-NLS-1$
hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$
//$NON-NLS-2$
hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
//$NON-NLS-1$ //$NON-NLS-2$
+
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate6.properties", hbmtemplateAttributes); //$NON-NLS-1$
// <hbmtemplate filepattern="{class-name}List.page.xml"
@@ -242,7 +260,14 @@
// foreach="entity"/>
hbmtemplateAttributes = new HashMap<String, String>();
- hbmtemplateAttributes.put("file_pattern",
"{package-name}/{class-name}Home.java"); //$NON-NLS-1$ //$NON-NLS-2$
+ if(seam2) {
+ //Seam2: <property key="actionPackage"
value="${action.package}" />
+ hbmtemplateAttributes.put("actionPackage",actionpackage); //$NON-NLS-1$
//$NON-NLS-2$
+ hbmtemplateAttributes.put("file_pattern", actionDir +
"/{class-name}Home.java"); //$NON-NLS-1$ //$NON-NLS-2$
+ } else {
+ hbmtemplateAttributes.put("file_pattern",
"{package-name}/{class-name}Home.java"); //$NON-NLS-1$ //$NON-NLS-2$
+ }
+
hbmtemplateAttributes.put("template_name",
"src/EntityHome.java.ftl"); //$NON-NLS-1$ //$NON-NLS-2$
hbmtemplateAttributes.put("outputdir",seamProjectsSet.getActionsFolder().getFullPath().toString());
//$NON-NLS-1$
hbmtemplateAttributes.put("for_each", "entity"); //$NON-NLS-1$
//$NON-NLS-2$
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java 2007-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/SeamCoreAllTests.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -10,12 +10,13 @@
******************************************************************************/
package org.jboss.tools.seam.core.test;
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+import org.jboss.tools.seam.core.test.project.facet.Seam2FacetInstallDelegateTest;
import org.jboss.tools.seam.core.test.project.facet.SeamFacetInstallDelegateTest;
import org.jboss.tools.seam.core.test.project.facet.SeamRuntimeListConverterTest;
import org.jboss.tools.seam.core.test.project.facet.SeamRuntimeManagerTest;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
/**
* @author V.Kabanovich
*
@@ -32,6 +33,7 @@
suite.addTestSuite(SeamRuntimeManagerTest.class);
suite.addTestSuite(SeamFacetInstallDelegateTest.class);
+ suite.addTestSuite(Seam2FacetInstallDelegateTest.class);
return suite;
}
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2007-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/AbstractSeamFacetTest.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -73,16 +73,24 @@
}
protected void tearDown()
- throws CoreException
+ throws Exception
{
+ Exception last = null;
for (IResource r : this.resourcesToCleanup) {
- r.delete(true, null);
+ try {
+ r.delete(true, null);
+ } catch(Exception e) {
+ e.printStackTrace();
+ last = e;
+ }
}
for (Runnable runnable : this.tearDownOperations) {
runnable.run();
}
+
+ if(last!=null) throw last;
}
protected final void addResourceToCleanup(final IResource resource) {
@@ -106,28 +114,7 @@
return fpj;
}
- protected IFacetedProject createSeamWarProject() throws CoreException {
- final IFacetedProject fproj = ProjectFacetsManager.create("seam12Project",
null,
- null);
- installDependentFacets(fproj);
-
- IDataModel config = createSeamDataModel("war");
-
- fproj.installProjectFacet(seamFacetVersion, config, null);
-
- final IProject proj = fproj.getProject();
-
- assertNotNull(proj);
- assertTrue(proj.exists());
-
- assertTrue(proj.getWorkspace().getRoot().getProject(proj.getName() +
"-test").exists());
-
- this.resourcesToCleanup.add(proj);
-
- return fproj;
- }
-
protected IDataModel createSeamDataModel(String deployType) {
IDataModel config = (IDataModel) new SeamFacetInstallDataModelProvider().create();
config.setStringProperty(ISeamFacetDataModelProperties.SEAM_RUNTIME_NAME, SEAM_1_2_0);
@@ -148,34 +135,58 @@
fproj.installProjectFacet(javaFacesVersion, null, null);
}
- protected IFacetedProject createSeamEarProject() throws CoreException {
- final IFacetedProject fproj = ProjectFacetsManager.create("seamear12Project",
null,
+ protected IFacetedProject createSeamProject(String baseProjectName, IDataModel config)
throws CoreException {
+ final IFacetedProject fproj = ProjectFacetsManager.create(baseProjectName, null,
null);
installDependentFacets(fproj);
- IDataModel config = createSeamDataModel("ear");
+ fproj.installProjectFacet(getSeamFacetVersion(), config, null);
- fproj.installProjectFacet(seamFacetVersion, config, null);
+ return fproj;
+ }
+
+ protected IFacetedProject createSeamWarProject(String name) throws CoreException {
+ final IFacetedProject fproj = createSeamProject(name,
createSeamDataModel("war"));
final IProject proj = fproj.getProject();
+
assertNotNull(proj);
+ assertTrue(proj.exists());
+
+ /*assertTrue(proj.getWorkspace().getRoot().getProject(proj.getName() +
"-test").exists());
+ IProject testProject = proj.getWorkspace().getRoot().getProject(proj.getName() +
"-test");
+ this.resourcesToCleanup.add(testProject);*/
+ this.resourcesToCleanup.add(proj);
+
+ return fproj;
+ }
+
+ protected IFacetedProject createSeamEarProject(String name) throws CoreException {
+ final IFacetedProject fproj = createSeamProject(name,
createSeamDataModel("ear"));
- IProject testProject = proj.getWorkspace().getRoot().getProject(proj.getName() +
"-test");
+ final IProject proj = fproj.getProject();
+ assertNotNull(proj);
+
+ //IProject testProject = proj.getWorkspace().getRoot().getProject(proj.getName() +
"-test");
IProject ejbProject = proj.getWorkspace().getRoot().getProject(proj.getName() +
"-ejb");
IProject earProject = proj.getWorkspace().getRoot().getProject(proj.getName() +
"-ear");
this.resourcesToCleanup.add(proj);
- this.resourcesToCleanup.add(testProject);
+ //this.resourcesToCleanup.add(testProject);
this.resourcesToCleanup.add(ejbProject);
this.resourcesToCleanup.add(earProject);
assertTrue(proj.exists());
- assertTrue(testProject.exists());
+ //assertTrue(testProject.exists());
assertTrue(ejbProject.exists());
assertTrue(earProject.exists());
return fproj;
}
+
+ protected IProjectFacetVersion getSeamFacetVersion() {
+ return seamFacetVersion;
+ }
}
\ No newline at end of file
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegateTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegateTest.java 2007-10-21
06:24:01 UTC (rev 4395)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegateTest.java 2007-10-21
06:33:02 UTC (rev 4396)
@@ -13,7 +13,9 @@
import java.io.IOException;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
public class SeamFacetInstallDelegateTest extends AbstractSeamFacetTest {
@@ -21,18 +23,26 @@
super(name);
}
- public void testCreateWarFromScratch() throws CoreException, IOException {
+ public void testCreateWar() throws CoreException, IOException {
- final IFacetedProject fproj = createSeamWarProject();
+ final IFacetedProject fproj = createSeamWarProject("seamwar");
}
- public void testCreateEarFromScratch() throws CoreException, IOException {
+ public void testCreateEar() throws CoreException, IOException {
- final IFacetedProject fproj = createSeamEarProject();
+ final IFacetedProject fproj = createSeamEarProject("seamear");
+ }
+
+ public void testCreateCustomProject() throws CoreException, IOException {
+
+ IDataModel createSeamDataModel = createSeamDataModel("war");
+ createSeamDataModel.setProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME,
"x.y.z");
-
+ final IFacetedProject fproj =
createSeamProject("customProject",createSeamDataModel);
+
+ assertTrue(fproj.getProject().findMember("src/action/x/y/z").exists());
+
}
-
}