Hi all,

I have attached a patch to SLING-264 which should solve the execution of
scripts without a request. The test has passed Slings integration tests as
well as my own test scenarios where I run scripts without requests.

While working on this I noticed that it is currently not possible to get an
instance of the ServiceLocator, as the implementation is part of a private
package in sling core and instances are only provided as a request
parameter. Thus I cannot pass a ServiceLocator to a script that does not run
within a request context. Since the ServiceLocator was designed (AFAIK) to
provide scripts with the ability to use OSGI services it would be nice to
get an instance of it without a request at hand so that all scripts can use
the power of OSGI.

In a short chat with Carsten about that he proposed to move the
ServiceLocatorImpl into the sling scripting bundle so that other bundles can
access the implementation and thus create their own service locator. What do
others think about that?

BTW, I'm not sure if this is intended but sling already contains two equal
implementation of the ServiceLocator interface that only differ in the
package name. One in the core and one in the scheduler bundle.

- Alex


On Thu, Feb 21, 2008 at 1:00 PM, Alexander Saar <
[EMAIL PROTECTED]> wrote:

> OK, I created an according JIRA issue.
>
> On Thu, Feb 21, 2008 at 8:39 AM, Carsten Ziegeler <[EMAIL PROTECTED]>
> wrote:
>
> > Agreed, thinking of scripts as a multi-purpose tool I can use to script
> > everything in my application (like a workflow, rule processing, you name
> > it), the minimum requirements should be very low. For now, I think the
> > only requirement should be the logger.
> >
> > However, if the script is used in a request-response-cycle than the
> > minimum should include the request, response and resource.
> >
>
> These minimum requirements are OK for me and I think the
> DefaultSlingScript should only check for the presence of those by default.
> Additionally we could check for presence of script reader, response,
> resource and so on if a request is attached to the SlingBindings.
>
> WDYT?
>
> - Alex
>
>

Reply via email to