Expert Spring MVC and Web Flow

(Dana P.) #1
The Ant syntax should be familiar enough, so we’ll concentrate on the key points. The
classpath that is set up initially is there to ensure that BeanDoc has access to those JAR files
we mentioned earlier. In this example, the runtime dependencies would all be located in
${lib.dir}. The BeanDoc task itself is declared in the inittarget (which the beandoctarget
depends on, so it’s guaranteed to be ready for use). In the last section, we actually call the
BeanDoc task.
To run successfully, BeanDoc only needs to know which files make up your application
context and where you want to place the output. You can use one or more nested filesetsto
choose the input resources.

Other Options


With the setup described, BeanDoc will happily function and maintain a nicely formatted set
of HTML documentation for your Spring project. But there are many ways in which you can
customize the output should you so wish. Following is a brief overview of some of the more
widely useful options. (For details of more advanced options, see the BeanDoc reference doc-
umentation linked from the main website.)
Most of BeanDoc’s customizable attributes are managed through a properties file that you
can locate anywhere. To tell the Ant task where to load them from, specify the beandocProps
attribute on the task itself, as shown in Listing A-2.

Listing A-2.Specifying beandoc Properties

<beandoc outputDir="${output.dir}"
beandocProps="/path/to/beandoc.properties">
<fileset dir="${conf.dir}">
<include name="*Context.xml"/>
<include name="*-servlet.xml"/>
</fileset>
</beandoc>

■Tip The samplesdirectory of the BeanDoc distribution contains a well-commented beandoc.properties
file that will give you examples of most of the other properties you might be interested in.

Controlling the Output


Let’s briefly look at the two most common options you want to set in the properties file
to affect the documentation produced. First, if you’ve downloaded and installed Graphviz
(and we highly recommend that you do), then you need to specify where the executable file is.
Listing A-3 shows the relevant options. Modify your paths depending on where you chose to
install to, of course.

374 APPENDIX A ■DOCUMENTING YOUR MVC APPLICATION

584X_Ch13_AppA_FINAL 1/30/06 1:13 PM Page 374

Free download pdf