Hi Janandith,

I had a closer look at the scala classpath problem and didn't found a
better solution than setting the classpath as a String on the settings
object, see how the "libJar" variable is used in [1]. That "minbundle"
works for me, requesting an existing resource with ".compile.scala"
added at the end of URL spits out the message generated by the scala
code.

We'll need to fix this, but for now that's good enough to start with,
if you can get this to work in your scripting engine bundle I'd
suggest that you go on with that, and leave the more hairy classpath
problem for later.

On Mon, Jun 16, 2008 at 8:56 PM, janandith jayawardena
<[EMAIL PROTECTED]> wrote:
> ...1. The engine needs to work with nodes so should I follow the path taken by
> the java script engine ?...

The ScriptableNode and related classes in the javascript engine are
meant to give easier access to the JCR objects in server-side
javascript. I don't know how Scala would handle that, and for now if
you're able to access the "currentNode" variable in scala that'd be
good enough.

The current scripting engines use a "binding" mechanism to make java
objects accessible in java scripts, you'll need to do the same for
Scala. But keep it as simple as possible for now, for the next steps
I'd suggest

1) make the scala engine work on a "hello world" script, using the
classpath hack

2) find out how to make Sling variables (currentNode etc.) available
to Scala scripts

And we can then take it from there.

> ....2. To parse scala code within html can I use the filtering shown in
> EspReader.java in javascript engine ?...

Eventually yes, but right now I'd suggest sticking to scala scripts
that use an "out" variable to print stuff to the response. Keep it as
simple as possible until you're able to get some data coming from a
JCR node in output generated by scala code.

-Bertrand

[1] 
http://code.google.com/p/sling-scala/source/browse/trunk/scala-min-bundle/src/main/java/org/apache/sling/scripting/scala/minbundle/ScalaCompileServlet.java

Reply via email to