Author: dgolovin
Date: 2007-07-11 03:43:51 -0400 (Wed, 11 Jul 2007)
New Revision: 2379
Added:
trunk/releng/.project
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java
Removed:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java
Modified:
trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
trunk/seam/plugins/org.jboss.tools.seam.core/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/SwtFieldEditorFactory.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegeteTest.java
Log:
http://jira.jboss.org/jira/browse/EXIN-221
Added: trunk/releng/.project
===================================================================
--- trunk/releng/.project (rev 0)
+++ trunk/releng/.project 2007-07-11 07:43:51 UTC (rev 2379)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>releng</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ </buildSpec>
+ <natures>
+ </natures>
+</projectDescription>
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-07-11 06:43:31
UTC (rev 2378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/META-INF/MANIFEST.MF 2007-07-11 07:43:51
UTC (rev 2379)
@@ -26,9 +26,11 @@
org.jboss.tools.seam.internal.core.scanner
Bundle-Version: 2.0.0
Export-Package: org.jboss.tools.seam.core,
- org.jboss.tools.seam.core.internal.project.facet,
+ org.jboss.tools.seam.core.event,
org.jboss.tools.seam.internal.core,
+ org.jboss.tools.seam.internal.core.project.facet,
org.jboss.tools.seam.internal.core.scanner,
org.jboss.tools.seam.internal.core.scanner.java,
org.jboss.tools.seam.internal.core.scanner.lib,
- org.jboss.tools.seam.internal.core.scanner.xml
+ org.jboss.tools.seam.internal.core.scanner.xml,
+ org.jboss.tools.seam.internal.core.validation
Modified: trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml
===================================================================
--- trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-11 06:43:31 UTC (rev
2378)
+++ trunk/seam/plugins/org.jboss.tools.seam.core/plugin.xml 2007-07-11 07:43:51 UTC (rev
2379)
@@ -83,10 +83,10 @@
type="install"
version="2.0">
<delegate
-
class="org.jboss.tools.seam.core.internal.project.facet.SeamFacetInstallDelegete">
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegete">
</delegate>
<config-factory
-
class="org.jboss.tools.seam.core.internal.project.facet.SeamFacetInstallDataModelProvider">
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDataModelProvider">
</config-factory>
</action>
<action
@@ -95,7 +95,7 @@
type="uninstall"
version="2.0">
<delegate
-
class="org.jboss.tools.seam.core.internal.project.facet.SeamFacetUninstallDelegate">
+
class="org.jboss.tools.seam.internal.core.project.facet.SeamFacetUninstallDelegate">
</delegate>
</action>
</extension>
Copied:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet
(from rev 2334,
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet)
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java 2007-07-05
18:06:31 UTC (rev 2334)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.core.internal.project.facet;
-import java.io.File;
-import java.io.IOException;
-import java.util.Properties;
-
-import org.apache.tools.ant.Project;
-import org.apache.tools.ant.types.FilterSet;
-import org.apache.tools.ant.types.FilterSetCollection;
-import org.apache.tools.ant.types.Resource;
-import org.apache.tools.ant.types.resources.FileResource;
-import org.apache.tools.ant.util.FileUtils;
-import org.apache.tools.ant.util.ResourceUtils;
-import
org.jboss.tools.seam.core.internal.project.facet.SeamFacetInstallDelegete.FileSetFileFilter;
-import org.jboss.tools.seam.core.SeamCorePlugin;
-
-/**
- *
- * @author eskimo
- *
- */
-public class AntCopyUtils {
-
- public static void copyFilesAndFolders(File sourceFolder, File destinationFolder,
FilterSetCollection set, boolean override) {
- copyFilesAndFolders(sourceFolder, destinationFolder, null, set, override);
- }
-
- public static void copyFilesAndFolders(File sourceFolder, File destinationFolder,
- FileSetFileFilter fileSetFilter,
- FilterSetCollection filterSetCollection, boolean override) {
- if(!destinationFolder.exists())
- destinationFolder.mkdirs();
- File[] files =
fileSetFilter==null?sourceFolder.listFiles():sourceFolder.listFiles(fileSetFilter);
- for (File file : files) {
- if(file.isDirectory()) {
- copyFilesAndFolders(file,new
File(destinationFolder,file.getName()),fileSetFilter,filterSetCollection,override);
- } else {
- try {
- FileUtils.getFileUtils().copyFile(file, new
File(destinationFolder,file.getName()),filterSetCollection,override);
- } catch (IOException e) {
- e.printStackTrace();
- SeamCorePlugin.getPluginLog().logError(e);
- }
- }
- }
- }
-
- public static void copyFile(File source, File dest, boolean override) {
- copyFileToFolder(source, new File(dest,source.getName()),new
FilterSetCollection(),override);
- }
-
- public static void copyFileToFolder(File source, File dest, FilterSetCollection
filterSetCollection, boolean override ) {
- try {
- FileUtils.getFileUtils().copyFile(source, new
File(dest,source.getName()),filterSetCollection,override);
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- }
- public static void copyFileToFile(File source, File dest, FilterSetCollection
filterSetCollection, boolean override ) {
- try {
- FileUtils.getFileUtils().copyFile(source, dest,filterSetCollection,override);
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- }
-}
Copied:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
(from rev 2377,
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/AntCopyUtils.java)
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/AntCopyUtils.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.project.facet;
+import java.io.File;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.tools.ant.Project;
+import org.apache.tools.ant.types.FilterSet;
+import org.apache.tools.ant.types.FilterSetCollection;
+import org.apache.tools.ant.types.Resource;
+import org.apache.tools.ant.types.resources.FileResource;
+import org.apache.tools.ant.util.FileUtils;
+import org.apache.tools.ant.util.ResourceUtils;
+import org.jboss.tools.seam.core.SeamCorePlugin;
+import
org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegete.FileSetFileFilter;
+
+/**
+ *
+ * @author eskimo
+ *
+ */
+public class AntCopyUtils {
+
+ public static void copyFilesAndFolders(File sourceFolder, File destinationFolder,
FilterSetCollection set, boolean override) {
+ copyFilesAndFolders(sourceFolder, destinationFolder, null, set, override);
+ }
+
+ public static void copyFilesAndFolders(File sourceFolder, File destinationFolder,
+ FileSetFileFilter fileSetFilter,
+ FilterSetCollection filterSetCollection, boolean override) {
+ File[] files =
fileSetFilter==null?sourceFolder.listFiles():sourceFolder.listFiles(fileSetFilter);
+ for (File file : files) {
+ if(file.isDirectory()) {
+ copyFilesAndFolders(file,new
File(destinationFolder,file.getName()),fileSetFilter,filterSetCollection,override);
+ } else {
+ try {
+ if(!destinationFolder.exists())
+ destinationFolder.mkdirs();
+ FileUtils.getFileUtils().copyFile(file, new
File(destinationFolder,file.getName()),filterSetCollection,override);
+ } catch (IOException e) {
+ e.printStackTrace();
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ }
+ }
+
+ public static void copyFileToFolder(File source, File dest, boolean override) {
+ copyFileToFolder(source, dest,new FilterSetCollection(),override);
+ }
+
+ public static void copyFileToFolder(File source, File dest, FilterSetCollection
filterSetCollection, boolean override ) {
+ try {
+ FileUtils.getFileUtils().copyFile(source, new
File(dest,source.getName()),filterSetCollection,override);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ public static void copyFileToFile(File source, File dest, FilterSetCollection
filterSetCollection, boolean override ) {
+ try {
+ FileUtils.getFileUtils().copyFile(source, dest,filterSetCollection,override);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+}
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/ISeamCoreConstants.java 2007-07-05
18:06:31 UTC (rev 2334)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -1,18 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.seam.core.internal.project.facet;
-
-public interface ISeamCoreConstants {
-
- public static final String SEAM_CORE_FACET_ID = "jst.seam";
-
-}
Copied:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java
(from rev 2377,
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/ISeamCoreConstants.java)
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamCoreConstants.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.seam.internal.core.project.facet;
+
+public interface ISeamCoreConstants {
+
+ public static final String SEAM_CORE_FACET_ID = "jst.seam";
+
+}
Deleted:
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/core/internal/project/facet/ISeamFacetDataModelProperties.java 2007-07-05
18:06:31 UTC (rev 2334)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-
-package org.jboss.tools.seam.core.internal.project.facet;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-
-/**
- * Seam facet properties
- * @author eskimo
- *
- */
-public interface ISeamFacetDataModelProperties extends IActionConfigFactory {
-
- public static final String PREFIX = "ISeamFacetDataModelProperties.";
-
- public static final String SEAM_PROJECT_NAME = "project.name";
-
- public static final String JBOSS_AS_HOME = "jboss.home";
-
- public static final String JBOSS_AS_DEPLOY_AS = "JBOSS_AS_DEPLOY_AS";
-
- public static final String DB_TYPE = "database.type";
-
- public static final String HIBERNATE_DIALECT = "hibernate.dialect";
-
- public static final String JDBC_DRIVER_CLASS_NAME =
"hibernate.connection.driver_class";
-
- public static final String JDBC_URL_FOR_DB = "hibernate.connection.url";
-
- public static final String DB_USER_NAME = "hibernate.connection.username";
-
- public static final String DB_USERP_PASSWORD =
"hibernate.connection.password";
-
- public static final String DB_SCHEMA_NAME = "schema.property";
-
- public static final String DB_CATALOG_NAME = "catalog.property";
-
- public static final String DB_ALREADY_EXISTS = "database.exists";
-
- public static final String RECREATE_TABLES_AND_DATA_ON_DEPLOY =
"database.drop";
-
- public static final String JDBC_DRIVER_JAR_PATH = "driver.file";
-
- public static final String SESION_BEAN_PACKAGE_NAME = "action.package";
-
- public static final String ENTITY_BEAN_PACKAGE_NAME = "model.package";
-
- public static final String TEST_CASES_PACKAGE_NAME = "test.package";
-
- public static final String JBOSS_SEAM_HOME = "JBOSS_SEAM_HOME";
-
- public static final String WEB_CONTENTS_FOLDER = PREFIX +
"WEB_CONTENTS_FOLDER";
-
-}
Copied:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
(from rev 2377,
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/ISeamFacetDataModelProperties.java)
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/ISeamFacetDataModelProperties.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+
+package org.jboss.tools.seam.internal.core.project.facet;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+
+/**
+ * Seam facet properties
+ * @author eskimo
+ *
+ */
+public interface ISeamFacetDataModelProperties extends IActionConfigFactory {
+
+ public static final String PREFIX = "ISeamFacetDataModelProperties.";
+
+ public static final String SEAM_PROJECT_NAME = "project.name";
+
+ public static final String JBOSS_AS_HOME = "jboss.home";
+
+ public static final String JBOSS_AS_DEPLOY_AS = "JBOSS_AS_DEPLOY_AS";
+
+ public static final String DB_TYPE = "database.type";
+
+ public static final String HIBERNATE_DIALECT = "hibernate.dialect";
+
+ public static final String JDBC_DRIVER_CLASS_NAME =
"hibernate.connection.driver_class";
+
+ public static final String JDBC_URL_FOR_DB = "hibernate.connection.url";
+
+ public static final String DB_USER_NAME = "hibernate.connection.username";
+
+ public static final String DB_USERP_PASSWORD =
"hibernate.connection.password";
+
+ public static final String DB_SCHEMA_NAME = "schema.property";
+
+ public static final String DB_CATALOG_NAME = "catalog.property";
+
+ public static final String DB_ALREADY_EXISTS = "database.exists";
+
+ public static final String RECREATE_TABLES_AND_DATA_ON_DEPLOY =
"database.drop";
+
+ public static final String JDBC_DRIVER_JAR_PATH = "driver.file";
+
+ public static final String SESION_BEAN_PACKAGE_NAME = "action.package";
+
+ public static final String ENTITY_BEAN_PACKAGE_NAME = "model.package";
+
+ public static final String TEST_CASES_PACKAGE_NAME = "test.package";
+
+ public static final String JBOSS_SEAM_HOME = "JBOSS_SEAM_HOME";
+
+ public static final String WEB_CONTENTS_FOLDER = PREFIX +
"WEB_CONTENTS_FOLDER";
+
+}
Deleted:
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/core/internal/project/facet/SeamFacetInstallDataModelProvider.java 2007-07-05
18:06:31 UTC (rev 2334)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.core.internal.project.facet;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-
-/**
- * Data model provider for Seam facet wizard page
- * @author eskimo
- *
- */
-public class SeamFacetInstallDataModelProvider extends
- FacetInstallDataModelProvider implements ISeamFacetDataModelProperties {
-
- public static final Map<String,String[]> SEAM_LIBRARIES= new
HashMap<String,String[]>();
-
- static {
- SEAM_LIBRARIES.put("1.2",new String[] {
- });
- }
- /**
- * Returns set of facet properties for facet wizard page
- */
- @Override
- public Set getPropertyNames() {
- Set<String> names = super.getPropertyNames();
-
- // General group
- names.add(ISeamFacetDataModelProperties.JBOSS_AS_HOME);
- names.add(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME);
- names.add(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS);
-
- // Database group
- names.add(ISeamFacetDataModelProperties.DB_TYPE);
- names.add(ISeamFacetDataModelProperties.HIBERNATE_DIALECT);
- names.add(ISeamFacetDataModelProperties.JDBC_DRIVER_CLASS_NAME);
- names.add(ISeamFacetDataModelProperties.JDBC_URL_FOR_DB);
-
- names.add(ISeamFacetDataModelProperties.DB_USER_NAME);
- names.add(ISeamFacetDataModelProperties.DB_USERP_PASSWORD);
- names.add(ISeamFacetDataModelProperties.DB_SCHEMA_NAME);
- names.add(ISeamFacetDataModelProperties.DB_CATALOG_NAME);
-
- names.add(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
- names.add(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
-
- names.add(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
-
- // Code generation group
- names.add(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME);
- names.add(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME);
- names.add(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME);
- names.add(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER);
- names.add(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME);
-
- return names;
- }
-
- /**
- * Returns default value for a given property
- */
- public Object getDefaultProperty(String propertyName) {
- if(JBOSS_AS_HOME.equals(propertyName)) {
- return "Jboss_AS_HOME";
- }else if(JBOSS_AS_DEPLOY_AS.equals(propertyName)) {
- return "Jboos_DEPLOY_AS";
- }else if (propertyName.equals(FACET_ID)) {
- return ISeamCoreConstants.SEAM_CORE_FACET_ID;
- }
- return super.getDefaultProperty(propertyName);
- }
-}
Copied:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
(from rev 2377,
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDataModelProvider.java)
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDataModelProvider.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -0,0 +1,85 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.project.facet;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Set;
+
+import org.eclipse.wst.common.componentcore.datamodel.FacetInstallDataModelProvider;
+import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
+
+/**
+ * Data model provider for Seam facet wizard page
+ * @author eskimo
+ *
+ */
+public class SeamFacetInstallDataModelProvider extends
+ FacetInstallDataModelProvider implements ISeamFacetDataModelProperties {
+
+ public static final Map<String,String[]> SEAM_LIBRARIES= new
HashMap<String,String[]>();
+
+ static {
+ SEAM_LIBRARIES.put("1.2",new String[] {
+ });
+ }
+ /**
+ * Returns set of facet properties for facet wizard page
+ */
+ @Override
+ public Set getPropertyNames() {
+ Set<String> names = super.getPropertyNames();
+
+ // General group
+ names.add(ISeamFacetDataModelProperties.JBOSS_AS_HOME);
+ names.add(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME);
+ names.add(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS);
+
+ // Database group
+ names.add(ISeamFacetDataModelProperties.DB_TYPE);
+ names.add(ISeamFacetDataModelProperties.HIBERNATE_DIALECT);
+ names.add(ISeamFacetDataModelProperties.JDBC_DRIVER_CLASS_NAME);
+ names.add(ISeamFacetDataModelProperties.JDBC_URL_FOR_DB);
+
+ names.add(ISeamFacetDataModelProperties.DB_USER_NAME);
+ names.add(ISeamFacetDataModelProperties.DB_USERP_PASSWORD);
+ names.add(ISeamFacetDataModelProperties.DB_SCHEMA_NAME);
+ names.add(ISeamFacetDataModelProperties.DB_CATALOG_NAME);
+
+ names.add(ISeamFacetDataModelProperties.DB_ALREADY_EXISTS);
+ names.add(ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY);
+
+ names.add(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH);
+
+ // Code generation group
+ names.add(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME);
+ names.add(ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_NAME);
+ names.add(ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_NAME);
+ names.add(ISeamFacetDataModelProperties.WEB_CONTENTS_FOLDER);
+ names.add(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME);
+
+ return names;
+ }
+
+ /**
+ * Returns default value for a given property
+ */
+ public Object getDefaultProperty(String propertyName) {
+ if(JBOSS_AS_HOME.equals(propertyName)) {
+ return "Jboss_AS_HOME";
+ }else if(JBOSS_AS_DEPLOY_AS.equals(propertyName)) {
+ return "Jboos_DEPLOY_AS";
+ }else if (propertyName.equals(FACET_ID)) {
+ return ISeamCoreConstants.SEAM_CORE_FACET_ID;
+ }
+ return super.getDefaultProperty(propertyName);
+ }
+}
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java 2007-07-05
18:06:31 UTC (rev 2334)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -1,345 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.core.internal.project.facet;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.regex.Pattern;
-
-import org.apache.tools.ant.types.FilterSet;
-import org.apache.tools.ant.types.FilterSetCollection;
-import org.apache.tools.ant.util.FileUtils;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-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.jboss.tools.seam.core.SeamCorePlugin;
-
-public class SeamFacetInstallDelegete extends Object implements IDelegate {
-
- public static String PROFILE = "dev-war";
-
- public static FileSet VIEW_FILESET = new FileSet()
- .include("home\\.xhtml")
- .include("error\\.xhtml")
- .include("login\\.xhtml")
- .include("login\\.page.xml")
- .include("index\\.html")
- .include("layout")
- .include("layout/.*")
- .include("stylesheet/.*")
- .include("img/.*")
- .include("img")
- .exclude(".*/.*\\.ftl");
-
- public static FileSet SEAM_JARS = new FileSet()
- .include("jboss-seam.*\\.jar")
- .exclude("jboss-seam-gen\\.jar");
-
- public static FileSet JAVA_LIBS = new FileSet()
- .include(".[^/]*\\.jar")
- .include(".[^/]*\\.zip");
-
- public static FileSet JBOOS_WAR_RESOURCE_SET1 = new FileSet()
- .include("META-INF/jboss-beans\\.xml")
- .include("WEB-INF/pages\\.xml")
- .include("WEB-INF/faces-config\\.xml")
- .include("WEB-INF/web\\.xml");
-
- public static FileSet JBOOS_JAR_RESOURCE_SET1 = new FileSet()
- .include("META-INF/ejb-jar\\.xml")
- .include("META-INF/persistence-" + PROFILE + "\\.xml" )
- .include("import-" + PROFILE + "\\.sql");
-
-
- public static String DROOLS_LIB_SEAM_RELATED_PATH = "drools/lib";
-
- public static String SEAM_LIB_RELATED_PATH = "lib";
-
- public static String WEB_LIBRARIES_RELATED_PATH = "WEB-INF/lib";
-
- public void execute(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
- IDataModel model = (IDataModel)config;
-
- // get WebContents folder path from DWP model
- WebArtifactEdit edit =
- WebArtifactEdit.getWebArtifactEditForRead(project);
- IVirtualComponent com = ComponentCore.createComponent(project);
- IVirtualFolder webRootFolder = com.getRootFolder().getFolder(new Path("/"));
- IContainer folder = webRootFolder.getUnderlyingFolder();
-
- File webContentFolder = folder.getLocation().toFile();
-
- model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
-
- String seamHomePath =
model.getProperty(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString();
- File seamHomeFolder = new File(seamHomePath);
- File seamLibFolder = new File(seamHomePath,SEAM_LIB_RELATED_PATH);
- File seamGenResFolder = new File(seamHomePath,"seam-gen/resources");
- File droolsLibFolder = new File(seamHomePath,DROOLS_LIB_SEAM_RELATED_PATH);
- File seamGenViewSource = new File(seamHomePath,"seam-gen/view");
- File jdbcDriverFile = new
File(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH).toString());
- File hibernateConsoleLaunchFile = new File(seamHomeFolder,
"seam-gen/hibernatetools/hibernate-console.launch");
- File hibernateConsolePropsFile = new File(seamHomeFolder,
"seam-gen/hibernatetools/hibernate-console.properties");
-
-
-
- FilterSet jdbcFilterSet = FilterSetFactory.createJdbcFilterSet(model);
- FilterSet projectFilterSet = FilterSetFactory.createProjectFilterSet(model);
-
- // ****************************************************************
- // Copy view folder from seam-gen installation to WebContent folder
- // ****************************************************************
-
- FileSet viewFileSet = new FileSet(VIEW_FILESET).dir(seamGenViewSource);
- FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
- viewFilterSetCollection.addFilterSet(jdbcFilterSet);
- viewFilterSetCollection.addFilterSet(projectFilterSet);
- AntCopyUtils.copyFilesAndFolders(
- seamGenViewSource, webContentFolder, new FileSetFileFilter(viewFileSet),
viewFilterSetCollection, true);
-
- // *******************************************************************
- // Copy manifest and configuration resources the same way as view
- // *******************************************************************
-
- FileSet res1FileSet = new FileSet(JBOOS_WAR_RESOURCE_SET1).dir(seamGenResFolder);
- AntCopyUtils.copyFilesAndFolders(
- seamGenResFolder,webContentFolder,new FileSetFileFilter(res1FileSet),
viewFilterSetCollection, true);
-
- AntCopyUtils.copyFileToFile(
- hibernateConsoleLaunchFile,
- new File(project.getLocation().toFile(),project.getName()+".launch"),
- new FilterSetCollection(projectFilterSet), true);
-
- FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
- hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
- hibernateDialectFilterSet.addFilterSet(projectFilterSet);
- hibernateDialectFilterSet.addFilterSet(FilterSetFactory.createHibernateDialectFilterSet(model));
-
- AntCopyUtils.copyFileToFolder(
- hibernateConsolePropsFile,
- project.getLocation().toFile(),
- hibernateDialectFilterSet, true);
-
- // TODO add copy for /hibernatetools/seam-gen.reveng.xml
-
- // *************************************
- // TODO modify existing faces-config.xml
- // *************************************
-
-
- //
********************************************************************************************
- // TODO copy libraries/link libraries (seam jars, seam dependencies jars, drols jars,
jdbc jar)
- //
********************************************************************************************
-
- File webLibFolder = new File(webContentFolder,WEB_LIBRARIES_RELATED_PATH);
- copyFiles(seamHomeFolder,webLibFolder,new FileSetFileFilter(new
FileSet(SEAM_JARS).dir(seamHomeFolder)));
- copyFiles(seamLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(SEAM_JARS).dir(seamLibFolder)));
- copyFiles(droolsLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(SEAM_JARS).dir(droolsLibFolder)));
-
- if(jdbcDriverFile.exists())
- AntCopyUtils.copyFile(jdbcDriverFile, webLibFolder, true);
-
- // TODO generate db support as seam-gen does
-
- // TODO may be generate RHDS studio feature to show it on projects view
-
- // TODO say JBoss AS adapter what kind of deployment to use
-
- // TODO generate build.xml
-
- project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
- }
-
- public static void copyFiles(File source, File dest, FileFilter filter) {
- dest.mkdir();
- for (File file:source.listFiles(filter)) {
- try {
- FileUtils.getFileUtils().copyFile(file, new File(dest,file.getName()),new
FilterSetCollection(),true);
- } catch (IOException e) {
- SeamCorePlugin.getPluginLog().logError(e);
- }
- }
- }
-
- public static class FileSet {
-
- File dir = null;
-
- List<Pattern> include = new ArrayList<Pattern>();
-
- List<Pattern> exclude = new ArrayList<Pattern>();
-
- public FileSet(String dir) {
- this.dir = new File(dir);
- }
-
- public FileSet(File dir) {
- this.dir = dir;
- }
-
- public FileSet(FileSet template) {
- include.addAll(template.getIncluded());
- exclude.addAll(template.getExcluded());
- }
-
- public FileSet() {
-
- }
-
- public FileSet dir(String dir) {
- this.dir = new File(dir);
- return this;
- }
-
- public FileSet dir(File dir) {
- this.dir = dir;
- return this;
- }
-
- public FileSet include(String pattern) {
- include.add(Pattern.compile(pattern));
- return this;
-
- }
-
- public FileSet exclude(String pattern) {
- exclude.add(Pattern.compile(pattern));
- return this;
- }
-
- public boolean isIncluded(String file) {
- int i = dir.getAbsolutePath().length()+1;
- String relatedPath = file.substring(i);
- if(new File(file).isDirectory())return true;
- for (Pattern pattern : include) {
- if(pattern.matcher(relatedPath.replace('\\', '/')).matches() ) {
- return !isExcluded(relatedPath);
- }
- }
- return false;
- }
-
- public boolean isExcluded(String file){
- for (Pattern pattern : exclude) {
- if(pattern.matcher(file.replace('\\', '/')).matches()) return true;
- }
- return false;
- }
-
- public List<Pattern> getExcluded() {
- return Collections.unmodifiableList(exclude);
- }
-
- public List<Pattern> getIncluded() {
- return Collections.unmodifiableList(include);
- }
- }
-
- public static class FileSetFileFilter implements FileFilter {
-
- FileSet set;
- public FileSetFileFilter(FileSet set) {
- this.set = set;
- }
-
- public boolean accept(File pathname){
- return set.isIncluded(pathname.getAbsolutePath());
- }
- }
-
- public static class FilterSetFactory {
-
- public static FilterSet JDBC_TEMPLATE;
- public static FilterSet PROJECT_TEMPLATE;
- public static FilterSet FILTERS_TEMPLATE;
- public static FilterSet HIBERNATE_DIALECT_TEMPLATE;
-
- static {
- JDBC_TEMPLATE = new FilterSet();
- JDBC_TEMPLATE.addFilter("jdbcUrl","${hibernate.connection.url}");
- JDBC_TEMPLATE.addFilter("driverClass","${hibernate.connection.driver_class}");
- JDBC_TEMPLATE.addFilter("username","${hibernate.connection.username}");
- JDBC_TEMPLATE.addFilter("password","${hibernate.connection.password}");
- JDBC_TEMPLATE.addFilter("catalogProperty","${catalog.property}");
- JDBC_TEMPLATE.addFilter("schemaProperty","${schema.property}");
-
- PROJECT_TEMPLATE = new FilterSet();
- PROJECT_TEMPLATE.addFilter("projectName","${project.name}");
- PROJECT_TEMPLATE.addFilter("jbossHome","${jboss.home}");
- PROJECT_TEMPLATE.addFilter("hbm2ddl","${hibernate.hbm2ddl.auto}");
- PROJECT_TEMPLATE.addFilter("driverJar","${driver.file}");
-
- FILTERS_TEMPLATE = new FilterSet();
- FILTERS_TEMPLATE.addFilter("interfaceName","${interface.name}");
- FILTERS_TEMPLATE.addFilter("beanName","${bean.name}");
- FILTERS_TEMPLATE.addFilter("entityName","${entity.name}");
- FILTERS_TEMPLATE.addFilter("methodName","${method.name}");
- FILTERS_TEMPLATE.addFilter("componentName","${component.name}");
- FILTERS_TEMPLATE.addFilter("pageName","${page.name}");
- FILTERS_TEMPLATE.addFilter("masterPageName","${masterPage.name}");
- FILTERS_TEMPLATE.addFilter("actionPackage","${action.package}");
- FILTERS_TEMPLATE.addFilter("modelPackage","${model.package}");
- FILTERS_TEMPLATE.addFilter("testPackage","${test.package}");
- FILTERS_TEMPLATE.addFilter("listName","${component.name}List");
- FILTERS_TEMPLATE.addFilter("homeName","${component.name}Home");
- FILTERS_TEMPLATE.addFilter("query","${query.text}");
-
- HIBERNATE_DIALECT_TEMPLATE = new FilterSet();
- HIBERNATE_DIALECT_TEMPLATE.addFilter("hibernate.dialect","$hibernate.dialect");
- }
-
- public static FilterSet createJdbcFilterSet(IDataModel values) {
- return aplayProperties(JDBC_TEMPLATE, values);
- }
- public static FilterSet createProjectFilterSet(IDataModel values){
- return aplayProperties(PROJECT_TEMPLATE, values);
- }
-
- public static FilterSet createFiltersFilterSet(IDataModel values) {
- return aplayProperties(FILTERS_TEMPLATE, values);
- }
-
- public static FilterSet createHibernateDialectFilterSet(IDataModel values) {
- return aplayProperties(HIBERNATE_DIALECT_TEMPLATE, values);
- }
-
- private static FilterSet aplayProperties(FilterSet template,IDataModel values) {
- FilterSet result = new FilterSet();
- for (Object filter : template.getFilterHash().keySet()) {
- String value = template.getFilterHash().get(filter).toString();
- for (Object property : values.getAllProperties()) {
- if(value.contains("${"+property.toString()+"}")) {
- value =
value.replace("${"+property.toString()+"}",values.getProperty(property.toString()).toString());
- }
- }
- result.addFilter(filter.toString(), value);
- }
- return result;
- }
- }
-
-
-}
Copied:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
(from rev 2377,
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetInstallDelegete.java)
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetInstallDelegete.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -0,0 +1,496 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.project.facet;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.regex.Pattern;
+
+import org.apache.tools.ant.types.FilterSet;
+import org.apache.tools.ant.types.FilterSetCollection;
+import org.apache.tools.ant.util.FileUtils;
+import org.eclipse.core.resources.IContainer;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jdt.core.JavaCore;
+import org.eclipse.jdt.internal.core.JavaModel;
+import org.eclipse.jdt.internal.core.JavaProject;
+import org.eclipse.jst.j2ee.web.componentcore.util.WebArtifactEdit;
+import org.eclipse.wst.common.componentcore.ComponentCore;
+import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
+import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
+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.jboss.tools.seam.core.SeamCorePlugin;
+
+public class SeamFacetInstallDelegete extends Object implements IDelegate {
+
+ public static String PROFILE = "dev-war";
+
+ public static FileSet TOMCAT_WAR_LIB_FILESET = new FileSet()
+ .include("activation\\.jar")
+ .include("ajax4jsf*.\\.jar")
+ .include("commons-beanutils.*\\.jar")
+ .include("commons-codec.*\\.jar")
+ .include("commons-collections.*\\.jar")
+ .include("commons-digester.*\\.jar")
+ .include("commons-el.*\\.jar")
+ .include("commons-lang.*\\.jar")
+ .include("hibernate-all\\.jar")
+ .include("itext.*\\.jar")
+ .include("jboss-aop-jdk50\\.jar")
+ .include("jboss-cache-jdk50\\.jar")
+ .include("jboss-ejb3-all\\.jar")
+ .include("jboss-seam-debug\\.jar")
+ .include("jboss-seam-ui\\.jar")
+ .include("jboss-seam\\.jar")
+ .include("jcaptcha-all.*\\.jar")
+ .include("jgroups\\.jar")
+ .include("jsf-facelets\\.jar")
+ .include("jstl.*\\.jar")
+ .include("mail-ra\\.jar")
+ .include("mail\\.jar")
+ .include("mc-conf\\.jar")
+ .include("myfaces-api.*\\.jar")
+ .include("myfaces-impl.*\\.jar")
+ .include("oscache.*\\.jar")
+ .include("portlet-api-lib\\.jar")
+ .include("richfaces.*\\.jar")
+ .include("spring\\.jar")
+ .include("thirdparty-all\\.jar");
+
+ public static FileSet JBOSS_WAR_LIB_FILESET = new FileSet()
+ .include("ajax4jsf.*\\.jar")
+ .include("antlr.*\\.jar")
+ .include("antlr.*\\.jar")
+ .include("commons-beanutils.*\\.jar")
+ .include("commons-collections.*\\.jar")
+ .include("commons-digester.*\\.jar")
+ .include("commons-jci-core.*\\.jar")
+ .include("commons-jci-janino.*\\.jar")
+ .include("drools-compiler.*\\.jar")
+ .include("drools-core.*\\.jar")
+ .include("janino.*\\.jar")
+ .include("jboss-seam-debug\\.jar")
+ .include("jboss-seam-ioc\\.jar")
+ .include("jboss-seam-mail\\.jar")
+ .include("jboss-seam-pdf\\.jar")
+ .include("jboss-seam-remoting\\.jar")
+ .include("jboss-seam-ui\\.jar")
+ .include("jboss-seam\\.jar")
+ .include("jbpm.*\\.jar")
+ .include("jsf-facelets\\.jar")
+ .include("oscache.*\\.jar")
+ .include("stringtemplate.*\\.jar");
+
+ public static FileSet EAR_LIB_FILESET = new FileSet()
+ .include("jboss-aop-jdk50\\.jar")
+ .include("jboss-cache-jdk50\\.jar")
+ .include("jboss-seam\\.jar")
+ .include("jgroups\\.jar");
+
+ public static FileSet VIEW_FILESET = new FileSet()
+ .include("home\\.xhtml")
+ .include("error\\.xhtml")
+ .include("login\\.xhtml")
+ .include("login\\.page.xml")
+ .include("index\\.html")
+ .include("layout")
+ .include("layout/.*")
+ .include("stylesheet/.*")
+ .include("img/.*")
+ .include("img")
+ .exclude(".*/.*\\.ftl");
+
+ public static FileSet JBOOS_WAR_WEBINF_SET = new FileSet()
+ .include("WEB-INF/web\\.xml")
+ .include("WEB-INF/pages\\.xml")
+ .include("WEB-INF/jboss-web\\.xml")
+ .include("WEB-INF/faces-config\\.xml")
+ .include("WEB-INF/componets\\.xml");
+
+ public static FileSet JBOOS_WAR_WEB_INF_CLASSES_SET = new FileSet()
+ .include("import\\.sql")
+ .include("security\\.drl")
+ .include("seam\\.properties")
+ .include("messages_en\\.properties");
+ // .include(project.getName()+"ds\\.xml")
+ // .include("META-INF/persistence-" + PROFILE + "\\.xml" )
+
+ public static String DROOLS_LIB_SEAM_RELATED_PATH = "drools/lib";
+
+ public static String SEAM_LIB_RELATED_PATH = "lib";
+
+ public static String WEB_LIBRARIES_RELATED_PATH = "WEB-INF/lib";
+
+ public void execute(IProject project, IProjectFacetVersion fv,
+ Object config, IProgressMonitor monitor) throws CoreException {
+ IDataModel model = (IDataModel)config;
+
+ // get WebContents folder path from DWP model
+ WebArtifactEdit edit = WebArtifactEdit.getWebArtifactEditForRead(project);
+ IVirtualComponent com = ComponentCore.createComponent(project);
+ IVirtualFolder webRootFolder = com.getRootFolder().getFolder(new Path("/"));
+ IVirtualFolder srcRootFolder = com.getRootFolder().getFolder(new
Path("/WEB-INF/classes"));
+ IContainer folder = webRootFolder.getUnderlyingFolder();
+ model.setProperty(ISeamFacetDataModelProperties.SEAM_PROJECT_NAME, project.getName());
+
+ File webContentFolder = folder.getLocation().toFile();
+ File webInfFolder = new File(webContentFolder,"WEB-INF");
+ File webInfClasses = new File(webInfFolder,"classes");
+ File webInfClassesMetaInf = new File(webInfClasses, "META-INF");
+ webInfClassesMetaInf.mkdirs();
+ File webLibFolder = new File(webContentFolder,WEB_LIBRARIES_RELATED_PATH);
+ File srcFolder = srcRootFolder.getUnderlyingFolder().getLocation().toFile();
+ File srcWebInf = new File(srcFolder, "META-INF");
+ String seamHomePath =
model.getProperty(ISeamFacetDataModelProperties.JBOSS_SEAM_HOME).toString();
+
+ File seamHomeFolder = new File(seamHomePath);
+ File seamLibFolder = new File(seamHomePath,SEAM_LIB_RELATED_PATH);
+ File seamGenResFolder = new File(seamHomePath,"seam-gen/resources");
+ File droolsLibFolder = new File(seamHomePath,DROOLS_LIB_SEAM_RELATED_PATH);
+ File securityDrools = new File(seamGenResFolder,"security.drl");
+ File seamGenHomeFolder = new File(seamHomePath,"seam-gen");
+ File seamGenViewSource = new File(seamGenHomeFolder,"view");
+ File dataSourceDsFile = new File(seamGenResFolder, "datasource-ds.xml");
+
+ File jdbcDriverFile = new
File(model.getProperty(ISeamFacetDataModelProperties.JDBC_DRIVER_JAR_PATH).toString());
+ File hibernateConsoleLaunchFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.launch");
+ File hibernateConsolePropsFile = new File(seamGenHomeFolder,
"hibernatetools/hibernate-console.properties");
+ File hibernateConsolePref = new File(seamGenHomeFolder,
"hibernatetools/.settings/org.hibernate.eclipse.console.prefs");
+ File persistenceFile = new File(seamGenResFolder,"META-INF/persistence-" +
PROFILE + ".xml");
+
+ FilterSet jdbcFilterSet = FilterSetFactory.createJdbcFilterSet(model);
+ FilterSet projectFilterSet = FilterSetFactory.createProjectFilterSet(model);
+ FilterSet filtersFilterSet = FilterSetFactory.createFiltersFilterSet(model);
+
+ // ****************************************************************
+ // Copy view folder from seam-gen installation to WebContent folder
+ // ****************************************************************
+
+ FileSet viewFileSet = new FileSet(VIEW_FILESET).dir(seamGenViewSource);
+ FilterSetCollection viewFilterSetCollection = new FilterSetCollection();
+ viewFilterSetCollection.addFilterSet(jdbcFilterSet);
+ viewFilterSetCollection.addFilterSet(projectFilterSet);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenViewSource,
+ webContentFolder,
+ new FileSetFileFilter(viewFileSet),
+ viewFilterSetCollection,
+ true);
+
+ // *******************************************************************
+ // Copy manifest and configuration resources the same way as view
+ // *******************************************************************
+
+ FileSet webInfSet = new FileSet(JBOOS_WAR_WEBINF_SET).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder,webContentFolder,new FileSetFileFilter(webInfSet),
viewFilterSetCollection, true);
+
+ FileSet webInfClassesSet = new
FileSet(JBOOS_WAR_WEB_INF_CLASSES_SET).dir(seamGenResFolder);
+ AntCopyUtils.copyFilesAndFolders(
+ seamGenResFolder,srcFolder,new FileSetFileFilter(webInfClassesSet),
viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFile(
+ dataSourceDsFile,
+ new File(srcFolder,project.getName()+"-ds.xml"),
+ viewFilterSetCollection, true);
+
+ AntCopyUtils.copyFileToFile(
+ hibernateConsoleLaunchFile,
+ new File(project.getLocation().toFile(),project.getName()+".launch"),
+ new FilterSetCollection(projectFilterSet), true);
+
+
+ AntCopyUtils.copyFileToFile(
+ persistenceFile,
+ new File(srcWebInf,"persistence.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ FilterSetCollection hibernateDialectFilterSet = new FilterSetCollection();
+ hibernateDialectFilterSet.addFilterSet(jdbcFilterSet);
+ hibernateDialectFilterSet.addFilterSet(projectFilterSet);
+ hibernateDialectFilterSet.addFilterSet(FilterSetFactory.createHibernateDialectFilterSet(model));
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePropsFile,
+ project.getLocation().toFile(),
+ hibernateDialectFilterSet, true);
+
+ // add copy for /hibernatetools/seam-gen.reveng.xml
+
+
+ AntCopyUtils.copyFileToFolder(
+ hibernateConsolePref,
+ new File(project.getLocation().toFile(),".settings"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ //
********************************************************************************************
+ // Copy libraries libraries (seam jars, seam dependencies jars, drols jars, jdbc jar)
+ //
********************************************************************************************
+ copyFiles(seamHomeFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(seamHomeFolder)));
+ copyFiles(seamLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(seamLibFolder)));
+ copyFiles(droolsLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(droolsLibFolder)));
+ copyFiles(seamHomeFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(seamHomeFolder)));
+ copyFiles(seamLibFolder,webLibFolder,new FileSetFileFilter(new
FileSet(JBOSS_WAR_LIB_FILESET).dir(seamLibFolder)));
+
+ //
********************************************************************************************
+ // Copy JDBC driver if there is any
+ //
********************************************************************************************
+ if(jdbcDriverFile.exists())
+ AntCopyUtils.copyFileToFolder(jdbcDriverFile, webLibFolder, true);
+
+ // Copy sources to src
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenHomeFolder,"src/Authenticator.java"),
+ new File(project.getLocation().toFile(),"src/" +
model.getProperty(ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_NAME).toString().replace('.',
'/')+"/"+"Authenticator.java"),
+ new FilterSetCollection(filtersFilterSet), true);
+
+ // TODO may be generate RHDS studio feature to show it on projects view
+
+ //
********************************************************************************************
+ // Handle WAR/EAR configurations
+ //
********************************************************************************************
+ if(model.getProperty(ISeamFacetDataModelProperties.JBOSS_AS_DEPLOY_AS).equals("war"))
{
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenResFolder,"WEB-INF/components-war.xml"),
+ new File(webInfFolder,"components.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ //
********************************************************************************************
+ // TODO replace with appropriate one to handle Dynamic Web Project Structure
+ //
********************************************************************************************
+ AntCopyUtils.copyFileToFile(
+ new File(seamHomeFolder,"seam-gen/build-scripts/build-war.xml"),
+ new File(project.getLocation().toFile(),"build.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+
+ //
********************************************************************************************
+ // Copy seam project indicator
+ //
********************************************************************************************
+ AntCopyUtils.copyFileToFolder(new File(seamGenResFolder,"seam.properties"),
srcFolder, true);
+
+ } else {
+ // copy ear files
+ AntCopyUtils.copyFileToFile(
+ new File(seamGenResFolder,"WEB-INF/components.xml"),
+ new File(webInfFolder,"components.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+ AntCopyUtils.copyFileToFile(
+ new File(seamHomeFolder,"seam-gen/build-scripts/build.xml"),
+ new File(project.getLocation().toFile(),"build.xml"),
+ new FilterSetCollection(projectFilterSet), true);
+ }
+
+
+ project.refreshLocal(IResource.DEPTH_INFINITE, monitor);
+ }
+
+ public static void copyFiles(File source, File dest, FileFilter filter) {
+ dest.mkdir();
+ for (File file:source.listFiles(filter)) {
+ if(file.isDirectory())continue;
+ try {
+ FileUtils.getFileUtils().copyFile(file, new File(dest,file.getName()),new
FilterSetCollection(),true);
+ } catch (IOException e) {
+ SeamCorePlugin.getPluginLog().logError(e);
+ }
+ }
+ }
+
+ public static class FileSet {
+
+ File dir = null;
+
+ List<Pattern> include = new ArrayList<Pattern>();
+
+ List<Pattern> exclude = new ArrayList<Pattern>();
+
+ public FileSet(String dir) {
+ this.dir = new File(dir);
+ }
+
+ public FileSet(File dir) {
+ this.dir = dir;
+ }
+
+ public FileSet(FileSet template) {
+ addTemplate(template);
+ }
+
+ public void addTemplate(FileSet template){
+ include.addAll(template.getIncluded());
+ exclude.addAll(template.getExcluded());
+ }
+
+ public FileSet() {
+
+ }
+
+ public FileSet add(FileSet set) {
+ addTemplate(set);
+ return this;
+ }
+
+ public FileSet dir(String dir) {
+ this.dir = new File(dir);
+ return this;
+ }
+
+ public FileSet dir(File dir) {
+ this.dir = dir;
+ return this;
+ }
+
+ public FileSet include(String pattern) {
+ include.add(Pattern.compile(pattern));
+ return this;
+
+ }
+
+ public FileSet exclude(String pattern) {
+ exclude.add(Pattern.compile(pattern));
+ return this;
+ }
+
+ public boolean isIncluded(String file) {
+ int i = dir.getAbsolutePath().length()+1;
+ String relatedPath = file.substring(i);
+ if(new File(file).isDirectory())return true;
+ for (Pattern pattern : include) {
+ if(pattern.matcher(relatedPath.replace('\\', '/')).matches() ) {
+ return !isExcluded(relatedPath);
+ }
+ }
+ return false;
+ }
+
+ public boolean isExcluded(String file){
+ for (Pattern pattern : exclude) {
+ if(pattern.matcher(file.replace('\\', '/')).matches()) return true;
+ }
+ return false;
+ }
+
+ public List<Pattern> getExcluded() {
+ return Collections.unmodifiableList(exclude);
+ }
+
+ public List<Pattern> getIncluded() {
+ return Collections.unmodifiableList(include);
+ }
+
+ /**
+ * @return
+ */
+ public File getDir() {
+ return dir;
+ }
+ }
+
+ public static class FileSetFileFilter implements FileFilter {
+
+ FileSet set;
+ public FileSetFileFilter(FileSet set) {
+ this.set = set;
+ }
+
+ public boolean accept(File pathname){
+ return set.isIncluded(pathname.getAbsolutePath());
+ }
+ }
+
+ public static class FilterSetFactory {
+
+ public static FilterSet JDBC_TEMPLATE;
+ public static FilterSet PROJECT_TEMPLATE;
+ public static FilterSet FILTERS_TEMPLATE;
+ public static FilterSet HIBERNATE_DIALECT_TEMPLATE;
+
+ static {
+ JDBC_TEMPLATE = new FilterSet();
+ JDBC_TEMPLATE.addFilter("jdbcUrl","${hibernate.connection.url}");
+ JDBC_TEMPLATE.addFilter("driverClass","${hibernate.connection.driver_class}");
+ JDBC_TEMPLATE.addFilter("username","${hibernate.connection.username}");
+ JDBC_TEMPLATE.addFilter("password","${hibernate.connection.password}");
+ JDBC_TEMPLATE.addFilter("catalogProperty","${catalog.property}");
+ JDBC_TEMPLATE.addFilter("schemaProperty","${schema.property}");
+
+ PROJECT_TEMPLATE = new FilterSet();
+ PROJECT_TEMPLATE.addFilter("projectName","${project.name}");
+ PROJECT_TEMPLATE.addFilter("jbossHome","${jboss.home}");
+ PROJECT_TEMPLATE.addFilter("hbm2ddl","${hibernate.hbm2ddl.auto}");
+ PROJECT_TEMPLATE.addFilter("driverJar","${driver.file}");
+ PROJECT_TEMPLATE.addFilter("jndiPattern","${project.name}/#{ejbName}/local");
+ PROJECT_TEMPLATE.addFilter("embeddedEjb","false");
+
+ FILTERS_TEMPLATE = new FilterSet();
+ FILTERS_TEMPLATE.addFilter("interfaceName","${interface.name}");
+ FILTERS_TEMPLATE.addFilter("beanName","${bean.name}");
+ FILTERS_TEMPLATE.addFilter("entityName","${entity.name}");
+ FILTERS_TEMPLATE.addFilter("methodName","${method.name}");
+ FILTERS_TEMPLATE.addFilter("componentName","${component.name}");
+ FILTERS_TEMPLATE.addFilter("pageName","${page.name}");
+ FILTERS_TEMPLATE.addFilter("masterPageName","${masterPage.name}");
+ FILTERS_TEMPLATE.addFilter("actionPackage","${action.package}");
+ FILTERS_TEMPLATE.addFilter("modelPackage","${model.package}");
+ FILTERS_TEMPLATE.addFilter("testPackage","${test.package}");
+ FILTERS_TEMPLATE.addFilter("listName","${component.name}List");
+ FILTERS_TEMPLATE.addFilter("homeName","${component.name}Home");
+ FILTERS_TEMPLATE.addFilter("query","${query.text}");
+
+
+ HIBERNATE_DIALECT_TEMPLATE = new FilterSet();
+ HIBERNATE_DIALECT_TEMPLATE.addFilter("hibernate.dialect","${hibernate.dialect}");
+
+
+ }
+
+ public static FilterSet createJdbcFilterSet(IDataModel values) {
+ return aplayProperties(JDBC_TEMPLATE, values);
+ }
+ public static FilterSet createProjectFilterSet(IDataModel values){
+ return aplayProperties(PROJECT_TEMPLATE, values);
+ }
+
+ public static FilterSet createFiltersFilterSet(IDataModel values) {
+ return aplayProperties(FILTERS_TEMPLATE, values);
+ }
+
+ public static FilterSet createHibernateDialectFilterSet(IDataModel values) {
+ return aplayProperties(HIBERNATE_DIALECT_TEMPLATE, values);
+ }
+
+ private static FilterSet aplayProperties(FilterSet template,IDataModel values) {
+ FilterSet result = new FilterSet();
+ for (Object filter : template.getFilterHash().keySet()) {
+ String value = template.getFilterHash().get(filter).toString();
+ for (Object property : values.getAllProperties()) {
+ if(value.contains("${"+property.toString()+"}")) {
+ value =
value.replace("${"+property.toString()+"}",values.getProperty(property.toString()).toString());
+ }
+ }
+ result.addFilter(filter.toString(), value);
+ }
+ return result;
+ }
+ }
+
+
+}
Deleted:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetUninstallDelegate.java 2007-07-05
18:06:31 UTC (rev 2334)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Exadel, Inc. and 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:
- * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
- ******************************************************************************/
-package org.jboss.tools.seam.core.internal.project.facet;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-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;
-
-/**
- * This delegate uninstalls facet from project
- * @author eskimo
- */
-public class SeamFacetUninstallDelegate extends Object implements IDelegate {
-
- /**
- * @see IDelegate.execute(IProject,IProjectFacetVersion,Object,IProgressMonitor)
- */
- public void execute(IProject project, IProjectFacetVersion fv,
- Object config, IProgressMonitor monitor) throws CoreException {
- }
-
-}
Copied:
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java
(from rev 2377,
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/core/internal/project/facet/SeamFacetUninstallDelegate.java)
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java
(rev 0)
+++
trunk/seam/plugins/org.jboss.tools.seam.core/src/org/jboss/tools/seam/internal/core/project/facet/SeamFacetUninstallDelegate.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2007 Exadel, Inc. and 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:
+ * Exadel, Inc. and Red Hat, Inc. - initial API and implementation
+ ******************************************************************************/
+package org.jboss.tools.seam.internal.core.project.facet;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IProgressMonitor;
+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;
+
+/**
+ * This delegate uninstalls facet from project
+ * @author eskimo
+ */
+public class SeamFacetUninstallDelegate extends Object implements IDelegate {
+
+ /**
+ * @see IDelegate.execute(IProject,IProjectFacetVersion,Object,IProgressMonitor)
+ */
+ public void execute(IProject project, IProjectFacetVersion fv,
+ Object config, IProgressMonitor monitor) throws CoreException {
+ }
+
+}
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-07-11
06:43:31 UTC (rev 2378)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SeamInstallWizardPage.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -26,7 +26,7 @@
import org.eclipse.wst.common.project.facet.ui.AbstractFacetWizardPage;
import org.eclipse.wst.common.project.facet.ui.IFacetWizardPage;
import org.hibernate.eclipse.console.utils.DriverClassHelpers;
-import org.jboss.tools.seam.core.internal.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditorFactory;
@@ -93,9 +93,9 @@
IFieldEditor recreateTablesOnDeploy =
IFieldEditorFactory.INSTANCE.createCheckboxEditor(
ISeamFacetDataModelProperties.RECREATE_TABLES_AND_DATA_ON_DEPLOY,
"Recreate database tables and data on deploy:", false);
- IFieldEditor pathToJdbcDriverJar = IFieldEditorFactory.INSTANCE.createTextEditor(
+ IFieldEditor pathToJdbcDriverJar =
IFieldEditorFactory.INSTANCE.createBrowseFolderEditor(
ISeamFacetDataModelProperties. JDBC_DRIVER_JAR_PATH,
- "File :", "url://domain/");
+ "JDBC Driver jar:", "");
// Code generation group
IFieldEditor sessionBeanPkgNameditor = IFieldEditorFactory.INSTANCE.createTextEditor(
@@ -220,6 +220,7 @@
validatorDelegate.addValidatorForProperty(jBossSeamHomeEditor.getName(),
ValidatorFactory.JBOSS_SEAM_HOME_FOLDER_VALIDATOR);
validatorDelegate.addValidatorForProperty(jBossAsHomeEditor.getName(),
ValidatorFactory.JBOSS_AS_HOME_FOLDER_VALIDATOR);
+ validatorDelegate.addValidatorForProperty(pathToJdbcDriverJar.getName(),
ValidatorFactory.FILESYSTEM_FILE_EXISTS_VALIDATOR);
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java 2007-07-11
06:43:31 UTC (rev 2378)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/SwtFieldEditorFactory.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -83,6 +83,7 @@
@Override
public void run() {
DirectoryDialog dialog = new DirectoryDialog(Display.getCurrent().getActiveShell());
+ dialog.setFilterPath(getFieldEditor().getValueAsString());
dialog.setMessage("Select Seam Home Folder");
dialog.setFilterPath(getFieldEditor().getValueAsString());
String directory = dialog.open();
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-07-11
06:43:31 UTC (rev 2378)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -15,7 +15,7 @@
import java.util.Map;
import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.jboss.tools.seam.core.internal.project.facet.ISeamFacetDataModelProperties;
+import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
/**
*
Modified:
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegeteTest.java
===================================================================
---
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegeteTest.java 2007-07-11
06:43:31 UTC (rev 2378)
+++
trunk/seam/tests/org.jboss.tools.seam.core.test/src/org/jboss/tools/seam/core/test/project/facet/SeamFacetInstallDelegeteTest.java 2007-07-11
07:43:51 UTC (rev 2379)
@@ -3,7 +3,7 @@
*/
package org.jboss.tools.seam.core.test.project.facet;
-import org.jboss.tools.seam.core.internal.project.facet.SeamFacetInstallDelegete;
+import org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegete;
import junit.framework.TestCase;
@@ -26,7 +26,7 @@
}
/**
- * Test method for {@link
org.jboss.tools.seam.core.internal.project.facet.SeamFacetInstallDelegete#execute(org.eclipse.core.resources.IProject,
org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, java.lang.Object,
org.eclipse.core.runtime.IProgressMonitor)}.
+ * Test method for {@link
org.jboss.tools.seam.internal.core.project.facet.SeamFacetInstallDelegete#execute(org.eclipse.core.resources.IProject,
org.eclipse.wst.common.project.facet.core.IProjectFacetVersion, java.lang.Object,
org.eclipse.core.runtime.IProgressMonitor)}.
*/
public void testExecute() {
SeamFacetInstallDelegete seamDelegate = new SeamFacetInstallDelegete();