tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anatoli Krassavine" <t...@PhotoCat.co.uk>
Subject RE: customized webs
Date Mon, 04 Oct 2004 11:24:21 GMT
Hello,

Well, the exact logic of page selection depends on your internal application
structure... I will describe below what we are doing:

We have 2 levels of skins:
1) Look-and-feel
2) Language-specific internationalization

Because of the way our systems are deployed we use (1) as the top-level
hierarchy and (2) as sub-hierarchy. In very simplistic terms you have
several look-and-feel skins (let us call them "White", "Red" and "Blue") and
within each you might have locale-specific subversions.

The skin pages differ by standard suffix, i.e. 

PageOne
PageOneRed
PageOneWhite
PageOneBlue

Whenever I do lookup (please note that I only lookup page names) I identify
the user preferred settings from Visit object and simply look for the page
with appropriate suffix. If such page not found, I fall back to default.

After that I execute super.getPage(...) which sorts out the
internationalization for me, i.e. I might have

PageOneRed_fr

The internationalization lookup is done via standard Tapestry, albeit it is
trivial to tweak (I looked at it). It is very simple in Tapestry in
particular to force locale.

It is more complex in real life, of course. There is a pretty deep component
structure in place on all pages which means that the amount of duplication
is minimal, the whole system is easily maintainable and proved to be
extremely robust.

Cheers,
 Toly

-----Original Message-----
From: Mato Mira, Fernando [mailto:Fernando.Matomira@thomson.com] 
Sent: 04 October 2004 10:34
To: 'Tapestry development'
Subject: RE: customized webs

In <get my current skin for this page>
how do you search for the pages?

Also, if you have

page_foo_de.html
page_fr.html

If your locale is French, giving
"page_foo" to getPage will get you a German page,
so you have to replicate also the search done by the PageSource,
so that you only give "page" to getPage().

When is 3.1 final supposed to come out?


> -----Original Message-----
> From: Anatoli Krassavine [mailto:anatoli.krassavine@intellidos.com]
> Sent: Friday, October 01, 2004 5:30 PM
> To: 'Tapestry development'
> Subject: RE: customized webs
> 
> 
> Hello Mira,
> 
> Well, this is even simpler in this case. You store the user 
> settings inside
> Visit object and apply custom PageSource to all requests:
> 
> public IPage getPage(IRequestCycle cycle, String pageName, 
> IMonitor monitor)
>   {
>     Visit visit = ...;
> 
>     if (<this page uses custom skin>)
>     {
>       pageName = <get my current skin for this page>;
>     }
> 
>     return super.getPage(cycle, pageName, monitor);
>   }
> 
>  
> Cheers,
>  Toly
> 
> -----Original Message-----
> From: Mato Mira, Fernando [mailto:Fernando.Matomira@thomson.com] 
> Sent: 01 October 2004 15:33
> To: 'Tapestry development'
> Subject: RE: customized webs
> 
> The same skin name is used in all windows associated with a session.
> You can have different sessions in different windows.
> 
> > -----Original Message-----
> > From: Anatoli Krassavine [mailto:anatoli.krassavine@intellidos.com]
> > Sent: Thursday, September 30, 2004 3:36 PM
> > To: 'Tapestry development'
> > Subject: RE: customized webs
> > 
> > 
> > Hello Mira,
> > 
> > Could you clarify please? When you say that you want to 
> > configure the skin
> > based on a parameter, does it affect only this particular 
> > browser window
> > (and pages which are followed up by links) or does it affect 
> > user settings
> > globally (in all windows)?
> > 
> > Within our HyperDossier system we used both approaches. For 
> > global settings
> > it is trivial to write a custom PageSource which will deliver 
> > custom skins
> > based on session parameters. It is also very efficient, as 
> > you could still
> > make the full use of Tapestry page caches. And actually Tapestry is
> > extremely flexible for this kind of customization.
> > 
> > We also have a separate system which allows us to have 
> > separate skins in
> > different browser windows within the same user session. It is 
> > more specific
> > and used only in a couple of workflows, nevertheless it is 
> absolutely
> > essential for those.
> > 
> > Cheers,
> >  Toly
> > 
> > Intellidos Ltd
> > http://www.intellidos.com/
> > 
> > -----Original Message-----
> > From: Mato Mira, Fernando [mailto:Fernando.Matomira@thomson.com] 
> > Sent: 30 September 2004 09:01
> > To: 'Tapestry development'
> > Subject: RE: customized webs
> > 
> > Well, I need to configure the skin based on some parameter, 
> > for example
> > the scheme we use is to put the skin name as the last 
> > component of the login
> > URL,
> > so for accessing customized web "foo" you would go to:
> > 
> > http://www.datastarweb.com/foo
> > 
> > Some newer subsystems written directly to the Servlet API 
> are accessed
> > similarly:
> > 
> > http://www.datastarweb.com/servlet/PrivateDB.UploadDocumentsSe
> rvlet/foo
> 
> > -----Original Message-----
> > From: Holger Stephan [mailto:tmp001@frogleg.net]
> > Sent: Tuesday, September 28, 2004 8:51 PM
> > To: Tapestry development
> > Subject: RE: customized webs
> > 
> > 
> > You may also want to look at Sitemesh
> > (http://www.opensymphony.com/sitemesh). I found it very flexible in
> > delivering customized Tapestry pages for different customer 
> > profiles. As
> > for images, I use the custom image component I posted to the user
> > mailing list a week or so ago. Image assets are delivered through a
> > custom getAsset that replaces the path to the skin specific 
> resource.
> > Doesn't allow to change the skin during run-time but for customized
> > solutions shipped to specific customers it works nicely. 
> > 
> > - Holger
> > 
> > To localize or skin images, I've 
> > On Tue, 2004-09-28 at 04:48, Mato Mira, Fernando wrote:
> > > That's good. We also localize and customize images.
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: 
> tapestry-dev-help@jakarta.apache.org
> > 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-dev-help@jakarta.apache.org
> 


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


Mime
View raw message