Raible's Wiki
Raible Designs AppFuseHomepage- Korean - Chinese - Italian - Japanese QuickStart Guide User Guide Tutorials Other ApplicationsStruts ResumeSecurity Example Struts Menu
Set your name in
UserPreferences
Referenced by
JSPWiki v2.2.33
Hide Menu |
This is version 2.
It is not the current version, and thus it cannot be edited. DTO in AppFuse using XSnapshotPart II: Implementing the example - Create Model, DAO, Manager, Actions for the example
Table of contentIntroduction : presenting the example[#1]In this example, we wiil create a very simple project manager. We can list and edit projects which contain a leader and some participants. Here there is a class diagram for this example. NOTE:by my little xsnapshot experience, it's recommened to use only Classes type, even for primary type (int, long...)
I am assuming that you know AppFuse, so you know how to generate and configure DAOs, Managers, Actions and JSPs for the classes of the model. If not, please refer first to the Matt Raible tutorial. The model[#2]We start with creating the Person class :
Copy generated files into the project's directory between each command.
<table name='person'>
<column>id</column>
<column>first_name</column>
<column>last_name</column>
<row>
<value>1</value>
<value>Matt</value>
<value>Raible</value>
</row>
<row>
<value>2</value>
<value>James</value>
<value>Davidson</value>
</row>
<row>
<value>3</value>
<value>John</value>
<value>Smith</value>
</row>
<row>
<value>4</value>
<value>Steven</value>
<value>Franks</value>
</row>
<row>
<value>5</value>
<value>Kevin</value>
<value>Gerorge</value>
</row>
<row>
<value>6</value>
<value>Mark</value>
<value>O'Connor</value>
</row>
</table>
<table name="project">
<column>id</column>
<column>name</column>
<column>description</column>
<column>startDate</column>
<column>leader</column>
<row>
<value>1</value>
<value>Appfuse</value>
<value>AppFuse is an application for "kickstarting" webapp development.</value>
<value>2004-03-01 13:41:57.886</value>
<value>1</value>
</row>
<row>
<value>2</value>
<value>Equinox</value>
<value>A lightweight version of AppFuse</value>
<value>2005-06-12 13:41:57.886</value>
<value>1</value>
</row>
</table>
<table name="person_project">
<column>project</column>
<column>person</column>
<row>
<value>1</value>
<value>1</value>
</row>
<row>
<value>1</value>
<value>2</value>
</row>
<row>
<value>2</value>
<value>1</value>
</row>
</table>
Yeah Baby, Yeah:
BUILD SUCCESSFUL The webapp [#3]
From "extras/appgen" execute :
you should have a project list page like this :
if you edit a project, you should have a page like this :
The goal of you project is to easyly map model classes to a 'flat' form for Struts, specially, for embedded Person objects into project classes. Next Up: Part III: Replace Beanutils by XSnapshot Attachments:
|
|||||||||