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

Gavin King gavin.king at jboss.com
Thu Nov 2 22:46:16 EST 2006


  User: gavin   
  Date: 06/11/02 22:46:16

  Modified:    src/gen/org/jboss/seam/tool    FaceletGenerator.java
                        JavaClassGenerator.java SeamGenCommandLine.java
  Log:
  list page
  
  Revision  Changes    Path
  1.5       +21 -0     jboss-seam/src/gen/org/jboss/seam/tool/FaceletGenerator.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FaceletGenerator.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/gen/org/jboss/seam/tool/FaceletGenerator.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- FaceletGenerator.java	3 Nov 2006 02:35:44 -0000	1.4
  +++ FaceletGenerator.java	3 Nov 2006 03:46:16 -0000	1.5
  @@ -29,6 +29,7 @@
   public class FaceletGenerator extends AbstractSeamGen {
   
   	private String pageName;
  +   private String masterPageName;
   	private String projectName;
   	private String actionName;
      private String componentName;
  @@ -39,6 +40,7 @@
   		this.projectName = args[1];
         this.actionName = args[2];
         this.pageName = args[3];
  +      if (args.length>4) this.masterPageName = args[4];
         //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);
   	}
  @@ -47,6 +49,7 @@
   		HashMap map = new HashMap();
   		map.put("projectName", this.projectName);
   		map.put("pageName", this.pageName);
  +      map.put("masterPageName", this.masterPageName);
   		map.put("actionName", this.actionName);
         map.put("componentName", this.componentName);      
   		return map;
  @@ -76,6 +79,14 @@
         generateFile("edit-page.ftl", page, getModel());
      }  
      
  +   public void newListPage() throws IOException, TemplateException {
  +      logger.info("Generating a new edit page");
  +      String page = getFaceletPath( this.projectProps.getWorkspaceHome(),
  +            this.projectName, this.masterPageName, this.projectProps.getWtp());     
  +
  +      generateFile("list-page.ftl", page, getModel());
  +   }  
  +   
      public void newFormPage() throws IOException, TemplateException {
         logger.info("Generating a new form page");
         String page = getFaceletPath( this.projectProps.getWorkspaceHome(),
  @@ -126,5 +137,15 @@
         this.componentName = componentName;
      }
   	
  +   protected String getMasterPageName()
  +   {
  +      return masterPageName;
  +   }
  +
  +   protected void setMasterPageName(String masterPageName)
  +   {
  +      this.masterPageName = masterPageName;
  +   }
  +	
   	
   }
  
  
  
  1.4       +10 -1     jboss-seam/src/gen/org/jboss/seam/tool/JavaClassGenerator.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: JavaClassGenerator.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/gen/org/jboss/seam/tool/JavaClassGenerator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -b -r1.3 -r1.4
  --- JavaClassGenerator.java	3 Nov 2006 02:35:44 -0000	1.3
  +++ JavaClassGenerator.java	3 Nov 2006 03:46:16 -0000	1.4
  @@ -123,7 +123,7 @@
   	}
   	
      public void newEntityHome() throws IOException, TemplateException {
  -      logger.info("Generating a new EntityHome SFSB");
  +      logger.info("Generating a new EntityHome");
         String entity = getJavaFilePath(this.projectProps.getWorkspaceHome(),
               this.projectName, this.projectProps.getActionDir(),
               this.actionName + "Home",  this.projectProps.getWtp());
  @@ -131,6 +131,15 @@
         generateFile("EntityHome.ftl", entity, getModel());
      }
      
  +   public void newEntityList() throws IOException, TemplateException {
  +      logger.info("Generating a new EntityList");
  +      String entity = getJavaFilePath(this.projectProps.getWorkspaceHome(),
  +            this.projectName, this.projectProps.getActionDir(),
  +            this.actionName + "List",  this.projectProps.getWtp());
  +      
  +      generateFile("EntityList.ftl", entity, getModel());
  +   }
  +   
   	public void newMdb() throws IOException, TemplateException {
   		logger.info("Generating a new MDB");
   		HashMap model = getModel();
  
  
  
  1.6       +3 -1      jboss-seam/src/gen/org/jboss/seam/tool/SeamGenCommandLine.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: SeamGenCommandLine.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/src/gen/org/jboss/seam/tool/SeamGenCommandLine.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- SeamGenCommandLine.java	3 Nov 2006 02:35:44 -0000	1.5
  +++ SeamGenCommandLine.java	3 Nov 2006 03:46:16 -0000	1.6
  @@ -77,13 +77,15 @@
   		}
   
   		else if (args[0].equals("new-entity")) {
  -			if (args.length == 4) {
  +			if (args.length == 5) {
   				JavaClassGenerator actionGen = new JavaClassGenerator(args);
               FaceletGenerator faceletGen = new FaceletGenerator(args);
               
   				actionGen.newEntity();
               actionGen.newEntityHome();
  +            actionGen.newEntityList();
               faceletGen.newEditPage();
  +            faceletGen.newListPage();
   			} else {
   				throw new Exception("Wrong number of arguments");
   			}
  
  
  



More information about the jboss-cvs-commits mailing list