Author: dgolovin
Date: 2007-09-26 05:43:08 -0400 (Wed, 26 Sep 2007)
New Revision: 3806
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/widget/editor/SeamRuntimeListFieldEditor.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizardPage1.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizardPage1.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizardPage1.java
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/SeamWizardFactory.java
Log:
http://jira.jboss.com/jira/browse/JBIDE-769
Domain and Generic exporters added based on seam-ge generate-entities ant atrget
http://jira.jboss.com/jira/browse/JBIDE-846
src/action
src/model
added for war config
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/internal/project/facet/ValidatorFactory.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -39,8 +39,11 @@
import org.eclipse.jdt.core.dom.CompilationUnit;
import org.eclipse.jdt.internal.corext.util.Messages;
import org.eclipse.ui.wizards.datatransfer.ZipFileStructureProvider;
+import org.eclipse.wst.common.project.facet.core.IFacetedProject;
+import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
import org.jboss.tools.seam.core.ISeamProject;
import org.jboss.tools.seam.core.SeamCorePlugin;
+import org.jboss.tools.seam.internal.core.SeamProject;
import org.jboss.tools.seam.internal.core.project.facet.ISeamFacetDataModelProperties;
import org.jboss.tools.seam.ui.wizard.IParameter;
@@ -317,10 +320,14 @@
return createErrormessage(
"Project '" + value + "' does'n exist.");
} else {
+ IProject selection = (IProject)project;
try {
- if (!((IProject) project).hasNature(ISeamProject.NATURE_ID)) {
+ if (!selection.hasNature(SeamProject.NATURE_ID)
+ || SeamCorePlugin.getSeamPreferences(selection)==null
+ || selection.getAdapter(IFacetedProject.class)==null
+ ||
!((IFacetedProject)selection.getAdapter(IFacetedProject.class)).hasProjectFacet(ProjectFacetsManager.getProjectFacet("jst.web")))
{
return createErrormessage(
- "Project '" + project.getName() + "' has no Seam
nature");
+ "Selected project '" + project.getName() + "' is not a
Seam Web Project");
}
} catch (CoreException e) {
SeamCorePlugin.getPluginLog().logError(e);
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-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/widget/editor/SeamRuntimeListFieldEditor.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -389,7 +389,7 @@
setErrorMessage("Cannot obtain Seam version number from jboss-seam.jar
file.");
setPageComplete(false);
return;
- } else if(!seamVersion.matches(version.getValueAsString()+".*")) {
+ } else
if(!seamVersion.matches(version.getValueAsString().replace(".","\\.")+".*"))
{
setErrorMessage("Selected seam has wrong version number '" +
seamVersion + "'");
setPageComplete(false);
return;
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java 2007-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizard.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -67,7 +67,7 @@
// initialize war files mapping
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ActionJavaBean.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" +
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/action/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/ActionTest.java",
"${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH +
"}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH +
"}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizardPage1.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizardPage1.java 2007-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamActionWizardPage1.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -37,17 +37,17 @@
@Override
public void propertyChange(PropertyChangeEvent event) {
- if(event.getPropertyName().equals(IParameter.SEAM_COMPONENT_NAME)) {
- if(event.getNewValue()==null||"".equals(event.getNewValue().toString().trim()))
{
+ if(event.getPropertyName().equals(IParameter.SEAM_COMPONENT_NAME) ||
event.getPropertyName().equals(IParameter.SEAM_PROJECT_NAME)) {
+ String value = getEditor(IParameter.SEAM_COMPONENT_NAME).getValueAsString();
+ if(value==null||"".equals(value)) {
setDefaultValue(IParameter.SEAM_COMPONENT_NAME, "");
setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "");
setDefaultValue(IParameter.SEAM_BEAN_NAME, "");
setDefaultValue(IParameter.SEAM_METHOD_NAME, "");
setDefaultValue(IParameter.SEAM_PAGE_NAME, "");
} else {
- String value = event.getNewValue().toString();
String valueU = value.substring(0,1).toUpperCase() + value.substring(1);
- setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "I" + valueU);
+ setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, isWar()?valueU :"I" +
valueU);
setDefaultValue(IParameter.SEAM_BEAN_NAME, valueU+"Bean");
String valueL = value.substring(0,1).toLowerCase() + value.substring(1);
setDefaultValue(IParameter.SEAM_METHOD_NAME, valueL);
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java 2007-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizard.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -63,10 +63,10 @@
// initialize war files mapping
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/ConversationBean.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" +
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/model/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_BEAN_NAME +"}.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/Conversation.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" +
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/model/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/conversation.xhtml",
"${" + IParameter.SEAM_PROJECT_WEBCONTENT_PATH + "}/${" +
IParameter.SEAM_PAGE_NAME +"}.xhtml"});
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizardPage1.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizardPage1.java 2007-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamConversationWizardPage1.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -58,14 +58,14 @@
@Override
public void propertyChange(PropertyChangeEvent event) {
if(event.getPropertyName().equals(IParameter.SEAM_COMPONENT_NAME)) {
- if(event.getNewValue()==null||"".equals(event.getNewValue().toString().trim()))
{
+ String value = getEditor(IParameter.SEAM_COMPONENT_NAME).getValueAsString();
+ if(value==null||"".equals(value)) {
setDefaultValue(IParameter.SEAM_COMPONENT_NAME, "");
setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "");
setDefaultValue(IParameter.SEAM_BEAN_NAME, "");
setDefaultValue(IParameter.SEAM_METHOD_NAME, "");
setDefaultValue(IParameter.SEAM_PAGE_NAME, "");
} else {
- String value = event.getNewValue().toString();
String valueU = value.substring(0,1).toUpperCase() + value.substring(1);
setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "I" + valueU);
setDefaultValue(IParameter.SEAM_BEAN_NAME, valueU+"Bean");
@@ -74,6 +74,5 @@
setDefaultValue(IParameter.SEAM_PAGE_NAME, valueL);
}
}
- super.propertyChange(event);
}
}
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizard.java 2007-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamEntityWizard.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -79,13 +79,13 @@
// initialize war files mapping
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/Entity.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" +
ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/model/${"
+ ISeamFacetDataModelProperties.ENTITY_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/EntityHome.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" +
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}Home.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/model/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}Home.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/EntityList.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" +
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}List.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/model/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_ENTITY_CLASS_NAME +"}List.java"});
ACTION_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/view/edit.xhtml",
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java 2007-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizard.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -84,7 +84,7 @@
static {
FORM_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/src/FormActionJavaBean.java",
- "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/${" +
ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
+ "${" + IParameter.SEAM_PROJECT_LOCATION_PATH + "}/src/model/${"
+ ISeamFacetDataModelProperties.SESION_BEAN_PACKAGE_PATH + "}/${" +
IParameter.SEAM_LOCAL_INTERFACE_NAME +"}.java"});
FORM_WAR_MAPPING.add(new String[]{
"${" + ISeamFacetDataModelProperties.JBOSS_SEAM_HOME +
"}/seam-gen/test/FormTest.java",
"${" + IParameter.SEAM_TEST_PROJECT_LOCATION_PATH +
"}/test-src/${" + ISeamFacetDataModelProperties.TEST_CASES_PACKAGE_PATH +
"}/${"+ IParameter.SEAM_LOCAL_INTERFACE_NAME +"}Test.java"});
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizardPage1.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizardPage1.java 2007-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamFormWizardPage1.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -36,23 +36,22 @@
@Override
public void propertyChange(PropertyChangeEvent event) {
- if(event.getPropertyName().equals(IParameter.SEAM_COMPONENT_NAME)) {
- if(event.getNewValue()==null||"".equals(event.getNewValue().toString().trim()))
{
+ if(event.getPropertyName().equals(IParameter.SEAM_COMPONENT_NAME) ||
event.getPropertyName().equals(IParameter.SEAM_PROJECT_NAME)) {
+ String value = getEditor(IParameter.SEAM_COMPONENT_NAME).getValueAsString();
+ if(value==null||"".equals(value)) {
setDefaultValue(IParameter.SEAM_COMPONENT_NAME, "");
setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "");
setDefaultValue(IParameter.SEAM_BEAN_NAME, "");
setDefaultValue(IParameter.SEAM_METHOD_NAME, "");
setDefaultValue(IParameter.SEAM_PAGE_NAME, "");
} else {
- String value = event.getNewValue().toString();
String valueU = value.substring(0,1).toUpperCase() + value.substring(1);
- setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, "I" + valueU);
+ setDefaultValue(IParameter.SEAM_LOCAL_INTERFACE_NAME, isWar()?valueU :"I" +
valueU);
setDefaultValue(IParameter.SEAM_BEAN_NAME, valueU+"Bean");
String valueL = value.substring(0,1).toLowerCase() + value.substring(1);
setDefaultValue(IParameter.SEAM_METHOD_NAME, valueL);
setDefaultValue(IParameter.SEAM_PAGE_NAME, valueL);
}
}
- super.propertyChange(event);
}
}
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-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamGenerateEnitiesWizard.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -65,106 +65,204 @@
ILaunchConfigurationType launchConfigurationType =
launchManager.getLaunchConfigurationType("org.hibernate.eclipse.launch.CodeGenerationLaunchConfigurationType");
ILaunchConfigurationWorkingCopy wc =
- launchConfigurationType.newInstance(project, project.getName() +
"generate-entities");
+ launchConfigurationType.newInstance(project, project.getName() +
"-generate-entities");
//Main
wc.setAttribute(
HibernateLaunchConstants.ATTR_CONSOLE_CONFIGURATION_NAME,
params.get(IParameter.HIBERNATE_CONFIGURATION_NAME));
- J2EEProjects seamProjectUtil = J2EEProjects.create(project);
- IPath webContentPath = null;
- IFolder webContent = seamProjectUtil.getWARContentFolder();
- IProject webProject = null;
- if(webContent!=null && webContent.exists()) {
- webContentPath = webContent.getFullPath();
- webProject = seamProjectUtil.getWARProjects().get(0);
- }
+ J2EEProjects seamProjectsSet = J2EEProjects.create(project);
- if(webContentPath == null) {
- throw new CoreException(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
"WebContent folder not found in project " + project.getName()));
- }
- wc.setAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR,
webContentPath.toString());
+ wc.setAttribute(HibernateLaunchConstants.ATTR_OUTPUT_DIR,
+ seamProjectsSet.getBeansFolder()==null?
+ "":seamProjectsSet.getBeansFolder().getFullPath().toString());
boolean isReverseEngineer =
"true".equals(params.get(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER));
wc.setAttribute(HibernateLaunchConstants.ATTR_REVERSE_ENGINEER, isReverseEngineer);
if(isReverseEngineer) {
- wc.setAttribute(HibernateLaunchConstants.ATTR_PACKAGE_NAME, "seamtest");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_PACKAGE_NAME,
seamProjectsSet.getEntityPackage());
wc.setAttribute(HibernateLaunchConstants.ATTR_PREFER_BASIC_COMPOSITE_IDS, true);
wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_MANY_TO_MANY, true);
wc.setAttribute(HibernateLaunchConstants.ATTR_AUTOMATIC_VERSIONING, true);
}
- wc.setAttribute(HibernateLaunchConstants.ATTR_USE_OWN_TEMPLATES, true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_USE_OWN_TEMPLATES, false);
+ wc.setAttribute("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.Util");
+
SeamRuntime seamRt = getRuntime(project);
if(seamRt==null) {
- seamRt = getRuntime(webProject);
+ seamRt = getRuntime(project);
}
if(seamRt == null) {
throw new CoreException(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
"Can't find seam runtime for project " + project.getName()));
}
+ String viewTemplate = seamRt.getViewTemplatesDir();
+ String srcTemplate = seamRt.getSrcTemplatesDir();
+ wc.setAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, viewTemplate);
- IResource[] resources = seamProjectUtil.getEJBSourceRoots();
- IPath javaSource = null;
- if(resources!=null && resources.length>0) {
- javaSource = resources[0].getFullPath();
- }
- if(javaSource == null) {
- throw new CoreException(new Status(IStatus.ERROR, SeamCorePlugin.PLUGIN_ID,
"Source folder not found in project " + project.getName()));
- }
-
- String template = "" + seamRt.getHomeDir() + "/seam-gen/view";
- wc.setAttribute(HibernateLaunchConstants.ATTR_TEMPLATE_DIR, template);
-
wc.setAttribute(HibernateLaunchConstants.ATTR_ENABLE_JDK5, true);
wc.setAttribute(HibernateLaunchConstants.ATTR_ENABLE_EJB3_ANNOTATIONS, true);
// Create exporters
// TODO Add others exporters
List<String> exporters = new ArrayList<String>();
+
+ exporters.add("hbmtemplate0");
exporters.add("hbmtemplate1");
exporters.add("hbmtemplate2");
+ exporters.add("hbmtemplate3");
+ exporters.add("hbmtemplate4");
+ exporters.add("hbmtemplate5");
+ exporters.add("hbmtemplate6");
+ exporters.add("hbmtemplate7");
+ exporters.add("hbmtemplate8");
+ exporters.add("hbmtemplate9");
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS, exporters);
-
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate0",
true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate0.extension_id", "org.hibernate.tools.hbm2java");
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate1",
true);
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate1.extension_id", "org.hibernate.tools.hbmtemplate");
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate2",
true);
wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate2.extension_id", "org.hibernate.tools.hbmtemplate");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate3",
true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate3.extension_id", "org.hibernate.tools.hbmtemplate");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate4",
true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate4.extension_id", "org.hibernate.tools.hbmtemplate");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate5",
true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate5.extension_id", "org.hibernate.tools.hbmtemplate");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate6",
true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate6.extension_id", "org.hibernate.tools.hbmtemplate");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate7",
true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate7.extension_id", "org.hibernate.tools.hbmtemplate");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate8",
true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate8.extension_id", "org.hibernate.tools.hbmtemplate");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS + ".hbmtemplate9",
true);
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate9.extension_id", "org.hibernate.tools.hbmtemplate");
+
+ Map<String, String> hbmtemplateAttributes = new HashMap<String,
String>();
+ hbmtemplateAttributes.put("file_pattern",
"{class-name}List.xhtml");
+ hbmtemplateAttributes.put("template_path", viewTemplate);
+ hbmtemplateAttributes.put("template_name", "list.xhtml.ftl");
+ hbmtemplateAttributes.put("outputdir",
seamProjectsSet.getViewsFolder().getFullPath().toString());
+ hbmtemplateAttributes.put("for_each", "entity");
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate1.properties", hbmtemplateAttributes);
-// ExporterDefinition[] ds = ExtensionManager.findExporterDefinitions();
+// <hbmtemplate filepattern="{class-name}.xhtml"
+// template="view/view.xhtml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
- // Set properties:
- // <hbmtemplate filepattern="{class-name}List.xhtml"
- // template="view/list.xhtml.ftl"
- // destdir="${project.home}/view"
- // foreach="entity"/>
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern", "{class-name}.xhtml");
+ hbmtemplateAttributes.put("template_path", viewTemplate);
+ hbmtemplateAttributes.put("template_name", "view.xhtml.ftl");
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString());
+ hbmtemplateAttributes.put("for_each", "entity");
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate2.properties", hbmtemplateAttributes);
- Map<String, String> hbmtemplate1Attributes = new HashMap<String,
String>();
- hbmtemplate1Attributes.put("file_pattern",
"{class-name}List.xhtml");
- hbmtemplate1Attributes.put("template_path", template);
- hbmtemplate1Attributes.put("template_name", "list.xhtml.ftl");
- // TODO create "view" folder
- hbmtemplate1Attributes.put("outputdir", webContentPath.toString() +
"/view");
- hbmtemplate1Attributes.put("for_each", "entity");
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate1.properties", hbmtemplate1Attributes);
+// <hbmtemplate filepattern="{class-name}.page.xml"
+// template="view/view.page.xml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
- // Set properties:
- // <hbmtemplate filepattern="{class-name}.page.xml"
- // template="view/view.page.xml.ftl"
- // destdir="${project.home}/view"
- // foreach="entity"/>
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern",
"{class-name}.page.xml");
+ hbmtemplateAttributes.put("template_path", viewTemplate);
+ hbmtemplateAttributes.put("template_name", "view.page.xml.ftl");
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString());
+ hbmtemplateAttributes.put("for_each", "entity");
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate3.properties", hbmtemplateAttributes);
+
+// <hbmtemplate filepattern="{class-name}Edit.xhtml"
+// template="view/edit.xhtml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
- Map<String, String> hbmtemplate2Attributes = new HashMap<String,
String>();
- hbmtemplate2Attributes.put("file_pattern",
"{class-name}.page.xml");
- hbmtemplate1Attributes.put("template_path", template);
- hbmtemplate1Attributes.put("template_name",
"view.page.xml.ftl");
- hbmtemplate2Attributes.put("outputdir", webContentPath.toString() +
"/view");
- hbmtemplate2Attributes.put("for_each", "entity");
- wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate2.properties", hbmtemplate2Attributes);
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern",
"{class-name}Edit.xhtml");
+ hbmtemplateAttributes.put("template_path", viewTemplate);
+ hbmtemplateAttributes.put("template_name", "edit.xhtml.ftl");
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString());
+ hbmtemplateAttributes.put("for_each", "entity");
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate4.properties", hbmtemplateAttributes);
- // TODO Set properties for others exporters
+// <hbmtemplate filepattern="{class-name}Edit.page.xml"
+// template="view/edit.page.xml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
+
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern",
"{class-name}Edit.page.xml");
+ hbmtemplateAttributes.put("template_path", viewTemplate);
+ hbmtemplateAttributes.put("template_name", "edit.page.xml.ftl");
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString());
+ hbmtemplateAttributes.put("for_each", "entity");
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate5.properties", hbmtemplateAttributes);
+// <hbmtemplate filepattern="{package-name}/{class-name}List.java"
+// template="src/EntityList.java.ftl"
+// destdir="${project.home}/src"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern",
"{class-name}List.java");
+ hbmtemplateAttributes.put("template_path", srcTemplate);
+ hbmtemplateAttributes.put("template_name",
"EntityList.java.ftl");
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getBeansFolder().getFullPath().toString());
+ hbmtemplateAttributes.put("for_each", "entity");
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate6.properties", hbmtemplateAttributes);
+
+// <hbmtemplate filepattern="{class-name}List.page.xml"
+// template="view/list.page.xml.ftl"
+// destdir="${project.home}/view"
+// foreach="entity"/>
+
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern",
"{class-name}List.page.xml");
+ hbmtemplateAttributes.put("template_path", viewTemplate);
+ hbmtemplateAttributes.put("template_name", "list.page.xml.ftl");
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString());
+ hbmtemplateAttributes.put("for_each", "entity");
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate7.properties", hbmtemplateAttributes);
+
+// <hbmtemplate filepattern="{package-name}/{class-name}Home.java"
+// template="src/EntityHome.java.ftl"
+// destdir="${project.home}/src"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern",
"{class-name}Home.java");
+ hbmtemplateAttributes.put("template_path", srcTemplate);
+ hbmtemplateAttributes.put("template_name",
"EntityHome.java.ftl");
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getBeansFolder().getFullPath().toString());
+ hbmtemplateAttributes.put("for_each", "entity");
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate8.properties", hbmtemplateAttributes);
+
+// <hbmtemplate filepattern="menu.xhtml"
+// template="view/layout/menu.xhtml.ftl"
+// destdir="${project.home}/view/layout"
+// foreach="entity"/>
+
+ hbmtemplateAttributes = new HashMap<String, String>();
+ hbmtemplateAttributes.put("file_pattern", "menu.xhtml");
+ hbmtemplateAttributes.put("template_path",
viewTemplate+"/layout");
+ hbmtemplateAttributes.put("template_name", "menu.xhtml.ftl");
+ hbmtemplateAttributes.put("outputdir",seamProjectsSet.getViewsFolder().getFullPath().toString()+"/layout");
+ hbmtemplateAttributes.put("for_each", "entity");
+ hbmtemplateAttributes.put("hibernatetool.util.toolclass","org.hibernate.eclipse.launch.SeamUtil");
+ wc.setAttribute(HibernateLaunchConstants.ATTR_EXPORTERS +
".hbmtemplate9.properties", hbmtemplateAttributes);
wc.doSave();
launchManager.addLaunch(wc.launch(ILaunchManager.RUN_MODE, monitor));
} catch (CoreException e) {
Modified:
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java
===================================================================
---
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java 2007-09-26
09:43:01 UTC (rev 3805)
+++
trunk/seam/plugins/org.jboss.tools.seam.ui/src/org/jboss/tools/seam/ui/wizard/SeamWizardFactory.java 2007-09-26
09:43:08 UTC (rev 3806)
@@ -16,6 +16,7 @@
import org.hibernate.console.ConsoleConfiguration;
import org.hibernate.console.KnownConfigurations;
+import org.hibernate.eclipse.console.HibernateConsolePlugin;
import org.jboss.tools.seam.ui.SeamUIMessages;
import org.jboss.tools.seam.ui.internal.project.facet.ValidatorFactory;
import org.jboss.tools.seam.ui.widget.editor.IFieldEditor;
@@ -109,6 +110,7 @@
* @return
*/
public static IFieldEditor
createHibernateConsoleConfigurationSelectionFieldEditor(String defaultSelection) {
+ HibernateConsolePlugin.getDefault();
ConsoleConfiguration[] configs =
KnownConfigurations.getInstance().getConfigurations();
List<String> configurationNames = new ArrayList<String>();
for (int i = 0; i < configs.length; i++) {
@@ -121,7 +123,10 @@
defaultSelection = "";
}
}
- IFieldEditor editor =
SwtFieldEditorFactory.INSTANCE.createComboEditor(IParameter.HIBERNATE_CONFIGURATION_NAME,
SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_HIBERNATE_CONFIGURATION_LABEL,
configurationNames, defaultSelection);
+ IFieldEditor editor = SwtFieldEditorFactory.INSTANCE.createComboEditor(
+ IParameter.HIBERNATE_CONFIGURATION_NAME,
+ SeamUIMessages.GENERATE_SEAM_ENTITIES_WIZARD_HIBERNATE_CONFIGURATION_LABEL,
+ configurationNames, defaultSelection);
return editor;
}
}
\ No newline at end of file