[jboss-cvs] /jboss-seam/src/gen/org/jboss/seam/tool ...

James Williams james.williams at jboss.com
Thu Nov 2 15:34:10 EST 2006


  User: jwilliams
  Date: 06/11/02 15:34:10

  Added:       jboss-seam/src/gen/org/jboss/seam/tool      
                        JavaClassGenerator.java AbstractSeamGen.java
                        SeamGenCommandLine.java FaceletGenerator.java
                        BuildPropertiesBean.java
                        BuildPropertiesGenerator.java
  Log:
  Fixed windows path issue.
  
  Added a "componentName" attribute that is actionName with first letter lowercase
  
  Cleaned up the command line class and removed a few commands.
  
  added lgpl licence notice.
  
  moved code to /src/gen instead of /seam-gen/sourcefiles
  
  Revision  Changes    Path
  1.1      date: 2006/11/02 20:34:10;  author: jwilliams;  state: Exp;/jboss-seam/src/gen/org/jboss/seam/tool/JavaClassGenerator.java
  
  Index: JavaClassGenerator.java
  ===================================================================
  /*******************************************************************************
   *    JBoss, Home of Professional Open Source
   *    Copyright 2006, JBoss Inc., and individual contributors as indicated
   *    by the @authors tag. See the copyright.txt in the distribution for a
   *    full listing of individual contributors.
   *   
   *    This is free software; you can redistribute it and/or modify it
   *    under the terms of the GNU Lesser General Public License as
   *    published by the Free Software Foundation; either version 2.1 of
   *    the License, or (at your option) any later version.
   *   
   *    This software is distributed in the hope that it will be useful,
   *    but WITHOUT ANY WARRANTY; without even the implied warranty of
   *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   *    Lesser General Public License for more details.
   *   
   *    You should have received a copy of the GNU Lesser General Public
   *    License along with this software; if not, write to the Free
   *    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   *    02110-1301 USA, or see the FSF site: http://www.fsf.org.
   *******************************************************************************/
  package org.jboss.seam.tool;
  
  import java.io.IOException;
  import java.util.HashMap;
  
  import freemarker.template.TemplateException;
  
  public class JavaClassGenerator extends AbstractSeamGen {
  
  	private String interfaceName;
  	private String actionName;
     private String componentName;
  	private String projectName;
  	
  	//for mdb
  	private String mdbDestination;
  	private String mdbDestinationType;
  
  	public JavaClassGenerator() {};
  
  	public JavaClassGenerator(String[] args) throws IOException {
  		this.projectName = args[1];
  		this.actionName = args[2];
  		this.interfaceName = args[2];	    
        
        //make the component name same as action name but first char lower case
        this.componentName = this.actionName.substring(0,1).toLowerCase() + this.actionName.substring(1);
  	}
  	
  	private HashMap getModel() throws IOException {
  		HashMap map = new HashMap();
  		map.put("projectName", this.projectName);
  		map.put("actionName", this.actionName);
        map.put("componentName", this.componentName);
  		map.put("interfaceName", this.interfaceName);
  		map.put("packageName", this.projectProps.getActionPackage());
  		map.put("testPackageName", this.projectProps.getTestPackage());
  		map.put("bpmPackage", this.projectProps.getBpmPackage());
  		map.put("mdbPackage", this.projectProps.getMdbPackage());
  		map.put("entityPackage", this.projectProps.getModelPackage());
  		
  		return map;
  	}
  
  	public void newAction() throws IOException, TemplateException {
  		logger.info("Generating a new SFSB and interface");
  		String sfsbAction = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getActionDir(),
  				this.actionName+"Action",  this.projectProps.getWtp());
  		String sfsbInterface = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getActionDir(),
  				this.interfaceName, this.projectProps.getWtp());		
  
  		generateFile("CreateSFSBAction.ftl", sfsbAction, getModel());
  		generateFile("CreateSFSBInterface.ftl", sfsbInterface, getModel());
  	}	
  	
  	public void newStatelessAction() throws IOException, TemplateException {
  		logger.info("Generating a new SLSB and interface");
  		String slsbAction = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getActionDir(),
  				this.actionName+"Action",  this.projectProps.getWtp());
  		String slsbInterface = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getActionDir(),
  				this.interfaceName, this.projectProps.getWtp());		
  
  		generateFile("CreateSLSBAction.ftl", slsbAction, getModel());
  		generateFile("CreateInterface.ftl", slsbInterface, getModel());
  	}	
  	
  	public void newConversation() throws IOException, TemplateException {
  		logger.info("Generating a new SFSB Conversation and interface");
  		String sfsbAction = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getActionDir(),
  				this.actionName+"Action",  this.projectProps.getWtp());
  		String sfsbInterface = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getActionDir(),
  				this.interfaceName, this.projectProps.getWtp());		
  
  		generateFile("CreateSFSBConversation.ftl", sfsbAction, getModel());
  		generateFile("CreateInterfaceConversation.ftl", sfsbInterface, getModel());
  	}	
  	
  	public void newTestcase() throws IOException, TemplateException {
  		logger.info("Generating a new TestNG test case");
  		String testAction = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getTestDir(),
  				this.actionName+"Test",  this.projectProps.getWtp());
  		
  		String testNgXml = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getTestDir(),
  				this.actionName+"Test",  this.projectProps.getWtp(), true);
  		
  		generateFile("TestCase.ftl", testAction, getModel());
  		generateFile("testng.ftl", testNgXml, getModel());
  	}
  	
  	public void newBpmAction() throws IOException, TemplateException {
  		logger.info("Generating a new jBPM Action Class");
  		String bpmAction = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getBpmDir(),
  				this.actionName,  this.projectProps.getWtp());
  		
  		generateFile("BpmAction.ftl", bpmAction, getModel());
  	}
  	
  	public void newEntity() throws IOException, TemplateException {
  		logger.info("Generating a new Entity EJB");
  		String entity = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getModelDir(),
  				this.actionName,  this.projectProps.getWtp());
  		
  		generateFile("Entity.ftl", entity, getModel());
  	}
  	
  	public void newMdb() throws IOException, TemplateException {
  		logger.info("Generating a new MDB");
  		HashMap model = getModel();
  		String mdb = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  				this.projectName, this.projectProps.getMdbDir(),
  				this.actionName,  this.projectProps.getWtp());
  		model.put("destination", this.mdbDestination);
  		model.put("destinationType", this.mdbDestinationType);	
  					
  		generateFile("Mdb.ftl", mdb, model);
  	}
  
  	public String getActionName() {
  		return actionName;
  	}
  
  	public void setActionName(String actionName) {
  		this.actionName = actionName;
  	}
  
  	public String getInterfaceName() {
  		return interfaceName;
  	}
  
  	public void setInterfaceName(String interfaceName) {
  		this.interfaceName = interfaceName;
  	}
  
  	public String getMdbDestination() {
  		return mdbDestination;
  	}
  
  	public void setMdbDestination(String mdbDestination) {
  		this.mdbDestination = mdbDestination;
  	}
  
  	public String getMdbDestinationType() {
  		return mdbDestinationType;
  	}
  
  	public void setMdbDestinationType(String mdbDestinationType) {
  		this.mdbDestinationType = mdbDestinationType;
  	}
  
  	public String getProjectName() {
  		return projectName;
  	}
  
  	public void setProjectName(String projectName) {
  		this.projectName = projectName;
  	}
  
     public String getComponentName()
     {
        return componentName;
     }
  
     public void setComponentName(String componentName)
     {
        this.componentName = componentName;
     }
  }
  
  
  
  1.1      date: 2006/11/02 20:34:10;  author: jwilliams;  state: Exp;/jboss-seam/src/gen/org/jboss/seam/tool/AbstractSeamGen.java
  
  Index: AbstractSeamGen.java
  ===================================================================
  /*******************************************************************************
   *    JBoss, Home of Professional Open Source
   *    Copyright 2006, JBoss Inc., and individual contributors as indicated
   *    by the @authors tag. See the copyright.txt in the distribution for a
   *    full listing of individual contributors.
   *   
   *    This is free software; you can redistribute it and/or modify it
   *    under the terms of the GNU Lesser General Public License as
   *    published by the Free Software Foundation; either version 2.1 of
   *    the License, or (at your option) any later version.
   *   
   *    This software is distributed in the hope that it will be useful,
   *    but WITHOUT ANY WARRANTY; without even the implied warranty of
   *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   *    Lesser General Public License for more details.
   *   
   *    You should have received a copy of the GNU Lesser General Public
   *    License along with this software; if not, write to the Free
   *    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   *    02110-1301 USA, or see the FSF site: http://www.fsf.org.
   *******************************************************************************/
  package org.jboss.seam.tool;
  
  import java.io.File;
  import java.io.FileInputStream;
  import java.io.FileWriter;
  import java.io.IOException;
  import java.io.Writer;
  import java.util.HashMap;
  import java.util.Properties;
  import java.util.logging.Level;
  import java.util.logging.Logger;
  
  import freemarker.template.Configuration;
  import freemarker.template.DefaultObjectWrapper;
  import freemarker.template.Template;
  import freemarker.template.TemplateException;
  
  public abstract class AbstractSeamGen {
  
  	protected static Logger logger = Logger.getLogger("SeamGen");
  
  	protected BuildPropertiesBean projectProps = new BuildPropertiesBean();
  
  	private static Level logLevel = Level.INFO;
  
  	private static Configuration cfg = new Configuration();
  
  	public AbstractSeamGen() {
  		logger.setLevel(logLevel);
  		try {
  			init();
  		} catch (IOException e) {
  			logger.log(Level.SEVERE, e.getMessage());
  		}
  	}
  
  	public void init() throws IOException {
  		cfg.setDirectoryForTemplateLoading(new File("freemarker-templates"));
  		cfg.setObjectWrapper(new DefaultObjectWrapper());
  		setBuildPropertiesBean();
  	}
  
  	public void setBuildPropertiesBean() throws IOException {
  		Properties buildProps = new Properties();
  		buildProps.load(new FileInputStream("build.properties"));
  
  		this.projectProps.setActionDir(buildProps.getProperty("action.dir"));
  		this.projectProps.setActionPackage(buildProps
  				.getProperty("action.package"));
  		this.projectProps.setBpmDir(buildProps.getProperty("bpm.dir"));
  		this.projectProps.setBpmPackage(buildProps.getProperty("bpm.package"));
  		this.projectProps.setJbossHome(buildProps.getProperty("jboss.home"));
  		this.projectProps.setMdbDir(buildProps.getProperty("mdb.dir"));
  		this.projectProps.setMdbPackage(buildProps.getProperty("mdb.package"));
  		this.projectProps.setModelDir(buildProps.getProperty("model.dir"));
  		this.projectProps.setModelPackage(buildProps
  				.getProperty("model.package"));
  		this.projectProps.setTestDir(buildProps.getProperty("test.dir"));
  		this.projectProps
  				.setTestPackage(buildProps.getProperty("test.package"));
  		this.projectProps.setWorkspaceHome(buildProps
  				.getProperty("workspace.home"));
  		this.projectProps.setWtp(buildProps.getProperty("eclipse.wtp"));
  	}
  
  	protected String getJavaFilePath(String workspaceHome, String projectName,
  			String packageDir, String fileName, String wtp) {
  
  		// This isn't a testng.xml file
  		return getJavaFilePath(workspaceHome, projectName, packageDir,
  				fileName, wtp, false);
  
  	}
  
  	protected String getJavaFilePath(String workspaceHome, String projectName,
  			String packageDir, String fileName, String wtp, boolean isTestNgXml) {
  		StringBuffer buff = new StringBuffer(workspaceHome);
  		buff.append("/");
  
  		buff.append(projectName);
  		if (wtp.equalsIgnoreCase("Y")) {
  			buff.append("EJB/ejbModule");
  		}
  
  		else {
  			buff.append("/src");
  		}
  
  		buff.append("/");
  		buff.append(packageDir);
  		buff.append("/");
  		buff.append(fileName);
  
  		if (isTestNgXml)
  			buff.append(".xml");
  		else
  			buff.append(".java");
  
  		return buff.toString();
  	}
  
  	protected String getFaceletPath(String workspaceHome, String projectName,
  			String fileName, String wtp) {
  		StringBuffer buff = new StringBuffer(workspaceHome);
  		buff.append("/");
  
  		buff.append(projectName);
  		if (wtp.equalsIgnoreCase("Y")) {
  			buff.append("Web/WebContent/");
  		} else {
  			buff.append("/view/");
  		}
  
  		buff.append(fileName);
  		buff.append(".xhtml");
  
  		return buff.toString();
  	}
  
  	protected static void generateFile(String templateName, String outputFile,
  			HashMap templateVariables) throws IOException, TemplateException {
  		Template template;
  
  		// Get or create a template
  		template = cfg.getTemplate(templateName);
  
  		// create output file path
  		File outFile = new File(outputFile);
  		File basePath = outFile.getParentFile();
  		
  		//we do want to overwrite build.properties file only in 
  		//all cases for "set-properties" seamgen task
  		if (!outFile.exists() || outFile.getName() == "build.properties") {
  			if (basePath != null) {
  				basePath.mkdirs();
  			}
  
  			// Merge data model with template
  			Writer out = new FileWriter(outputFile);
  			template.process(templateVariables, out);
  			out.flush();
  			logger
  					.info("New File Generated by Seam Gen using: "
  							+ templateName);
  			logger.info("File path is: " + outFile.getPath());
  		} else {
  			logger.info("No file generated because it already exists");
  		}
  	}
  
  }
  
  
  
  1.1      date: 2006/11/02 20:34:10;  author: jwilliams;  state: Exp;/jboss-seam/src/gen/org/jboss/seam/tool/SeamGenCommandLine.java
  
  Index: SeamGenCommandLine.java
  ===================================================================
  /*******************************************************************************
   *    JBoss, Home of Professional Open Source
   *    Copyright 2006, JBoss Inc., and individual contributors as indicated
   *    by the @authors tag. See the copyright.txt in the distribution for a
   *    full listing of individual contributors.
   *   
   *    This is free software; you can redistribute it and/or modify it
   *    under the terms of the GNU Lesser General Public License as
   *    published by the Free Software Foundation; either version 2.1 of
   *    the License, or (at your option) any later version.
   *   
   *    This software is distributed in the hope that it will be useful,
   *    but WITHOUT ANY WARRANTY; without even the implied warranty of
   *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   *    Lesser General Public License for more details.
   *   
   *    You should have received a copy of the GNU Lesser General Public
   *    License along with this software; if not, write to the Free
   *    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   *    02110-1301 USA, or see the FSF site: http://www.fsf.org.
   *******************************************************************************/
  package org.jboss.seam.tool;
  
  public class SeamGenCommandLine {
  
  	public static void main(String[] args) throws Exception {
  
  		if (args[0].equals("set-properties")) {
  			// check to make sure we have right # of arguments
  			if (args.length == 9) {
  				BuildPropertiesBean projectProps = new BuildPropertiesBean(args);
  				BuildPropertiesGenerator propsGen = new BuildPropertiesGenerator(
  						projectProps);
  				propsGen.generate();
  			} else {
  				throw new Exception("Wrong number of arguments");
  			}
  		} 
  
  		else if (args[0].equals("new-stateless-action")) {
  			if (args.length == 4) {
  				JavaClassGenerator actionGen = new JavaClassGenerator(args);            
              FaceletGenerator faceletGen = new FaceletGenerator(args);
              
              faceletGen.newPage();
              actionGen.newStatelessAction();            
              actionGen.newTestcase();
  			} else {
  				throw new Exception("Wrong number of arguments");
  			}
  		}
  
  		else if (args[0].equals("new-conversation")) {
  			if (args.length == 4) {
  				JavaClassGenerator actionGen = new JavaClassGenerator(args);
              FaceletGenerator faceletGen = new FaceletGenerator(args);
                         
              faceletGen.newPage();
  				actionGen.newConversation();
              actionGen.newTestcase();
  			} else {
  				throw new Exception("Wrong number of arguments");
  			}
  		}
  		else if (args[0].equals("new-bpm-action")) {
  			if (args.length == 3) {
  				JavaClassGenerator actionGen = new JavaClassGenerator(args);
  				actionGen.newBpmAction();
  			} else {
  				throw new Exception("Wrong number of arguments");
  			}
  		}
  
  		else if (args[0].equals("new-entity")) {
  			if (args.length == 3) {
  				JavaClassGenerator actionGen = new JavaClassGenerator(args);
  				actionGen.newEntity();
  			} else {
  				throw new Exception("Wrong number of arguments");
  			}
  		}
  
  		else if (args[0].equals("new-mdb")) {
  			if (args.length == 5) {
  				JavaClassGenerator actionGen = new JavaClassGenerator(args);
  				actionGen.setMdbDestination(args[3]);
  				actionGen.setMdbDestinationType(args[4]);
  				actionGen.newMdb();
  			} else {
  				throw new Exception("Wrong number of arguments");
  			}
  		} 
  		
  		else {
  			System.out.println("No command executed");
  		}
  	}
  
  }
  
  
  
  1.1      date: 2006/11/02 20:34:10;  author: jwilliams;  state: Exp;/jboss-seam/src/gen/org/jboss/seam/tool/FaceletGenerator.java
  
  Index: FaceletGenerator.java
  ===================================================================
  /*******************************************************************************
   *    JBoss, Home of Professional Open Source
   *    Copyright 2006, JBoss Inc., and individual contributors as indicated
   *    by the @authors tag. See the copyright.txt in the distribution for a
   *    full listing of individual contributors.
   *   
   *    This is free software; you can redistribute it and/or modify it
   *    under the terms of the GNU Lesser General Public License as
   *    published by the Free Software Foundation; either version 2.1 of
   *    the License, or (at your option) any later version.
   *   
   *    This software is distributed in the hope that it will be useful,
   *    but WITHOUT ANY WARRANTY; without even the implied warranty of
   *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   *    Lesser General Public License for more details.
   *   
   *    You should have received a copy of the GNU Lesser General Public
   *    License along with this software; if not, write to the Free
   *    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   *    02110-1301 USA, or see the FSF site: http://www.fsf.org.
   *******************************************************************************/
  package org.jboss.seam.tool;
  
  import java.io.IOException;
  import java.util.HashMap;
  
  import freemarker.template.TemplateException;
  
  public class FaceletGenerator extends AbstractSeamGen {
  
  	private String pageName;
  	private String projectName;
  	private String actionName;
     private String componentName;
  	
  	public FaceletGenerator() {};
  
  	public FaceletGenerator(String[] args) throws IOException {
  		this.projectName = args[1];
  		this.pageName = args[3];
        this.actionName = args[2];
  	}
  	
  	private HashMap getModel() throws IOException {
  		HashMap map = new HashMap();
  		map.put("projectName", this.projectName);
  		map.put("pageName", this.pageName);
  		map.put("actionName", this.actionName);
        map.put("componentName", this.componentName);
        
        //make the component name same as action name but first char lower case
        this.componentName = this.actionName.substring(0,1).toLowerCase() + this.actionName.substring(1);
        
  		return map;
  	}
  
  	public void newPage() throws IOException, TemplateException {
  		logger.info("Generating a new Facelet Page");
  		String pageTemplate = getFaceletPath( this.projectProps.getWorkspaceHome(),
  				this.projectName, "template", this.projectProps.getWtp());
  		String page = getFaceletPath( this.projectProps.getWorkspaceHome(),
  				this.projectName, this.pageName, this.projectProps.getWtp());		
  
  		generateFile("page.ftl", page, getModel());
  	}	
  	
  	public void newActionPage() throws IOException, TemplateException {
  		logger.info("Generating a new action Facelet Page");
  		String pageTemplate = getFaceletPath( this.projectProps.getWorkspaceHome(),
  				this.projectName, "template", this.projectProps.getWtp());
  		String page = getFaceletPath( this.projectProps.getWorkspaceHome(),
  				this.projectName, this.pageName, this.projectProps.getWtp());		
  
  		generateFile("action-page.ftl", page, getModel());
  	}	
  	
  	public String getProjectName() {
  		return projectName;
  	}
  
  	public void setProjectName(String projectName) {
  		this.projectName = projectName;
  	}
  
  	public String getPageName() {
  		return pageName;
  	}
  
  	public void setPageName(String pageName) {
  		this.pageName = pageName;
  	}
  
  	public String getActionName() {
  		return actionName;
  	}
  
  	public void setActionName(String actionName) {
  		this.actionName = actionName;
  	}
  
     public String getComponentName()
     {
        return componentName;
     }
  
     public void setComponentName(String componentName)
     {
        this.componentName = componentName;
     }
  	
  	
  }
  
  
  
  1.1      date: 2006/11/02 20:34:10;  author: jwilliams;  state: Exp;/jboss-seam/src/gen/org/jboss/seam/tool/BuildPropertiesBean.java
  
  Index: BuildPropertiesBean.java
  ===================================================================
  /*******************************************************************************
   *    JBoss, Home of Professional Open Source
   *    Copyright 2006, JBoss Inc., and individual contributors as indicated
   *    by the @authors tag. See the copyright.txt in the distribution for a
   *    full listing of individual contributors.
   *   
   *    This is free software; you can redistribute it and/or modify it
   *    under the terms of the GNU Lesser General Public License as
   *    published by the Free Software Foundation; either version 2.1 of
   *    the License, or (at your option) any later version.
   *   
   *    This software is distributed in the hope that it will be useful,
   *    but WITHOUT ANY WARRANTY; without even the implied warranty of
   *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   *    Lesser General Public License for more details.
   *   
   *    You should have received a copy of the GNU Lesser General Public
   *    License along with this software; if not, write to the Free
   *    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   *    02110-1301 USA, or see the FSF site: http://www.fsf.org.
   *******************************************************************************/
  package org.jboss.seam.tool;
  
  public class BuildPropertiesBean {
  	
  	private String workspaceHome;
  	private String jbossHome;
  	private String actionPackage;
  	private String actionDir;
  	private String modelPackage;
  	private String modelDir;
  	private String testDir;
  	private String testPackage;
  	private String bpmDir;
  	private String bpmPackage;
  	private String mdbDir;
  	private String mdbPackage;
  	private String wtp;	
  
  	public BuildPropertiesBean(){}
  	
  	public BuildPropertiesBean(String args[])
  	{
  		this.workspaceHome = fixPath(args[1]);
  		this.jbossHome = fixPath(args[2]);
  		
        this.actionPackage = args[3];
  		this.actionDir = args[3].replace(".", "/");
  		this.modelPackage = args[4];
  		this.modelDir = args[4].replace(".", "/");
  		this.testDir = args[5].replace(".", "/");
  		this.testPackage = args[5];
  		this.bpmDir = args[6].replace(".", "/");
  		this.bpmPackage = args[6];
  		this.mdbDir = args[7].replace(".", "/");
  		this.mdbPackage = args[7];
  		this.wtp = args[8];
  	}
     
     private String fixPath(String aPath)
     {
        return aPath.replace("\\", "\\\\");      
     }
  	
  	public String getActionDir() {
  		return actionDir;
  	}
  	public void setActionDir(String actionDir) {
  		this.actionDir = actionDir;
  	}
  	public String getActionPackage() {
  		return actionPackage;
  	}
  	public void setActionPackage(String actionPackage) {
  		this.actionPackage = actionPackage;
  	}
  	public String getBpmDir() {
  		return bpmDir;
  	}
  	public void setBpmDir(String bpmDir) {
  		this.bpmDir = bpmDir;
  	}
  	public String getBpmPackage() {
  		return bpmPackage;
  	}
  	public void setBpmPackage(String bpmPackage) {
  		this.bpmPackage = bpmPackage;
  	}
  	public String getJbossHome() {
  		return jbossHome;
  	}
  	public void setJbossHome(String jbossHome) {
  		this.jbossHome = jbossHome;
  	}
  	public String getMdbDir() {
  		return mdbDir;
  	}
  	public void setMdbDir(String mdbDir) {
  		this.mdbDir = mdbDir;
  	}
  	public String getMdbPackage() {
  		return mdbPackage;
  	}
  	public void setMdbPackage(String mdbPackage) {
  		this.mdbPackage = mdbPackage;
  	}
  	public String getModelDir() {
  		return modelDir;
  	}
  	public void setModelDir(String modelDir) {
  		this.modelDir = modelDir;
  	}
  	public String getModelPackage() {
  		return modelPackage;
  	}
  	public void setModelPackage(String modelPackage) {
  		this.modelPackage = modelPackage;
  	}
  	public String getTestDir() {
  		return testDir;
  	}
  	public void setTestDir(String testDir) {
  		this.testDir = testDir;
  	}
  	public String getTestPackage() {
  		return testPackage;
  	}
  	public void setTestPackage(String testPackage) {
  		this.testPackage = testPackage;
  	}
  	public String getWorkspaceHome() {
  		return workspaceHome;
  	}
  	public void setWorkspaceHome(String workspaceHome) {
  		this.workspaceHome = workspaceHome;
  	}
  
  	public String getWtp() {
  		return wtp;
  	}
  
  	public void setWtp(String wtp) {
  		this.wtp = wtp;
  	}
  	
  	
  	
  }
  
  
  
  1.1      date: 2006/11/02 20:34:10;  author: jwilliams;  state: Exp;/jboss-seam/src/gen/org/jboss/seam/tool/BuildPropertiesGenerator.java
  
  Index: BuildPropertiesGenerator.java
  ===================================================================
  /*******************************************************************************
   *    JBoss, Home of Professional Open Source
   *    Copyright 2006, JBoss Inc., and individual contributors as indicated
   *    by the @authors tag. See the copyright.txt in the distribution for a
   *    full listing of individual contributors.
   *   
   *    This is free software; you can redistribute it and/or modify it
   *    under the terms of the GNU Lesser General Public License as
   *    published by the Free Software Foundation; either version 2.1 of
   *    the License, or (at your option) any later version.
   *   
   *    This software is distributed in the hope that it will be useful,
   *    but WITHOUT ANY WARRANTY; without even the implied warranty of
   *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
   *    Lesser General Public License for more details.
   *   
   *    You should have received a copy of the GNU Lesser General Public
   *    License along with this software; if not, write to the Free
   *    Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
   *    02110-1301 USA, or see the FSF site: http://www.fsf.org.
   *******************************************************************************/
  package org.jboss.seam.tool;
  
  import java.io.IOException;
  import java.util.HashMap;
  
  import freemarker.template.TemplateException;
  
  public class BuildPropertiesGenerator extends AbstractSeamGen {
  	
  	BuildPropertiesBean projectProps;
  	
  	public BuildPropertiesGenerator(BuildPropertiesBean projectProps){
  		this.projectProps = projectProps;
  	}
  	
  	public void generate() throws IOException, TemplateException
  	{
  		logger.info("Generating a new build.properties file");
  		HashMap map = new HashMap();
  		map.put("projectProps", this.projectProps);
  	
  		generateFile("build-properties.ftl", "build.properties", map);
  	}
  	
  	public void generateWtp() throws IOException, TemplateException
  	{
  		logger.info("Generating a new build.properties file");
  		HashMap map = new HashMap();
  		map.put("projectProps", this.projectProps);
  	
  		generateFile("build-properties.ftl", "build.properties", map);
  	}
  }
  
  
  



More information about the jboss-cvs-commits mailing list