Skip navigation

Release Notes 2.0 M5
Added by Matt Raible, last edited by tibi@dds.nl on Jun 25, 2007 03:58
(None)

Toggle Sidebar

The major features in this release are Code Generation, Full Source and XFire support. Please see about the AppFuse Maven Plugin (AMP) for more information on how to generate code and import AppFuse source into your project. In addition, we've finally solved the DAO Framework switching problem. However, AMP relies on a hibernate.cfg.xml file to generate code, so if you switch to iBATIS or JPA, you may need to keep this file around until we come up with a better solution. Finally, we added an "appfuse-core" archetype that allows you to create a backend-only application with Managers, DAOs and Web Services.

Please see the Upgrade Guide below or the QuickStart Guide to get started with this release.

Upgrade Guide

If you're currently using AppFuse 2.0 M4, here's a few things you'll need to change to upgrade to 2.0 M5. If you're using a version prior to 2.0 M4, you may want to follow previous upgrade instructions first.

Diff is your friend
The easiest way to make the changes below might be to compare your pom.xml, web.xml and web-tests.xml with the ones from a new archetype. Beyond Compare is a fabulous diff tool for Windows users.
  1. Backup your project on your local file system or (even better) in your source control system.
  2. In pom.xml, change <appfuse.version>2.0-m4</appfuse.version> to <appfuse.version>2.0-m5</appfuse.version>.
    War inplace
    Take care when using mvn war:inplace (exploded war for mvn jetty:run) to remove old class file first from the WEB-INF folder: rm -r src/main/webapp/WEB-INF/classes
  3. The default usernames and passwords have changed from mraible/tomcat and tomcat/tomcat to admin/admin and user/user. In addition, the default role names have changed from "admin" and "user" to "ROLE_ADMIN" and "ROLE_USER". You'll need to update your login.xml, applicationContext-struts.xml, menu-config.xml, sample-data.xml, web-tests.xml and security.xml (if you've customized it) to reflect this change. Using a diff tool to do this is probably the easiest solution.
    Own roles
    You need to change your roles to the same format. From myRole to ROLE_myRole (or better ROLE_MY_ROLE).
  4. If you've created any Managers or DAOs, you'll may need to make some changes as described below.
  5. Maven's war overlay feature is based on timestamps. If you've overridden AppFuse files in your project, you'll need to "touch" them in order to give them a newer timestamp. Here's a sample of what you might run:
    touch src/main/webapp/*
    touch src/main/webapp/scripts/*
    touch src/main/webapp/WEB-INF/*
    touch src/main/webapp/WEB-INF/pages/*
    Another, more permanent, solution is to use <dependentWarExcludes> to prevent the files from being overlayed.
  6. In pom.xml, change the groupId of the appfuse-maven-plugin from org.appfuse to org.codehaus.mojo.
  7. If you'd like to use the appfuse-maven-plugin to generate code in a pre-2.0 M5 project, you'll need to add placeholders to various XML files
  8. The default goal in basic projects has changed from "package" to "install".
  9. JPA: The <warpathExcludes> should have **/persistence.xml instead of "persistence.xml".
  10. If you want to switch your persistence framework from Hibernate to iBATIS or JPA, you'll need to configure your appfuse-${web.framework} dependency to exclude appfuse-hibernate. If you're using a modular archetype, put the following exclusion on your appfuse-service dependency.
    <dependency>
        <groupId>org.appfuse</groupId>
        <artifactId>appfuse-${web.framework}</artifactId>
        <version>${appfuse.version}</version>
        <type>warpath</type>
        <!-- This exclusion and the dependency following this one allow DAO framework switching. -->
        <!-- You only need these if you want to use JPA or iBATIS. See APF-565 for more information. -->
        <!-- It does no harm to leave it in for Hibernate, but it's not needed. -->
        <exclusions>
            <exclusion>
                <groupId>org.appfuse</groupId>
                <artifactId>appfuse-hibernate</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.appfuse</groupId>
        <artifactId>appfuse-${dao.framework}</artifactId>
        <version>${appfuse.version}</version>
    </dependency>
    
  11. Add <version>2.0</version> to the cobertura-maven-plugin to fix its "100% code coverage" bug.
    <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>cobertura-maven-plugin</artifactId>
        <version>2.0</version>
    </plugin>
    
  12. Configure the maven-pmd-plugin so it works with JDK 5.
    <plugin>
        <artifactId>maven-pmd-plugin</artifactId>
        <configuration>
            <linkXref>true</linkXref>
            <targetJdk>1.5</targetJdk>
        </configuration>
    </plugin>
    
  13. Change <spring.version> to 2.0.5 if you have it specified in your pom.xml.
  14. The maven-warpath-plugin has a new version of 1.0-m5. Update your pom.xml.
  15. In webapp/common/menu.jsp, change the path of the Velocity template from "WEB-INF/classes/cssHorizontalMenu.vm" to "cssHorizontalMenu.vm". This is necessary if you plan on using "mvn jetty:run" after running "mvn appfuse:full-source".
  16. Some menu location changes were made: the Main Menu is now hidden on the login screen and Upload File has moved to Admin Menu. You're not required to make these changes in your project, it was more of a cosmetic change.
  17. The OpenSessionInViewFilter is now commented out in web.xml by default. It's not needed by AppFuse and makes it more difficult to test everything with iBATIS and JPA.
  18. XFire is now integrated by default. If you'd like to use web services in your project, you'll need to make a few changes to your web.xml. Diffs are available for JSF, Spring, Struts and Tapestry. Thanks to Luke McLean for detailed instructions on integration.
  19. The syntax for setting the heading has changed. If you haven't customized your decorators/default.jsp, you'll need to change your headings from <content tag="heading"><fmt:message key="mainMenu.heading"/></content> to <meta name="heading" content="<fmt:message key='mainMenu.heading'/>"/>. This was done to reduce errors from JSP editors in Eclipse and IDEA.

Change in usage of Managers and DAOs

In versions prior to M5, the EntityManager.merge() method was being used incorrectly. This has been fixed for M5, and the fix requires a slight modification of how Manager and DAO methods are used. Previously, the 'save' methods (semantically, these methods handle saving a new object or updating a previously saved one) returned void. Now, these methods return a value.

So, for example, when SignupAction.java used the userManager in versions prior to M5, it did so like this:

userManager.saveUser(user);

Starting with version M5, the code should look like this:

user = userManager.saveUser(user);

This change is required if you used jpa-hibernate as your persistence implementation. Incidentally, if you used hibernate or iBatis as your persistence implementation, this change is not required for your code to still work the same. That being said, it is recommended that you make the modifications for the latter two options as time allows for the sake of consistency.

If you have any questions about how to use these manager or daos, a good place to look for usage examples is the tests, as all tests in M5 have been updated to reflect this subtle change.

If you're really interested in understanding the motivation behind the change, feel free to look at APF-695.

About the AppFuse Maven Plugin

This release marks the first release of the AppFuse Maven Plugin (AMP). This plugin currently does two things: 1) code generation for CRUD and 2) allows you to convert your project to use AppFuse's source instead of using its binary dependencies. If you'd like to use this plugin in your pre 2.0-M5 project, see its usage instructions.

Generating CRUD with AMP

In the 2.0 M5 release, you can run the following command to generate CRUD screens/classes for a POJO:

mvn appfuse:gen -Dentity=Name

If you don't specify the entity name, you will be prompted for it. Currently, if a @Column has "nullable = false", a "required field" validation rule will be generated as part of the web framework's validation configuration. After generating the code, you can install it using:

mvn appfuse:install -Dentity=Name

Your entity must be defined in your hibernate.cfg.xml file for this to work.
You should also make sure that the database tables for your entities have been generated by running

mvn compile hibernate3:hbm2ddl

and connecting to the database to check that a table with the correct name exists.

In a modular project, these commands must be run in the "core" and "web" modules. The plugin is smart enough to figure out when it should/should not generate stuff based on the packaging type (jar vs. war). In a future release, we hope to combine "gen" and "install" into a single command.

There's also a goal that allows you to generate model objects from database tables.

appfuse:gen-model

This goal does not install the generated files into your source tree, so you'll need to manually copy it. If you want to generate CRUD for the object, you'll also want to add it to your hibernate.cfg.xml.

We hope to combine these commands in a future release.

Installing AppFuse's source into your project

The good news is creating an "old style" project is now pretty easy. If you create a new project using 2.0-m5-SNAPSHOT, you can now use:

mvn appfuse:full-source

This goal will convert your project to use all of AppFuse's source and remove all dependencies on AppFuse. Known issues with "full-source" include:

  1. It only supports basic archetypes. It will likely only take a couple of hours to add modular project support, so this feature will be in the next release.
  2. It doesn't do package renaming. We plan to add this as part of the next release.

What the full-source plugin does:

  1. Exports all sources from Subversion into your project. It reads the dao.framework and web.framework properties to determine what you need.
  2. Removes warpath plugin from pom.xml.
  3. Calculates dependencies by reading pom.xml files form the various AppFuse modules. It replaces your dependencies with these new ones. The order of the dependencies added is alphabetical based on groupId.
  4. Reads properties from the root AppFuse pom.xml and adds the ones that don't exist to your project. Since these are stored in a java.util.Properties, I was unable to sort them alphabetically.

If you have issues developing AppFuse in Eclipse or NetBeans because of the WarPath plugin, running "appfuse:full-source" should fix that problem. It removes the warpath plugin as part of its installation process.

Detailed Changelog

AppFuse JIRA (51 issues)
T Key Summary Status Res
Bug APF-813 Appfuse 1.9.4 does not work with UTF-8 for Vietnamese ResolvedResolved FIXED
Bug APF-768 Mixed Case Entity Names handled incorrectly in generated test ResolvedResolved FIXED
Improvement APF-766 Change maven-jetty-plugin to monitor specific XML files rather than WEB-INF directory ResolvedResolved FIXED
Improvement APF-765 Upgrade to EhCache 1.3 Beta 2 ResolvedResolved FIXED
Task APF-764 Add to release notes and documentation to note the files and placeholders that AMP expects ResolvedResolved FIXED
Task APF-763 Change tutorials to reflect that applicationContext.xml might already exist ResolvedResolved FIXED
Task APF-762 Upgrade appfuse-demos (tutorial code) to 2.0 M5 ResolvedResolved FIXED
Bug APF-756 maven-pmd-plugin is not configured for JDK 5 ResolvedResolved FIXED
Bug APF-754 AMP requires users to duplicate src/main/resources/hibernate.cfg.xml in web module when using a modular archetype ResolvedResolved FIXED
New Feature APF-753 cut down version of appfuse (say, appfuse-core) that has only dao and service layers ResolvedResolved FIXED
Improvement APF-749 Menu Changes: Hide Main Menu on Login and move Upload File to Admin Menu ResolvedResolved FIXED
Bug APF-748 plexus-utils is hidden from plugins in SVN version of the maven embedder ResolvedResolved FIXED
Bug APF-745 Canoo test - PasswordHint fails ClosedClosed FIXED
Bug APF-742 Velocity Menu doesn't work when using jetty:run on a full-source project ResolvedResolved FIXED
Bug APF-741 UserCounterListener doesn't add logged in users on Jetty ResolvedResolved FIXED
Bug APF-740 cobertura-maven-plugin version 2.1 doesn't work, revert to version 2.0 ResolvedResolved FIXED
Bug APF-739 Struts2 tags (autocompleter, datetimepicker) don't work out-of-the-box (dojo scripts not loading) ResolvedResolved WON'T FIX
Improvement APF-738 Upgrade to DWR 2.0.1 ResolvedResolved FIXED
Bug APF-737 Ajax4JSF doesn't work when user not signed in ResolvedResolved FIXED
Improvement APF-734 Change default usernames to admin/admin and user/user and role names to follow Acegi Conventions ResolvedResolved FIXED
Improvement APF-733 Upgrade to Apache MyFaces Tomahawk 1.1.5 ResolvedResolved FIXED
Bug APF-730 pmd plugin fails if not set to the right jdk ResolvedResolved FIXED
Bug APF-727 Upgrade to Spring 2.0.5 ResolvedResolved FIXED
Improvement APF-725 Add @SuppressWarnings("unchecked") to methods where generic casting is necessary ResolvedResolved FIXED
Bug APF-723 Change Struts to filter on FORWARDs so URL Rewrite Filter can be used to pretty up URLs ResolvedResolved FIXED
Improvement APF-721 Maven Test (mvn test); Remote Debugging Added ResolvedResolved FIXED
Improvement APF-719 Upgrade to Commons DBCP 1.2.2 ResolvedResolved FIXED
Improvement APF-717 update maven archtype:create commands on QuickStart page to match FAQ package guidlines ResolvedResolved FIXED
Improvement APF-714 Comment out OpenSessionInViewFilter in web.xml since it's not needed ResolvedResolved FIXED
Improvement APF-713 Modify links to the 'dev' mailing list to alert subscribers they most likely want the 'user' list ResolvedResolved FIXED
Bug APF-712 Error "No name provided and several persistence units found" when using JPA ResolvedResolved FIXED
Bug APF-711 Wrong encoding of Umlaute in ApplicationResources_de and correction of some misspelling ResolvedResolved FIXED
Bug APF-709 Remove messages.jps include in error.jsp ResolvedResolved FIXED
Improvement APF-708 Mysql default character set not set to utf-8 on Appfuse DE 2.0M4 ResolvedResolved FIXED
Task APF-707 iBatis sample implementaion(Tutorial) ResolvedResolved FIXED
Bug APF-706 no end tag </label> ResolvedResolved FIXED
Improvement APF-695 Fix the way EntityManager.merge is being used and get rid of the DaoUtils class ResolvedResolved FIXED
Bug APF-683 Upgrade to Hibernate3 Plugin version 2.0-alpha-2-SNAPSHOT ResolvedResolved FIXED
New Feature APF-675 Create archetypes like Equinox that contain full source and support Ant ResolvedResolved FIXED
Bug APF-662 iBatis Mapping file issue ResolvedResolved FIXED
Improvement APF-642 Change <form:errors> to use "div" element ResolvedResolved FIXED
Bug APF-640 Fix overlaying menu entries when using locale DE ResolvedResolved FIXED
Bug APF-637 Update Dao and Manager Tutorials to reflect things you need to do when using a modular archetype ResolvedResolved FIXED
Improvement APF-622 struts.xml file edited in video ambiguous when trying to do the example ResolvedResolved FIXED
Improvement APF-594 Change the database name to match the artifact ID. ResolvedResolved FIXED
Bug APF-565 Setting dao.framework property doesn't work in AppFuse-generated projects ResolvedResolved FIXED
Task APF-491 Create documentation for AppFuse 2.0 ResolvedResolved FIXED
New Feature APF-490 Replace AppGen with an annotation-aware code generation tool ResolvedResolved FIXED
New Feature APF-488 Integrate XFire by default (for existing classes and generated classes) ResolvedResolved FIXED
Improvement APF-487 Change all <titles> to be nested in <head> and move from content tag to meta tag ResolvedResolved FIXED
Improvement APF-404 Tapestry Improvements from Review by Howard Lewis Ship ResolvedResolved FIXED


Adaptavist Theme Builder Powered by Atlassian Confluence