hi,
i've been playing around with the javascript impl. (by using
microsling) quite a while. it works well, but stumbled over the
ScriptableNode object which you get by calling:
var node = request.getResource().node;
the javax.jcr.Node provides lots of methods which are not wrapped in
the ScriptableNode class (e.g. getPath()) which might be useful.
getting a property or a node is from my point of view also a bit
awkward, especially if you are familiar with the jcr api:
javascript: node.text
jcr: node.getProperty("text").getString()
ok, i see that you have to write quite a few more characters for the
jcr syntax case in order to retrieve the property (or for the nodwe
case a node).
i would nevertheless propose to drop the ScriptableNode impl because
the sling resource also provides a default mapping which does
basically what the ScriptableNode impl does. this mapped object can be
retrieved by calling request.getResource().adaptTo(Object.class).
what do others think?
regards,
philipp