On 1/7/10 3:06 AM, Carsten Ziegeler wrote:
Justin Edelson wrote:
3) I've been kicking around the idea that it would be nice for the scripting
binding to be expandable. Given a service interface like this:
public interface SlingScriptBindingValuesProvider {
void addBindings(Bindings bindings);
}
Yes, I thought about this, too. The question is how to define the
interface. I don't want to give providers the possibility th
change/replace already set bindings. So they should just be able to add
stuff.
Indeed. What I was thinking is to make the Bindings pass to the provider
service methods be a proxy to the actual Bindings object. This proxy
would throw UnsupportedOperationException on remove(),
IllegalArgumentException on a put() with a pre-existing name, and add
only new keys on a putAll().
That said, I haven't looked at the JSP Taglib bundle to see how these
providers might be integrated. Ideally, you'd be able to write a single
provider and get support for adding values for both JSPs and Scripting.
Justin