[jboss-cvs] jboss-seam-tools/src/org/jboss/seam/tools ...
Thomas Heute
theute at jboss.com
Mon Jul 24 11:00:23 EDT 2006
User: theute
Date: 06/07/24 11:00:23
Modified: src/org/jboss/seam/tools WebProject.java EjbProject.java
Context.java
Log:
Allow creatiion of basic example project (based on "registration")
Revision Changes Path
1.2 +23 -0 jboss-seam-tools/src/org/jboss/seam/tools/WebProject.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: WebProject.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam-tools/src/org/jboss/seam/tools/WebProject.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- WebProject.java 19 Jul 2006 16:11:33 -0000 1.1
+++ WebProject.java 24 Jul 2006 15:00:23 -0000 1.2
@@ -98,5 +98,28 @@
file = new File(webinfDirectoryPath + File.separatorChar + "web.xml");
TemplateProcessor.process(cfg, "web/web.xml.ftl", webHash, file);
+ if (context.isBasicProject())
+ {
+ copyBasicProject(contentDirectoryPath, webHash, context);
+ }
+ }
+
+ public void copyBasicProject(String destDir, TemplateHashModel ejbHash, Context context) throws GenerationException
+ {
+ Configuration cfg = ConfigurationFactory.getConfiguration();
+
+ // Process index.html
+ File file = new File(destDir + File.separatorChar + "index.html");
+ TemplateProcessor.process(cfg, "basic/index.html.ftl", ejbHash, file);
+
+ // Process register.jsp
+ file = new File(destDir + File.separatorChar + "register." + context.getJsfExtension());
+ TemplateProcessor.process(cfg, "basic/register.jsp.ftl", ejbHash, file);
+
+ // Process registered.jsp
+ file = new File(destDir + File.separatorChar + "registered." + context.getJsfExtension());
+ TemplateProcessor.process(cfg, "basic/registered.jsp.ftl", ejbHash, file);
+
+
}
}
1.2 +42 -0 jboss-seam-tools/src/org/jboss/seam/tools/EjbProject.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: EjbProject.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam-tools/src/org/jboss/seam/tools/EjbProject.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- EjbProject.java 19 Jul 2006 16:11:33 -0000 1.1
+++ EjbProject.java 24 Jul 2006 15:00:23 -0000 1.2
@@ -75,6 +75,11 @@
created = new File(contentDirectoryPath).mkdirs();
if (!created) throw new GenerationException("Could not create directory: " + contentDirectoryPath);
+ // Create lib directory
+ String libDirectoryPath = outputLocation + File.separatorChar + "lib";
+ created = new File(libDirectoryPath).mkdirs();
+ if (!created) throw new GenerationException("Could not create directory: " + libDirectoryPath);
+
// Create META-INF directory
String metainfDirectoryPath = contentDirectoryPath + File.separatorChar + "META-INF";
created = new File(metainfDirectoryPath).mkdirs();
@@ -96,6 +101,43 @@
file = new File(contentDirectoryPath + File.separatorChar + "seam.properties");
TemplateProcessor.process(cfg, "ejb/seam.properties.ftl", ejbHash, file);
+ if (context.isBasicProject())
+ {
+ copyBasicProject(contentDirectoryPath, ejbHash, context);
+ }
+ }
+
+ public void copyBasicProject(String destDir, TemplateHashModel ejbHash, Context context) throws GenerationException
+ {
+ Configuration cfg = ConfigurationFactory.getConfiguration();
+
+ // Create src package directory
+ String srcPackageDir = destDir + File.separatorChar + "org" + File.separatorChar + "jboss" + File.separatorChar + "seam";
+ File file = new File(srcPackageDir);
+ file.mkdirs();
+
+ // Create test package directory
+ String testPackageDir = destDir + File.separatorChar + "org" + File.separatorChar + "jboss" + File.separatorChar + "seam" + File.separatorChar + "test";
+ file = new File(testPackageDir);
+ file.mkdirs();
+
+ // Process Register.java
+ file = new File(srcPackageDir + File.separatorChar + "Register.java");
+ TemplateProcessor.process(cfg, "basic/Register.java.ftl", ejbHash, file);
+
+
+ // Process RegisterTest.java
+ file = new File(testPackageDir + File.separatorChar + "RegisterTest.java");
+ TemplateProcessor.process(cfg, "basic/RegisterTest.java.ftl", ejbHash, file);
+
+
+ // Process RegisterAction.java
+ file = new File(srcPackageDir + File.separatorChar + "RegisterAction.java");
+ TemplateProcessor.process(cfg, "basic/RegisterAction.java.ftl", ejbHash, file);
+
+ // Process User.java
+ file = new File(srcPackageDir + File.separatorChar + "User.java");
+ TemplateProcessor.process(cfg, "basic/User.java.ftl", ejbHash, file);
}
public EarProject getEarProject() {
1.2 +54 -0 jboss-seam-tools/src/org/jboss/seam/tools/Context.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: Context.java
===================================================================
RCS file: /cvsroot/jboss/jboss-seam-tools/src/org/jboss/seam/tools/Context.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- Context.java 19 Jul 2006 16:11:33 -0000 1.1
+++ Context.java 24 Jul 2006 15:00:23 -0000 1.2
@@ -2,16 +2,46 @@
public class Context {
+ /**
+ * Build required elements for WTP support
+ */
private boolean wtpSupport = false;
+ /**
+ * Build required elements for testing environment
+ */
+ private boolean testSupport = true;
+
+ private boolean faceletsSupport = false;
+
+ /**
+ * Build required elements for basic project
+ */
+ private boolean basicProject = false;
+
+ /**
+ * isolation classloading name (jboss-app.xml)
+ */
private String isolationClassLoadingName;
+ /**
+ * directory where to create the projects
+ */
private String outputLocation;
+ /**
+ * Build required elements for debugging
+ */
private boolean debug = true;
+ /**
+ *
+ */
private boolean myFacesLifecycleBug;
+ /**
+ * Default conversation timeout
+ */
private String conversationTimeout = "30000";
private boolean embeddedEJB = false;
@@ -36,6 +66,30 @@
return wtpSupport;
}
+ public boolean isTestSupport() {
+ return testSupport;
+ }
+
+ public void setTestSupport(boolean testSupport) {
+ this.testSupport = testSupport;
+ }
+
+ public boolean isFaceletsSupport() {
+ return faceletsSupport;
+ }
+
+ public void setFaceletsSupport(boolean faceletsSupport) {
+ this.faceletsSupport = faceletsSupport;
+ }
+
+ public boolean isBasicProject() {
+ return basicProject;
+ }
+
+ public void setBasicProject(boolean basicProject) {
+ this.basicProject = basicProject;
+ }
+
public String getIsolationClassLoadingName() {
return isolationClassLoadingName;
}
More information about the jboss-cvs-commits
mailing list