You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Ben Gidley <be...@gidley.co.uk> on 2009/03/20 17:05:40 UTC

Overriding Templates

Hi,

We have been trying to modify tapestry to allow us to
- Override templates at runtime (e.g. load them from a CMS)
- Override templates at runtime DEPENDING on page data

We have pretty much achieved this but only by customising Tapestry Core to a
degree that is going to make it hard to maintain.

Has anyone got any suggestions as to what we could do to make this easier?

We have had to customise the some IOC services - these aren't too hard to
override. The ones we are really finding hard to deal with are the follow
that don't appear to be services but are quite tightly linked in

   - org.apache.tapestry5.internal.services.ComponentEventDispatcher
   - org.apache.tapestry5.internal.services.MessagesSourceImpl


As a suggestion :)  things that will make overriding services easier would
be

   - Some way to replace contributions (as opposed to just add)
   - Some way to replace listeners to the event hubs
   - Always use services
   - Try and make services friendly for extension

(BTW I know this is all our fault for messing around with the internals of
tapestry)



Ben Gidley

www.gidley.co.uk
ben@gidley.co.uk

Re: Overriding Templates

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
Em Fri, 20 Mar 2009 13:05:40 -0300, Ben Gidley <be...@gidley.co.uk> escreveu:

> We have pretty much achieved this but only by customising Tapestry Core  
> to a degree that is going to make it hard to maintain.
> Has anyone got any suggestions as to what we could do to make this  
> easier?

Use service decoration and/or method advising. Many interesnting things  
can be done without touching existing code. The URL rewriting support, for  
example, is completely built on decoration.

-- 
Thiago H. de Paula Figueiredo
Independent Java consultant, developer, and instructor
http://www.arsmachina.com.br/thiago

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