Page tree
Skip to end of metadata
Go to start of metadata

About this Tutorial

There is going to come a time in the development of your project when you will need to make changes to one or more of the AppFuse core model classes. This tutorial takes you through the seeding of your project with the source code for these classes, and gives some guidelines as to what you can and what you cannot change without breaking AppFuse.

Be Careful


Please be careful when changing the AppFuse model classes. The functionality in the security layer as well as many of the controllers rely on these classes exposing a core set of attributes. The old adage applies: test everything thoroughly!

Before you Start

In order to complete the tutorial you need to have a a recent version of the Subversion command line client installed. Binaries and install instructions for the client are available here.

Get the Model Class Code

The process varies slightly according to which AppFuse archetype you are using:

  1. If you are using one of the basic archetypes, open a command prompt at the root of the project (on the directory that contains the pom.xml).
  2. If you are using one of the modular archetypes, open a command prompt at the root of the core module (on the directory that holds the pom.xml file for the core module).

Now enter the following at the command prompt:

svn export --force

If all goes well, a set of source files have been downloaded into the src folder of your project. These are the AppFuse core model classes - open them in your favourite IDE and spend some time browsing through them. The ones you are interested in are held in the package org.appfuse.model. The download also includes some interfaces from the org.appfuse.dao package - please leave these as they are.

Leave Package and Class Names As They Are


You are free to change the class attributes and methods as you see fit, but you must leave the class package and names unchanged. AppFuse depends on it!

Exclude the AppFuse Data Common Package

You now have all the core AppFuse classes building in your own project, so to avoid any possible classpath clashes you need to exclude the data common module bundled as part of AppFuse.

Add the following <exclusions>..</exclusions> to the existing dependencies in pom.xml (core/pom.xml for modular archetypes):

Model Class Attribute Dependencies

Much of the functionality that ships with AppFuse depends on the presence of a core set of attributes on the model classes. The following table lists these dependencies.






User class must implement org.acegisecurity.userdetails.UserDetails

User Profile


User.password, User.version, User.username, User.confirmPassword,, User.roles, User.addRole(), User.getFullName(),

Password Hint

PasswordHintAction/PasswordHintController/PasswordHint, User.username, User.passwordHint

Active User List


User.username, User.getFullName() (JSF only)

User Signup


User.addRole(), User.password, User.username,, User.getFullName()

Note that a dependency does not mean that you absolutely cannot remove/change the related attribute - it simply means that that piece of functionality will cease to work. Only change the attribute or method if you do not need the functionality in your application!

  • No labels