Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

WebWork comes with a utility called WebFlow. WebFlow is used to generate graphical diagrams representing the flow of your web application. It does this by parsing your configuration files, action classes, and view (JSP, Velocity, and FreeMarker) files. An example of a typical output of WebFlow is provided (for the full size, click here):

Image Added

Setting up

WebFlow is built in to WebWork, so if you're up and running with WebWork, you don't need to do anything additional java packages. However, WebFlow does require the "dot" package by GraphViz.

You'll need to download the latest version of GraphViz and make sure that the dot executable (dot.exe in Windows) is in your command path. In Windows the GraphViz installer typically automatically adds dot.exe to your path. However, you may need to do this by hand depending on your system configuration.

Usage

You can use WebFlow with the following command:

Panelcode

java -cp ... -jar webwork.jar
     -config CONFIG_DIR 
     -views VIEWS_DIRS 
     -output OUTPUT 
     [-ns NAMESPACE]

Where:

  • CONFIG_DIR is the directory where xwork.xml and other configuration files are located
  • VIEWS_DIRS is a comma separated list of directories where you JSPs and Velocity files are located
  • OUTPUT is the directory where WebFlow will write its files
  • NAMESPACE (optional) is the namespace that you wish to restrict WebFlow
Warning

You must supply the correct classpath when invoking the WebFlow tool. Specifically, the XWork, WebWork, and their dependencies must be included in the classpath. Futhermore, you must also include your action class files referenced in xwork.xml. Without the proper class path entries, WebFlow will not function properly.

Using dot files

WebFlow outputs files with the extension "dot". These files are used by the GraphViz tool. Once WebFlow has produced the dot files, you can then use the dot program to render a GIF file that contains the actual diagrams of your site.

Once you have run WebFlow, check the directory specified in the "output" argument (OUTPUT). In there you will find two files: out.dot and out.gif. You may immediately open up out.gif and view the web application flow. However, you may also wish to either run the out.dot file through a different GraphVis layout engine (neato, twopi, etc), so the original dot file is provided as well. You may also wish to edit the dot file before rendering the final flow diagram.

Automatic Execution

Some advanced users may wish to execute WebFlow from within their application – this could be required if you are developing an application that supports WebWork plugin capabilities. This can easily be done.*After install GraphViz, you can use the dot tool to create the GIF file:
example: dot.exe -Tgif output.dot -o graph.gif