Raible's Wiki

Raible Designs
Wiki Home
News
Recent Changes

AppFuse

Homepage
  - Korean
  - Chinese
  - Italian
  - Japanese

QuickStart Guide
  - Chinese
  - French
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish
  - Japanese

User Guide
  - Korean
  - Chinese

Tutorials
  - Chinese
  - German
  - Italian
  - Korean
  - Portuguese
  - Spanish

FAQ
  - Korean

Latest Downloads

Other Applications

Struts Resume
Security Example
Struts Menu

Set your name in
UserPreferences


Referenced by
...nobody




JSPWiki v2.2.33

[RSS]


Hide Menu

FormattingSourceCode


This is version 13. It is not the current version, and thus it cannot be edited.
[Back to current version]   [Restore this version]


This page will show you how to setup appfuse 1.8 and jalopy so that you can format/beautify your code.

This tutorial is divided in two. First we have to setup an ant task that calls jalopy to format your code, once there we'll have to modify appfuse's source code (I hope it's not for long, since all we do is modify the javadoc comments in the code).

Setup AppFuse

  • First you need to create a folder named lib/jalopy-1.0b11 and extract the contents of jalopy-1.0b11.zip in there.
  • Edit the lib/lib.properties file and add this lines at the end
#
# Jalopy - http://jalopy.sourceforge.net
#
jalopy.version=1.0b11
jalopy.dir=${lib.dir}/jalopy-${jalopy.version}
jalopy.jar=${jalopy.dir}/jalopy-ant-0.6.2.jar
  • Open the properties.xml and search for the <path id="web.test.classpath">...</path> section and add the following under it
<path id="jalopy.classpath">
    <path refid="dao.test.classpath"/>
    <path refid="service.test.classpath"/>
    <path refid="web.test.classpath"/>
    <fileset dir="${jalopy.dir}" includes="*.jar"/>
</path>
  • Open the build.xml file and search for the <!-- Taskdefs --> section and add the following under it
        <taskdef name="jalopy"
            classname="de.hunsicker.jalopy.plugin.ant.AntPlugin"
            classpath="${jalopy.jar}"/>
  • Still in the same file (build.xml) find the docs target and add the following above it
    <target name="jalopy" depends="compile">
        <jalopy convention="um.xml"
            loglevel="info"
            threads="2"
            classpathref="jalopy.classpath">
            <fileset dir="${src}">
                <include name="**/*.java"/>
            </fileset>
        </jalopy>
    </target>
If you're looking at what we're doing you'll notice a convention xml named um.xml... this is the convention I use, and you can change it if you like, but I won't get into that, there are tools to do that (an Eclipse plugin, a standalone gui, etc.). By the way, the um.xml is attached at the bottom of this page as well as the jalopy-1.0b11.zip (you'll have to use this one, if you want jalopy task you've just create it to format your javadoc comments, because it's patched to know what to do with the servlet-mapping tag found in some servlets).

Thats it!!! Well... not quite, we still have to modify some javadocs :-)...

Fixing AppFuse's javadocs

Before this it all was fun, now comes the ugly part... But be patient, it's worth it!!!

  • Open /src/dao/org/appfuse/dao/hibernate.BaseDaoHibernate.java file and add a <p> at the start of the class javadoc.
  • Open /src/dao/org/appfuse/model/LabelValue.java file and insert * <p> before the line 14 and change both <p/> in lines 11 and 12 respectively for <br/>.
  • Open /src/dao/org/appfuse/model/Address.java file and add a <p> at the start of the class javadoc.
  • Open /src/dao/org/appfuse/model/Role.java file and add a <p> at the start of the class javadoc and in the @author section Dan Kibler [email protected] should be <a href="mailto:[email protected]">Dan Kibler</a>.
  • Open /src/dao/org/appfuse/model/User.java file and do the same with the @author.
  • Open /src/service/org/appfuse/service/impl/RoleManagerImpl.java file and add a <p> at the start of the class javadoc.
  • Open /src/service/org/appfuse/service/impl/UserManagerImpl.java file and add a <p> at the start of the class javadoc.

Attachments:
jalopy-1.0b11.zip Info on jalopy-1.0b11.zip 1343353 bytes
um.xml Info on um.xml 14555 bytes


Go to top   More info...   Attach file...
This particular version was published on 06-Nov-2006 13:52:47 MST by DavidMendoza.