Hello Geir, "Geir Magnusson Jr." wrote:
#snip() > Re the docs, we can make a quick style for dvsl and drop it into site.dvsl. > That would make it more valuable for everyone - I want to try to start > getting DVSL used in Jakarta-land, so having that will be a plus. Attached is reference documentation for the revised DVSLTask I submitted earlier. I converted the original style.html from the <style> task to XML using the same format already supported by site.dvsl. Rewrote most of the introduction and made many other revisions. At this point it should be fairly complete content wise but still needs a bit of cleanup here and there. Even without any modifications to site.dvsl, the formatting looks quite nice--much better than the existing Ant task docs format. When generating the docs, there are a number of errors in the velocity.log but it doesn't seem to have affected the formatting much at all. -Bill P.S. Since the DVSLTask.java I submitted is substantially different from the original, I should have just sent the whole file in case you have problems applying the patch. So, here it is.
<?xml version="1.0"?> <document> <properties> <title>DVSL Ant Task Reference</title> <author email="[EMAIL PROTECTED]">Geir Magnusson Jr.</author> <meta http-equiv="Content-Language" content="en-us" /> <base href="http://jakarta.apache.org/ant/manual/CoreTasks/" /> </properties> <body> <section name="DVSL Ant Task Reference"> <p>Processes a set of XML documents using a stylesheet written in DVSL (Declarative Velocity Style Language).</p> <p>This is useful for building views of XML based documentation, or for generating code, etc. Conceptually, this task performs the same function as the <style> task included with the Ant distribution but using a stylesheet with DVSL syntax instead of XSLT.</p> <p>As DVSL has a tight binding with Java objects, access is provided to the "Toolbox" which loads properties and objects which are then exposed to the stylesheet in a transparent manner.</p> <p>Since DVSL utilizes Velocity for rendering its output, access is provided to allow configuring the Velocity runtime environment from within this task.</p> <p>It is possible to refine the set of files that are being processed. This can be done with the <i>includes</i>, <i>includesfile</i>, <i>excludes</i>, <i>excludesfile</i> and <i>defaultexcludes</i> attributes. With the <i>includes</i> or <i>includesfile</i> attribute you specify the files you want to have included by using patterns. The <i>exclude</i> or <i>excludesfile</i> attribute is used to specify the files you want to have excluded. This is also done with patterns. And finally with the <i>defaultexcludes</i> attribute, you can specify whether you want to use default exclusions or not. See the section on <a href="../dirtasks.html#directorybasedtasks">directory based tasks</a>, on how the inclusion/exclusion of files works, and how to write patterns.</p> <p>This task forms an implicit <a href="../CoreTypes/fileset.html">FileSet</a> and supports all attributes of <code><fileset></code> (<code>dir</code> becomes <code>basedir</code>) as well as the nested <code><include></code>, <code><exclude></code> and <code><patternset></code> elements.</p> <p>DVSL supports the use of a <tool> element which is used to pass values to the DVSL toolbox configuration.</p> </section> <section name="Parameters"> <table border="1" cellpadding="2" cellspacing="0"> <tr> <td valign="top"><b>Attribute</b></td> <td valign="top"><b>Description</b></td> <td align="center" valign="top"><b>Required</b></td> </tr> <tr> <td valign="top">basedir</td> <td valign="top">where to find the source XML file, default is the project's basedir.</td> <td align="center" valign="top">No</td> </tr> <tr> <td valign="top">destdir</td> <td valign="top">directory in which to store the results.</td> <td align="center" valign="top">Yes, unless in and out have been specified.</td> </tr> <tr> <td valign="top">extension</td> <td valign="top">desired file extension to be used for the targets. If not specified, the default is ".html".</td> <td align="center" valign="top">No</td> </tr> <tr> <td valign="top">style</td> <td valign="top">name of the stylesheet to use - given either relative to the project's basedir or as an absolute path </td> <td align="center" valign="top">Yes</td> </tr> <tr> <td valign="top">classpath</td> <td valign="top">classpath to use when loading toolbox and velocity configuration classes.</td> <td align="center" valign="top">No</td> </tr> <tr> <td valign="top">classpathref</td> <td valign="top">the classpath to use, given as <a href="../using.html#references">reference</a> to a path defined elsewhere.</td> <td align="center" valign="top">No</td> </tr> <tr> <td valign="top">force</td> <td valign="top">Recreate target files, even if they are newer than their corresponding source files or the stylesheet.</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">includes</td> <td valign="top">comma separated list of patterns of files that must be included. All files are included when omitted.</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">includesfile</td> <td valign="top">the name of a file. Each line of this file is taken to be an include pattern</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">excludes</td> <td valign="top">comma separated list of patterns of files that must be excluded. No files (except default excludes) are excluded when omitted.</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">excludesfile</td> <td valign="top">the name of a file. Each line of this file is taken to be an exclude pattern</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">defaultexcludes</td> <td valign="top">indicates whether default excludes should be used or not ("yes"/"no"). Default excludes are used when omitted.</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">in</td> <td valign="top">specifies a single XML document to be styled. Should be used with the out attribute.</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">out</td> <td valign="top">specifies the output name for the styled result from the in attribute.</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">toolboxfile</td> <td valign="top">specifies the toolbox properties file name.</td> <td valign="top" align="center">No</td> </tr> <tr> <td valign="top">velocityconfigclass</td> <td valign="top">specifies a class to load which sets Velocity properties. The class must implement the <code>java.util.Map</code> interface.</td> <td valign="top" align="center">No</td> </tr> </table> </section> <section name="Parameters specified as nested elements"> <subsection name="classpath"> <p>Classpath to use when loading toolbox and velocity configuration classes. This is defined using a <a href="../using.html#path">path</a>-like structure.</p> </subsection> <subsection name="tool"> <p>Set a toolbox property. Properties specified with this nested element override those defined in a properties file specified by the <code>toolboxfile</code> attribute.</p> <strong>Parameters</strong> <table width="60%" border="1" cellpadding="2" cellspacing="0"> <tr> <td valign="top"><b>Attribute</b></td> <td valign="top"><b>Description</b></td> <td align="center" valign="top"><b>Required</b></td> </tr> <tr> <td valign="top">name</td> <td valign="top">Name of the toolbox property</td> <td align="center" valign="top">Yes</td> </tr> <tr> <td valign="top">value</td> <td valign="top">Value of the toolbox property.</td> <td align="center" valign="top">Yes</td> </tr> </table> </subsection> <subsection name="velconfig"> <p>Velconfig is used to set a Velocity configuration property. Properties specified with this nested element override those defined in a class loaded via the <code>velocityconfigclass</code> attribute. </p> <strong>Parameters</strong> <table width="60%" border="1" cellpadding="2" cellspacing="0"> <tr> <td valign="top"><b>Attribute</b></td> <td valign="top"><b>Description</b></td> <td align="center" valign="top"><b>Required</b></td> </tr> <tr> <td valign="top">name</td> <td valign="top">Name of the Velocity configuration property</td> <td align="center" valign="top">Yes</td> </tr> <tr> <td valign="top">value</td> <td valign="top">Value of the Velocity configuration property.</td> <td align="center" valign="top">Yes</td> </tr> </table> </subsection> </section> <section name="Declaring the DVSL Task in the build file"> <p>This task as with any other task not shipped with Ant must be defined in the build file using a <code><taskdef></code> declaration. For example, the following declaration associates a task named <dvsl> with the class <code>org.apache.tools.dvsl.DVSLTask</code>. In addition, the required jars for DVSL support are specified in classpath using a FileSet.</p> <source><![CDATA[ <taskdef name="dvsl" classname="org.apache.tools.dvsl.DVSLTask"> <classpath> <fileset dir="${lib.dir}"> <include name="velocity-dvsl-*.jar" /> <include name="velocity-dep-*.jar" /> <include name="dom4j-*.jar" /> </fileset> </classpath> </taskdef> ]]></source> </section> <section name="Examples"> <p><strong>Simple case running a transformation on all files in a directory:</strong></p> <source><![CDATA[ <dvsl basedir="doc" destdir="build/doc" extension=".html" style="style/apache.dvsl" /> ]]></source> <p><strong>Using parameters to set Toolbox and Velocity properties:</strong></p> <source><![CDATA[ <dvsl basedir="doc" destdir="build/doc" extension=".html" style="style/apache.xsl" classpath="."> <tool name="toolbox.string.mystring" value="Some arbitrary text" /> <tool name="toolbox.tool.footool" value="Footool" /> <velconfig name="runtime.log" value="${basedir}/dvsl.log" /> </dvsl> ]]></source> </section> </body> </document>
DVSLTask.java
Description: application/unknown-content-type-javafile
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
