{"id":144,"date":"2009-10-06T10:40:11","date_gmt":"2009-10-06T10:40:11","guid":{"rendered":"http:\/\/www.scmgalaxy.com\/tutorials\/2009\/10\/06\/what-are-antform-antmenu\/"},"modified":"2017-12-26T09:22:34","modified_gmt":"2017-12-26T09:22:34","slug":"what-are-antform-antmenu","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/what-are-antform-antmenu\/","title":{"rendered":"What are AntForm \/ AntMenu? Usage, Installation Process and Examples"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4086 aligncenter\" src=\"http:\/\/www.scmgalaxy.com\/tutorials\/wp-content\/uploads\/2009\/10\/antform-antmenu.png\" alt=\"antform-antmenu\" width=\"600\" height=\"400\" srcset=\"https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2009\/10\/antform-antmenu.png 600w, https:\/\/www.devopsschool.com\/blog\/wp-content\/uploads\/2009\/10\/antform-antmenu-300x200.png 300w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>AntForm is a java tool designed to add interaction to Ant scripts through graphical forms. If you&#8217;re new to Ant, start at the Ant site (see website: http:\/\/ant.apache.org\/). Ant is used extensively used in the java world to automate system-level tasks, mostly (but not exclusively) as a software build system.<\/p>\n<p><strong>Why use AntForm?<\/strong><br \/>\nBecause automation can only be pushed so far until user input is required, the Ant developper will resort to prompting the user for certain property values at runtime. When the number of these properties increases and certain property values become dependant on others, it makes sense to divide the input into a flow of forms. AntForm enables you to do this.<br \/>\nIn short, in keeping with the natural evolution of console-to-gui at the language level, AntForm ushers in the present-form paradigm where a read value view existed before.<br \/>\nThe goal of the AntForm project is to provide a simple GUI that provides the following:<br \/>\n\u2022\u00a0\u00a0\u00a0 Input forms for modifying properties<br \/>\n\u2022\u00a0\u00a0\u00a0 Button-based menus that launch ant targets<\/p>\n<p><strong>What AntForm does<\/strong><br \/>\nAntForm provides an Ant task (see usage) for setting property values through a Swing-based form. Properties are presented with a label on the left column and a widget field in the right column, one property per line. Each field component modifies an appointed Ant property when the form is submitted (i.e. the ok button clicked). Properties thus modified can be saved to a specified properties file and\/or reused in other tasks. See screenshot<\/p>\n<p><strong>What AntMenu does<\/strong><br \/>\nAntMenu provides an Ant task (see usage) that sets up a menu in a single vertical column for launching other ant targets. Each link to an Ant target is enabled by a button. See screenshot<\/p>\n<p><strong>Installation<\/strong><br \/>\nAfter downloading the package, unzip it into a specific folder on your hard disk. Let&#8217;s call this folder AntForm_home for what follows.<br \/>\nIn your Ant build file, create taskdef (task definitions) with a classpath referring to your ${antForm_home}\/lib\/AntForm.jar file, unless this file is copied into the base ${ant_home}\/lib folder of your Ant distribution, in which case it doesn&#8217;t need to be referenced through the taskdef classpath attribute. The task definitions should look like this:<br \/>\n&lt;taskdef name=&#8221;antform&#8221; classname=&#8221;com.sardak.antform.AntForm&#8221;<br \/>\nclasspath=&#8221;${antform.home}\/lib\/antform.jar&#8221;\/&gt;<br \/>\n&lt;taskdef name=&#8221;antmenu&#8221; classname=&#8221;com.sardak.antform.AntMenu&#8221;<br \/>\nclasspath=&#8221;${antform.home}\/lib\/antform.jar&#8221;\/&gt;<br \/>\nYou can also use the provided taskdefs.properties:<br \/>\n&lt;taskdef resource=&#8221;com\/sardak\/antform\/taskdefs.properties&#8221;<br \/>\nclasspath=&#8221;${antform.home}\/lib\/antform.jar&#8221;\/&gt;<\/p>\n<p>You&#8217;re ready to use the freshly-defined tasks in other ant targets. See AntForm and AntMenu for more information on the specificities if the antform and antmenu tasks.<\/p>\n<p><strong>Samples<\/strong><br \/>\nThere&#8217;s a sample and build file named test.xml in the root folder. If your ant_home and path environment variables are correctly set, you should be able to test the samples with the following command:<br \/>\nant -f test.xml test testmenu testne spinners password wizard1<br \/>\nUse ant -f test.xml -p to see a list of other tests. These tests use other properties or behavioural characteristics and will show you more of what AntForm\/AntMenu can do.<\/p>\n<p><strong>AntForm<\/strong><br \/>\nThe following example generates properties for sending a mail.<br \/>\n&lt;antform title=&#8221;Send Mail&#8221;<br \/>\nsave=&#8221;properties.txt&#8221;<br \/>\nimage=&#8221;doc\/images\/testlogo.jpg&#8221;&gt;<br \/>\n&lt;label&gt;To send a mail, use the following form. Pick a recipient,<br \/>\ntype a subject and a body&#8230;the script will do the rest.&lt;\/label&gt;<br \/>\n&lt;selectionProperty label=&#8221;Recipient: &#8221;<br \/>\nproperty=&#8221;recipient&#8221;<br \/>\nvalues=&#8221;address1@somewhere.com; address2@somewhere.com; address4@somewhere.com&#8221;<br \/>\nseparator=&#8221;;&#8221;\/&gt;<br \/>\n&lt;textProperty label=&#8221;Subject : &#8221; property=&#8221;subject&#8221; \/&gt;<br \/>\n&lt;multilineTextProperty label=&#8221;Message body: &#8221;<br \/>\nproperty=&#8221;body&#8221;\/&gt;<br \/>\n&lt;booleanProperty label=&#8221;Send immediately: &#8221; property=&#8221;send&#8221;\/&gt;<br \/>\n&lt;\/antform&gt;<\/p>\n<p><strong>AntMenu<\/strong><br \/>\nThe following example generates a simple menu.<br \/>\n&lt;antmenu image=&#8221;doc\/images\/logo-small.jpg&#8221;<br \/>\ntitle=&#8221;AntForm &amp; AntMenu tests&#8221;&gt;<br \/>\n&lt;AntMenuItem name=&#8221;AntMenu Tests&#8221;&gt;<br \/>\n&lt;AntMenuItem name=&#8221;Mail-type form&#8221; target=&#8221;test&#8221;\/&gt;<br \/>\n&lt;AntMenuItem name=&#8221;Spinners &amp; dateProperty test&#8221; target=&#8221;spinners&#8221;\/&gt;<br \/>\n&lt;AntMenuItem name=&#8221;Test non-editable properties&#8221; target=&#8221;testne&#8221;\/&gt;<br \/>\n&lt;AntMenuItem name=&#8221;Login &amp; password test&#8221; target=&#8221;password&#8221;\/&gt;<br \/>\n&lt;AntMenuItem name=&#8221;AntForm with inner menu test&#8221; target=&#8221;afm&#8221;\/&gt;<br \/>\n&lt;AntMenuItem name=&#8221;Wizards test&#8221; target=&#8221;wizard1&#8243;\/&gt;<br \/>\n&lt;\/AntMenuItem&gt;<br \/>\n&lt;AntMenuItem name=&#8221;AntMenu tests&#8221;&gt;<br \/>\n&lt;AntMenuItem name=&#8221;This test&#8221; target=&#8221;testmenu&#8221;\/&gt;<br \/>\n&lt;\/AntMenuItem&gt;<br \/>\n&lt;label&gt;A short label with a few explanatory words concerning the menu at hand.&lt;\/label&gt;<br \/>\n&lt;link label=&#8221;Echo 1 target&#8221; target=&#8221;echo1&#8243;\/&gt;<br \/>\n&lt;link label=&#8221;Echo 2 target&#8221; target=&#8221;echo2&#8243;\/&gt;<br \/>\n&lt;link label=&#8221;Echo 3 target&#8221; target=&#8221;echo3&#8243;\/&gt;<br \/>\n&lt;link label=&#8221;End&#8221; target=&#8221;end&#8221;\/&gt;<br \/>\n&lt;\/antmenu&gt;<\/p>\n<p>More Info\u2026<br \/>\nhttp:\/\/antforms.sourceforge.net\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AntForm is a java tool designed to add interaction to Ant scripts through graphical forms. If you&#8217;re new to Ant, start at the Ant site (see website: http:\/\/ant.apache.org\/). Ant is&#8230; <\/p>\n","protected":false},"author":1,"featured_media":4086,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[8],"tags":[3284,3296,3299,3294,3298,3297,3290,3292,3285,3291,3293,3295,670,3286,3287,3288,3289],"class_list":["post-144","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-training","tag-antform","tag-antform-antmenu-guide","tag-antform-antmenu-installation","tag-antform-antmenu-introduction","tag-antform-antmenu-reference","tag-antform-antmenu-tutorial","tag-antform-example","tag-antform-usage","tag-antmenu","tag-antmenu-example","tag-antmenu-usage","tag-overview-antform-antmenu","tag-what","tag-what-is-antform","tag-what-is-antmenu","tag-why-antform","tag-why-antmenu"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/144","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=144"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/144\/revisions"}],"predecessor-version":[{"id":4087,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/144\/revisions\/4087"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/4086"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=144"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=144"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=144"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}