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.
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:
- 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).
- 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:
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.
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.password, User.version, User.username, User.confirmPassword, User.email, User.roles, User.addRole(), User.getFullName(), Role.name
User.email, User.username, User.passwordHint
Active User List
User.username, User.getFullName() (JSF only)
User.addRole(), User.password, User.username, User.email, 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!