| Software Secret Weapons™ |
How To Use Linguine Maps From Ant Build Files posted by Pavel Simakov on 2005-11-18 16:48:49 under Linguine Maps |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Linguine Maps provides clean object-oriented diagramming API for graph visualization. This is how it works:
Here is a smallest working Apache Ant build file for programmatic visualization:
<project name="Test" default="build" basedir=".">
<property name="doc" location="doc"/>
<property name="bin" location="bin"/>
<property name="dot.exe" location="${bin}/graphviz-2.4/bin/dot.exe" />
<taskdef
name="ant2gif"
classname="com.oy.shared.lm.ant.ANTtoGIFTask"
classpath="${dist}/lib/oy-lm-1.3.jar"
/>
<target name="build" >
<ant2gif
caption="XML file for launching Catalina 5.0.25 applications using Apache Ant."
rotated="true"
colors="cyan, lightcyan, orange, black, black"
inFile="${src}/com/oy/shared/lm/test/ant/catalina-5.0.25.xml"
dotFile="${doc}/test/ant/catalina-5.0.25.dot"
outFile="${doc}/test/ant/catalina-5.0.25.gif"
exeFile="${dot.exe}"
/>
</target>
</project>
There are several tasks for programmatic visualization of various files types. Before using them, you would need to define a custom Ant task. You can define custom tasks as follows:
<taskdef
name="ant2gif"
classname="com.oy.shared.lm.ant.ANTtoGIFTask"
classpath="${dist}/lib/oy-lm-1.3.jar"
/>
<taskdef
name="ojb2gif"
classname="com.oy.shared.lm.ant.OJBtoGIFTask"
classpath="${dist}/lib/oy-lm-1.3.jar"
/>
<taskdef
name="hbm2gif"
classname="com.oy.shared.lm.ant.HBMtoGIFTask"
classpath="${dist}/lib/oy-lm-1.3.jar"
/>
<taskdef
name="dtd2gif"
classname="com.oy.shared.lm.ant.DTDtoGIFTask"
classpath="${dist}/lib/oy-lm-1.3.jar"
/>
<taskdef
name="wsdl2gif"
classname="com.oy.shared.lm.ant.WSDLtoGIFTask"
classpath="${dist}/lib/oy-lm-1.3.jar"
/>
After new tasks have been defined you can use them in the Ant build files as shown in the example above. All tasks have identical set of parameters, with following usage:
Starting with release 1.3 HBM2GIF task in addition to a inFile attribute supports nested <fileset> elements. In this case a single diagram is produced reflecting contents of all mapping files contained in the <fileset>. For example:
<hbm2gif
caption="HIBERNATE - Animal & Beings"
rotated="true"
colors="#FF5937, black, black"
dotFile="${doc}/test/hbm/AnimalBeings.dot"
outFile="${doc}/test/hbm/AnimalBeings.png"
exeFile="${dot.exe}"
>
<fileset dir="${src}/com/oy/shared/lm/test/hbm/">
<include name="Animal.hbm.xml"/>
<include name="Beings.hbm.xml"/>
</fileset>
</hbm2gif>
Please review runme.xml Comment (1) Leave a comment |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright © 2004-2009 by Pavel Simakov |
|
Comment by Kolorowanki — June 28, 2009 @ 6:15 pm
nice API:)
Cheers for that!
M.K.