On Fri, Aug 6, 2010 at 6:28 AM, Tony Giaccone <[email protected]> wrote:
> ...when i google JCR API NodeIterator I get a bunch of references to java.jcr 
> classes, which
> clearly aren't going to work in the esp transform....

Sling scripts have access to all classes exported by all bundles.

In this case, as Eric said you can use ESP code like

<%
var items = currentNode.lineItems;
var nodeIterator = items.nodes;
while (nodeIterator.hasNext())
...
%>

As the javascript engine will resolve those method names dynamically.

If you need to load a specific java class in an ESP script you can do
something like

var privilegesInfo =
sling.getService(Packages.org.apache.sling.jackrabbit.usermanager.AuthorizablePrivilegesInfo);

All java classes that the ESP script engine has access to can be used
via this Packages notation.
See http://www.mozilla.org/rhino/ScriptingJava.html for details.

Hope this helps!
-Bertrand

Reply via email to