Built with Seam

You can find the full source code for this website in the Seam package in the directory /examples/wiki. It is licensed under the LGPL.

This document describes the current feature set of the first generation seam-gen, which we need to be sure to maintain (and naturally improve on) in the process of redesigning the tool.

Near the bottom is an itemization of the files that seam-gen and JBoss Tools share. For a good overview of how a seam-gen project differs from a project created by JBoss Tools, see this post by Xebia Blog. One of the main goals of Seam Forge is to eliminate the differences while at the same time bolstering functionality.

This list is a work in progress. Some of the capabilities that seam-gen adds to a project may not be represented in this list.

Project morphology

This section describes many of the files which are present in seam-gen projects. Note that at this time they are specific to JSF, though seam-gen should eventually be able to create non-JSF projects to demonstrate Seam's integration with alternate web frameworks (Wicket, GWT, etc).

  • Webapp descriptor (WEB-INF/web.xml) - Seam listener, filter, and resource servlet, Faces servlet, javax.faces.DEFAULT_SUFFIX (.xhtml), RichFaces/ICEfaces skin/settings, restrict .xhtml files, Facelets development mode
  • Faces descriptor (WEB-INF/faces-config.xml) - Facelets view handler, supported locales
  • Seam component descriptor (WEB-INF/components.xml) - debug mode token, JNDI pattern token, persistence unit configuration, authentication configuration, other basic settings
  • Seam pages descriptor (WEB-INF/pages.xml) - standard exception handlers registered, login page specified
  • Login page (login.xhtml,, - login page bound to Seam's identity component with trivial authentication callback implementation
  • JCA datasources (%profile%-ds.xml and glassfish-resources.xml) - JBoss and GlassFish datasource configuration for database connection pool
  • I18N messsages (messages_*.properties) - Standard set of i18n messages for the following languages: bg, de, en, fr, it, tr
  • Database import script (import-%profile%.sql) - Empty but can be used if set to create or create-drop
  • Persistence unit descriptor (META-INF/persistence-%profile%.xml) - JPA persistence unit configuration using Hibernate provider and datasource; set according to response to setup questions
  • IDE project files - Eclipse (w/ JBoss Tools support), NetBeans, and IntelliJ IDEA project files
  • Home page (home.xhtml) - Default home page presenting information about project
  • CSS (theme.css) - Stylesheet to enchance the RichFaces/ICEfaces theme
  • JAR dependencies with file listing runtime dependencies

Build capabilities

  • Ant-based build
  • Build exploded or packaged archive deployable to either JBoss AS or GlassFish
  • Hot deploy assets and hot deployable components when using an exploded archive
  • Build profiles: replacement tokens substituted from values in per target environment
  • Two classpaths: src/hot compiled/copied to Seam's hot deployment directory; src/main compiled to normal classpath location (WEB-INF/classes or EJB-JAR)
  • Groovy support: copy Groovy scripts to hot deployment classpath in development mode; compile Groovy scripts in production mode
  • TestNG task to run test suites defined in TestNG configuration files ending in Test.xml

Code generation capabilities

  • Reverse engineer database using Hibernate Tools into JPA entity classes
  • Generate UI from JPA entity classes for search and CRUD operations supported by Seam Application Framework; links are bookmarkable
  • Templates for new action, new form, new test, new query, new entity, new conversation

Available add-ons

  • Ivy support for fetching dependencies from a remote repository (currently a precursor step to the main build)
  • User interface for Seam's identity management / declarative authentication using Seam's identity management

Files used by JBoss Tools

The following is a list of seam-gen files that are used by the JBoss Tools Seam plugin. The files are mapped to their destination within the project.

Source Destination
resources/META-INF/persistence-dev.xml (or persistence-dev-war.xml) src/main/META-INF/persistence.xml
resources/WEB-INF/components.xml (or components-war.xml) WebContent/WEB-INF/components.xml
resources/WEB-INF/faces-config.xml WebContent/WEB-INF/faces-config.xml
resources/WEB-INF/jboss-web.xml WebContent/WEB-INF/jboss-web.xml
resources/WEB-INF/pages.xml WebContent/WEB-INF/pages.xml
resources/import.sql src/main/import.sql
resources/datasource-ds.xml resources/@projectName@-ds.xml
resources/ src/main/
resources/security.drl src/main/security.drl
view/* WebContent (FreeMarker templates processed appropriately)
test/*.java test-src (in -test project; FreeMarker templates processed appropriately)
src/*.java src/hot or src/main (FreeMarker templates processed appropriately)
pojo/GetPropertyAnnotation.ftl used in reverse engineering
util/TypeInfo.ftl used in reverse engineering

Note that some files undergo post-processing by seam-gen (commandline script) when creating the project to account for differences between the two projects. For instance, the <use-java-context> setting in the *-ds.xml files needs to be false for seam-gen projects but true for JBDS. The persistence.xml files for the dev profile in seam-gen projects needs to strip the java:/ JNDI prefix for the datasource and be infused with the transaction manager Ant token. These changes allow the seam-gen project to accommodate GlassFish deployments in addition to JBoss AS.

Further reading