Oleg,

This is possible. We did something that way to allow not only different 
designs, but different layouts (i.e. even the displayed components may differ).

I extended org.apache.tapestry.l10n.ResourceLocalizer with an overriden method 
such as

public Resource findLocalization(Resource rootResource, Locale locale) {
  Layout layout = layoutService.findLayout(requestCycle.getPage());
  if (layout != null) {
    String lResourceName = getClientResourcePath(rootResource, layout);
    Resource lResource = rootResource.getRelativeResource(lResourceName);
    Resource llResource = lResource.getLocalization(locale);
    if (llResource != null) {
      return llResource;
    }
  }
  return rootResource.getLocalization(locale);
}


The method getLayoutResourcePath(..) enhanced the path to a layout-dependent 
path, so the lookup works in the following manner:
/static/myLayout/img/navigation/send_en.gif
/static/myLayout/img/navigation/send.gif
/static/img/navigation/send_en.gif
/static/img/navigation/send.gif


This does not work only for assets, but for all resources (where you use that 
ResourceLocalizer). Be aware you must extend Tapestry's caching mechanism, too.

Best Regards,
Till


> -----Original Message-----
> From: Bondarenko, Oleg [mailto:[EMAIL PROTECTED]
> Sent: Monday, May 22, 2006 4:41 PM
> To: Tapestry users
> Subject: AW: Multiple skins with Tapestry
> 
> Wild thought: one could also misuse Locale and have "localized" templates
> like Home_design1, etc..., but all in the same folders.
> 
> But I also like the idea with different folders more. Is it maybe
> possible?
> 
> Mit freundlichen Grüßen / Best regards
> ______________________________________________
> Oleg Bondarenko
> Software Engineer
> 
> GFT Technologies AG
> 
> Düsseldorfer Straße 13
> D-65760 Eschborn
> T +49-6196-969-2157
> F +49-6196-969-1001
> [EMAIL PROTECTED]
> www.gft.com
> ______________________________________________
> 
> 
> -----Ursprüngliche Nachricht-----
> Von: Paul Cantrell [mailto:[EMAIL PROTECTED]
> Gesendet: Montag, 22. Mai 2006 16:33
> An: Tapestry users
> Betreff: Re: Multiple skins with Tapestry
> 
> Yes, CSS for sure, and a border component that swaps out different
> CSS files based on some parameter.
> 
> On May 22, 2006, at 9:16 AM, mike jones wrote:
> 
> > css?
> >
> > On 5/22/06, Sergey G. Kashin <[EMAIL PROTECTED]> wrote:
> >>
> >> How to create multiple designs with tapestry for one application?
> >>
> >> may be good idea to use folders for skins
> >> design1/Home.html
> >> design2/Home.html
> >> design3/Home.html
> >>
> >> but for all that pages will need create view
> >> design1/Home.java
> >> design2/Home.java
> >> design3/Home.java
> >>
> >> that not very nice.
> >>
> >> Any ideas to resolve this problem?
> 
> _________________________________________________________________
> Piano music podcast: http://inthehands.com
> Other interesting stuff: http://innig.net
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to