[jboss-cvs] jboss-seam-tools/src/org/jboss/seam/tools ...

Thomas Heute theute at jboss.com
Thu Aug 10 08:55:21 EDT 2006


  User: theute  
  Date: 06/08/10 08:55:21

  Modified:    src/org/jboss/seam/tools   WebProject.java EjbProject.java
  Log:
  Use resource classloading instead of simple directories
  
  Revision  Changes    Path
  1.4       +10 -10    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.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- WebProject.java	8 Aug 2006 11:33:12 -0000	1.3
  +++ WebProject.java	10 Aug 2006 12:55:21 -0000	1.4
  @@ -37,7 +37,7 @@
    * Common structure for Web projects
    * 
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version <tt>$Revision: 1.3 $</tt>
  + * @version <tt>$Revision: 1.4 $</tt>
    */
   public abstract class WebProject extends Project {
   
  @@ -56,19 +56,19 @@
   
   	public void copyBasicProject(String destDir, TemplateHashModel ejbHash, Context context) throws GenerationException
   	{
  -		Configuration cfg = ConfigurationFactory.getConfiguration();
  +		Configuration cfg = ConfigurationFactory.getConfiguration("basic");
   		
   		// Process index.html
   		File file = new File(destDir + File.separatorChar + "index.html");
  -		TemplateProcessor.process(cfg, "basic/index.html.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "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);
  +		TemplateProcessor.process(cfg, "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);
  +		TemplateProcessor.process(cfg, "registered.jsp.ftl", ejbHash, file);
   	}
   	
   	public void copyLibs(Context context) throws GenerationException
  @@ -133,7 +133,7 @@
   	
   	protected void createWebInf(String directory, TemplateHashModel webHash) throws IOException, GenerationException
   	{
  -		Configuration cfg = ConfigurationFactory.getConfiguration();
  +		Configuration cfg = ConfigurationFactory.getConfiguration("web");
   
   		// Create WEB-INF directory
   		String webinfDirectoryPath = directory + File.separatorChar + "WEB-INF";
  @@ -141,19 +141,19 @@
   		
   		// Process WEB-INF/components.xml
   		File file = new File(webinfDirectoryPath + File.separatorChar + "components.xml");
  -		TemplateProcessor.process(cfg, "web/components.xml.ftl", webHash, file);
  +		TemplateProcessor.process(cfg, "components.xml.ftl", webHash, file);
   
   		// Process WEB-INF/faces-config.xml
   		file = new File(webinfDirectoryPath + File.separatorChar + "faces-config.xml");
  -		TemplateProcessor.process(cfg, "web/faces-config.xml.ftl", webHash, file);
  +		TemplateProcessor.process(cfg, "faces-config.xml.ftl", webHash, file);
   		
   		// Process WEB-INF/pages.xml
   		file = new File(webinfDirectoryPath + File.separatorChar + "pages.xml");
  -		TemplateProcessor.process(cfg, "web/pages.xml.ftl", webHash, file);
  +		TemplateProcessor.process(cfg, "pages.xml.ftl", webHash, file);
   		
   		// Process WEB-INF/web.xml
   		file = new File(webinfDirectoryPath + File.separatorChar + "web.xml");
  -		TemplateProcessor.process(cfg, "web/web.xml.ftl", webHash, file);
  +		TemplateProcessor.process(cfg, "web.xml.ftl", webHash, file);
   
   
   	}
  
  
  
  1.5       +22 -22    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.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- EjbProject.java	9 Aug 2006 08:43:26 -0000	1.4
  +++ EjbProject.java	10 Aug 2006 12:55:21 -0000	1.5
  @@ -37,7 +37,7 @@
    * Common structure for EJB projects
    * 
    * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
  - * @version <tt>$Revision: 1.4 $</tt>
  + * @version <tt>$Revision: 1.5 $</tt>
    */
   public abstract class EjbProject extends Project {
   
  @@ -55,7 +55,7 @@
   	
   	public void createBasicProjectMainSources(String destDir, TemplateHashModel ejbHash, Context context) throws GenerationException
   	{
  -		Configuration cfg = ConfigurationFactory.getConfiguration();
  +		Configuration cfg = ConfigurationFactory.getConfiguration("basic");
   		
   		// Create src package directory
   		String srcPackageDir = destDir + File.separatorChar + context.getSrcPackage().replace('.', File.separatorChar); 
  @@ -64,20 +64,20 @@
   		
   		// Process Register.java
   		file = new File(srcPackageDir + File.separatorChar + "Register.java");
  -		TemplateProcessor.process(cfg, "basic/Register.java.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "Register.java.ftl", ejbHash, file);
   
   		// Process RegisterAction.java
   		file = new File(srcPackageDir + File.separatorChar + "RegisterAction.java");
  -		TemplateProcessor.process(cfg, "basic/RegisterAction.java.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "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);
  +		TemplateProcessor.process(cfg, "User.java.ftl", ejbHash, file);
   	}
   	
   	public void createBasicProjectTestSources(String destDir, TemplateHashModel ejbHash, Context context) throws GenerationException
   	{
  -		Configuration cfg = ConfigurationFactory.getConfiguration();
  +		Configuration cfg = ConfigurationFactory.getConfiguration("basic");
   
   		// Create src package directory
   		String srcPackageDir = destDir + File.separatorChar + context.getTestPackage().replace('.', File.separatorChar); 
  @@ -86,23 +86,23 @@
   		
   		// Process RegisterTest.java
   		file = new File(srcPackageDir + File.separatorChar + "RegisterTest.java");
  -		TemplateProcessor.process(cfg, "basic/RegisterTest.java.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "RegisterTest.java.ftl", ejbHash, file);
   
   	}
   
   	public void createBasicProjectTestResources(String destDir, TemplateHashModel ejbHash, Context context) throws GenerationException
   	{
  -		Configuration cfg = ConfigurationFactory.getConfiguration();
  +		Configuration cfg = ConfigurationFactory.getConfiguration("basic");
   		
   		// Process testng.xml
   		File file = new File(destDir + File.separatorChar + "testng.xml");
  -		TemplateProcessor.process(cfg, "basic/testng.xml.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "testng.xml.ftl", ejbHash, file);
   	}
   
   
   	public void createTestSupport(String destDir, TemplateHashModel ejbHash, Context context) throws GenerationException
   	{
  -		Configuration cfg = ConfigurationFactory.getConfiguration();
  +		Configuration cfg = ConfigurationFactory.getConfiguration("test");
   		
   		// Create confTest/WEB-INF directory
   		String webInfTestDir = destDir + File.separatorChar + "WEB-INF"; 
  @@ -111,35 +111,35 @@
   
   		// Process components.properties
   		file = new File(destDir + File.separatorChar + "components.properties");
  -		TemplateProcessor.process(cfg, "test/components.properties.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "components.properties.ftl", ejbHash, file);
   		
   		// Process components.xml
   		file = new File(webInfTestDir + File.separatorChar + "components.xml");
  -		TemplateProcessor.process(cfg, "test/components.xml.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "components.xml.ftl", ejbHash, file);
   		
   		// Process default.persistence.properties
   		file = new File(destDir + File.separatorChar + "default.persistence.properties");
  -		TemplateProcessor.process(cfg, "test/default.persistence.properties.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "default.persistence.properties.ftl", ejbHash, file);
   		
   		// Process ejb3-interceptors-aop.xml
   		file = new File(destDir + File.separatorChar + "ejb3-interceptors-aop.xml");
  -		TemplateProcessor.process(cfg, "test/ejb3-interceptors-aop.xml.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "ejb3-interceptors-aop.xml.ftl", ejbHash, file);
   		
   		// Process embedded-jboss-beans.xml
   		file = new File(destDir + File.separatorChar + "embedded-jboss-beans.xml");
  -		TemplateProcessor.process(cfg, "test/embedded-jboss-beans.xml.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "embedded-jboss-beans.xml.ftl", ejbHash, file);
   
   		// Process jboss-jms-beans.xml
   		file = new File(destDir + File.separatorChar + "jboss-jms-beans.xml");
  -		TemplateProcessor.process(cfg, "test/jboss-jms-beans.xml.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "jboss-jms-beans.xml.ftl", ejbHash, file);
   
   		// Process jndi.properties
   		file = new File(destDir + File.separatorChar + "jndi.properties");
  -		TemplateProcessor.process(cfg, "test/jndi.properties.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "jndi.properties.ftl", ejbHash, file);
   
   		// Process log4j.xml
   		file = new File(destDir + File.separatorChar + "log4j.xml");
  -		TemplateProcessor.process(cfg, "test/log4j.xml.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "log4j.xml.ftl", ejbHash, file);
   	}
   	
   	public RootProject getRootProject() {
  @@ -153,7 +153,7 @@
   
   	public void createResources(String directory, TemplateHashModel ejbHash) throws IOException, GenerationException
   	{
  -		Configuration cfg = ConfigurationFactory.getConfiguration();
  +		Configuration cfg = ConfigurationFactory.getConfiguration("ejb");
   		
   		// Create META-INF directory
   		String metainfDirectoryPath = directory + File.separatorChar + "META-INF";
  @@ -162,15 +162,15 @@
   		
   		// Process META-INF/ejb-jar.xml
   		File file = new File(metainfDirectoryPath + File.separatorChar + "ejb-jar.xml");
  -		TemplateProcessor.process(cfg, "ejb/ejb-jar.xml.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "ejb-jar.xml.ftl", ejbHash, file);
   
   		// Process META-INF/persistence.xml
   		file = new File(metainfDirectoryPath + File.separatorChar + "persistence.xml");
  -		TemplateProcessor.process(cfg, "ejb/persistence.xml.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "persistence.xml.ftl", ejbHash, file);
   
   		// Process seam.properties
   		file = new File(directory + File.separatorChar + "seam.properties");
  -		TemplateProcessor.process(cfg, "ejb/seam.properties.ftl", ejbHash, file);
  +		TemplateProcessor.process(cfg, "seam.properties.ftl", ejbHash, file);
   
   	}
   
  
  
  



More information about the jboss-cvs-commits mailing list