Hi all,

While thinking about the scripting in the real Sling yesterday I
thought, that we should not only support scripts in the repository but
also in the OSGi bundles. Currently this is supported in real Sling by
compiling JSP scripts into servlet classes which are registered as OSGi
components.

To think this further, it would probably be a good idea to be able to
support script distribution in bundles not only for JSPs but also for
other scripts. In addition the support for JSPs contained in bundles is
currently different to how JSPs are supported when located in the
repository.

So Carsten and me came to the conclusion to take up Betrand's early idea
again of having a Resource in the Script instead of the script path.
This way, the ScriptResolver may look up the scripts in the repository
and create JCR based Resource instances in this case. Of finding a
script in a Bundle would create a Resource whose raw data is the URL to
the script file in the bundle.

By using this information, the ScriptEngine implementations can still
access the script source transparently (the getScriptReader() method is
the primary accessor to the script source) while for example JSP support
may be slightly more intelligent (and involved) and be able to find the
class files for the JSP based on the script resource raw data.

WDYT ?

Regards
Felix

Reply via email to