cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Upayavira" ...@upaya.co.uk>
Subject Re: Ant task using CocoonBean (was Re: New CLI, twice as fast :)
Date Fri, 25 Jul 2003 15:33:09 GMT
Marc,

> the first is the easier, and both can coexist nicely in your task 
> implementation (I think it just makes sense for people having an 
> xconf file already, and as explained it could simulate the second 
> approach by using the echo/@file trick)

Okay. I'll see if I can do the first, until we can work out the rest.

> I read some on the wiki page now, and start to see more of the 
> light even

Great.

> but putting some effort in now: (rough cut thoughts below)
> 
> approach 1/ similar hack from the echo task:
> 
> anything that is inside your ant-task as free text will be 
> reported to you by void addText(String theNestedText)
> 
> (possibly called multiple times based on the underlaying SAX 
> characters() event I guess... plus, you should make sure the 
> ant-properties get replaced)
> 
> so easiest is to go for stealing what the echo-task is doing:
> 
>      /**
>       * Set a multiline message.
>       */
>      public void addText(String msg) {
>          message += getProject().replaceProperties(msg);
>      }
> 
> check the full code here: 
> http://cvs.apache.org/viewcvs.cgi/ant/src/main/org/apache/tools/ant/taskdefs/Echo.java?rev=1.28&content-type=text/vnd.viewcvs-markup
> 
> catch: for ant to ignore the nested XML of your 'text' you will 
> need to declare the <![CDATA[ ...  ]]> around the nested xconf stuff
> 
> after these addText calls your task will have a String containing 
> the text (with all properties substituted)
> 
> wrap it up in a StringBufferInputStream and hand it over to a 
> DOMParser to get your DOMTree
> 
> pass that to the processXConf and let your magic do its job...

> approach 2/ reusable nested-xml-conf datatype
> 
> please let me think some more...
> 
I'm afraid I find both of these a bit hacky. Let's wait until we can come
up with a decent way of doing it.

It won't be until next week that I'll stand a chance of having a go at
this, so you've got some time to come up with your DOM approach!

Regards, Upayavira

Mime
View raw message