-
1. Re: Jboss Seam - Confusion on Project Structure
gonorrhea May 16, 2009 12:56 AM (in response to varun077)I prefer the one root folder (project folder) approach via seam-gen cmd line.
Here is some feedback I got on this very confusing topic from the JBoss Tools team:
me:
Also, it seems strange to me that when you use seam-gen from cmd line, you end up with one high level project folder (in my case 'BETS'). But when you create a new Seam project using JBoss Tools (or Seam tools??), you end up with 4 high level folders for the exact same project (i.e. it's an EAR, etc.)JBoss tools team:
Seam-gen projects use ant sript to build/deploy EAR/EJB/WAR. So you can use any project structure. It's metter of ant file to handle it. But JBoss Tools depends on Eclipse Web Tools. And you have to have WTP-strucrtured projects to have whole set of features. For EAR deployment type it creates 4 projects: EAR,EJB,WAR,Test. And there are two projects in case of WAR deployment: WAR,Test.source: http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4216787#4216787
So the root cause of the 4 folders is WTP compatibility with JBoss Tools (very bad restriction!)
It's very confusing b/c when you look at any of the example projects in the Seam distro, they all have the standard one high level root folder structure.
This is another reason why the ramp up time with Seam is very high... :(
/-------------------------------------------------------------------------------------------------------------------/
Answers to your questions:
1. WTP
2. ant explode
3. if you ran 'seam generate' the following happens:
Generate CRUD pages and controllers for an existing database schema. Combines the generate-model and generate-ui commands to create the JPA entity classes and then the pages and controllers that allow them to be managed.
So if you add a column, you can manually update your entity class to reflect that change and any requisite metadata (e.g. @OneToMany, etc.) for that column. Or you can re-run 'seam generate-model' to refresh your entities.
Keep in mind that Seam has something called SAF (Seam Application Framework) which supports full CRUD operations via EntityQuery and EntityHome classes, etc. and creates a working but basic CRUD application after you run the appropraite seam-gen commands.
You may not necessarily want to use this depending on your use cases (obviously your functional requirements and use cases will make the views generated completely unusable).
My preference is to reverse-engineer my database schema so I have my entity classes (bottom-up approach) and write the xhtml and Seam components (EJB, JavaBean, etc.) by hand. You will also need to configure the pages.xml file for page navigation and exception handling, etc.
enjoy.
-
2. Re: Jboss Seam - Confusion on Project Structure
varun077 May 18, 2009 8:05 AM (in response to varun077)Thanks Arbi for detailed response.
I have couple of more question,
a) Where is purpose of pages.xml explained in SEAM documentation?
b) I am assuming pages.xml has to do with SEAM, not JSF. I mean I could not find reference to pages.xml in a JSF book that I have.