You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by ja...@mac.com on 2004/11/24 09:56:42 UTC

avoiding cutting and paste in JWC files

I'm about to hack together about 20 different components which are all 
basically the same apart from a few configuration properties. (e.g. 
picker style components which work the same but just use different 
tables/SQL queries to choose things from). For simple components its 
not so big a deal but for components with lots of configuration XML 
(e.g. Tree controls) this leads to lots of cut and paste and is a 
violation of the DRY principle.

Now I could go the XML entity route and include an XML fragment in each 
file (which I try and avoid at all cost as it tends to cause no end of 
grief) or some XSLT thing to code generate these things. But I'm 
wondering if anyone's ever come up with a way to inherit XML 
configuration from another component. Kinda like object inheritance, 
but at the .jwc file level.

What I'd like to do is something like

TreePicker.jwc // all the basic config stuff goes in here....

LocationPicker.jwc // inherits from TreePicker.jwc and just adds the 
new configuration details, such as the SQL to find locations.

So its kinda like, create a component exactly like TreePicker.jwc but 
then apply any extra property configurations I've specified in 
LocationPicker.jwc.


Forgive me if there's something blindingly obvious I've missed, I'm 
still a bit of a Tapestry newbie (am quite enjoying it though!). I'm 
just trying to avoid using XML entities if I can...

James
-------
http://radio.weblogs.com/0112098/


---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org