You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by janandith jayawardena <ja...@gmail.com> on 2008/06/22 21:44:09 UTC

Sling/Scala weekly progress report.(15-06-2008 to 22-06-2008)

Sling/Scala weekly progress report.

 Duration : 15th June 2008 to 22nd June 2008.

 Progress:

    1. I tried to understand and use the JavaScriptEngine's wrapper code
initially to enable jcr support. I abandoned this because it uses Rhino's
internal classes.This code is available in the tag
"sling-scala-23-06-2008".

    2. Modified the ScalaScriptEngine as suggested by Bertrand in [1] with
modifications.

    3. Manually access the currentNode using
SlingScriptHelper.getRequest().getResource() and embedding in to compile
code in step 2 as,

       String code = "object MyClass { def execute = Console.println(\"" +
prefix +
SlingScriptHelper.getRequest().getResource().getCurrentNode(helper).getProperty("title").getValue().getString()
+ "\") }";

to retrieve node title as described in "Discover Sling in 15 minutes.



 Problems:

    Unsolved:

    1. Binding Sling variables to the scala compiler to get current
resource.
    2. Problems in deciding the scope of reource usage in Sling ex: Whether
multiple workspace are supported etc.


Perspective:

    1. I've posted to the scala-list for a solution to the problem [1]
above.
    2. Hope to clear all problems regarding resource handling.
    3. Other necessary work arising while continuing with the project.


Reference:
[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