Sorry Eelco, I still don't see it. I am simply not familiar enough with the details of clustering and the core code has been shifting so much recently I find it difficult to keep up-to-date with Wicket's paradigm-of-the-day. If we can invoke this code manually, I don't see why you can't invoke it automatically at parsing time. We have access to the Application and are capable of ensuring the resource is only generated the first time and all the other things you mentioned. In so far as I understand, the process is 100% reproducible so clustering is not a concern. You just need to ensure that the same resource path will always result in the same static image URL (regardless of which machine computes it), and that is certainly possible to implement. If I have missed something, please explain the problem in more detail; it'll likely help me understand
Thank you, Gili
Eelco Hillenius wrote:
Efficiency and clustering. Look at the code. In application the 'stable' url to the resource is created. But only if not done yet. Furthermore, to have clustering work, the action of creating/ getting the resource must be reproducable.
Eelco
Gili wrote:
I'm not familiar with Application.getSharedResource() and all the new methods you mention, but can you please explain why you can't pick up the factory and static name automatically? Aren't there decent defaults for both these things?
Gili
Eelco Hillenius wrote:
As a side node this is what you can do to use static images now:
private SharedResource getImage(final String name)
{
return getApplication().getSharedResource(MyTree.class, name, new ISharedResourceFactory()
{
public Resource newResource()
{
return StaticImageResource.get(MyTree.class.getPackage(), name, null, null);
}
});
}
Image img = new Image(NODE_IMAGE_NAME, getImage("node.gif"));
In the above piece of code, 'node.gif' will be read from the package (could be from a jar) and used as the resource for the image. A static URL is created for it, based (in this case) and the package name and the given name ('node.gif').
It probably won't get easier than this, as we need the factory and static name to be able to support clustering. Actually, I think it really rocks that we can support this in a clustered environment now. Not many other frameworks that'll do that for you ;)
Eelco
Gili wrote:
I'm looking for some feedback on how difficult it would be to implement this. It has been filed as a RFE a week back I think. If it is trivial, I am hoping we can schedule it for pre-1.0. Right now it is rather annoying doing it manually (but at least it's doable). One of my pages had twelve static images and adding them in took me a long while. If we can automate this sort of thing I really think we should.
Gili
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Wicket-develop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ Wicket-develop mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/wicket-develop
