ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: Nested Elements
Date Thu, 21 Aug 2003 04:52:28 GMT
If http://ant.apache.org/manual/develop.html#nested-elements doesn´t help,
have a look at the tutorial in
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=22570.

Does that help?


For short:
- create a class for <attribute>
  - for each attribute a set-method
- create a class for <config>
  - for each attribute a set-method
  - a createConfig() method
    public UniDConfig createConfig() {
        UniDConfig newConfig = new UniDConfig();
        configList.add(newConfig);
        return newConfig;
    }
  - have a list for holding the <config>s
    java.util.Vector configList = new Vector();
- similiar for your task


Jan

> -----Original Message-----
> From: Andrei [mailto:andrei@netrom.ro]
> Sent: Wednesday, August 20, 2003 4:25 PM
> To: Ant Users List
> Subject: Nested Elements
> 
> 
>  I have a task called uni-d
> 
>     <target name="UniDTask">
>        <taskdef name="uni-d"
>            classname="be.unid.generate.AntTask"
>            classpath="${unid.dir}/uni-d.jar"
>            classpathref="task.path"
>           />
>      </target>
> 
> and here i use it:
> 
>     <target name="task" depends="UniDTask">
>         <uni-d
>             appdir="D:\Work\Uni-D\test\src\uni-d"
>             definition="test1.xml"
>             outputdir="../../build/src"
>             spackage="be.unid.test.om"
>             template="xejb">
>             <config
>                 name="extra">
>                 <attribute name="datasource" value="java:/ICtraceDS"/>
>                 <attribute jndi="IC-trace"/>
>             </config>
>         </uni-d>
> 
> This task add's the values for attributes:
>         appdir; definition; outputdir;  spackage;  template     in the
> config   section of a ini file. The problem is that i have to 
> create another
> section in the ini file named extra and add the values for 
> the parameters
> datasource and jndi in the extra section of ini file. For 
> this purpose i
> must use the sintax in as you can se above:
> 
>             <config
>                 name="extra">
>                 <attribute name="datasource" value="java:/ICtraceDS"/>
>                 <attribute jndi="IC-trace"/>
>             </config>
> 
> 
> How can i do that?
> 
> 
>                                                               
>       Andrei
> 
> 
> 
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message