Hi,

I am just looking at the various scripting engines and ran into some probs.
Maybe someone can help?

Velocity
-----------
I have installed the velocity bundle and want to do the first test in
Bertrand's 15min tutorial with a velocity script. Saving this as
html.vltworks OK:
<html>
<body>
    $resource.getResourceType() <br>
    $resource.getPath()
</body>
</html>
I get something like:
foo/bar
/content/mynode

But if I try to access something like $resource.node (which I would have
expected) Velocity does not recognize the expression. How do I get to the
node? Do I have the wrong syntax? I looked at the src of JcrNodeResource and
expected to be able to use something like .node, .getNode() or similar.

Freemarker
----------------
Almost the same as velocity. If I save this as html.ftl
<html><body>
    ${resource.resourceType} <br>
    ${resource.path}
</body></html>

This works, but this

<html><body>
${resource.node}
</body></html>

Gives an exception: Expression resource.node is undefined on line 3, column
3 in /apps/foo/bar/html.ftl. The problematic instruction: ---------- ==> ${
resource.node} [on line 3, column 1 in /apps/foo/bar/html.ftl] ----------
Java backtrace for programmers: ----------
freemarker.core.InvalidReferenceException: Expression resource.node is
undefined on line 3, column 3 in /apps/foo/bar/html.ftl

Ruby
-------
Saving anything as html.erb gives me an exception when I do a request like
above. I installed the scripting bundle just like for velocity and
freemarker. The console says things are fine. The exception is:

org/jruby/runtime/callback/InvocationCallback (500)
The requested URL /content/mynode.html resulted in an error in Sling Default
Error Handler Servlet.
Exception:
java.lang.NoClassDefFoundError:
org/jruby/runtime/callback/InvocationCallback

Is there additional installation work to be done for Ruby?


Thanks a lot for hints
Michael

-- 
Michael Marth, http://dev.day.com

Reply via email to