Hi,
First off, I'm sorry that I didn't post any code to the Wiki - but
something came up. And I want to do this right before I release anything
- preferably to a Maven site.
Now, I've done something totally different from what I started out with
- partially inspired by Fernando's suggestions.
You can now do this:
hivemodule.xml:
<contribution configuration-id="com.example.GlobalAssets">
<asset id="app-logo" path="context:/assets/graphics/app-logo.png" />
</contribution>
Component.html:
<img jwcid="@Image" image="asset-id:app-logo" />
I'm working on allowing you to specify assets in Component.assets and
Library.assets files - similar to the way you specify component messages
. I might also get around to providing some kind of asset overriding -
but that's for later. So, you should be able to do this:
Component.assets:
app-logo = context:/assets/graphics/app-logo.png
OR Library.assets:
app-logo = context:/assets/graphics/app-logo.png
AND THEN Component.html:
<img jwcid="@Image" image="asset-id:app-logo" />
This solution supports localization and all asset prefixes. (It taps [no
pun intended] into Tapestry's asset services etc.)
The final code with documentation, javadocs, and Maven site should be
done within a week. If you want a working version of what I have now -
same as above, but you have to specify asset ids as HiveMind
contributions - drop me a line and I'll mail you what I have.
-Filip
Filip S. Adamsen skrev:
Okay, will post it to the wiki later tonight.
The thing about adding asset definitions to the .application or .library
file is that I have no idea how to do that. =/
And I imagine that this is the sort of stuff HiveMind was meant to be
used for. If anything, I could add the ability to define your assets in
a .properties file... And perhaps have a default location for this file.
I'll see if I can do something like that.
Regarding aliases, I don't quite understand what it is that you want...
Could you please explain?
-Filip
Fernando Padilla skrev:
Yes, please post this up on the wiki, it is definitely useful.
I wonder if there is some way to add this to the core tapestry. Also,
it might be clearer to add application or library wide assets, so we
just modify the .application or .library rather than the
hivemodule.xml....
then we can simply go image="appasset:blah" or image="libasset:blah"..
maybe.. but then we might want an asset aliases <asset name="babble"
alias="appasset:blah"/>
just a thought.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]