Simon Lessard wrote:
Hello Jeanne,
I could live with that as long as the XSD should prevents the usage of
both a bundle and a map at the same time.
I agree
However, I would prefer a "resource-bundle" element than a
"translation-map".
For one, it's much easier to create a ResourceBundle from a Map than
the other way around.
This is true, but don't we already allow the ResourceBundle to be picked
by base-name? Also, though easy-enough, no code is still better than
straightforward code. This feature is aimed at users who have access to
Maps through managed beans or variable resolvers. The returned Maps map
be used elsewhere in the application code (since Maps are much more
flexible than ResourceBundles (the very reason it is easy to slice off
Map functionality to expose it as a ResourceBundle)).
Also, that would be more aligned with JSF 1.2 since its include a way
to define resource-bundle with a var name within the faces-config.xml.
This would also be useful, but isn't mutually exclusive with the above.
-- Blake Sullivan
~ Simon
On 9/21/07, *Jeanne Waldman* < [EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Hi,
I have a new issue I need to resolve and I wanted to run by my
solution --
https://issues.apache.org/jira/browse/TRINIDAD-728
"support for el to be used in a skin to bind to other translation
data sources"
Currently, a SkinExtension and SkinAddition can have resource
bundles associated with them so that a person can "skin" text.
We have customers who want to use a Map that is EL-accessible/
instead/ of a ResourceBundle.
I'd like to add a '*translation-map*' element to the <skin> and
<skin-addition> elements in trinidad-skins.xml.
I'd add new constructors to SkinExtension and SkinAddition to
accept a translationMap ValueExpression.
Let me know what you think and if you think 'translation-map' is a
good name for the new element.
See below for an example.
Thanks,
Jeanne
from trinidad-skins.xml:
<skin>
<id>
purple.desktop
</id>
<family>
purple
</family>
<render-kit-id>
org.apache.myfaces.trinidad.desktop
</render-kit-id>
<style-sheet-name>
skins/purple/purpleSkin.css
</style-sheet-name>
<bundle-name>
org.apache.myfaces.trinidaddemo.resource.SkinBundle
</bundle-name>
</skin>
<!-- You can extend any skin you want. Here we want the purple
skin, but with a bigger font size -->
<skin>
<id>
purpleBigFont.desktop
</id>
<family>
purpleBigFont
</family>
<extends>
purple.desktop
</extends>
<render-kit-id>
org.apache.myfaces.trinidad.desktop
</render-kit-id>
<style-sheet-name>
skins/purple/purpleBigFontSkin.css
</style-sheet-name>
*<translation-map>#{skinTranslationMap.contents}</translation-map>*
</skin>