I think if we would be in the jsp world, you would do a taglib for this - of course taglibs are not usable within other scripting languages - so depending on your script language you would have to come up with the equivalent. Taglibs in JSP allow exactly what you want - the BVP is more a way to make objects always available to all script engines; so apart from adding the optional node and session objects, we don't use this in Sling at all...
Carsten 2013/8/6 Bertrand Delacretaz <bdelacre...@apache.org> > On Tue, Aug 6, 2013 at 5:39 PM, Carsten Ziegeler <cziege...@apache.org> > wrote: > > I guess this only works as you have a special script engine for health > > check, right? > > Not really a special script engine, but I'm using the > ScriptEngineManager directly instead of going through SlingScript. > > See code at [1] where bindings are hardcoded for now - I could invent > my own bindings providers interface but as we already have one why not > reuse it? > > > > > What if people want to use the same functionality if they write lets say > > workflow scripts or wcm scripts etc? > > The bindings service could be marked with > usage=healthcheck,workflow,wcm, or the consumers could be configured > to use bindings which are marked with usage=healthcheck. > > > As long as there is no way to make use of this in every script engine, I > > don't see the point of adding it. It's a special requirement for hc, so > it > > should have a hc solution. > > That's an option of course, that's why I'm asking for opinions. > > -Bertrand > > [1] > https://svn.apache.org/repos/asf/sling/branches/SLING-2987-healthcheck-redesign/hc-core/src/main/java/org/apache/sling/hc/impl/ScriptableHealthCheck.java > -- Carsten Ziegeler cziege...@apache.org