Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>One strategy that I have used in the past is to have an ANT script generate another ANT build file and then execute that dynamically generated ANT build file in the run:</p> <ol> <li>invoke a process(to fetch SVN info)</li> <li>invoke an XSLT to dynamically produce another ANT build file(with a dynamically constructed ANTForm)</li> <li>invoke the dynamically generated ANT build file (using antcall, ant, etc)</li> </ol> <p>A stylesheet like this could be used as a starting point to generate the dynamic ANT build file that invokes the dynamically generated ANT Form:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"&gt; &lt;xsl:output indent="yes"/&gt; &lt;xsl:template match="/"&gt; &lt;project name="enhancedRSS" default="form" basedir="."&gt; &lt;taskdef name="antform" classname="com.sardak.antform.AntForm" classpath="${antform.home}/lib/antform.jar"/&gt; &lt;target name="form"&gt; &lt;xsl:call-template name="ANTFORM" /&gt; &lt;/target&gt; &lt;/project&gt; &lt;/xsl:template&gt; &lt;xsl:template name="ANTFORM"&gt; &lt;antform title="Example ANTForm generated from XSLT"&gt; &lt;label&gt;Some title label&lt;/label&gt; &lt;textProperty label="LABEL" property="label1" required="true" focus="true" tooltip="This is the first label, which will assign the value entered to the ANT property label1" /&gt; &lt;selectionProperty label="Values from SVN-CALL1:" property="svn-call1" separator=";"&gt; &lt;xsl:attribute name="values"&gt; &lt;xsl:call-template name="SVN-CALL1" /&gt; &lt;/xsl:attribute&gt; &lt;/selectionProperty&gt; &lt;selectionProperty label="Values from SVN-CALL2:" property="svn-call2" separator=";"&gt; &lt;xsl:attribute name="values"&gt; &lt;xsl:call-template name="SVN-CALL2" /&gt; &lt;/xsl:attribute&gt; &lt;/selectionProperty&gt; &lt;selectionProperty label="Values from SVN-CALL3:" property="svn-call3" separator=";"&gt; &lt;xsl:attribute name="values"&gt; &lt;xsl:call-template name="SVN-CALL3" /&gt; &lt;/xsl:attribute&gt; &lt;/selectionProperty&gt; &lt;radioSelectionProperty label="Release core files: " property="release" values="Yes;No" separator=";" /&gt; &lt;selectionProperty label="Which verion of the core:"&gt; &lt;xsl:attribute name="values"&gt; &lt;xsl:call-template name="SVN-CALL4" /&gt; &lt;/xsl:attribute&gt; &lt;/selectionProperty&gt; &lt;radioSelectionProperty label="Environment: " property="environment" values="Test;Production" separator=";" /&gt; &lt;textProperty label="Password" property="svn.password" required="true" password="true" /&gt; &lt;controlbar&gt; &lt;button label="Cancel" type="cancel" /&gt; &lt;button label="Deploy" target="deploy" /&gt; &lt;/controlbar&gt; &lt;/antform&gt; &lt;/xsl:template&gt; &lt;xsl:template name="SVN-CALL1"&gt; &lt;xsl:text&gt;Trunk&lt;/xsl:text&gt; &lt;xsl:for-each select="/lists/list/entry/name"&gt; &lt;xsl:text&gt;;&lt;/xsl:text&gt; &lt;xsl:value-of select="."/&gt; &lt;/xsl:for-each&gt; &lt;/xsl:template&gt; &lt;xsl:template name="SVN-CALL2"&gt; &lt;!--Similar logic as SVN-CALL1--&gt; &lt;/xsl:template&gt; &lt;xsl:template name="SVN-CALL3"&gt; &lt;!--Similar logic as SVN-CALL1--&gt; &lt;/xsl:template&gt; &lt;xsl:template name="SVN-CALL4"&gt; &lt;!--Similar logic as SVN-CALL1--&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>It creates this ANT build file with the majority of the ANT Form that you described (should be enough to get you started):</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;project name="enhancedRSS" default="form" basedir="."&gt; &lt;taskdef name="antform" classname="com.sardak.antform.AntForm" classpath="$/lib/antform.jar"/&gt; &lt;target name="form"&gt; &lt;antform title="Example ANTForm generated from XSLT"&gt; &lt;label&gt;Some title label&lt;/label&gt; &lt;textProperty label="LABEL" property="label1" required="true" focus="true" tooltip="This is the first label, which will assign the value entered to the ANT property label1"/&gt; &lt;selectionProperty label="Values from SVN-CALL1:" property="svn-call1" separator=";" values="Trunk;archive;milestone 1-0-0;milestone 1-0-0b"/&gt; &lt;selectionProperty label="Values from SVN-CALL2:" property="svn-call2" separator=";" values=""/&gt; &lt;selectionProperty label="Values from SVN-CALL3:" property="svn-call3" separator=";" values=""/&gt; &lt;radioSelectionProperty label="Release core files: " property="release" values="Yes;No" separator=";"/&gt; &lt;selectionProperty label="Which verion of the core:" property="svn-call4" values=""/&gt; &lt;radioSelectionProperty label="Environment: " property="environment" values="Test;Production" separator=";"/&gt; &lt;textProperty label="Password" property="svn.password" required="true" password="true"/&gt; &lt;controlbar&gt; &lt;button label="Cancel" type="cancel"/&gt; &lt;button label="Deploy" target="deploy"/&gt; &lt;/controlbar&gt; &lt;/antform&gt; &lt;/target&gt; &lt;/project&gt; </code></pre> <p>When executed, the generated ANT build file and ANT Form produce:</p> <p><img src="https://i.stack.imgur.com/5N25J.jpg" alt="ANT Form"></p> <p>This should be enough to get you started. The ANTForm <a href="http://antforms.sourceforge.net/usageaf.htm" rel="nofollow noreferrer">usage page</a> tells you what each of the attributes are for each of the ANTForm elements. There is also a lot more that you can do to customize(skin it with your own CSS, custom icons, save properties to pre-populate the form on next run, etc)</p> <p>If you are going to have the results of your four SVN calls in separate XML files, then you may need to look into using the XSLT <code>document()</code> function to accomplish what you need in a single XSLT.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload