cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Delacretaz <bdelacre...@codeconsult.ch>
Subject Re: Customization (ResourceSelectorAction?)
Date Wed, 28 May 2003 08:56:44 GMT
Le Mercredi, 28 mai 2003, à 09:28 Europe/Zurich, Mato Mira, Fernando a 
écrit :
> ...There is a fallback mechanism whereby when the framework looks for 
> some
> page foo the following search will be performed (say the user has 
> Spanish in
> his preferences):
>
> foo_hisproduct_sp.html
> foo_hisproduct_en.html (English, the defauult)
> foo_dsp_sp.html (dsp is the default product)
> foo_dsp_en.html...

You could implement a ResourceSelectorAction that goes through the 
possible file paths and names, based on the input page name, product 
name and a configurable ordered list of languages.  Using java 
MessageFormats to build filenames could make it configurable for 
different file selection schemes.

The action's output would be the name of the selected file.

I don't think something already exists that does exactly that in Cocoon 
(but one is often proven wrong when making such statements here ;-),  
you could probably use resource-exists but it might get ugly if you 
have a lot of possible languages.

-Bertrand

Mime
View raw message