AntDepo
 
Built with Apache Forrest logo
Sponsored by ControlTier Software logo
  Font size:      
 

Apply-Macro

PDF
PDF

Description

apply-macro iterates over the results of an input generator and calls the named macro with selected paramaters.

Input generators are specified as nested elements, you must specify exactly one. Input generators are any data type that implements the FuntionMapperInputGenerator java interface.

Parameters

AttributeDescriptionRequired
macroThe defined macro to callYes
threadcountMaximum number of threads to useNo. Defaults to 1

Parameters specified as nested elements

errorhandler

If ane error occurs during the course of the apply-macro execution, an errorhandler can be configured to handle the exception.

input

The apply-macro task also requires a nested element that provides input.

Examples

This example iterates against a nested propertiesquery and executes a defined macro with desired parameters and sort order:

	<property name="var.download.dir" value="/var/tmp">	<property name="package.war.headlines-20060910.war.package-install-rank" 	    value="3"/>	<property name="package.jar.hncore-20060910.jar.package-install-rank"             value="2"/>	<property name="package.zip.jakarta-tomcat-4.1.31.zip.package-install-rank"             value="1"/>        <macrodef name="getPackage">           <attribute name="pkgtype"/>           <attribute name="filename"/>           <sequential>              <echo>downloading package file @{filename}</echo>	      <get src="http://repo:8080/webdav/pkgs/@{pkgtype}s/@{filename}"	              dest="${var.download.dir}/@{filename}"	      />           </sequential>        </macrodef>	<apply-macro macro="getPackage">          <propertiesquery id="packages-query"                      select="pkgtype,filename"                      from="package\.([^\.]*)\.(.*)\.package-install-rank">               <sortby>                 <select name="pkgtype" by="name" order="ascending"/>               </sortby>           </propertiesquery>	</apply-macro>      

This example iterates against a queryresults and executes a defined macro with desired parameters and sort order:

        <macrodef name="processDeployment">           <attribute name="dType"/>           <attribute name="dName"/>           <sequential>              <echo>deployment type: @{dType}, deployment name: @{dName}/echo>           </sequential>        </macrodef name="processDeployment">        <propertiesquery-task id="deployments.query"                                 select="dType,dName"                                 from="deployment.([^\.]*).([^\.]*).startup-rank">           <sortby>              <select by="value" order="ascending"/>           </sortby>        </propertiesquery-task>        <apply-macro macro="showDeploymentsByNode">           <queryresults refid="deployments.query"/>        </apply-macro> 




автошины|voucher codes, which they find either online, or offline